Adding Graphics Vendor and Renderer to result file.

bug:10820540
Change-Id: I82655cc887c23f3283aa35815d903444e3994e3a
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()) {