Merge "Additional logging to track down RSRuntimeException issues." into klp-dev
diff --git a/hostsidetests/appsecurity/test-apps/ExternalStorageApp/src/com/android/cts/externalstorageapp/CommonExternalStorageTest.java b/hostsidetests/appsecurity/test-apps/ExternalStorageApp/src/com/android/cts/externalstorageapp/CommonExternalStorageTest.java
index 5d3bdb6..f38236b 100644
--- a/hostsidetests/appsecurity/test-apps/ExternalStorageApp/src/com/android/cts/externalstorageapp/CommonExternalStorageTest.java
+++ b/hostsidetests/appsecurity/test-apps/ExternalStorageApp/src/com/android/cts/externalstorageapp/CommonExternalStorageTest.java
@@ -122,6 +122,14 @@
         return paths;
     }
 
+    public static List<File> getAllPackageSpecificPathsExceptObb(Context context) {
+        final List<File> paths = new ArrayList<File>();
+        Collections.addAll(paths, context.getExternalCacheDirs());
+        Collections.addAll(paths, context.getExternalFilesDirs(null));
+        Collections.addAll(paths, context.getExternalFilesDirs(Environment.DIRECTORY_PICTURES));
+        return paths;
+    }
+
     public static List<File> getPrimaryPackageSpecificPaths(Context context) {
         final List<File> paths = new ArrayList<File>();
         Collections.addAll(paths, context.getExternalCacheDir());
diff --git a/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/Android.mk b/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/Android.mk
index 8781e8b..48f88b8 100644
--- a/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/Android.mk
@@ -17,9 +17,11 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := 16
+LOCAL_SDK_VERSION := current
 
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
+LOCAL_SRC_FILES := $(call all-java-files-under, src) \
+    ../ExternalStorageApp/src/com/android/cts/externalstorageapp/CommonExternalStorageTest.java
+
 LOCAL_PACKAGE_NAME := CtsMultiUserStorageApp
 
 LOCAL_DEX_PREOPT := false
diff --git a/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/src/com/android/cts/multiuserstorageapp/MultiUserStorageTest.java b/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/src/com/android/cts/multiuserstorageapp/MultiUserStorageTest.java
index 267bf11..2a80c75 100644
--- a/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/src/com/android/cts/multiuserstorageapp/MultiUserStorageTest.java
+++ b/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/src/com/android/cts/multiuserstorageapp/MultiUserStorageTest.java
@@ -16,16 +16,15 @@
 
 package com.android.cts.multiuserstorageapp;
 
+import static com.android.cts.externalstorageapp.CommonExternalStorageTest.getAllPackageSpecificPathsExceptObb;
+import static com.android.cts.externalstorageapp.CommonExternalStorageTest.readInt;
+import static com.android.cts.externalstorageapp.CommonExternalStorageTest.writeInt;
+
 import android.os.Environment;
 import android.test.AndroidTestCase;
 import android.util.Log;
 
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
 
 /**
  * Test multi-user emulated storage environment, ensuring that each user has
@@ -59,22 +58,44 @@
     }
 
     public void writeIsolatedStorage() throws Exception {
-        writeInt(buildApiPath(FILE_SINGLETON), android.os.Process.myUid());
-        writeInt(buildApiPath(FILE_MY_UID), android.os.Process.myUid());
+        final int uid = android.os.Process.myUid();
+
+        writeInt(buildApiPath(FILE_SINGLETON), uid);
+        writeInt(buildApiPath(FILE_MY_UID), uid);
+
+        // Write to every external path we think we have access to
+        for (File path : getAllPackageSpecificPathsExceptObb(getContext())) {
+            assertNotNull("Valid media must be inserted during CTS", path);
+            assertEquals("Valid media must be inserted during CTS", Environment.MEDIA_MOUNTED,
+                    Environment.getStorageState(path));
+
+            writeInt(new File(path, FILE_SINGLETON), uid);
+        }
     }
 
     public void readIsolatedStorage() throws Exception {
+        final int uid = android.os.Process.myUid();
+
         // Expect that the value we wrote earlier is still valid and wasn't
         // overwritten by us running as another user.
-        assertEquals("Failed to read singleton file from API path", android.os.Process.myUid(),
+        assertEquals("Failed to read singleton file from API path", uid,
                 readInt(buildApiPath(FILE_SINGLETON)));
-        assertEquals("Failed to read singleton file from env path", android.os.Process.myUid(),
+        assertEquals("Failed to read singleton file from env path", uid,
                 readInt(buildEnvPath(FILE_SINGLETON)));
-        assertEquals("Failed to read singleton file from raw path", android.os.Process.myUid(),
+        assertEquals("Failed to read singleton file from raw path", uid,
                 readInt(buildRawPath(FILE_SINGLETON)));
 
-        assertEquals("Failed to read UID file from API path", android.os.Process.myUid(),
+        assertEquals("Failed to read UID file from API path", uid,
                 readInt(buildApiPath(FILE_MY_UID)));
+
+        for (File path : getAllPackageSpecificPathsExceptObb(getContext())) {
+            assertNotNull("Valid media must be inserted during CTS", path);
+            assertEquals("Valid media must be inserted during CTS", Environment.MEDIA_MOUNTED,
+                    Environment.getStorageState(path));
+
+            assertEquals("Unexpected value in singleton file at " + path, uid,
+                    readInt(new File(path, FILE_SINGLETON)));
+        }
     }
 
     public void cleanObbStorage() throws Exception {
@@ -119,22 +140,4 @@
     private static File buildRawPath(String file) {
         return new File("/sdcard/", file);
     }
-
-    private static void writeInt(File file, int value) throws IOException {
-        final DataOutputStream os = new DataOutputStream(new FileOutputStream(file));
-        try {
-            os.writeInt(value);
-        } finally {
-            os.close();
-        }
-    }
-
-    private static int readInt(File file) throws IOException {
-        final DataInputStream is = new DataInputStream(new FileInputStream(file));
-        try {
-            return is.readInt();
-        } finally {
-            is.close();
-        }
-    }
 }
diff --git a/tests/expectations/knownfailures.txt b/tests/expectations/knownfailures.txt
index ae6a093..99dfad4 100644
--- a/tests/expectations/knownfailures.txt
+++ b/tests/expectations/knownfailures.txt
@@ -19,5 +19,10 @@
   name: "com.android.pts.opengl.primitive.GLPrimitiveBenchmark#testFullPipelineOffscreen",
   name: "com.android.pts.opengl.primitive.GLPrimitiveBenchmark#testPixelOutputOffscreen",
   bug: 11238219
+},
+{
+  name: "android.hardware.cts.SensorIntegrationTests#testSensorsWithSeveralClients",
+  name: "android.hardware.cts.SensorIntegrationTests#testSensorsMovingRates",
+  bug: 11352697
 }
 ]
diff --git a/tests/tests/hardware/src/android/hardware/cts/SensorEventOrderingTests.java b/tests/tests/hardware/src/android/hardware/cts/SensorEventOrderingTests.java
index 9efa71d..55c2637 100644
--- a/tests/tests/hardware/src/android/hardware/cts/SensorEventOrderingTests.java
+++ b/tests/tests/hardware/src/android/hardware/cts/SensorEventOrderingTests.java
@@ -60,9 +60,7 @@
                 { Sensor.TYPE_ACCELEROMETER, SensorManager.SENSOR_DELAY_FASTEST, 0 },
                 { Sensor.TYPE_GYROSCOPE, SensorManager.SENSOR_DELAY_FASTEST, 0 },
                 { Sensor.TYPE_MAGNETIC_FIELD, SensorManager.SENSOR_DELAY_FASTEST, 0 },
-                { Sensor.TYPE_LIGHT, SensorManager.SENSOR_DELAY_FASTEST, 0 },
                 { Sensor.TYPE_PRESSURE, SensorManager.SENSOR_DELAY_FASTEST, 0 },
-                { Sensor.TYPE_PROXIMITY, SensorManager.SENSOR_DELAY_FASTEST, 0 },
                 { Sensor.TYPE_GRAVITY, SensorManager.SENSOR_DELAY_FASTEST, 0 },
                 { Sensor.TYPE_LINEAR_ACCELERATION, SensorManager.SENSOR_DELAY_FASTEST, 0 },
                 { Sensor.TYPE_ROTATION_VECTOR, SensorManager.SENSOR_DELAY_FASTEST, 0 },
diff --git a/tests/tests/hardware/src/android/hardware/cts/SensorIntegrationTests.java b/tests/tests/hardware/src/android/hardware/cts/SensorIntegrationTests.java
index 0612c03..f96c885 100644
--- a/tests/tests/hardware/src/android/hardware/cts/SensorIntegrationTests.java
+++ b/tests/tests/hardware/src/android/hardware/cts/SensorIntegrationTests.java
@@ -92,21 +92,22 @@
                 Sensor.TYPE_MAGNETIC_FIELD,
                 Sensor.TYPE_GYROSCOPE };
 
-        ParallelCompositeSensorTestOperation operation = new ParallelCompositeSensorTestOperation();
+        ParallelCompositeSensorTestOperation operation =
+                new ParallelCompositeSensorTestOperation(this);
         for(int sensorType : sensorTypes) {
             SensorTestOperation continuousOperation = new VerifyEventOrderingOperation(
                     this,
                     sensorType,
                     SensorManager.SENSOR_DELAY_NORMAL,
                     0 /* reportLatencyInUs */);
-            operation.add(new RepeatingSensorTestOperation(continuousOperation, ITERATIONS));
+            operation.add(new RepeatingSensorTestOperation(this, continuousOperation, ITERATIONS));
 
             SensorTestOperation batchingOperation = new VerifyEventOrderingOperation(
                     this,
                     sensorType,
                     SensorTestInformation.getMaxSamplingRateInUs(this, sensorType),
                     SensorCtsHelper.getSecondsAsMicroSeconds(BATCHING_RATE_IN_SECONDS));
-            operation.add(new RepeatingSensorTestOperation(batchingOperation, ITERATIONS));
+            operation.add(new RepeatingSensorTestOperation(this, batchingOperation, ITERATIONS));
         }
         operation.execute();
     }
@@ -137,7 +138,8 @@
         final int INSTANCES_TO_USE = 5;
         final int ITERATIONS_TO_EXECUTE = 100;
 
-        ParallelCompositeSensorTestOperation operation = new ParallelCompositeSensorTestOperation();
+        ParallelCompositeSensorTestOperation operation =
+                new ParallelCompositeSensorTestOperation(this);
         int sensorTypes[] = {
                 Sensor.TYPE_ACCELEROMETER,
                 Sensor.TYPE_MAGNETIC_FIELD,
@@ -146,7 +148,7 @@
         for(int sensorType : sensorTypes) {
             for(int instance = 0; instance < INSTANCES_TO_USE; ++instance) {
                 SequentialCompositeSensorTestOperation sequentialOperation =
-                        new SequentialCompositeSensorTestOperation();
+                        new SequentialCompositeSensorTestOperation(this);
                 for(int iteration = 0; iteration < ITERATIONS_TO_EXECUTE; ++iteration) {
                     VerifyEventOrderingOperation sensorOperation = new VerifyEventOrderingOperation(
                             this,
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/SensorCtsHelper.java b/tests/tests/hardware/src/android/hardware/cts/helpers/SensorCtsHelper.java
index 47b3973..ce859d2 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/SensorCtsHelper.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/SensorCtsHelper.java
@@ -146,7 +146,7 @@
      *      . android.permission.READ_LOGS
      *      . android.permission.DUMP
      */
-    public static void collectBugreport(String collectorId)
+    public static String collectBugreport(String collectorId)
             throws IOException, InterruptedException {
         String commands[] = new String[] {
                 "dumpstate",
@@ -158,8 +158,8 @@
         SimpleDateFormat dateFormat = new SimpleDateFormat("M-d-y_H:m:s.S");
         String outputFile = String.format(
                 "%s/%s_%s",
-                collectorId,
                 Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),
+                collectorId,
                 dateFormat.format(new Date()));
 
         DataOutputStream processOutput = null;
@@ -182,6 +182,8 @@
                 } catch(IOException e) {}
             }
         }
+
+        return outputFile;
     }
 
     public static Sensor getSensor(AndroidTestCase testCase, int sensorType) {
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/SensorManagerTestVerifier.java b/tests/tests/hardware/src/android/hardware/cts/helpers/SensorManagerTestVerifier.java
index f7f55c9..dd29cb1 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/SensorManagerTestVerifier.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/SensorManagerTestVerifier.java
@@ -146,17 +146,6 @@
     }
 
     /**
-     * Support methods for clients of this class.
-     */
-    public Assert verifier() {
-        return mAssert;
-    }
-
-    public int getUnderlyingType() {
-        return mSensorUnderTest.getType();
-    }
-
-    /**
      * Definition of support test classes.
      */
     private class TestSensorListener implements SensorEventListener2 {
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/SensorTestOperation.java b/tests/tests/hardware/src/android/hardware/cts/helpers/SensorTestOperation.java
index 11b113f..e87b289 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/SensorTestOperation.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/SensorTestOperation.java
@@ -16,6 +16,10 @@
 
 package android.hardware.cts.helpers;
 
+import junit.framework.Assert;
+
+import java.util.concurrent.TimeUnit;
+
 /**
  * Base test class that supports a basic test operation performed in a sensor.
  * The class follows a command patter as a base for its work.
@@ -28,12 +32,19 @@
     private final SensorTestExceptionHandler mExceptionHandler = new SensorTestExceptionHandler();
 
     protected final String LOG_TAG = "TestRunner";
-    protected final int WAIT_TIMEOUT_IN_MILLISECONDS = 30 * 1000;
+    protected final long WAIT_TIMEOUT_IN_MILLISECONDS =
+            TimeUnit.MILLISECONDS.convert(5, TimeUnit.MINUTES);
+
+    protected final Assert mAssert;
 
     private Thread mThread;
 
     protected int mIterationCount;
 
+    protected SensorTestOperation(Assert assertionObject) {
+        mAssert = assertionObject;
+    }
+
     /**
      * Public API definition.
      */
@@ -65,6 +76,16 @@
             return;
         }
         mThread.join(WAIT_TIMEOUT_IN_MILLISECONDS);
+        if(mThread.isAlive()) {
+            // the test is hung so collect the state of the system and fail
+            String operationName = this.getClass().getSimpleName();
+            String message = String.format(
+                    "%s hung. %s. BugReport collected at: %s",
+                    operationName,
+                    this.toString(),
+                    SensorCtsHelper.collectBugreport(operationName));
+            mAssert.fail(message);
+        }
         mThread = null;
         mExceptionHandler.rethrow();
     }
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/ParallelCompositeSensorTestOperation.java b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/ParallelCompositeSensorTestOperation.java
index 3730f4b..11fb81f 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/ParallelCompositeSensorTestOperation.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/ParallelCompositeSensorTestOperation.java
@@ -16,6 +16,8 @@
 
 package android.hardware.cts.helpers.sensorTestOperations;
 
+import junit.framework.Assert;
+
 import android.hardware.cts.helpers.SensorTestOperation;
 
 import java.util.ArrayList;
@@ -28,6 +30,10 @@
 public class ParallelCompositeSensorTestOperation extends SensorTestOperation {
     private final ArrayList<SensorTestOperation> mOperations = new ArrayList<SensorTestOperation>();
 
+    public ParallelCompositeSensorTestOperation(Assert assertionObject) {
+        super(assertionObject);
+    }
+
     /**
      * There is no synchronization
      * @param operations
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/RepeatingSensorTestOperation.java b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/RepeatingSensorTestOperation.java
index 7a3c450..35782c1 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/RepeatingSensorTestOperation.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/RepeatingSensorTestOperation.java
@@ -16,6 +16,8 @@
 
 package android.hardware.cts.helpers.sensorTestOperations;
 
+import junit.framework.Assert;
+
 import android.hardware.cts.helpers.SensorTestOperation;
 
 /**
@@ -25,7 +27,11 @@
     private final SensorTestOperation mSensorTestOperation;
     private final int mRepetitionCount;
 
-    public RepeatingSensorTestOperation(SensorTestOperation operation, int repetitionCount) {
+    public RepeatingSensorTestOperation(
+            Assert assertionObject,
+            SensorTestOperation operation,
+            int repetitionCount) {
+        super(assertionObject);
         mSensorTestOperation = operation;
         mRepetitionCount = repetitionCount;
     }
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/SequentialCompositeSensorTestOperation.java b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/SequentialCompositeSensorTestOperation.java
index 4b921680..cd879f5 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/SequentialCompositeSensorTestOperation.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/SequentialCompositeSensorTestOperation.java
@@ -16,6 +16,8 @@
 
 package android.hardware.cts.helpers.sensorTestOperations;
 
+import junit.framework.Assert;
+
 import android.hardware.cts.helpers.SensorTestOperation;
 
 import java.util.ArrayList;
@@ -28,6 +30,10 @@
 public class SequentialCompositeSensorTestOperation extends SensorTestOperation {
     private final ArrayList<SensorTestOperation> mOperations = new ArrayList<SensorTestOperation>();
 
+    public SequentialCompositeSensorTestOperation(Assert assertionObject) {
+        super(assertionObject);
+    }
+
     /**
      * There is no synchronization
      * @param operations
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyEventOrderingOperation.java b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyEventOrderingOperation.java
index a4e5642..90824b2 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyEventOrderingOperation.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyEventOrderingOperation.java
@@ -34,6 +34,7 @@
             int sensorType,
             int samplingRateInUs,
             int reportLatencyInUs) {
+        super(testCase);
         mSensor = new SensorManagerTestVerifier(
                 testCase,
                 sensorType,
@@ -55,7 +56,9 @@
                     i,
                     previousTimestamp,
                     timestamp);
-            mSensor.verifier().assertTrue(message, previousTimestamp < timestamp);
+            // allow two identical timestamps to be considered in order, in case the resolution of
+            // the timestamp is not granular enough
+            mAssert.assertTrue(message, previousTimestamp <= timestamp);
         }
     }
 }
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyJitteringOperation.java b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyJitteringOperation.java
index 79b835c..5aac8af 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyJitteringOperation.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyJitteringOperation.java
@@ -48,6 +48,7 @@
             int sensorType,
             int reportLatencyInUs,
             int thresholdPercentageOfNs) throws InvalidParameterException {
+        super(testCase);
         if(thresholdPercentageOfNs < 0) {
             throw new InvalidParameterException("thresholdPercentageOfNs needs to be >= 0");
         }
@@ -87,7 +88,7 @@
                     mThresholdPercentage,
                     percentile95InNs,
                     actualPercentValue);
-            mSensor.verifier().fail(message);
+            mAssert.fail(message);
         }
     }
 }
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyMaximumFrequencyOperation.java b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyMaximumFrequencyOperation.java
index 1ff8cde..94fef60 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyMaximumFrequencyOperation.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyMaximumFrequencyOperation.java
@@ -49,6 +49,7 @@
             int sensorType,
             int reportLatencyInUs,
             int thresholdPercentageOfNs) throws InvalidParameterException {
+        super(testCase);
         if(thresholdPercentageOfNs < 0) {
             throw new InvalidParameterException("thresholdPercentageOfNs needs to be >= 0");
         }
@@ -90,7 +91,7 @@
                     SensorCtsHelper.getFrequencyInHz(frequencyMeanInUs),
                     mThresholdInNs,
                     mThresholdPercentage);
-            mSensor.verifier().fail(message);
+            mAssert.fail(message);
         }
     }
 }
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyNormOperation.java b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyNormOperation.java
index 75998db..e3b64e7 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyNormOperation.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyNormOperation.java
@@ -40,13 +40,14 @@
             int samplingRateInUs,
             float referenceValue,
             float threshold) {
+        super(testCase);
         mSensor = new SensorManagerTestVerifier(
                 testCase,
                 sensorType,
                 samplingRateInUs,
                 0 /*reportLatencyInUs*/);
         // set expectations
-        mAxisCount = SensorTestInformation.getAxisCount(mSensor.getUnderlyingType());
+        mAxisCount = SensorTestInformation.getAxisCount(mSensor.getUnderlyingSensor().getType());
         mReferenceValue = referenceValue;
         mThreshold = threshold;
     }
@@ -75,6 +76,6 @@
                 mThreshold,
                 norm,
                 valuesBuilder.toString());
-        mSensor.verifier().assertTrue(message, Math.abs(mReferenceValue - norm) <= mThreshold);
+        mAssert.assertTrue(message, Math.abs(mReferenceValue - norm) <= mThreshold);
     }
 }
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyStandardDeviationOperation.java b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyStandardDeviationOperation.java
index dd4df72..bc0a498 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyStandardDeviationOperation.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorTestOperations/VerifyStandardDeviationOperation.java
@@ -42,13 +42,14 @@
             int samplingRateInUs,
             int reportLatencyInUs,
             float expectedStandardDeviation) {
+        super(testCase);
         mSensor = new SensorManagerTestVerifier(
                 testCase,
                 sensorType,
                 samplingRateInUs,
                 reportLatencyInUs);
         // set expectations
-        mAxisCount = SensorTestInformation.getAxisCount(mSensor.getUnderlyingType());
+        mAxisCount = SensorTestInformation.getAxisCount(mSensor.getUnderlyingSensor().getType());
         mExpectedStandardDeviation = expectedStandardDeviation;
     }
 
@@ -74,7 +75,7 @@
                         i,
                         mExpectedStandardDeviation,
                         standardDeviation);
-                mSensor.verifier().fail(message);
+                mAssert.fail(message);
             }
         }
     }
diff --git a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoActivity.java b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoActivity.java
index e18e626..28f4d53 100644
--- a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoActivity.java
+++ b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoActivity.java
@@ -35,6 +35,8 @@
     // work done should be reported in GLES..View
     private CountDownLatch mDone = new CountDownLatch(1);
     private HashSet<String> mFormats = new HashSet<String>();
+    private String mGraphicsVendor;
+    private String mGraphicsRenderer;
 
     /**
      * Other classes can call this function to wait for this activity
@@ -71,6 +73,12 @@
         DeviceInfoInstrument.addResult(
                 DeviceInfoConstants.OPEN_GL_COMPRESSED_TEXTURE_FORMATS,
                 builder.toString());
+        DeviceInfoInstrument.addResult(
+                DeviceInfoConstants.GRAPHICS_VENDOR,
+                mGraphicsVendor);
+        DeviceInfoInstrument.addResult(
+                DeviceInfoConstants.GRAPHICS_RENDERER,
+                mGraphicsRenderer);
         mDone.countDown();
     }
 
@@ -78,6 +86,11 @@
         mFormats.add(format);
     }
 
+    public void setGraphicsInfo(String vendor, String renderer) {
+        mGraphicsVendor = vendor;
+        mGraphicsRenderer = renderer;
+    }
+
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
diff --git a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoConstants.java b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoConstants.java
index 4a0ea66..ddc87dc 100644
--- a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoConstants.java
+++ b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoConstants.java
@@ -28,6 +28,8 @@
     public static final String SYS_LIBRARIES = "systemlibraries";
     public static final String PARTITIONS = "partitions";
     public static final String OPEN_GL_ES_VERSION = "openGlEsVersion";
+    public static final String GRAPHICS_VENDOR = "graphicsVendor";
+    public static final String GRAPHICS_RENDERER = "graphicsRenderer";
     public static final String PROCESSES = "processes";
     public static final String FEATURES = "features";
     public static final String PHONE_NUMBER = "subscriberId";
diff --git a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/GLESSurfaceView.java b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/GLESSurfaceView.java
index b2f2211..b3af3a7 100644
--- a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/GLESSurfaceView.java
+++ b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/GLESSurfaceView.java
@@ -37,7 +37,7 @@
     /**
      *
      * @param parent
-     * @param useGL20 whether to use GLES2.0 API or not inside the view
+     * @param glVersion the version of GLES API to use inside the view
      * @param done to notify the completion of the task
      */
     public GLESSurfaceView(DeviceInfoActivity parent, int glVersion, CountDownLatch done){
@@ -58,14 +58,25 @@
         @Override
         public void onSurfaceCreated(GL10 gl, EGLConfig config) {
             String extensions;
+            String vendor;
+            String renderer;
             if (mGLVersion == 2) {
                 extensions = GLES20.glGetString(GLES20.GL_EXTENSIONS);
+                vendor = GLES20.glGetString(GLES20.GL_VENDOR);
+                renderer = GLES20.glGetString(GLES20.GL_RENDERER);
             } else if (mGLVersion == 3) {
                 extensions = GLES30.glGetString(GLES30.GL_EXTENSIONS);
+                vendor = GLES30.glGetString(GLES30.GL_VENDOR);
+                renderer = GLES30.glGetString(GLES30.GL_RENDERER);
             } else {
                 extensions = gl.glGetString(GL10.GL_EXTENSIONS);
+                vendor = gl.glGetString(GL10.GL_VENDOR);
+                renderer = gl.glGetString(GL10.GL_RENDERER);
             }
             Log.i(TAG, "extensions : " + extensions);
+            Log.i(TAG, "vendor : " + vendor);
+            Log.i(TAG, "renderer : " + renderer);
+            mParent.setGraphicsInfo(vendor, renderer);
             Scanner scanner = new Scanner(extensions);
             scanner.useDelimiter(" ");
             while (scanner.hasNext()) {