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

Commit 8a871d81 authored by zhouwenjie's avatar zhouwenjie
Browse files

Update mMinLearnedBatteryCapacity when necessary.

Currently mMinLearnedBatteryCapacity is only updated once (when it's
-1). We check the minimum of mMinLearnedBatteryCapacity and the new
chargeFullUah reading but never update mMinLearnedBatteryCapacity to the
new value.

Bug: 111132682
Test: manual
Change-Id: I1680e7a4bdf9176feb2a2dcc9f2c10c829202bda
parent 565aa509
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -12709,7 +12709,7 @@ public class BatteryStatsImpl extends BatteryStats {
        if (mMinLearnedBatteryCapacity == -1) {
            mMinLearnedBatteryCapacity = chargeFullUAh;
        } else {
            Math.min(mMinLearnedBatteryCapacity, chargeFullUAh);
            mMinLearnedBatteryCapacity = Math.min(mMinLearnedBatteryCapacity, chargeFullUAh);
        }
        mMaxLearnedBatteryCapacity = Math.max(mMaxLearnedBatteryCapacity, chargeFullUAh);
    }