summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Lesinski <adamlesinski@google.com> 2015-05-06 02:21:15 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2015-05-06 02:21:16 +0000
commitc9399a80448ddc4a01d5a9c3d738f3077f70233c (patch)
tree0689dd00c6c43650c6fdae48b8e8367c81ad20a3
parentf1ca5777283cd647a629456e163f68376f1415b1 (diff)
parentd9b48d5735dc499d735d28447d5000599a1d3dfd (diff)
Merge "Fix overcounting of mobile radio" into mnc-dev
-rw-r--r--core/java/com/android/internal/os/MobileRadioPowerCalculator.java6
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 9711c3bd37a1..8586d76a75ee 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;