summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2011-12-16 16:02:51 -0800
committerTodd Poynor <toddpoynor@google.com>2012-01-05 10:40:14 -0800
commite3b4dfae6f6063ffbcc5d105fa54888b7e3873f7 (patch)
treec482ba1ff448185c1abe2db1e1efe0ad7b4cb2af /src
parent2bccd7f4a7793fd78dd9c83e9fe613ea9e32513b (diff)
downloadpackages_apps_Settings-e3b4dfae6f6063ffbcc5d105fa54888b7e3873f7.tar.gz
packages_apps_Settings-e3b4dfae6f6063ffbcc5d105fa54888b7e3873f7.tar.bz2
packages_apps_Settings-e3b4dfae6f6063ffbcc5d105fa54888b7e3873f7.zip
Android OS battery usage overstated by screen on time
Change-Id: Icbc4b3ecf91bdbb90da3ee0cf1c68bec953d0177 Signed-off-by: Todd Poynor <toddpoynor@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/fuelgauge/PowerUsageSummary.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index 6312682eb..b813ec637 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -579,11 +579,12 @@ public class PowerUsageSummary extends PreferenceFragment implements Runnable {
if (osApp != null) {
long wakeTimeMillis = mStats.computeBatteryUptime(
SystemClock.uptimeMillis() * 1000, which) / 1000;
- wakeTimeMillis -= appWakelockTime - (mStats.getScreenOnTime(
+ wakeTimeMillis -= appWakelockTime + (mStats.getScreenOnTime(
SystemClock.elapsedRealtime(), which) / 1000);
if (wakeTimeMillis > 0) {
double power = (wakeTimeMillis
* mPowerProfile.getAveragePower(PowerProfile.POWER_CPU_AWAKE)) / 1000;
+ if (DEBUG) Log.i(TAG, "OS wakeLockTime " + wakeTimeMillis + " power " + power);
osApp.wakeLockTime += wakeTimeMillis;
osApp.value += power;
osApp.values[0] += power;