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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user