diff options
| author | Adam Lesinski <adamlesinski@google.com> | 2015-05-05 19:19:00 -0700 |
|---|---|---|
| committer | Adam Lesinski <adamlesinski@google.com> | 2015-05-05 19:19:19 -0700 |
| commit | d9b48d5735dc499d735d28447d5000599a1d3dfd (patch) | |
| tree | cdd741a37e42e01882ad7a61e492d75e694c9178 /core/java | |
| parent | 5b1516900ac23fbbc32c3fee36009e1dd3569dcd (diff) | |
| download | frameworks_base-d9b48d5735dc499d735d28447d5000599a1d3dfd.zip frameworks_base-d9b48d5735dc499d735d28447d5000599a1d3dfd.tar.gz frameworks_base-d9b48d5735dc499d735d28447d5000599a1d3dfd.tar.bz2 | |
Fix overcounting of mobile radio
Bug:20438089
Change-Id: Ie8987cf61ef7a0cecab6d730eed7bc47eabb9eec
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/com/android/internal/os/MobileRadioPowerCalculator.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/com/android/internal/os/MobileRadioPowerCalculator.java b/core/java/com/android/internal/os/MobileRadioPowerCalculator.java index 9711c3b..8586d76 100644 --- a/core/java/com/android/internal/os/MobileRadioPowerCalculator.java +++ b/core/java/com/android/internal/os/MobileRadioPowerCalculator.java @@ -52,7 +52,7 @@ public class MobileRadioPowerCalculator extends PowerCalculator { public MobileRadioPowerCalculator(PowerProfile profile, BatteryStats stats) { mPowerRadioOn = profile.getAveragePower(PowerProfile.POWER_RADIO_ACTIVE); for (int i = 0; i < mPowerBins.length; i++) { - mPowerBins[i] = profile.getAveragePower(PowerProfile.POWER_RADIO_ACTIVE, i); + mPowerBins[i] = profile.getAveragePower(PowerProfile.POWER_RADIO_ON, i); } mPowerScan = profile.getAveragePower(PowerProfile.POWER_RADIO_SCANNING); mStats = stats; @@ -128,7 +128,9 @@ public class MobileRadioPowerCalculator extends PowerCalculator { } if (power != 0) { - app.noCoveragePercent = noCoverageTimeMs * 100.0 / signalTimeMs; + if (signalTimeMs != 0) { + app.noCoveragePercent = noCoverageTimeMs * 100.0 / signalTimeMs; + } app.mobileActive = remainingActiveTimeMs; app.mobileActiveCount = stats.getMobileRadioActiveUnknownCount(statsType); app.mobileRadioPowerMah = power; |
