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

# PerformanceHintManager

*** ** * ** ***


`
public

final

class
PerformanceHintManager
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

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

<br />

*** ** * ** ***

The PerformanceHintManager allows apps to send performance hint to system.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/os/PerformanceHintManager.Session` A Session represents a group of threads with an inter-related workload such that hints for their performance should be considered as a unit. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/os/PerformanceHintManager.Session` | ` https://developer.android.com/reference/android/os/PerformanceHintManager#createHintSession(int[],%20long)(int[] tids, long initialTargetWorkDurationNanos) ` Creates a `https://developer.android.com/reference/android/os/PerformanceHintManager.Session` for the given set of threads and sets their initial target work duration. |
| ` long` | ` https://developer.android.com/reference/android/os/PerformanceHintManager#getPreferredUpdateRateNanos()() ` Get preferred update rate information for this device. |

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

### createHintSession

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

```
public PerformanceHintManager.Session createHintSession (int[] tids, 
                long initialTargetWorkDurationNanos)
```

Creates a `https://developer.android.com/reference/android/os/PerformanceHintManager.Session` for the given set of threads and sets their initial target work
duration.

<br />

| Parameters ||
|---|---|
| `tids` | `int`: The list of threads to be associated with this session. They must be part of this process' thread group. This value cannot be `null`. <br /> |
| `initialTargetWorkDurationNanos` | `long`: The desired duration in nanoseconds for the new session <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/PerformanceHintManager.Session` | the new session if it is supported on this device, null if hint session is not supported on this device or the tid doesn't belong to the application <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the thread id list is empty, or initialTargetWorkDurationNanos is non-positive |

### getPreferredUpdateRateNanos

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

```
public long getPreferredUpdateRateNanos ()
```

Get preferred update rate information for this device.

<br />

| Returns ||
|---|---|
| `long` | the preferred update rate supported by device software <br /> |