Update Android toolchains and streamline process.

  - This updates to r10e / API v21 everywhere.
  - This has each host machine fetch the NDK,
    run make-standalone-toolchain.sh, and copy gdbserver itself.

(It will do all this once per $ARCH, which is a little inefficient, but it
washes out in steady state.)

BUG=skia:

Review URL: https://codereview.chromium.org/1385463002
diff --git a/platform_tools/android/bin/download_toolchains.py b/platform_tools/android/bin/download_toolchains.py
deleted file mode 100755
index 9922283..0000000
--- a/platform_tools/android/bin/download_toolchains.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/python
-
-"""Download all toolchains for this platform.
-
-This module downloads multiple tgz's.
-"""
-
-import download_utils
-import sys
-
-url = sys.argv[1]
-filepath = sys.argv[2]
-
-try:
-  download_utils.SyncURL(url, filepath)
-  exit(0)
-except download_utils.HashError, e:
-  exit(1)
-
diff --git a/platform_tools/android/bin/utils/setup_toolchain.sh b/platform_tools/android/bin/utils/setup_toolchain.sh
index 3f27189..a61b507 100755
--- a/platform_tools/android/bin/utils/setup_toolchain.sh
+++ b/platform_tools/android/bin/utils/setup_toolchain.sh
@@ -32,47 +32,41 @@
 fi
 
 function default_toolchain() {
-  NDK_REV=${NDK_REV-10c}
+  TOOLCHAINS=${SCRIPT_DIR}/../toolchains
+
   ANDROID_ARCH=${ANDROID_ARCH-arm}
-  
+  LLVM=3.6
+  NDK=r10e
+
   if [[ $ANDROID_ARCH == *64* ]]; then
-    API_LEVEL=21 # Official Android 5.0 (Lollipop) system images
+      API=21  # Android 5.0
   else
-    API_LEVEL=14 # Official Android 4.0 system images
+      API=14  # Android 4.0
   fi
 
-  TOOLCHAIN_DIR=${SCRIPT_DIR}/../toolchains
-  if [ $(uname) == "Darwin" ]; then
-    verbose "Using Mac toolchain."
-    TOOLCHAIN_TYPE=ndk-r$NDK_REV-$ANDROID_ARCH-darwin_v$API_LEVEL
-  else
-    verbose "Using Linux toolchain."
-    TOOLCHAIN_TYPE=ndk-r$NDK_REV-$ANDROID_ARCH-linux_v$API_LEVEL
-  fi
-  exportVar ANDROID_TOOLCHAIN "${TOOLCHAIN_DIR}/${TOOLCHAIN_TYPE}/bin"
+  TOOLCHAIN=$ANDROID_ARCH-$NDK-$API
+  HOST=`uname | tr '[A-Z]' '[a-z]'`
 
-  # Hack for NDK_REV == 10c to ensure that clang is present as it was
-  # added to the tarball after it was initially distributed.
-  if [ ! -x ${ANDROID_TOOLCHAIN}/clang ]; then
-    rm -rf ${TOOLCHAIN_DIR}/${TOOLCHAIN_TYPE}
-  fi
+  exportVar ANDROID_TOOLCHAIN "${TOOLCHAINS}/${TOOLCHAIN}/bin"
 
-  # if the toolchain doesn't exist on your machine then we need to fetch it
   if [ ! -d "$ANDROID_TOOLCHAIN" ]; then
-    mkdir -p $TOOLCHAIN_DIR
-    # enter the toolchain directory then download, unpack, and remove the tarball
-    pushd $TOOLCHAIN_DIR
-    TARBALL=ndk-r$NDK_REV-v$API_LEVEL.tgz
-
-    ${SCRIPT_DIR}/download_toolchains.py \
-        http://storage.googleapis.com/chromium-skia-gm/android-toolchains/$TARBALL \
-        $TOOLCHAIN_DIR/$TARBALL
-    tar -xzf $TARBALL $TOOLCHAIN_TYPE
-    rm $TARBALL
+    mkdir -p $TOOLCHAINS
+    pushd $TOOLCHAINS
+    curl -o $NDK.bin https://dl.google.com/android/ndk/android-ndk-$NDK-$HOST-x86_64.bin
+    chmod +x $NDK.bin
+    ./$NDK.bin -y
+    ./android-ndk-$NDK/build/tools/make-standalone-toolchain.sh \
+        --arch=$ANDROID_ARCH    \
+        --llvm-version=$LLVM    \
+        --platform=android-$API \
+        --install_dir=$TOOLCHAIN
+    cp android-ndk-$NDK/prebuilt/android-$ANDROID_ARCH/gdbserver/gdbserver $TOOLCHAIN
+    rm $NDK.bin
+    rm -rf android-ndk-$NDK
     popd
   fi
 
-  verbose "Targeting NDK API $API_LEVEL (NDK Revision $NDK_REV)"
+  verbose "Targeting NDK API $API (NDK Revision $NDK)"
 }
 
 #check to see if the toolchain has been defined and if not setup the default toolchain