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

Unified Diff: build/android/pylib/device/battery_utils.py

Issue 1066253003: Disable ac charging similar to usb charging (used by Nexus6) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « no previous file | build/android/pylib/device/battery_utils_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/device/battery_utils.py
diff --git a/build/android/pylib/device/battery_utils.py b/build/android/pylib/device/battery_utils.py
index cca89c725e6e1608b1d674ebfa319709af5ca6fa..bfe553d517b2aa3ddf57778f862f498021400709 100644
--- a/build/android/pylib/device/battery_utils.py
+++ b/build/android/pylib/device/battery_utils.py
@@ -238,7 +238,7 @@ class BatteryUtils(object):
return self.GetCharging() is False
self._device.RunShellCommand(
- ['dumpsys', 'battery', 'set', 'usb', '1'], check_return=True)
+ ['dumpsys', 'battery', 'reset'], check_return=True)
self._device.RunShellCommand(
['dumpsys', 'batterystats', '--reset'], check_return=True)
battery_data = self._device.RunShellCommand(
@@ -252,6 +252,8 @@ class BatteryUtils(object):
and l[PWI_POWER_INDEX] != 0):
raise device_errors.CommandFailedError(
'Non-zero pmi value found after reset.')
+ self._device.RunShellCommand(['dumpsys', 'battery', 'set', 'ac', '0'],
+ check_return=True)
self._device.RunShellCommand(['dumpsys', 'battery', 'set', 'usb', '0'],
check_return=True)
timeout_retry.WaitFor(battery_updates_disabled, wait_period=1)
@@ -267,8 +269,6 @@ class BatteryUtils(object):
def battery_updates_enabled():
return self.GetCharging() is True
- self._device.RunShellCommand(['dumpsys', 'battery', 'set', 'usb', '1'],
rnephew (Wrong account) 2015/04/07 23:51:40 This is in there because on K devices reset takes
fmeawad 2015/04/07 23:56:13 I cannot set the ac to 1 as well as this will set
fmeawad 2015/04/08 00:54:29 I checked the code, and this code is never called
- check_return=True)
self._device.RunShellCommand(['dumpsys', 'battery', 'reset'],
check_return=True)
timeout_retry.WaitFor(battery_updates_enabled, wait_period=1)
« no previous file with comments | « no previous file | build/android/pylib/device/battery_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698