Update the battery charging status when turning battery on/off.
Bug: 72656089
Test: cts-tradefed run singleCommand cts-dev -m CtsHostsideNetworkTests -t \
com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: Ida6d3ff4a78c91e656b49a26006603973753c808
This commit is contained in:
@@ -810,11 +810,15 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation
|
||||
|
||||
protected void turnBatteryOn() throws Exception {
|
||||
executeSilentShellCommand("cmd battery unplug");
|
||||
executeSilentShellCommand("cmd battery set status "
|
||||
+ BatteryManager.BATTERY_STATUS_NOT_CHARGING);
|
||||
assertBatteryState(false);
|
||||
}
|
||||
|
||||
protected void turnBatteryOff() throws Exception {
|
||||
executeSilentShellCommand("cmd battery set ac " + BatteryManager.BATTERY_PLUGGED_AC);
|
||||
executeSilentShellCommand("cmd battery set status "
|
||||
+ BatteryManager.BATTERY_STATUS_CHARGING);
|
||||
assertBatteryState(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user