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

Commit 50fa8ad4 authored by Aaron Whyte's avatar Aaron Whyte Committed by Android (Google) Code Review
Browse files

Merge "Prevent division-by-zero error when calculating battery capacity." into cw-f-dev

parents b06c3ed7 415f8b32
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9594,7 +9594,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));
                }