What do CPU Total, CPU Foreground, and Keep awake mean? I've been keeping an eye on my battery usage on my Android device (HTC One), mostly to see if I can drain it during a full work-day, and I came across the app usage details under the Power settings.

I get a percentage of battery used by the app, the CPU total, the CPU foreground, and keep awake. I'm not sure what they mean, although I can take a guess, but I'm wondering more on how they work.

For instance, I've used the Chrome browser extensively throughout the day (device was on for ~14 hrs, holding around 30% battery life left) and noticed that the battery usage for the app was at 54%. Under use details (see pic below) CPU total was 29m 31s; CPU foreground was 14m 43s; and Keep awake was 30s.


Screenshot (click image for larger variant)

How can these numbers be relatively low when I know I've used Chrome for more than a half-hour and had it as the primary app running for much longer than 15m, which is assuming that my ideas on CPU total and foreground use are what I believe they are.

In essence, what do those three numbers mean in terms of app/battery usage and what does it tell me?
The first thing to remember is that when an app runs, it doesn't actually do computation for the whole time it's running: most of the time it's idle, waiting for data to arrive over the network, or while you're looking at it on the screen. Only very badly-written apps and games keep the CPU active the whole time they're running: this runs the battery down very quickly, and makes your phone rather warm.

So even if Chrome has been on the screen for 30 minutes, it shouldn't have used 30 minutes of CPU time. If it's completely static in that time and you're not interacting with it, it might not have used any CPU time at all! But at the other extreme, even if it was continually scrolling a page, it wouldn't use 30 minutes of CPU time: the screen updates every 1/60th of a second, and each time it just has to run for long enough to work out what the next frame should be.

CPU foreground

Bearing this in mind, CPU foreground is how much time the app has been running on the CPU while an activity from the app was in the foreground. (It might also include when a service from the app was in the foreground: that is, displaying an "ongoing" notification.) It's not a very useful figure on its own.

CPU total

I'm sure you already know that apps can run services and broadcast receivers in the background, as well as activities in the foreground. (For more on this, see What&#39;s the difference between a service and a broadcast receiver? ) CPU total includes all of this CPU use. If it's a lot more than CPU foreground, you might suspect that the app is doing a lot of work in the background and therefore might be a battery hog. How much is "a lot" depends on the app. An app that keeps running to check some remote service will use more CPU in the background than a sudoku game.

Keep awake

When the screen of your phone is off, it starts to think about having a quick nap. It enters a low-power mode called sleep where the CPU is almost completely powered down until needed. Because this can interrupt apps' background activities, an app can use a wake lock to stop the device going to sleep until it's finished. (There's also another kind of wake lock, which stops the screen turning off automatically. A video player might use that kind of wake lock.) An app can also use an alarm to wake the device up to perform some background tasks.

Keep awake measures the length of time that this app has used wake locks or alarms to keep the device awake when it would otherwise have been asleep. In a way, this is potentially the biggest drain on battery. Sleeping uses much less power than staying awake, so if an app keeps a wake lock for a long time, it's keeping your device in a high-power mode all that time, even if the app isn't doing any useful work.

If you see an app whose Keep awake time is more than a few seconds, you should report a bug to the app developer, and you might consider uninstalling it. 30 seconds over the course of a whole day is reasonable for an app that does work in the background, but most apps will show less than a second here.