aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fernandes <joelaf@google.com>2017-05-31 18:06:59 -0700
committerJoel Fernandes <joelaf@google.com>2017-05-31 18:06:59 -0700
commit9c29690314577c966c69c481547d3c376abb257f (patch)
tree16cbc42364994cee6f0479f575e906f7dcad4755
parent4568bcb2fe8a739b5d18ece1fe83ded59117f37e (diff)
downloaddevlib-oreo-dr1-dev.tar.gz
android env: Remove dependency on SDKoreo-dr1-dev
Currently devlib will error out if ANDROID_HOME isn't set, it looks like aapt is the only thing it needs from what I see. If ANDROID_HOME isn't set, just get it from the environment. Change-Id: I9b0ea8129cf3e4feec4f7ddf08bf843733635d92 Signed-off-by: Joel Fernandes <joelaf@google.com>
-rw-r--r--devlib/utils/android.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/devlib/utils/android.py b/devlib/utils/android.py
index bd49ea4..be8b960 100644
--- a/devlib/utils/android.py
+++ b/devlib/utils/android.py
@@ -451,7 +451,15 @@ def _initialize_without_android_home(env):
logger.debug('Discovering ANDROID_HOME from adb path.')
env.platform_tools = os.path.dirname(adb_full_path)
env.android_home = os.path.dirname(env.platform_tools)
- _init_common(env)
+ try:
+ _init_common(env)
+ except:
+ env.aapt = which('aapt')
+ if env.aapt:
+ logger.info('Using aapt: ' + env.aapt)
+ else:
+ raise RuntimeError('aapt not found, try setting ANDROID_HOME to \
+ Android SDK or run LISA from android environment')
return env