| Index: build/android/pylib/constants.py
|
| diff --git a/build/android/pylib/constants.py b/build/android/pylib/constants.py
|
| index 29da601259ddb734145583b41ca4e390fc75990e..da28eeb5d139ea9a6767e924ded00a8f887aae48 100644
|
| --- a/build/android/pylib/constants.py
|
| +++ b/build/android/pylib/constants.py
|
| @@ -246,8 +246,21 @@ def _Memoize(func):
|
| return Wrapper
|
|
|
|
|
| -@_Memoize
|
| +def SetAdbPath(adb_path):
|
| + os.environ['ADB_PATH'] = adb_path
|
| +
|
| +
|
| def GetAdbPath():
|
| + # Check if a custom adb path as been set. If not, try to find adb
|
| + # on the system.
|
| + if os.environ.get('ADB_PATH'):
|
| + return os.environ.get('ADB_PATH')
|
| + else:
|
| + return _FindAdbPath()
|
| +
|
| +
|
| +@_Memoize
|
| +def _FindAdbPath():
|
| if os.environ.get('ANDROID_SDK_ROOT'):
|
| return 'adb'
|
| # If envsetup.sh hasn't been sourced and there's no adb in the path,
|
| @@ -260,7 +273,6 @@ def GetAdbPath():
|
| logging.debug('No adb found in $PATH, fallback to checked in binary.')
|
| return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb')
|
|
|
| -
|
| # Exit codes
|
| ERROR_EXIT_CODE = 1
|
| WARNING_EXIT_CODE = 88
|
|
|