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

Unified Diff: build/android/devil/android/battery_utils.py

Issue 1325143002: [Android] Move Android version codes into devil/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/devil/android/device_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/devil/android/battery_utils.py
diff --git a/build/android/devil/android/battery_utils.py b/build/android/devil/android/battery_utils.py
index dbd377b443f1edb8cea41540344665e67a4fdc42..3d27db2652d28a177b317cf1612d025467046406 100644
--- a/build/android/devil/android/battery_utils.py
+++ b/build/android/devil/android/battery_utils.py
@@ -14,6 +14,7 @@ import logging
from devil.android import decorators
from devil.android import device_errors
from devil.android import device_utils
+from devil.android.sdk import version_codes
from devil.utils import timeout_retry
from pylib import constants
@@ -423,8 +424,7 @@ class BatteryUtils(object):
Raises:
device_errors.DeviceVersionError: If device is not L or higher.
"""
- if (self._device.build_version_sdk <
- constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP):
+ if (self._device.build_version_sdk < version_codes.LOLLIPOP):
raise device_errors.DeviceVersionError('Device must be L or higher.')
try:
self.DisableBatteryUpdates(timeout=timeout, retries=retries)
@@ -583,8 +583,7 @@ class BatteryUtils(object):
device_errors.DeviceVersionError: If power clearing is supported,
but fails.
"""
- if (self._device.build_version_sdk <
- constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP):
+ if (self._device.build_version_sdk < version_codes.LOLLIPOP):
logging.warning('Dumpsys power data only available on 5.0 and above. '
'Cannot clear power data.')
return False
« no previous file with comments | « no previous file | build/android/devil/android/device_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698