Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f463ef1 authored by Conley Owens's avatar Conley Owens Committed by Android Code Review
Browse files

Merge "Adding a sanity test in the while loop in readHistory()"

parents c5505f6a 3d865240
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {