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

Commit 99d0452d authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix a few small battery stats problems:

- Actually aggregate discharge amounts.
- Actually print the unplugged battery info when currently plugged in.

Change-Id: I22dd6feb73ac1364eb169d3239ce403b0755bb6c
parent 39792d22
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1400,6 +1400,7 @@ public abstract class BatteryStats implements Parcelable {
                        pw.println(getDischargeStartLevel());
                pw.print(prefix); pw.print("    Discharge cycle current level: ");
                        pw.println(getDischargeCurrentLevel());
            } else {
                pw.print(prefix); pw.println("  Device is currently plugged into power");
                pw.print(prefix); pw.print("    Last discharge cycle start level: "); 
                        pw.println(getDischargeStartLevel());
+2 −2
Original line number Diff line number Diff line
@@ -3691,8 +3691,8 @@ public final class BatteryStatsImpl extends BatteryStats {
                mTrackBatteryPastRealtime += realtime - mTrackBatteryRealtimeStart;
                mDischargeCurrentLevel = level;
                if (level < mDischargeUnplugLevel) {
                    mLowDischargeAmountSinceCharge = mDischargeUnplugLevel-level-1;
                    mHighDischargeAmountSinceCharge = mDischargeUnplugLevel-level;
                    mLowDischargeAmountSinceCharge += mDischargeUnplugLevel-level-1;
                    mHighDischargeAmountSinceCharge += mDischargeUnplugLevel-level;
                }
                doPlugLocked(getBatteryUptimeLocked(uptime), getBatteryRealtimeLocked(realtime));
            }