diff options
author | Adam Lesinski <adamlesinski@google.com> | 2015-09-28 10:21:33 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2015-09-28 10:59:45 -0700 |
commit | a57a5404400b8dec5144d275452101e283f772b1 (patch) | |
tree | acf0f73e3b09884838f7a0c8d9619576d139d5cb /core | |
parent | 86e153d5f0614c9f3da137fd0b815a398598928b (diff) | |
download | frameworks_base-a57a5404400b8dec5144d275452101e283f772b1.zip frameworks_base-a57a5404400b8dec5144d275452101e283f772b1.tar.gz frameworks_base-a57a5404400b8dec5144d275452101e283f772b1.tar.bz2 |
Fix asymmetry in parceling/unparceling code for BatteryStats summary
Bug:24434303
Change-Id: I638979e54076004860035396738f6a1281e26c20
Diffstat (limited to 'core')
-rw-r--r-- | core/java/com/android/internal/os/BatteryStatsImpl.java | 17 |
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 8cf2dab..64b7768 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 { |