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

Unified Diff: build/android/device_status_check.py

Issue 11828044: Android: fixes "device_status_check.py" for missing status. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 7 years, 11 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/device_status_check.py
diff --git a/build/android/device_status_check.py b/build/android/device_status_check.py
index 2aa4d73c9caa8641a9259926904c8bf9fa21db88..5f78ddce3d87a2d3778c5748c355b84ffd52e745 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 'Error' in battery:
+ 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')),
« 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