Fix sustained performance CTS test failures.

bug: 31215027
Change-Id: Iad347a0f0f54672dadaa71699290e62283f948af
diff --git a/hostsidetests/sustainedperf/src/android/SustainedPerformance/cts/SustainedPerformanceHostTest.java b/hostsidetests/sustainedperf/src/android/SustainedPerformance/cts/SustainedPerformanceHostTest.java
index 7b3a30c..7fe64fb 100644
--- a/hostsidetests/sustainedperf/src/android/SustainedPerformance/cts/SustainedPerformanceHostTest.java
+++ b/hostsidetests/sustainedperf/src/android/SustainedPerformance/cts/SustainedPerformanceHostTest.java
@@ -194,27 +194,7 @@
         appResultsWithMode.clear();
         dhrystoneResultsWithoutMode.clear();
         dhrystoneResultsWithMode.clear();
-        /*
-         * Run the test without the mode.
-         * Start the application and collect stats.
-         * Run two threads of dhrystone and collect stats.
-         */
-        setUpEnvironment();
-        device.executeShellCommand(START_COMMAND);
-        Thread dhrystone = new Thread(new Dhrystone(false, 1));
-        Thread dhrystone1 = new Thread(new Dhrystone(false, 2));
-        dhrystone.start();
-        dhrystone1.start();
-        Thread.sleep(testDuration);
-        device.executeShellCommand(STOP_COMMAND);
-        dhrystone.join();
-        dhrystone1.join();
-        logs = device.executeAdbCommand("logcat", "-v", "brief", "-d", CLASS + ":I", "*:S");
-        analyzeResults(logs, false);
-        double diff = (dhryMax - dhryMin)*100/dhryMax;
-        dhrystoneResultsWithoutMode.add(0, dhryMin);
-        dhrystoneResultsWithoutMode.add(1, dhryMax);
-        dhrystoneResultsWithoutMode.add(2, diff);
+
         /*
          * Run the test with the mode.
          * Start the application and collect stats.
@@ -222,8 +202,8 @@
          */
         setUpEnvironment();
         device.executeShellCommand(START_COMMAND_MODE);
-        dhrystone = new Thread(new Dhrystone(true, 1));
-        dhrystone1 = new Thread(new Dhrystone(true, 2));
+        Thread dhrystone = new Thread(new Dhrystone(true, 1));
+        Thread dhrystone1 = new Thread(new Dhrystone(true, 2));
         dhrystone.start();
         dhrystone1.start();
         Thread.sleep(testDuration);
@@ -232,7 +212,7 @@
         dhrystone1.join();
         logs = device.executeAdbCommand("logcat", "-v", "brief", "-d", CLASS + ":I", "*:S");
         analyzeResults(logs, true);
-        diff = (dhryMax - dhryMin)*100/dhryMax;
+        double diff = (dhryMax - dhryMin)*100/dhryMax;
         dhrystoneResultsWithMode.add(0, dhryMin);
         dhrystoneResultsWithMode.add(1, dhryMax);
         dhrystoneResultsWithMode.add(2, diff);
@@ -240,12 +220,9 @@
         device.executeShellCommand("settings put global airplane_mode_on 0");
         device.executeShellCommand("am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false");
 
-        double perfdegradapp = (appResultsWithMode.get(1) - appResultsWithoutMode.get(1))*100/appResultsWithMode.get(1);
-        double perfdegraddhry = (dhrystoneResultsWithoutMode.get(0) - dhrystoneResultsWithMode.get(0))*100/dhrystoneResultsWithoutMode.get(0);
-
         /*
          * Checks if the performance in the mode is consistent with
-         * 5% error margin.
+         * 5% error margin for shader and 10% error margin for dhrystone.
          */
         assertFalse("Results in the mode are not sustainable",
                 (dhrystoneResultsWithMode.get(2) > 10) ||