Skip to content

Most visited

Recently visited

navigation

SystemHealthManager

public class SystemHealthManager
extends Object

java.lang.Object
   ↳ android.os.health.SystemHealthManager


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

Instances of this class must be obtained using Context.getSystemService(Class) with the argument SystemHealthManager.class or Context.getSystemService(String) with the argument Context.SYSTEM_HEALTH_SERVICE.

Summary

Public methods

HealthStats takeMyUidSnapshot()

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

HealthStats takeUidSnapshot(int uid)

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

HealthStats[] takeUidSnapshots(int[] uids)

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

Inherited methods

From class java.lang.Object

Public methods

takeMyUidSnapshot

added in API level 24
HealthStats takeMyUidSnapshot ()

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

Returns
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
HealthStats takeUidSnapshot (int uid)

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.

Returns
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
HealthStats[] takeUidSnapshots (int[] uids)

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 int: An array of User IDs to retrieve.

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

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.