Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/os/CombinedVibration.ParallelCombination#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/os/CombinedVibration.ParallelCombination#inhmethods)

# CombinedVibration.ParallelCombination

*** ** * ** ***

` public static final class CombinedVibration.ParallelCombination `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.os.CombinedVibration.ParallelCombination |

<br />

*** ** * ** ***

A combination of haptic effects that should be played in multiple vibrators in parallel.
**See also:**

- `https://developer.android.com/reference/android/os/CombinedVibration#startParallel()`

## Summary

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/os/CombinedVibration.ParallelCombination` | ` https://developer.android.com/reference/android/os/CombinedVibration.ParallelCombination#addVibrator(int,%20android.os.VibrationEffect)(int vibratorId, https://developer.android.com/reference/android/os/VibrationEffect effect) ` Add or replace a one shot vibration effect to be performed by the specified vibrator. |
| ` https://developer.android.com/reference/android/os/CombinedVibration` | ` https://developer.android.com/reference/android/os/CombinedVibration.ParallelCombination#combine()() ` Combine all of the added effects into a `https://developer.android.com/reference/android/os/CombinedVibration`. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### addVibrator

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CombinedVibration.ParallelCombination addVibrator (int vibratorId, 
                VibrationEffect effect)
```

Add or replace a one shot vibration effect to be performed by the specified vibrator.

<br />

| Parameters ||
|---|---|
| `vibratorId` | `int`: The id of the vibrator that should perform this effect. <br /> |
| `effect` | `VibrationEffect`: The effect this vibrator should play. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/CombinedVibration.ParallelCombination` | The `https://developer.android.com/reference/android/os/CombinedVibration.ParallelCombination` object to enable adding multiple effects in one chain. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/VibrationEffect#createOneShot(long,%20int)`

### combine

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CombinedVibration combine ()
```

Combine all of the added effects into a `https://developer.android.com/reference/android/os/CombinedVibration`.

If `https://developer.android.com/` is enabled, all effects added to this combination must be consistent regarding timeline anchoring: they must either all be timeline anchored (see `https://developer.android.com/`) or none of them should be.

The `https://developer.android.com/reference/android/os/CombinedVibration.ParallelCombination` object is still valid after this call, so you can continue adding more effects to it and generating more `https://developer.android.com/reference/android/os/CombinedVibration`s by calling this method again.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/CombinedVibration` | The `https://developer.android.com/reference/android/os/CombinedVibration` resulting from combining the added effects to be played in parallel. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | if the combination is empty or if it contains a mix of timeline anchored and non-timeline anchored effects. |