Chromium Code Reviews| Index: build/android/provision_devices.py |
| diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py |
| index a9c6cd8d192bb14883b95c51d99a33813e62eae7..23919d6357787ef478fdd7fef9ad3e046d604343 100755 |
| --- a/build/android/provision_devices.py |
| +++ b/build/android/provision_devices.py |
| @@ -338,7 +338,16 @@ def FinishProvisioning(device, options): |
| if options.min_battery_level is not None: |
| try: |
| battery = battery_utils.BatteryUtils(device) |
| - battery.ChargeDeviceToLevel(options.min_battery_level) |
| + try: |
| + battery.ChargeDeviceToLevel(options.min_battery_level) |
| + except device_errors.DeviceChargingError: |
| + device.Reboot() |
| + try: |
| + battery.ChargeDeviceToLevel(options.min_battery_level) |
| + except device_errors.DeviceChargingError: |
|
jbudorick
2016/02/05 01:40:43
We shouldn't catch this or handle the blacklist he
rnephew (Reviews Here)
2016/02/05 01:52:00
Done.
|
| + blacklist = device_blacklist.Blacklist(options.blacklist_file) |
| + blacklist.Extend([str(device)], reason='Charging timeout') |
| + logging.exception('Error while charging device.') |
| except device_errors.CommandFailedError: |
|
jbudorick
2016/02/05 01:40:43
We shouldn't catch this either.
rnephew (Reviews Here)
2016/02/05 01:52:00
Done.
|
| logging.exception('Unable to charge device to specified level.') |