Update callback delay when constant changes.
Update the delay of the ACTION_CHARGING/DISCHARGING broadcast whenever the delay constant is updated to ensure that tests can run smoothly. Bug: 214599394 Test: atest --rerun-until-failure 25 CtsJobSchedulerTestCases:BatteryConstraintTest Test: atest --rerun-until-failure 25 CtsJobSchedulerTestCases:JobThrottlingTest Change-Id: Ic664fa58edb3cab9980759baf356457158f66ead
This commit is contained in:
@@ -16109,6 +16109,11 @@ public class BatteryStatsImpl extends BatteryStats {
|
||||
BATTERY_CHARGED_DELAY_MS = delay >= 0 ? delay : mParser.getInt(
|
||||
KEY_BATTERY_CHARGED_DELAY_MS,
|
||||
DEFAULT_BATTERY_CHARGED_DELAY_MS);
|
||||
|
||||
if (mHandler.hasCallbacks(mDeferSetCharging)) {
|
||||
mHandler.removeCallbacks(mDeferSetCharging);
|
||||
mHandler.postDelayed(mDeferSetCharging, BATTERY_CHARGED_DELAY_MS);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateKernelUidReadersThrottleTime(long oldTimeMs, long newTimeMs) {
|
||||
|
||||
Reference in New Issue
Block a user