diff options
author | Lifu Tang <lifu@google.com> | 2013-09-05 21:47:00 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-05 21:47:00 +0000 |
commit | 8aea7b4d3d79163912f55a2d37657c4d33109655 (patch) | |
tree | 45ca3a1d501401fc4aff39b73083793108377817 /src/com/android | |
parent | 10cbbc5515a30dfa347f0a7b816ebde8cbb0e0f7 (diff) | |
parent | 6cc61f17a1b239217225347d52fbef43fc72066c (diff) | |
download | packages_apps_Settings-8aea7b4d3d79163912f55a2d37657c4d33109655.zip packages_apps_Settings-8aea7b4d3d79163912f55a2d37657c4d33109655.tar.gz packages_apps_Settings-8aea7b4d3d79163912f55a2d37657c4d33109655.tar.bz2 |
Merge "Fixed the NullPointerException" into klp-dev
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/settings/fuelgauge/BatteryStatsHelper.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/settings/fuelgauge/BatteryStatsHelper.java b/src/com/android/settings/fuelgauge/BatteryStatsHelper.java index 953ff3d..71c69a3 100644 --- a/src/com/android/settings/fuelgauge/BatteryStatsHelper.java +++ b/src/com/android/settings/fuelgauge/BatteryStatsHelper.java @@ -560,7 +560,7 @@ public class BatteryStatsHelper { osApp = app; } } - if (power != 0) { + if (power != 0 || includeZeroConsumption) { if (u.getUid() == Process.WIFI_UID) { mWifiPower += power; } else if (u.getUid() == Process.BLUETOOTH_UID) { @@ -725,7 +725,8 @@ public class BatteryStatsHelper { name = mActivity.getResources().getString( R.string.running_process_item_removed_user_label); } - double power = mUserPower.get(userId); + Double userPower = mUserPower.get(userId); + double power = (userPower != null) ? userPower : 0.0; BatterySipper bs = addEntry(name, DrainType.USER, 0, 0, power); bs.icon = icon; aggregateSippers(bs, sippers, "User"); |