CombinedVibration


public abstract class CombinedVibration
extends Object implements Parcelable

java.lang.Object
   ↳ android.os.CombinedVibration


A CombinedVibration describes a combination of haptic effects to be performed by one or more Vibrators. These effects may be any number of things, from single shot vibrations to complex waveforms.

See also:

Summary

Nested classes

class CombinedVibration.ParallelCombination

A combination of haptic effects that should be played in multiple vibrators in parallel. 

Inherited constants

Fields

public static final Creator<CombinedVibration> CREATOR

Public methods

static CombinedVibration createParallel(VibrationEffect effect)

Create a vibration that plays a single effect in parallel on all available vibrators.

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

static CombinedVibration.ParallelCombination startParallel()

Start creating a vibration that plays explicit effects in parallel on specific target vibrators.

Inherited methods

Fields

CREATOR

Added in API level 31
public static final Creator<CombinedVibration> CREATOR

Public methods

createParallel

Added in API level 31
public static CombinedVibration createParallel (VibrationEffect effect)

Create a vibration that plays a single effect in parallel on all available vibrators.

This creates a parallel vibration that plays the given VibrationEffect across all available vibrators on the device at the same time.

Parameters
effect VibrationEffect: The VibrationEffect to perform.
This value cannot be null.

Returns
CombinedVibration The combined vibration representing the effect to be played in parallel on all vibrators.
This value cannot be null.

describeContents

Added in API level 31
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

startParallel

Added in API level 31
public static CombinedVibration.ParallelCombination startParallel ()

Start creating a vibration that plays explicit effects in parallel on specific target vibrators.

A parallel combination takes one or more VibrationEffects mapped to explicit vibrator IDs to be performed simultaneously.

Returns
CombinedVibration.ParallelCombination This value cannot be null.