Added in API level 24

SystemHealthManager

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

Provides access to data about how various system resources are used by applications.

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()).

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).

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.

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).

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.