Only check-out the emulator for the target architecture

This is to reduce the space used on travis which seems to be
hitting the 20GB limit.

TBR=hjd

Change-Id: I31cfa8a1b33e75f10c6f6b5a277ce485b5c2ff77
diff --git a/.travis.yml b/.travis.yml
index 315cdfc..a97174d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -132,7 +132,8 @@
     if [[ "$CFG" != android-* ]]; then
       tools/install-build-deps --no-android
     else
-      tools/install-build-deps
+      ARCH=$(echo "$CFG" | cut -d- -f3)
+      tools/install-build-deps --emulator="$ARCH"
     fi
 
 script:
diff --git a/tools/install-build-deps b/tools/install-build-deps
index a3d34dd..13584ca 100755
--- a/tools/install-build-deps
+++ b/tools/install-build-deps
@@ -180,12 +180,12 @@
   ('buildtools/android_sdk/system-images/android-24/default/armeabi-v7a.zip',
    'https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-24_r07.zip',
    '3454546b4eed2d6c3dd06d47757d6da9f4176033',
-   'all'
+   'android-arm'
   ),
   ('buildtools/android_sdk/system-images/android-24/default/arm64-v8a.zip',
    'https://dl.google.com/android/repository/sys-img/android/arm64-v8a-24_r07.zip',
    'e8ab2e49e4efe4b064232b33b5eeaded61437d7f',
-   'all'
+   'android-arm64'
   ),
 ]
 
@@ -243,12 +243,15 @@
 def Main():
   parser = argparse.ArgumentParser()
   parser.add_argument('--no-android', action='store_true')
+  parser.add_argument('--emulator', action='append', help='arm|arm64')
   args = parser.parse_args()
+  andriod_emulator_images = ['android-' + arch for arch in args.emulator or []]
   deps = BUILD_DEPS_HOST
   if not args.no_android:
     deps += BUILD_DEPS_ANDROID + TEST_DEPS_ANDROID
   for rel_path, url, expected_sha1, platform in deps:
-    if platform != 'all' and platform != sys.platform:
+    if (platform != 'all' and platform != sys.platform and
+        platform not in andriod_emulator_images):
       continue
     local_path = os.path.join(ROOT_DIR, rel_path)
     if url.endswith('.git'):