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

Unified Diff: build/android/pylib/android_commands.py

Issue 333723003: Wait for perfbot devices to charge between runs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fail high when battery level can't be determined Created 6 years, 6 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/provision_devices.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index 960f2ae96381370eaf49be6c87a4e6589b5c5616..f7264b091a645c48865743102697ffb9da32c9b6 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -1357,10 +1357,14 @@ class AndroidCommands(object):
return '\n'.join(iphone_sub)
def GetBatteryInfo(self):
- """Returns the device battery info (e.g. status, level, etc) as string."""
+ """Returns a {str: str} dict of battery info (e.g. status, level, etc)."""
battery = self.RunShellCommand('dumpsys battery')
assert battery
- return '\n'.join(battery)
+ battery_info = {}
+ for line in battery[1:]:
+ k, _, v = line.partition(': ')
+ battery_info[k.strip()] = v.strip()
+ return battery_info
def GetSetupWizardStatus(self):
"""Returns the status of the device setup wizard (e.g. DISABLED)."""
« no previous file with comments | « build/android/provision_devices.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698