| Index: build/android/devil/android/sdk/adb_wrapper.py
|
| diff --git a/build/android/devil/android/sdk/adb_wrapper.py b/build/android/devil/android/sdk/adb_wrapper.py
|
| index c184c77acb82dedbd3a37e03853ca911e2df8ca7..3ab7ddc096a9dad266c15a48df30e2ced45ed4d4 100644
|
| --- a/build/android/devil/android/sdk/adb_wrapper.py
|
| +++ b/build/android/devil/android/sdk/adb_wrapper.py
|
| @@ -14,15 +14,11 @@
|
| import os
|
| import re
|
|
|
| -from devil import devil_env
|
| from devil.android import decorators
|
| from devil.android import device_errors
|
| from devil.utils import cmd_helper
|
| -from devil.utils import lazy
|
| from devil.utils import timeout_retry
|
| -
|
| -with devil_env.SysPath(devil_env.CATAPULT_BASE_PATH):
|
| - from catapult_base import dependency_manager # pylint: disable=import-error
|
| +from pylib import constants
|
|
|
|
|
| _DEFAULT_TIMEOUT = 30
|
| @@ -46,29 +42,12 @@
|
| raise IOError(errno.ENOENT, os.strerror(errno.ENOENT), path)
|
|
|
|
|
| -def _FindAdb():
|
| - try:
|
| - return devil_env.config.LocalPath('adb')
|
| - except dependency_manager.NoPathFoundError:
|
| - pass
|
| -
|
| - try:
|
| - return os.path.join(devil_env.config.LocalPath('android_sdk'),
|
| - 'platform-tools', 'adb')
|
| - except dependency_manager.NoPathFoundError:
|
| - pass
|
| -
|
| - return devil_env.config.FetchPath('adb')
|
| -
|
| -
|
| DeviceStat = collections.namedtuple('DeviceStat',
|
| ['st_mode', 'st_size', 'st_time'])
|
|
|
|
|
| class AdbWrapper(object):
|
| """A wrapper around a local Android Debug Bridge executable."""
|
| -
|
| - _adb_path = lazy.WeakConstant(_FindAdb)
|
|
|
| def __init__(self, device_serial):
|
| """Initializes the AdbWrapper.
|
| @@ -80,21 +59,19 @@
|
| raise ValueError('A device serial must be specified')
|
| self._device_serial = str(device_serial)
|
|
|
| - @classmethod
|
| - def GetAdbPath(cls):
|
| - return cls._adb_path.read()
|
| -
|
| + # pylint: disable=unused-argument
|
| @classmethod
|
| def _BuildAdbCmd(cls, args, device_serial, cpu_affinity=None):
|
| if cpu_affinity is not None:
|
| cmd = ['taskset', '-c', str(cpu_affinity)]
|
| else:
|
| cmd = []
|
| - cmd.append(cls.GetAdbPath())
|
| + cmd.append(constants.GetAdbPath())
|
| if device_serial is not None:
|
| cmd.extend(['-s', device_serial])
|
| cmd.extend(args)
|
| return cmd
|
| + # pylint: enable=unused-argument
|
|
|
| # pylint: disable=unused-argument
|
| @classmethod
|
|
|