Index: build/android/pylib/android_commands.py |
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py |
index 29be40fbde4f00093b0f41dad74fa706e6fef9a8..ab370f01efbe0c68861085918568dda4e228e21b 100644 |
--- a/build/android/pylib/android_commands.py |
+++ b/build/android/pylib/android_commands.py |
@@ -100,7 +100,8 @@ def GetAttachedDevices(hardware=True, emulator=True, offline=False): |
Returns: List of devices. |
""" |
- adb_devices_output = cmd_helper.GetCmdOutput([constants.ADB_PATH, 'devices']) |
+ adb_devices_output = cmd_helper.GetCmdOutput([constants.GetAdbPath(), |
+ 'devices']) |
re_device = re.compile('^([a-zA-Z0-9_:.-]+)\tdevice$', re.MULTILINE) |
online_devices = re_device.findall(adb_devices_output) |
@@ -241,7 +242,7 @@ class AndroidCommands(object): |
api_strict_mode: A boolean indicating whether fatal errors should be |
raised if this API is used improperly. |
""" |
- adb_dir = os.path.dirname(constants.ADB_PATH) |
+ adb_dir = os.path.dirname(constants.GetAdbPath()) |
if adb_dir and adb_dir not in os.environ['PATH'].split(os.pathsep): |
# Required by third_party/android_testrunner to call directly 'adb'. |
os.environ['PATH'] += os.pathsep + adb_dir |
@@ -511,7 +512,7 @@ class AndroidCommands(object): |
def KillAdbServer(self): |
"""Kill adb server.""" |
- adb_cmd = [constants.ADB_PATH, 'kill-server'] |
+ adb_cmd = [constants.GetAdbPath(), 'kill-server'] |
ret = cmd_helper.RunCmd(adb_cmd) |
retry = 0 |
while retry < 3: |
@@ -525,7 +526,7 @@ class AndroidCommands(object): |
def StartAdbServer(self): |
"""Start adb server.""" |
- adb_cmd = ['taskset', '-c', '0', constants.ADB_PATH, 'start-server'] |
+ adb_cmd = ['taskset', '-c', '0', constants.GetAdbPath(), 'start-server'] |
ret = cmd_helper.RunCmd(adb_cmd) |
retry = 0 |
while retry < 3: |
@@ -1261,7 +1262,7 @@ class AndroidCommands(object): |
# Spawn logcat and synchronize with it. |
for _ in range(4): |
- self._logcat = pexpect.spawn(constants.ADB_PATH, args, timeout=10, |
+ self._logcat = pexpect.spawn(constants.GetAdbPath(), args, timeout=10, |
logfile=logfile) |
if not clear or self.SyncLogCat(): |
break |
@@ -1343,7 +1344,7 @@ class AndroidCommands(object): |
logging.critical('Found EOF in adb logcat. Restarting...') |
# Rerun spawn with original arguments. Note that self._logcat.args[0] is |
# the path of adb, so we don't want it in the arguments. |
- self._logcat = pexpect.spawn(constants.ADB_PATH, |
+ self._logcat = pexpect.spawn(constants.GetAdbPath(), |
self._logcat.args[1:], |
timeout=self._logcat.timeout, |
logfile=self._logcat.logfile) |