Update charge level too when turning battery off.
BATTERY_CHARGING which triggers the parole state will only be sent if the level is > 90. Change-Id: I1073e473c27eb5d29744f4a967771392729b4e1a Fixes:80534062 Test: Verified that updating the level activates the parole mode.
This commit is contained in:
@@ -831,6 +831,7 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation
|
||||
|
||||
protected void turnBatteryOff() throws Exception {
|
||||
executeSilentShellCommand("cmd battery set ac " + BATTERY_PLUGGED_ANY);
|
||||
executeSilentShellCommand("cmd battery set level 100");
|
||||
executeSilentShellCommand("cmd battery set status "
|
||||
+ BatteryManager.BATTERY_STATUS_CHARGING);
|
||||
assertBatteryState(true);
|
||||
|
||||
Reference in New Issue
Block a user