Partager via


Vibrator.AreAllEffectsSupported(Int32[]) Method

Definition

Query whether the vibrator supports all the given effects.

[Android.Runtime.Register("areAllEffectsSupported", "([I)I", "", ApiSince=30)]
public int AreAllEffectsSupported (params int[] effectIds);
[<Android.Runtime.Register("areAllEffectsSupported", "([I)I", "", ApiSince=30)>]
member this.AreAllEffectsSupported : int[] -> int

Parameters

effectIds
Int32[]

Which effects to query for.

Returns

Whether all specified effects are natively supported by the device. Empty query defaults to #VIBRATION_EFFECT_SUPPORT_YES.

Attributes

Remarks

Query whether the vibrator supports all the given effects. If no argument is provided this method will always return #VIBRATION_EFFECT_SUPPORT_YES.

If an effect is not supported, the system may still automatically fall back to a simpler vibration instead, which is not optimised for the specific device, however vibration isn't guaranteed in this case.

If the result is #VIBRATION_EFFECT_SUPPORT_YES, all effects in the query are supported by the hardware.

If the result is #VIBRATION_EFFECT_SUPPORT_NO, at least one of the effects in the query is not supported, and using them may fall back to an un-optimized vibration or no vibration.

If the result is #VIBRATION_EFFECT_SUPPORT_UNKNOWN, the system doesn't know whether all the effects are supported. It may support any or all of the queried effects, but there's no way to programmatically know whether a #vibrate call will successfully cause a vibration. It's guaranteed, however, that none of the queried effects are definitively unsupported by the hardware.

Use #areEffectsSupported(int...) to get individual results for each effect.

Java documentation for android.os.Vibrator.areAllEffectsSupported(int...).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to