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:
Sudheer Shanka
2018-05-31 11:41:30 -07:00
parent 4ca791b07b
commit cd670e7957

View File

@@ -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);