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

Commit 3b22042f authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Reset monotonic size of battery history on history.reset()" into main

parents ecfab510 63392466
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -672,6 +672,7 @@ public class BatteryStatsHistory {
     */
    public void reset() {
        synchronized (this) {
            mMonotonicHistorySize = 0;
            initHistoryBuffer();
            if (mStore != null) {
                mStore.reset();
+1 −1
Original line number Diff line number Diff line
@@ -579,7 +579,7 @@ public class BatteryUsageStatsProviderTest {
        MockBatteryStatsImpl batteryStats = mStatsRule.getBatteryStats();
        accumulateBatteryUsageStats(batteryStats, 10000000, 0);
        // Accumulate every 200 bytes of battery history
        accumulateBatteryUsageStats(batteryStats, 200, 2);
        accumulateBatteryUsageStats(batteryStats, 200, 1);
        accumulateBatteryUsageStats(batteryStats, 50, 5);
        // Accumulate on every invocation of accumulateBatteryUsageStats
        accumulateBatteryUsageStats(batteryStats, 0, 7);