[CTS]It should be more reasonable to control battery saver function from setting DB instead of plugging/unplugging charger for “CtsHostsideNetworkTests” test case.

Symptom: It should be more reasonable to control battery saver function from setting DB instead of plugging/unplugging charger for “CtsHostsideNetworkTests” test case.
Root Cause: The test function “setBatterySaverMode” of “CtsHostsideNetworkTests” use command to set setting DB when trying to turn on battery saver. But while trying to turn off battery saver, it only use charger plug-in event. It should be more reasonable to turn off battery saver through similar DB setting as this function did at turning on.
Solution: To control battery saver function from setting DB.
Project:
Note:
Test done by RD:
Futher testing need Q team's support:

Bug: 31897608

Change-Id: Id70ba458e85f98393d7652bb4e79bd182172c60f
This commit is contained in:
peter_li
2016-10-04 13:36:03 +08:00
committed by Felipe Leme
parent 9be9d5865b
commit 2ecad8d87d

View File

@@ -610,6 +610,7 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation
executeSilentShellCommand("cmd battery unplug");
executeSilentShellCommand("settings put global low_power 1");
} else {
executeSilentShellCommand("settings put global low_power 0");
turnBatteryOn();
}
}