am 2f463ef1: Merge "Adding a sanity test in the while loop in readHistory()"

* commit '2f463ef18bb235be57b39cbda536bcd2df2d0908':
  Adding a sanity test in the while loop in readHistory()
This commit is contained in:
Conley Owens
2011-04-29 10:23:28 -07:00
committed by Android Git Automerger

View File

@@ -4708,7 +4708,7 @@ public final class BatteryStatsImpl extends BatteryStats {
mHistory = mHistoryEnd = mHistoryCache = null;
mHistoryBaseTime = 0;
long time;
while ((time=in.readLong()) >= 0) {
while (in.dataAvail() > 0 && (time=in.readLong()) >= 0) {
HistoryItem rec = new HistoryItem(time, in);
addHistoryRecordLocked(rec);
if (rec.time > mHistoryBaseTime) {