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

# VibratorFrequencyProfile

*** ** * ** ***

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

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

<br />

*** ** * ** ***

Describes the output of a `https://developer.android.com/reference/android/os/Vibrator` for different vibration frequencies.

The profile contains the vibrator's frequency range (minimum/maximum) and maximum acceleration, enabling retrieval of supported acceleration levels for specific frequencies, if the device supports independent frequency control.

It also describes the max output acceleration (Gs), of a vibration at different supported frequencies (Hz).

Vibrators without independent frequency control do not have a frequency profile.

## Summary

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/util/SparseArray<https://developer.android.com/reference/java/lang/Float>` | ` https://developer.android.com/reference/android/os/vibrator/VibratorFrequencyProfile#getFrequenciesOutputAcceleration()() ` Returns a `https://developer.android.com/reference/android/util/SparseArray` representing the vibrator's output acceleration capabilities across different frequencies. |
| ` https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Float>` | ` https://developer.android.com/reference/android/os/vibrator/VibratorFrequencyProfile#getFrequencyRange(float)(float minOutputAccelerationGs) ` Returns the frequency range (in Hz) where the vibrator can sustain at least the given minimum output acceleration (Gs). |
| ` float` | ` https://developer.android.com/reference/android/os/vibrator/VibratorFrequencyProfile#getMaxFrequencyHz()() ` Gets the maximum frequency supported by the vibrator. |
| ` float` | ` https://developer.android.com/reference/android/os/vibrator/VibratorFrequencyProfile#getMaxOutputAccelerationGs()() ` Returns the maximum output acceleration (in Gs) supported by the vibrator. |
| ` float` | ` https://developer.android.com/reference/android/os/vibrator/VibratorFrequencyProfile#getMinFrequencyHz()() ` Gets the minimum frequency supported by the vibrator. |
| ` float` | ` https://developer.android.com/reference/android/os/vibrator/VibratorFrequencyProfile#getOutputAccelerationGs(float)(float frequencyHz) ` Returns the output acceleration (in Gs) for the given frequency (Hz). |

### 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

### getFrequenciesOutputAcceleration

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

```
public SparseArray<Float> getFrequenciesOutputAcceleration ()
```

Returns a `https://developer.android.com/reference/android/util/SparseArray` representing the vibrator's output acceleration capabilities across different frequencies. This map defines the maximum acceleration the vibrator can achieve at each supported frequency.

The map's keys are frequencies in Hz, and the corresponding values are the maximum achievable output accelerations in Gs.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/SparseArray<https://developer.android.com/reference/java/lang/Float>` | A map of frequencies (Hz) to maximum accelerations (Gs). This value cannot be `null`. <br /> |

### getFrequencyRange

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

```
public Range<Float> getFrequencyRange (float minOutputAccelerationGs)
```

Returns the frequency range (in Hz) where the vibrator can sustain at least the given minimum output acceleration (Gs).

<br />

| Parameters ||
|---|---|
| `minOutputAccelerationGs` | `float`: The minimum desired output acceleration in Gs. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Float>` | A `https://developer.android.com/reference/android/util/Range` object representing the frequency range where the vibrator can sustain at least the given minimum acceleration, or null if the minimum output acceleration cannot be achieved. <br /> |

### getMaxFrequencyHz

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

```
public float getMaxFrequencyHz ()
```

Gets the maximum frequency supported by the vibrator.

<br />

| Returns ||
|---|---|
| `float` | the maximum frequency supported by the vibrator, in hertz. <br /> |

### getMaxOutputAccelerationGs

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

```
public float getMaxOutputAccelerationGs ()
```

Returns the maximum output acceleration (in Gs) supported by the vibrator. This value represents the highest acceleration the vibrator can achieve across its entire frequency range.

<br />

| Returns ||
|---|---|
| `float` | The maximum output acceleration in Gs. <br /> |

### getMinFrequencyHz

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

```
public float getMinFrequencyHz ()
```

Gets the minimum frequency supported by the vibrator.

<br />

| Returns ||
|---|---|
| `float` | the minimum frequency supported by the vibrator, in hertz. <br /> |

### getOutputAccelerationGs

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

```
public float getOutputAccelerationGs (float frequencyHz)
```

Returns the output acceleration (in Gs) for the given frequency (Hz). This method provides the actual acceleration the vibrator will produce when operating at the specified frequency, using linear interpolation over the `https://developer.android.com/reference/android/os/vibrator/VibratorFrequencyProfile#getFrequenciesOutputAcceleration()`.

<br />

| Parameters ||
|---|---|
| `frequencyHz` | `float`: The frequency in Hz. <br /> |

| Returns ||
|---|---|
| `float` | The output acceleration in Gs for the given frequency. <br /> |