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

Commit a7ee33e7 authored by Andrew Chant's avatar Andrew Chant
Browse files

Revert "Breaking history writing out of BatteryStatsImpl"

This reverts commit 62242bdc.

Reason for revert: ramdumps on ToT related to battersystats parcel parsing
Bug: 243434675

Change-Id: I18522929f5a1499f56a0cc19606c28a2ed9fc26d
parent 62242bdc
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2325,6 +2325,11 @@ public abstract class BatteryStats {

    public abstract void finishIteratingHistoryLocked();

    /**
     * Return the base time offset for the battery history.
     */
    public abstract long getHistoryBaseTime();

    /**
     * Returns the number of times the device has been started.
     */
@@ -7610,6 +7615,8 @@ public abstract class BatteryStats {
                CHECKIN_VERSION, getParcelVersion(), getStartPlatformVersion(),
                getEndPlatformVersion());

        long now = getHistoryBaseTime() + SystemClock.elapsedRealtime();

        if ((flags & (DUMP_INCLUDE_HISTORY | DUMP_HISTORY_ONLY)) != 0) {
            if (startIteratingHistoryLocked()) {
                try {
+62 −1254

File changed.

Preview size limit exceeded, changes collapsed.

+1 −7
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ public class BatteryStatsHistoryIterator {

    public BatteryStatsHistoryIterator(@NonNull BatteryStatsHistory history) {
        mBatteryStatsHistory = history;
        mBatteryStatsHistory.startIteratingHistory();
    }

    /**
@@ -230,11 +231,4 @@ public class BatteryStatsHistoryIterator {
        out.batteryTemperature = (short) ((batteryLevelInt & 0x01ff8000) >>> 15);
        out.batteryVoltage = (char) ((batteryLevelInt & 0x00007ffe) >>> 1);
    }

    /**
     * Should be called when iteration is complete.
     */
    public void close() {
        mBatteryStatsHistory.finishIteratingHistory();
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -657,7 +657,7 @@ public class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStat

        // Now that we have finally received all the data, we can tell mStats about it.
        synchronized (mStats) {
            mStats.recordHistoryEventLocked(
            mStats.addHistoryEventLocked(
                    elapsedRealtime,
                    uptime,
                    BatteryStats.HistoryItem.EVENT_COLLECT_EXTERNAL_STATS,
+1305 −491

File changed.

Preview size limit exceeded, changes collapsed.

Loading