Application Battery Usage via Settings Services

With Josh Hickman finally releasing his Android 12 test image, we have more new things to hunt down. Something new that I came across is more battery usage items, this time found here:

data\data\com.google.android.settings.intelligence\databases\battery-usage-db-v4

This SQLite database seems to correlate to the Settings Services:

https://play.google.com/store/apps/details?id=com.google.android.settings.intelligence

If you navigate to Settings > Battery > Battery usage, you will see a similar page that lists application usage for the past 24 hours. It also gives you application breakdowns per app with total usage in time, background usage as well as a percentage overall.

Figure 1: Settings Services Battery Usage

Each two hour interval is clickable as well which shows an even more granular breakdown for a smaller timeframe.

Opening the database file there was only one table of interest, BatteryState. Inside we get some useful columns:
  • appLabel - application name
  • packageName - package name of the application
  • bootTimestamp - offset in milliseconds of the boot time of the device. I believe this is the last time the phone started up (restart or power on), more testing needs done to verify
  • timestamp - timestamp of when the Settings calculated the entry
  • zoneID - timezone (ex. America/New_York)
  • totalPower - my assumption here is total mAh available at a point in time
  • consumePower - amount of mAh used by an app at a point in time
  • percentofTotal - percentage total of battery usage per application
  • foregroundUsageTimeInMs - usage of an app in the foreground in milliseconds
  • backgroundUsageTimeInMs - usage of an app in the background in milliseconds
  • batteryLevel - the percentage of battery available at a point in time
  • batteryStatus - appears to show if the device is charging or not, assumptions based off test data:
    • 2 = Charging
    • 3 = Not Charging
    • 5 = Fully Charged
A few other columns data are too generic to determine what the cause for population were at this time so there is still more research to be done but in the meantime,  as always, you can get the parser as part of the latest version of ALEAPP.

Figure 2: Sample ALEAPP report