Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3619)

Unified Diff: build/android/provision_devices.py

Issue 1218173004: [Android] Move battery & temperature waits after the second reboot. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/provision_devices.py
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
index 9bf1612321735ec28a343cfc2e0ec1d816ac5296..191f1adca58b04f6907344d8058f4a08299a260b 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -182,20 +182,6 @@ def SetProperties(device, options):
device_settings.ConfigureContentSettings(
device, device_settings.NETWORK_DISABLED_SETTINGS)
- if options.min_battery_level is not None:
- try:
- battery = battery_utils.BatteryUtils(device)
- battery.ChargeDeviceToLevel(options.min_battery_level)
- except device_errors.CommandFailedError as e:
- logging.exception('Unable to charge device to specified level.')
-
- if options.max_battery_temp is not None:
- try:
- battery = battery_utils.BatteryUtils(device)
- battery.LetBatteryCoolToTemperature(options.max_battery_temp)
- except device_errors.CommandFailedError as e:
- logging.exception('Unable to let battery cool to specified temperature.')
-
def _ConfigureLocalProperties(device, java_debug=True):
"""Set standard readonly testing device properties prior to reboot."""
local_props = [
@@ -222,6 +208,20 @@ def _ConfigureLocalProperties(device, java_debug=True):
def FinishProvisioning(device, options):
+ if options.min_battery_level is not None:
+ try:
+ battery = battery_utils.BatteryUtils(device)
+ battery.ChargeDeviceToLevel(options.min_battery_level)
+ except device_errors.CommandFailedError:
+ logging.exception('Unable to charge device to specified level.')
+
+ if options.max_battery_temp is not None:
+ try:
+ battery = battery_utils.BatteryUtils(device)
+ battery.LetBatteryCoolToTemperature(options.max_battery_temp)
+ except device_errors.CommandFailedError:
+ logging.exception('Unable to let battery cool to specified temperature.')
+
device.RunShellCommand(
['date', '-s', time.strftime('%Y%m%d.%H%M%S', time.gmtime())],
as_root=True, check_return=True)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698