Android: Battery usage of each application

前端 未结 2 2126
无人及你
无人及你 2020-12-11 08:24

Is there anyway to get the battery usage info per application per second in API, adb shell, ...?

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-11 09:06

    just try to read http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/1.6_r2/com/android/settings/fuelgauge/PowerUsageSummary.java/ , then you can get the info shown in the battery usage screen. the key class are IBatteryStats and BatteryStatsImpl.

提交回复
热议问题