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

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

Issue 222413002: Adding dumpsys based power monitor for android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: W0212 warnings Created 6 years, 9 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
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 16474b762d50e11f6c853db9aec108a3f6ed0b6d..f96a4777ae680a1b69c92fe4c13994241adc7ee1 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
@@ -39,7 +39,7 @@ class DS2784PowerMonitor(power_monitor.PowerMonitor):
def _HasFuelGauge(self):
return self._adb.FileExistsOnDevice(CHARGE_COUNTER)
- def CanMonitorPowerAsync(self):
+ def CanMonitorPower(self):
if not self._HasFuelGauge():
return False
if self._IsDeviceCharging():
@@ -47,16 +47,16 @@ class DS2784PowerMonitor(power_monitor.PowerMonitor):
return False
return True
- def StartMonitoringPowerAsync(self):
+ def StartMonitoringPower(self, browser):
assert not self._powermonitor_process_port, (
- 'Must call StopMonitoringPowerAsync().')
+ 'Must call StopMonitoringPower().')
self._powermonitor_process_port = int(self._adb.RunShellCommand(
'%s %d %s %s %s' % (self._file_poller_binary, SAMPLE_RATE_HZ,
CHARGE_COUNTER, CURRENT, VOLTAGE))[0])
- def StopMonitoringPowerAsync(self):
+ def StopMonitoringPower(self):
assert self._powermonitor_process_port, (
- 'StartMonitoringPowerAsync() not called.')
+ 'StartMonitoringPower() not called.')
try:
result = '\n'.join(self._adb.RunShellCommand(
'%s %d' % (self._file_poller_binary,
@@ -71,7 +71,7 @@ class DS2784PowerMonitor(power_monitor.PowerMonitor):
"""Parse output of powermonitor command line utility.
Returns:
- Dictionary in the format returned by StopMonitoringPowerAsync().
+ Dictionary in the format returned by StopMonitoringPower().
"""
power_samples = []
total_energy_consumption_mwh = 0

Powered by Google App Engine
This is Rietveld 408576698