Stay organized with collections
Save and categorize content based on your preferences.
Starting in Android Studio Hedgehog, the Power Profiler shows power consumption
on devices. You can view this new data in the On Device Power Rails Monitor (ODPM).
It segments the information by subsystems called "Power Rails". See Profileable
power rails for a list of supported sub-systems.
The System Trace records and displays power
consumption data. It is part of the CPU profiler This data helps you to visually
correlate power consumption of the device with the actions occurring in your
app. The Power Profiler enables visualizing this data.
Figure 1. Example of power consumption in different power
rails.
Profileable power rails
The ODPM reports all profileable power rails and is available in Android 10
(API level 29) and higher and on Pixel 6 and subsequent Pixel devices.
Table 1. Availability of individual power rails is expected to
change based on the device being used.
Power rail name
Description
CPU Big
Power being consumed by the big CPU core.
CPU Little
Power being consumed by the little CPU core.
CPU Mid
Power being consumed by the mid CPU core.
Camera
Power being consumed by the camera sensor.
Cellular
Power being consumed by the cellular sensor.
Display
Power being consumed by the display.
GPS
Power being consumed by the GPS sensor.
GPU
Power being consumed by the GPU sensor.
Memory
Power being consumed by the RAM memory sensor.
Sensor core
Power being consumed by other device sensors.
UFS (disk)
Power being consumed by the Disk sensor.
WLAN
Power being consumed by the Wifi sensor.
Devices that don't support ODPM can offer power consumption data through Coulomb
counters and the battery gauge.
Table 2. Power consumption data.
Name
Description
Capacity
The remaining battery percentage (%).
Charge
The remaining battery charge in microampere-hours (µAh).
Current
The instantaneous current in microampere (µA).
Example scenarios for profiling power consumption through the Power Profiler
Assume you are building an app that needs to download assets over the network.
You want to understand how the power consumption of WLAN power rail changes
while downloading assets individually versus in a large chunk.
Scenario A: The app makes individual network requests to download assets
over WLAN.
Figure 2. Individual network requests to download assets
over WLAN.
Scenario B: The app makes one network request to download a very large asset
over WLAN.
Figure 3. Individual network requests to download a very
large asset over WLAN.
As shown in the preceding scenarios, the two system traces show different
signatures of power consumption in the WLAN power rail based on how you trigger
the download.
Even though the preceding example is a simple way to measure power consumption
in different scenarios, it demonstrates the process with which you can build
more sophisticated A/B tests for your app. You can use these tests to optimize
power consumption across different features or different implementations of the
same feature.
Important notes
ODPM measures power consumption at the device level—not specific to any app.
You can correlate power consumption information from the ODPM to what's
happening in your app foreground or background. As a result, you can expect
noise in power consumption data based on how many apps are active in the device
at the time of reading ODPM data.
Power Profiler reads power consumption data from the ODPM, which is only
available on Pixel 6 and subsequent Pixel devices running Android 10
(API level 29) and higher.
Some power rails might only be available on some devices implementing ODPM.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2023-11-06 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-06 UTC."],[],[],null,["# Power Profiler\n\nStarting in Android Studio Hedgehog, the Power Profiler shows power consumption\non devices. You can view this new data in the On Device Power Rails Monitor (ODPM).\nIt segments the information by subsystems called \"Power Rails\". See [Profileable\npower rails](#power-rails) for a list of supported sub-systems.\n\nThe [System Trace](/studio/profile/cpu-profiler) records and displays power\nconsumption data. It is part of the CPU profiler This data helps you to visually\ncorrelate power consumption of the device with the actions occurring in your\napp. The Power Profiler enables visualizing this data.\n**Figure 1.** Example of power consumption in different power rails.\n\nProfileable power rails\n-----------------------\n\nThe ODPM reports all profileable power rails and is available in Android 10\n(API level 29) and higher and on Pixel 6 and subsequent Pixel devices.\n\n| Power rail name | Description |\n|-----------------|------------------------------------------------|\n| CPU Big | Power being consumed by the big CPU core. |\n| CPU Little | Power being consumed by the little CPU core. |\n| CPU Mid | Power being consumed by the mid CPU core. |\n| Camera | Power being consumed by the camera sensor. |\n| Cellular | Power being consumed by the cellular sensor. |\n| Display | Power being consumed by the display. |\n| GPS | Power being consumed by the GPS sensor. |\n| GPU | Power being consumed by the GPU sensor. |\n| Memory | Power being consumed by the RAM memory sensor. |\n| Sensor core | Power being consumed by other device sensors. |\n| UFS (disk) | Power being consumed by the Disk sensor. |\n| WLAN | Power being consumed by the Wifi sensor. |\n[**Table 1.** Availability of individual power rails is expected to\nchange based on the device being used.]\n\nDevices that don't support ODPM can offer power consumption data through Coulomb\ncounters and the battery gauge.\n\n| Name | Description |\n|----------|----------------------------------------------------------|\n| Capacity | The remaining battery percentage (%). |\n| Charge | The remaining battery charge in microampere-hours (µAh). |\n| Current | The instantaneous current in microampere (µA). |\n[**Table 2.** Power consumption data.]\n\nExample scenarios for profiling power consumption through the Power Profiler\n----------------------------------------------------------------------------\n\nAssume you are building an app that needs to download assets over the network.\nYou want to understand how the power consumption of WLAN power rail changes\nwhile downloading assets individually versus in a large chunk.\n\n**Scenario A:** The app makes individual network requests to download assets\nover WLAN.\n**Figure 2.** Individual network requests to download assets over WLAN.\n\n**Scenario B:** The app makes one network request to download a very large asset\nover WLAN.\n**Figure 3.** Individual network requests to download a very large asset over WLAN.\n\nAs shown in the preceding scenarios, the two system traces show different\nsignatures of power consumption in the WLAN power rail based on how you trigger\nthe download.\n\nEven though the preceding example is a simple way to measure power consumption\nin different scenarios, it demonstrates the process with which you can build\nmore sophisticated A/B tests for your app. You can use these tests to optimize\npower consumption across different features or different implementations of the\nsame feature.\n\nImportant notes\n---------------\n\n- ODPM measures power consumption at the device level---not specific to any app. You can correlate power consumption information from the ODPM to what's happening in your app foreground or background. As a result, you can expect noise in power consumption data based on how many apps are active in the device at the time of reading ODPM data.\n- Power Profiler reads power consumption data from the ODPM, which is only available on Pixel 6 and subsequent Pixel devices running Android 10 (API level 29) and higher.\n- Some power rails might only be available on some devices implementing ODPM."]]