Be very patient with the emulator.

Change-Id: I9f1f3a5d825fea85115b3331da317eefd3dbe17b
diff --git a/tools/run-libcore-tests.sh b/tools/run-libcore-tests.sh
index e28de09..a84365a 100755
--- a/tools/run-libcore-tests.sh
+++ b/tools/run-libcore-tests.sh
@@ -32,6 +32,11 @@
   exit 1
 fi
 
+emulator="no"
+if [ "$ANDROID_SERIAL" = "emulator-5554" ]; then
+  emulator="yes"
+fi
+
 # Packages that currently work correctly with the expectation files.
 working_packages=("dalvik.system"
                   "libcore.icu"
@@ -81,10 +86,12 @@
     # Remove the --debug from the arguments.
     vogar_args=${vogar_args/$1}
     vogar_args="$vogar_args --vm-arg -XXlib:libartd.so"
-    # Increase the timeout, as vogar cannot set individual test
-    # timeout when being asked to run packages, and some tests go above
-    # the default timeout.
-    vogar_args="$vogar_args --timeout 240"
+    if [ "$emulator" = "no" ]; then
+      # Increase the timeout, as vogar cannot set individual test
+      # timeout when being asked to run packages, and some tests go above
+      # the default timeout.
+      vogar_args="$vogar_args --timeout 240"
+    fi
     shift
   elif [[ "$1" == "" ]]; then
     break
@@ -93,6 +100,11 @@
   fi
 done
 
+if [ "$emulator" = "yes" ]; then
+  # Be very patient with the emulator.
+  vogar_args="$vogar_args --timeout 480"
+fi
+
 # Run the tests using vogar.
 echo "Running tests for the following test packages:"
 echo ${working_packages[@]} | tr " " "\n"