Added in API level 31

PerformanceHintManager

class PerformanceHintManager
kotlin.Any
   ↳ android.os.PerformanceHintManager

The PerformanceHintManager allows apps to send performance hint to system.

Summary

Nested classes

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
PerformanceHintManager.Session?
createHintSession(tids: IntArray, initialTargetWorkDurationNanos: Long)

Creates a Session for the given set of threads and sets their initial target work duration.

Long

Get preferred update rate information for this device.

Public methods

createHintSession

Added in API level 31
fun createHintSession(
    tids: IntArray,
    initialTargetWorkDurationNanos: Long
): PerformanceHintManager.Session?

Creates a Session for the given set of threads and sets their initial target work duration.

Parameters
tids IntArray: The list of threads to be associated with this session. They must be part of this process' thread group This value cannot be null.
initialTargetWorkDurationNanos Long: The desired duration in nanoseconds for the new session
Return
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
Exceptions
java.lang.IllegalArgumentException if the thread id list is empty, or initialTargetWorkDurationNanos is non-positive

getPreferredUpdateRateNanos

Added in API level 31
fun getPreferredUpdateRateNanos(): Long

Get preferred update rate information for this device.

Return
Long the preferred update rate supported by device software