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

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

Issue 1180443004: [Android] Change how battery_utils determines if battery updates resume. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + fix test broken due to rebase Created 5 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 | « 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 df5f826ff0f205343e188a30d2f560d10c085221..682238cbe6d982530547222e3d7edea0e42f36f9 100644
--- a/build/android/pylib/device/battery_utils.py
+++ b/build/android/pylib/device/battery_utils.py
@@ -324,7 +324,9 @@ class BatteryUtils(object):
device_errors.DeviceVersionError: If device is not L or higher.
"""
def battery_updates_enabled():
- return self.GetCharging() is True
+ return (self.GetCharging()
+ or not bool('UPDATES STOPPED' in self._device.RunShellCommand(
+ ['dumpsys', 'battery'], check_return=True)))
if (self._device.build_version_sdk <
constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP):
« 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