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

Commit 306eff8a authored by Dmitri Plotnikov's avatar Dmitri Plotnikov
Browse files

Keep recording battery history when already charged

Bug: 361424002
Test: atest PowerStatsTests
Flag: com.android.server.power.optimization.battery_usage_stats_by_power_and_screen_state


Change-Id: I161304b2ca6c8010de898ff6110c5dfcebd7666c
parent 1c36a3c7
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -15300,15 +15300,6 @@ public class BatteryStatsImpl extends BatteryStats {
                mHistory.writeHistoryItem(elapsedRealtimeMs, uptimeMs);
            }
        }
        if (!onBattery &&
                (status == BatteryManager.BATTERY_STATUS_FULL ||
                        status == BatteryManager.BATTERY_STATUS_UNKNOWN)) {
            // We don't record history while we are plugged in and fully charged
            // (or when battery is not present).  The next time we are
            // unplugged, history will be cleared.
            mHistory.setHistoryRecordingEnabled(DEBUG);
        }
        mLastLearnedBatteryCapacityUah = chargeFullUah;
        if (mMinLearnedBatteryCapacityUah == -1) {
            mMinLearnedBatteryCapacityUah = chargeFullUah;