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

Commit 44409800 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix divide-by-zero in mobile radio remaining power calculation"

parents cc43a52f 3619c4bc
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -264,8 +264,10 @@ public class MobileRadioPowerCalculator extends PowerCalculator {
            if (total.remainingPowerMah < 0) total.remainingPowerMah = 0;
        } else {
            // Smear unattributed active time and add it to the remaining power consumption.
            if (totalActiveDurationMs != 0) {
                total.remainingPowerMah +=
                        (totalActivePowerMah * total.remainingDurationMs) / totalActiveDurationMs;
            }

            // Calculate the inactive modem power consumption.
            final BatteryStats.ControllerActivityCounter modemActivity =