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

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

Merge "Fix charging reporting logic."

parents 001f6165 8d3c8782
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -103,14 +103,8 @@ public final class BatteryController extends RestrictingController {
        boolean reportChange = false;
        for (int i = mTrackedTasks.size() - 1; i >= 0; i--) {
            final JobStatus ts = mTrackedTasks.valueAt(i);
            boolean previous = ts.setChargingConstraintSatisfied(nowElapsed, stablePower);
            if (previous != stablePower) {
                reportChange = true;
            }
            previous = ts.setBatteryNotLowConstraintSatisfied(nowElapsed, batteryNotLow);
            if (previous != batteryNotLow) {
                reportChange = true;
            }
            reportChange |= ts.setChargingConstraintSatisfied(nowElapsed, stablePower);
            reportChange |= ts.setBatteryNotLowConstraintSatisfied(nowElapsed, batteryNotLow);
        }
        if (stablePower || batteryNotLow) {
            // If one of our conditions has been satisfied, always schedule any newly ready jobs.