Chromium Code Reviews| Index: build/android/device_status_check.py |
| diff --git a/build/android/device_status_check.py b/build/android/device_status_check.py |
| index 2aa4d73c9caa8641a9259926904c8bf9fa21db88..0a0463f73edbfd5429cafd48452cd0f6cc137675 100755 |
| --- a/build/android/device_status_check.py |
| +++ b/build/android/device_status_check.py |
| @@ -37,8 +37,12 @@ def DeviceInfo(serial): |
| setup_wizard_disabled = AdbShellCmd( |
| 'getprop ro.setupwizard.mode') == 'DISABLED' |
| battery = AdbShellCmd('dumpsys battery') |
| - battery_level = int(re.findall('level: (\d+)', battery)[0]) |
| - battery_temp = float(re.findall('temperature: (\d+)', battery)[0])/10 |
| + if battery.find('Error') == 0: |
|
Isaac (use chromium)
2013/01/10 20:21:52
nit will this work?
if 'Error' not in battery:
bulach
2013/01/11 10:04:23
yep, done.
|
| + battery_level = 'Unknown' |
| + battery_temp = 'Unknown' |
| + else: |
| + battery_level = int(re.findall('level: (\d+)', battery)[0]) |
| + battery_temp = float(re.findall('temperature: (\d+)', battery)[0]) / 10 |
| report = ['Device %s (%s)' % (serial, device_type), |
| ' Build: %s (%s)' % (device_build, |
| AdbShellCmd('getprop ro.build.fingerprint')), |