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

Unified Diff: build/android/provision_devices.py

Issue 1672543002: [Android] Detect if device is not charging properly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « build/android/devil/android/device_errors.py ('k') | 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 a9c6cd8d192bb14883b95c51d99a33813e62eae7..1a7f9e02ec06d1a66a1ab2a5765448188a9eaf07 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -336,11 +336,12 @@ def FinishProvisioning(device, options):
device.SendKeyEvent(keyevent.KEYCODE_MENU)
if options.min_battery_level is not None:
+ battery = battery_utils.BatteryUtils(device)
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.')
+ except device_errors.DeviceChargingError:
+ device.Reboot()
+ battery.ChargeDeviceToLevel(options.min_battery_level)
if options.max_battery_temp is not None:
try:
« no previous file with comments | « build/android/devil/android/device_errors.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698