summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2015-09-29 23:22:59 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-09-29 23:22:59 +0000
commitffc6ce000568c08a50f7b538bd4cd7729e64c229 (patch)
tree41a8e3a4f0a20793d5d29f23d990b8802eafe661
parentc25d546050423845c42a5e8cc8e356caa1f4f71a (diff)
parenta57a5404400b8dec5144d275452101e283f772b1 (diff)
downloadbase-ffc6ce000568c08a50f7b538bd4cd7729e64c229.tar.gz
Merge "Fix asymmetry in parceling/unparceling code for BatteryStats summary" into mnc-dr-dev
-rw-r--r--core/java/com/android/internal/os/BatteryStatsImpl.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index 8cf2dabdb549..64b7768c8337 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -5704,6 +5704,8 @@ public final class BatteryStatsImpl extends BatteryStats {
cpuSpeeds[speed] = new LongSamplingCounter(mOnBatteryTimeBase, in);
}
}
+ } else {
+ mCpuClusterSpeed[cluster] = null;
}
}
} else {
@@ -9382,13 +9384,14 @@ public final class BatteryStatsImpl extends BatteryStats {
u.mCpuClusterSpeed = new LongSamplingCounter[numClusters][];
for (int cluster = 0; cluster < numClusters; cluster++) {
- int NSB = in.readInt();
- if (mPowerProfile != null &&
- mPowerProfile.getNumSpeedStepsInCpuCluster(cluster) != NSB) {
- throw new ParcelFormatException("File corrupt: too many speed bins " + NSB);
- }
-
if (in.readInt() != 0) {
+ final int NSB = in.readInt();
+ if (mPowerProfile != null &&
+ mPowerProfile.getNumSpeedStepsInCpuCluster(cluster) != NSB) {
+ throw new ParcelFormatException("File corrupt: too many speed bins " +
+ NSB);
+ }
+
u.mCpuClusterSpeed[cluster] = new LongSamplingCounter[NSB];
for (int speed = 0; speed < NSB; speed++) {
if (in.readInt() != 0) {
@@ -9397,6 +9400,8 @@ public final class BatteryStatsImpl extends BatteryStats {
u.mCpuClusterSpeed[cluster][speed].readSummaryFromParcelLocked(in);
}
}
+ } else {
+ u.mCpuClusterSpeed[cluster] = null;
}
}
} else {