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

Commit 62b3c92c authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Adjust future charge start time.

Change-Id: Id10508a917a47a767614dee5a55f0ca7dbbae6bb
Fixes: 70606388
Test: Manual test with forwarding the clock and rewinding it with "cmd battery".
parent 5d8dfe17
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4083,7 +4083,8 @@ public class BatteryStatsImpl extends BatteryStats {
    boolean ensureStartClockTime(final long currentTime) {
        final long ABOUT_ONE_YEAR = 365*24*60*60*1000L;
        if (currentTime > ABOUT_ONE_YEAR && mStartClockTime < (currentTime-ABOUT_ONE_YEAR)) {
        if ((currentTime > ABOUT_ONE_YEAR && mStartClockTime < (currentTime-ABOUT_ONE_YEAR))
                || (mStartClockTime > currentTime)) {
            // If the start clock time has changed by more than a year, then presumably
            // the previous time was completely bogus.  So we are going to figure out a
            // new time based on how much time has elapsed since we started counting.