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

Unified Diff: build/android/provision_devices.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 | « build/android/devil/utils/mock_calls_test.py ('k') | build/android/pylib/constants/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/provision_devices.py
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
index 6ecffca1bf2dd941bc245fa1fd9d6684adf89828..96324ff5a912c278a0e9387a495b2796b6b35c8c 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -21,6 +21,8 @@ import subprocess
import sys
import time
+from devil.android.sdk import version_codes
+
from pylib import constants
from pylib import device_settings
from pylib.device import battery_utils
@@ -80,8 +82,7 @@ def ProvisionDevices(args):
def ProvisionDevice(device, blacklist, options):
if options.reboot_timeout:
reboot_timeout = options.reboot_timeout
- elif (device.build_version_sdk >=
- constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP):
+ elif (device.build_version_sdk >= version_codes.LOLLIPOP):
reboot_timeout = _DEFAULT_TIMEOUTS.LOLLIPOP
else:
reboot_timeout = _DEFAULT_TIMEOUTS.PRE_LOLLIPOP
@@ -273,11 +274,11 @@ def _ConfigureLocalProperties(device, java_debug=True):
local_props.append('debug.checkjni=1')
try:
device.WriteFile(
- constants.DEVICE_LOCAL_PROPERTIES_PATH,
+ device.LOCAL_PROPERTIES_PATH,
'\n'.join(local_props), as_root=True)
# Android will not respect the local props file if it is world writable.
device.RunShellCommand(
- ['chmod', '644', constants.DEVICE_LOCAL_PROPERTIES_PATH],
+ ['chmod', '644', device.LOCAL_PROPERTIES_PATH],
as_root=True, check_return=True)
except device_errors.CommandFailedError:
logging.exception('Failed to configure local properties.')
@@ -299,8 +300,7 @@ def FinishProvisioning(device, options):
logging.exception('Unable to let battery cool to specified temperature.')
def _set_and_verify_date():
- if (device.build_version_sdk
- >= constants.ANDROID_SDK_VERSION_CODES.MARSHMALLOW):
+ if (device.build_version_sdk >= version_codes.MARSHMALLOW):
date_format = '%m%d%H%M%Y.%S'
set_date_command = ['date']
else:
« no previous file with comments | « build/android/devil/utils/mock_calls_test.py ('k') | build/android/pylib/constants/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698