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

Unified Diff: tools/telemetry/telemetry/core/platform/power_monitor/android_ds2784_power_monitor.py

Issue 228253003: Update usb charging command to wait for it to succeed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Follow review Created 6 years, 8 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/pylib/android_commands.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/power_monitor/android_ds2784_power_monitor.py
diff --git a/tools/telemetry/telemetry/core/platform/power_monitor/android_ds2784_power_monitor.py b/tools/telemetry/telemetry/core/platform/power_monitor/android_ds2784_power_monitor.py
index f96a4777ae680a1b69c92fe4c13994241adc7ee1..5ee5eb1e68c3d863e9e000068b557fec8d75d075 100644
--- a/tools/telemetry/telemetry/core/platform/power_monitor/android_ds2784_power_monitor.py
+++ b/tools/telemetry/telemetry/core/platform/power_monitor/android_ds2784_power_monitor.py
@@ -28,13 +28,6 @@ class DS2784PowerMonitor(power_monitor.PowerMonitor):
'file_poller')
- def _IsDeviceCharging(self):
- for line in self._adb.RunShellCommand('dumpsys battery'):
- if 'powered: ' in line:
- if 'true' == line.split('powered: ')[1]:
- return True
- return False
-
@decorators.Cache
def _HasFuelGauge(self):
return self._adb.FileExistsOnDevice(CHARGE_COUNTER)
@@ -42,7 +35,7 @@ class DS2784PowerMonitor(power_monitor.PowerMonitor):
def CanMonitorPower(self):
if not self._HasFuelGauge():
return False
- if self._IsDeviceCharging():
+ if self._adb.IsDeviceCharging():
logging.warning('Can\'t monitor power usage since device is charging.')
return False
return True
« no previous file with comments | « build/android/pylib/android_commands.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698