Loading core/java/android/os/BatteryStats.java +6 −8 Original line number Diff line number Diff line Loading @@ -1554,7 +1554,10 @@ public abstract class BatteryStats implements Parcelable { } } public final static class HistoryItem implements Parcelable { /** * Battery history record. */ public static final class HistoryItem { public HistoryItem next; // The time of this event in milliseconds, as per SystemClock.elapsedRealtime(). Loading Loading @@ -1789,16 +1792,10 @@ public abstract class BatteryStats implements Parcelable { public HistoryItem() { } public HistoryItem(long time, Parcel src) { this.time = time; numReadInts = 2; public HistoryItem(Parcel src) { readFromParcel(src); } public int describeContents() { return 0; } public void writeToParcel(Parcel dest, int flags) { dest.writeLong(time); int bat = (((int)cmd)&0xff) Loading Loading @@ -1835,6 +1832,7 @@ public abstract class BatteryStats implements Parcelable { public void readFromParcel(Parcel src) { int start = src.dataPosition(); time = src.readLong(); int bat = src.readInt(); cmd = (byte)(bat&0xff); batteryLevel = (byte)((bat>>8)&0xff); Loading core/java/com/android/internal/os/BatteryStatsImpl.java +3 −6 Original line number Diff line number Diff line Loading @@ -3478,10 +3478,8 @@ public class BatteryStatsImpl extends BatteryStats { if (deltaTimeToken < DELTA_TIME_ABS) { cur.time += deltaTimeToken; } else if (deltaTimeToken == DELTA_TIME_ABS) { cur.time = src.readLong(); cur.numReadInts += 2; if (DEBUG) Slog.i(TAG, "READ DELTA: ABS time=" + cur.time); cur.readFromParcel(src); if (DEBUG) Slog.i(TAG, "READ DELTA: ABS time=" + cur.time); return; } else if (deltaTimeToken == DELTA_TIME_INT) { int delta = src.readInt(); Loading Loading @@ -13459,9 +13457,8 @@ public class BatteryStatsImpl extends BatteryStats { return; } mHistory = mHistoryEnd = mHistoryCache = null; long time; while (in.dataAvail() > 0 && (time=in.readLong()) >= 0) { HistoryItem rec = new HistoryItem(time, in); while (in.dataAvail() > 0) { HistoryItem rec = new HistoryItem(in); addHistoryRecordLocked(rec); } } Loading
core/java/android/os/BatteryStats.java +6 −8 Original line number Diff line number Diff line Loading @@ -1554,7 +1554,10 @@ public abstract class BatteryStats implements Parcelable { } } public final static class HistoryItem implements Parcelable { /** * Battery history record. */ public static final class HistoryItem { public HistoryItem next; // The time of this event in milliseconds, as per SystemClock.elapsedRealtime(). Loading Loading @@ -1789,16 +1792,10 @@ public abstract class BatteryStats implements Parcelable { public HistoryItem() { } public HistoryItem(long time, Parcel src) { this.time = time; numReadInts = 2; public HistoryItem(Parcel src) { readFromParcel(src); } public int describeContents() { return 0; } public void writeToParcel(Parcel dest, int flags) { dest.writeLong(time); int bat = (((int)cmd)&0xff) Loading Loading @@ -1835,6 +1832,7 @@ public abstract class BatteryStats implements Parcelable { public void readFromParcel(Parcel src) { int start = src.dataPosition(); time = src.readLong(); int bat = src.readInt(); cmd = (byte)(bat&0xff); batteryLevel = (byte)((bat>>8)&0xff); Loading
core/java/com/android/internal/os/BatteryStatsImpl.java +3 −6 Original line number Diff line number Diff line Loading @@ -3478,10 +3478,8 @@ public class BatteryStatsImpl extends BatteryStats { if (deltaTimeToken < DELTA_TIME_ABS) { cur.time += deltaTimeToken; } else if (deltaTimeToken == DELTA_TIME_ABS) { cur.time = src.readLong(); cur.numReadInts += 2; if (DEBUG) Slog.i(TAG, "READ DELTA: ABS time=" + cur.time); cur.readFromParcel(src); if (DEBUG) Slog.i(TAG, "READ DELTA: ABS time=" + cur.time); return; } else if (deltaTimeToken == DELTA_TIME_INT) { int delta = src.readInt(); Loading Loading @@ -13459,9 +13457,8 @@ public class BatteryStatsImpl extends BatteryStats { return; } mHistory = mHistoryEnd = mHistoryCache = null; long time; while (in.dataAvail() > 0 && (time=in.readLong()) >= 0) { HistoryItem rec = new HistoryItem(time, in); while (in.dataAvail() > 0) { HistoryItem rec = new HistoryItem(in); addHistoryRecordLocked(rec); } }