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

Commit df6a7371 authored by Ying Wai (Daniel) Fan's avatar Ying Wai (Daniel) Fan Committed by android-build-merger
Browse files

Prevent division-by-zero error when calculating battery capacity. am: 415f8b32

am: 63f3dbae

Change-Id: I1c97aa2e4c0bbc84c547e4ce3ff98b77c5bba3f4
parents ebe26f89 63f3dbae
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9612,7 +9612,7 @@ public class BatteryStatsImpl extends BatteryStats {
                }
                doWrite = true;
                resetAllStatsLocked();
                if (chargeUAh > 0) {
                if (chargeUAh > 0 && level > 0) {
                    // Only use the reported coulomb charge value if it is supported and reported.
                    mEstimatedBatteryCapacity = (int) ((chargeUAh / 1000) / (level / 100.0));
                }