blob: 3a46a5ba9cc45fe154833c9c844cca5f16b2ed88 [file] [log] [blame]
Joe Onorato713fec82016-03-04 10:34:02 -08001<html>
2<body>
3
4The android.os.health package contains a set of classes to provide data
5to track the system resources of applications.
6<p>
7Applications running in the background are responsible for a significant amount
8of battery usage on a typical android device. There are several things that
9applications can do in order to reduce their impact. For example, by using
10{@link android.app.job.JobScheduler JobScheduler}, an application does not need
11to independently monitor whether the network is available, whether the device is
12plugged in, etc. In addition to being simpler to use, the application's
13services are only started when the required conditions have been met. But even
14when using the appropriate helper APIs, applications still can reduce their
15footprint. This package provides more insight into what is going on behind the
16scenes when an application is running.
17<p>
18Application data is tracked by which user id (uid) is using particular
19resources. A snapshot of an application's measurements can be taken with the
20{@link android.os.health.SystemHealthManager#takeMyUidSnapshot() SystemHealth.takeMyUidSnapshot()}
21method. The {@link android.os.health.HealthStats} object returned contains the
22statistics.
23<p>
24<b>HealthStats</b><br>
25In order to be returned efficiently, the {@link android.os.health.HealthStats}
26class uses a set of int keys to identify the data returned. The
27{@link android.os.health.UidHealthStats}, {@link android.os.health.PidHealthStats},
28{@link android.os.health.PackageHealthStats} , {@link android.os.health.ProcessHealthStats},
29and {@link android.os.health.ServiceHealthStats} classes provide those constants.
30Each {@link android.os.health.HealthStats} object will be associated with
31exactly one of those classes. The object returned from
32{@link android.os.health.SystemHealthManager#takeMyUidSnapshot() SystemHealth.takeMyUidSnapshot()}
33will be using the {@link android.os.health.UidHealthStats} keys, as it contains all
34of the data available for that uid.
35
36
37</body>
38</html>
39