SystemHealthManager

open class SystemHealthManager
kotlin.Any
   ↳ android.os.health.SystemHealthManager

Provides access to data about how various system resources are used by applications.
Requires API level 24 (Android 7.0, Nougat)

Summary

Public methods
open HealthStats!

Return a HealthStats object containing a snapshot of system health metrics for the application calling this API.

open HealthStats!

Return a HealthStats object containing a snapshot of system health metrics for the given uid (user-id, which in usually corresponds to application).

open Array<HealthStats!>!

Return a HealthStats object containing a snapshot of system health metrics for the given uids (user-id, which in usually corresponds to application).

Public methods

takeMyUidSnapshot

added in API level 24
open fun takeMyUidSnapshot(): HealthStats!

Return a HealthStats object containing a snapshot of system health metrics for the application calling this API. This method is the same as calling takeUidSnapshot(Process.myUid()).
Requires API level 24 (Android 7.0, Nougat)

Return
HealthStats!: A HealthStats object containing the metrics for this application. The keys for this HealthStats object will be from the UidHealthStats class.

takeUidSnapshot

added in API level 24
open fun takeUidSnapshot(uid: Int): HealthStats!

Return a HealthStats object containing a snapshot of system health metrics for the given uid (user-id, which in usually corresponds to application).
Requires API level 24 (Android 7.0, Nougat)

Parameters
uid Int: User ID for a given application.
Return
HealthStats!: A HealthStats object containing the metrics for the requested application. The keys for this HealthStats object will be from the UidHealthStats class.

See Also

takeUidSnapshots

added in API level 24
open fun takeUidSnapshots(uids: IntArray!): Array<HealthStats!>!

Return a HealthStats object containing a snapshot of system health metrics for the given uids (user-id, which in usually corresponds to application).
Requires API level 24 (Android 7.0, Nougat)

Parameters
uids IntArray!: An array of User IDs to retrieve.
Return
Array<HealthStats!>!: An array of HealthStats objects containing the metrics for each of the requested uids. The keys for this HealthStats object will be from the UidHealthStats class.