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

Unified Diff: build/android/devil/android/sdk/fastboot.py

Issue 1416703003: [Android] Add a configurable environment for devil/. (RELAND 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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/android/sdk/dexdump.py ('k') | build/android/devil/android/sdk/shared_prefs_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/devil/android/sdk/fastboot.py
diff --git a/build/android/devil/android/sdk/fastboot.py b/build/android/devil/android/sdk/fastboot.py
index cfc566a67c292f8ee2e9f4d0d2df5bdf774acea8..aebff203fdaa602d00087f04aebd5f8328da3d62 100644
--- a/build/android/devil/android/sdk/fastboot.py
+++ b/build/android/devil/android/sdk/fastboot.py
@@ -11,19 +11,21 @@ should be delegated to a higher level (ex. FastbootUtils).
import os
+from devil import devil_env
from devil.android import decorators
from devil.android import device_errors
from devil.utils import cmd_helper
-from pylib import constants
+from devil.utils import lazy
-_FASTBOOT_CMD = os.path.join(
- constants.ANDROID_SDK_ROOT, 'platform-tools', 'fastboot')
_DEFAULT_TIMEOUT = 30
_DEFAULT_RETRIES = 3
_FLASH_TIMEOUT = _DEFAULT_TIMEOUT * 10
class Fastboot(object):
+ _fastboot_path = lazy.WeakConstant(lambda: os.path.join(
+ devil_env.config.LocalPath('android_sdk'), 'platform-tools', 'adb'))
+
def __init__(self, device_serial, default_timeout=_DEFAULT_TIMEOUT,
default_retries=_DEFAULT_RETRIES):
"""Initializes the FastbootWrapper.
@@ -51,7 +53,7 @@ class Fastboot(object):
TypeError: If cmd is not of type list.
"""
if type(cmd) == list:
- cmd = [_FASTBOOT_CMD, '-s', self._device_serial] + cmd
+ cmd = [self._fastboot_path.read(), '-s', self._device_serial] + cmd
else:
raise TypeError(
'Command for _RunFastbootCommand must be a list.')
« no previous file with comments | « build/android/devil/android/sdk/dexdump.py ('k') | build/android/devil/android/sdk/shared_prefs_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698