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

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: 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..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')),
« 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