diff --git a/tools/host/src/com/android/cts/HostConfig.java b/tools/host/src/com/android/cts/HostConfig.java
index 5625840..8a45526 100644
--- a/tools/host/src/com/android/cts/HostConfig.java
+++ b/tools/host/src/com/android/cts/HostConfig.java
@@ -60,12 +60,32 @@
     static final String[] CTS_RESULT_RESOURCES = {"cts_result.xsl", "cts_result.css",
                                                   "logo.gif", "newrule-green.png"};
 
+    /** Default number of tests executed between reboots. */
+    private static final long MAX_TEST_COUNT_DEFAULT = 500;
+    /** Name of environment variable that can override MAX_TEST_COUNT_DEFAULT. */ 
+    private static final String MAX_TEST_ENV_VAR = "CTS_RESTART_AFTER";
+    /** Number of tests executed between reboots. A value <= 0 disables reboots. */
+    private static final long MAX_TEST_COUNT; // set in static initializer
+    
     private String mConfigRoot;
     private CaseRepository mCaseRepos;
     private Repository mResultRepos;
     private PlanRepository mPlanRepos;
     private HashMap<String, TestPackage> mTestPackageMap;
 
+    static {
+        long maxTestCount = MAX_TEST_COUNT_DEFAULT;
+        String prop = System.getenv(MAX_TEST_ENV_VAR);
+        if (prop != null) {
+            try {
+                maxTestCount = Long.parseLong(prop);
+            } catch (NumberFormatException ignored) {
+                // just use default value
+            }
+        }
+        MAX_TEST_COUNT = maxTestCount;
+    }
+    
     private final static HostConfig sInstance = new HostConfig();
 
     private HostConfig() {
@@ -75,6 +95,14 @@
     public static HostConfig getInstance() {
         return sInstance;
     }
+    
+    /**
+     * Returns the max number of tests to run between reboots. A value of 0 or smaller indicates
+     * that reboots should not be used.
+     */
+    public static long getMaxTestCount() {
+        return MAX_TEST_COUNT;
+    }
 
     /**
      * Load configuration.
diff --git a/tools/host/src/com/android/cts/TestHost.java b/tools/host/src/com/android/cts/TestHost.java
index a67c8f0..3b5aa76 100644
--- a/tools/host/src/com/android/cts/TestHost.java
+++ b/tools/host/src/com/android/cts/TestHost.java
@@ -488,7 +488,9 @@
         }
 
         TestSession.resetADBServerRestartedMode();
-        sDeviceManager.resetTestDevice(device);
+        if (HostConfig.getMaxTestCount() > 0) {
+            sDeviceManager.resetTestDevice(device);
+        }
     }
 
     /**
diff --git a/tools/host/src/com/android/cts/TestSession.java b/tools/host/src/com/android/cts/TestSession.java
index f994066..c28b4e9 100644
--- a/tools/host/src/com/android/cts/TestSession.java
+++ b/tools/host/src/com/android/cts/TestSession.java
@@ -45,7 +45,7 @@
     private boolean mNeedRestartAdbServer;
     private static boolean mADBServerRestartedMode;
 
-    private static final long MAX_TEST_COUNT = 500;
+    /** Running count of tests executed since last reboot. */
     private static long mTestCount;
 
     public TestSession(final TestSessionLog sessionLog,
@@ -109,12 +109,14 @@
     }
 
     /**
-     * Check if the test count exceeds the max test count.
+     * Check if the test count exceeds the max test count. If the max test count is disabled
+     * (HostConfig.getMaxTestCount() <= 0), this method always returns false.
      *
-     * @return If reached, return true; else, return false.
+     * @return true, if the max count is enabled and exceeded.
      */
     public static boolean exceedsMaxCount() {
-        return mTestCount >= MAX_TEST_COUNT;
+        final long maxTestCount = HostConfig.getMaxTestCount();
+        return (maxTestCount > 0) && (mTestCount >= maxTestCount);
     }
 
     /**
@@ -214,7 +216,7 @@
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
-        if (mNeedRestartAdbServer) {
+        if (mNeedRestartAdbServer && HostConfig.getMaxTestCount() > 0) {
             throw new ADBServerNeedRestartException("Need restart ADB server");
         }
     }
