Merge "Fix charging reporting logic."
This commit is contained in:
committed by
Android (Google) Code Review
commit
eb2e346e78
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user