Add missing libraries to openglperf2 test cases.

bug:26980605
Change-Id: I288e99fd1ddf7fdd65081f06b75bedaf58aeb421
diff --git a/suite/cts/deviceTests/opengl/jni/Android.mk b/suite/cts/deviceTests/opengl/jni/Android.mk
index 7b58170..fa68344 100644
--- a/suite/cts/deviceTests/opengl/jni/Android.mk
+++ b/suite/cts/deviceTests/opengl/jni/Android.mk
@@ -29,6 +29,8 @@
 
 LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
 
-LOCAL_SHARED_LIBRARIES := libEGL libGLESv2 libandroid libutils libcutils liblog
+LOCAL_SHARED_LIBRARIES := libEGL libGLESv2 libandroid liblog
+
+LOCAL_CXX_STL := libc++_static
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.cpp b/suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.cpp
index 455ccd6..5581e95 100644
--- a/suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.cpp
+++ b/suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.cpp
@@ -20,7 +20,7 @@
 }
 
 void SceneGraphNode::addChild(SceneGraphNode* child) {
-    mChildren.add(child);
+    mChildren.push_back(child);
 }
 
 void SceneGraphNode::draw(Program& program, Matrix& model, Matrix& view, Matrix& projection) {
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.h b/suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.h
index dce8fde..41f5a6d 100644
--- a/suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.h
+++ b/suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.h
@@ -14,7 +14,7 @@
 #ifndef SCENEGRAPHNODE_H
 #define SCENEGRAPHNODE_H
 
-#include <utils/Vector.h>
+#include <vector>
 #include "Matrix.h"
 #include "Program.h"
 
@@ -28,7 +28,7 @@
     virtual void after(Program& program, Matrix& model, Matrix& view, Matrix& projection) = 0;
     void draw(Program& program, Matrix& model, Matrix& view, Matrix& projection);
 private:
-    android::Vector<SceneGraphNode*> mChildren;
+    std::vector<SceneGraphNode*> mChildren;
 };
 
 #endif
diff --git a/suite/cts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp b/suite/cts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp
index 856da1e..14c869f 100644
--- a/suite/cts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp
+++ b/suite/cts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp
@@ -14,6 +14,7 @@
 #include <jni.h>
 
 #include <stdlib.h>
+#include <android/log.h>
 
 #include <android/native_window.h>
 #include <android/native_window_jni.h>
@@ -92,7 +93,8 @@
             gRenderer = new ContextSwitchRenderer(gNativeWindow, offscreen);
             break;
         default:
-            ALOGE("Unknown benchmark '%d'", benchmark);
+            __android_log_print(ANDROID_LOG_ERROR, "GLPrimitive",
+                    "Unknown benchmark '%d'", benchmark);
             ANativeWindow_release(gNativeWindow);
             gNativeWindow = NULL;
             return;
diff --git a/suite/cts/deviceTests/opengl/jni/reference/ReferenceRenderer.cpp b/suite/cts/deviceTests/opengl/jni/reference/ReferenceRenderer.cpp
index 3b12ee1..7e629a8 100644
--- a/suite/cts/deviceTests/opengl/jni/reference/ReferenceRenderer.cpp
+++ b/suite/cts/deviceTests/opengl/jni/reference/ReferenceRenderer.cpp
@@ -19,6 +19,7 @@
 #include <graphics/GLUtils.h>
 #include <graphics/ProgramNode.h>
 
+#include <android/log.h>
 #include <Trace.h>
 
 ReferenceRenderer::ReferenceRenderer(ANativeWindow* window) :
@@ -95,6 +96,6 @@
 
     glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
     if (!mCurrentScene->draw()) {
-        ALOGE("Error when rendering scene");
+        __android_log_print(ANDROID_LOG_ERROR, "ReferenceRenderer", "Error when rendering scene");
     }
 }
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/Scene.h b/suite/cts/deviceTests/opengl/jni/reference/scene/Scene.h
index 06178b9..01a2c0c 100644
--- a/suite/cts/deviceTests/opengl/jni/reference/scene/Scene.h
+++ b/suite/cts/deviceTests/opengl/jni/reference/scene/Scene.h
@@ -19,7 +19,7 @@
 #include <graphics/Program.h>
 #include <graphics/ProgramNode.h>
 
-#include <utils/Vector.h>
+#include <vector>
 
 class Scene {
 public:
@@ -40,9 +40,9 @@
     virtual bool updateSceneGraphs(int frame) = 0;
     int mWidth;
     int mHeight;
-    android::Vector<Mesh*> mMeshes;
-    android::Vector<GLuint> mTextureIds;
-    android::Vector<ProgramNode*> mSceneGraphs;
+    std::vector<Mesh*> mMeshes;
+    std::vector<GLuint> mTextureIds;
+    std::vector<ProgramNode*> mSceneGraphs;
 private:
     Matrix* mModelMatrix;
     Matrix* mViewMatrix;
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.cpp b/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.cpp
index 71e5dac..241a6fe 100644
--- a/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.cpp
+++ b/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.cpp
@@ -111,17 +111,17 @@
 
 bool FlockingScene::setUpTextures() {
     SCOPED_TRACE();
-    mTextureIds.add(GLUtils::loadTexture("texture/fish_dark.png"));
-    mTextureIds.add(GLUtils::loadTexture("texture/background.png"));
-    mTextureIds.add(GLUtils::loadTexture("texture/water1.png"));
-    mTextureIds.add(GLUtils::loadTexture("texture/water2.png"));
+    mTextureIds.push_back(GLUtils::loadTexture("texture/fish_dark.png"));
+    mTextureIds.push_back(GLUtils::loadTexture("texture/background.png"));
+    mTextureIds.push_back(GLUtils::loadTexture("texture/water1.png"));
+    mTextureIds.push_back(GLUtils::loadTexture("texture/water2.png"));
     return true;
 }
 
 bool FlockingScene::setUpMeshes() {
     SCOPED_TRACE();
-    mMeshes.add(GLUtils::loadMesh("mesh/fish.cob"));
-    mMeshes.add(GLUtils::loadMesh("mesh/plane.cob"));
+    mMeshes.push_back(GLUtils::loadMesh("mesh/fish.cob"));
+    mMeshes.push_back(GLUtils::loadMesh("mesh/plane.cob"));
     return true;
 }
 
@@ -141,7 +141,7 @@
     const float LIMIT_Y = mBoardHeight / 2.0f;
 
     ProgramNode* mainSceneGraph = new ProgramNode(*mMainProgram);
-    mSceneGraphs.add(mainSceneGraph);
+    mSceneGraphs.push_back(mainSceneGraph);
     // Bottom
     Matrix* transformMatrix = Matrix::newScale(MAIN_SCALE * mDisplayRatio, MAIN_SCALE, 0.0f);
     TransformationNode* transformNode = new TransformationNode(transformMatrix);
@@ -170,7 +170,7 @@
         transformNode->addChild(meshNode);
     }
     ProgramNode* waterSceneGraph = new ProgramNode(*mWaterProgram);
-    mSceneGraphs.add(waterSceneGraph);
+    mSceneGraphs.push_back(waterSceneGraph);
     // Top
     transformMatrix = Matrix::newScale(MAIN_SCALE * mDisplayRatio, MAIN_SCALE, 1.0f);
     transformMatrix->translate(0, 0, 0.1f);
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.cpp b/suite/cts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.cpp
index 0d22b96..6529236 100644
--- a/suite/cts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.cpp
+++ b/suite/cts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.cpp
@@ -113,17 +113,17 @@
 
 bool GlowingScene::setUpTextures() {
     SCOPED_TRACE();
-    mTextureIds.add(GLUtils::genTexture(mWidth, mHeight, 0)); // fbo
-    mTextureIds.add(GLUtils::genTexture(mWidth, mHeight, 0)); // tmp1
-    mTextureIds.add(GLUtils::genTexture(mWidth, mHeight, 0)); // tmp2
-    mTextureIds.add(GLUtils::loadTexture("texture/arc.png"));
+    mTextureIds.push_back(GLUtils::genTexture(mWidth, mHeight, 0)); // fbo
+    mTextureIds.push_back(GLUtils::genTexture(mWidth, mHeight, 0)); // tmp1
+    mTextureIds.push_back(GLUtils::genTexture(mWidth, mHeight, 0)); // tmp2
+    mTextureIds.push_back(GLUtils::loadTexture("texture/arc.png"));
     return true;
 }
 
 bool GlowingScene::setUpMeshes() {
     SCOPED_TRACE();
-    mMeshes.add(GLUtils::loadMesh("mesh/plane.cob"));
-    mMeshes.add(GLUtils::loadMesh("mesh/arc.cob"));
+    mMeshes.push_back(GLUtils::loadMesh("mesh/plane.cob"));
+    mMeshes.push_back(GLUtils::loadMesh("mesh/arc.cob"));
     return true;
 }
 
@@ -153,20 +153,20 @@
 bool GlowingScene::updateSceneGraphs(int frame) {
     // To render the mesh to the FBO
     ProgramNode* lightSceneGraph = new ProgramNode(*mMainProgram);
-    mSceneGraphs.add(lightSceneGraph);
+    mSceneGraphs.push_back(lightSceneGraph);
     MeshNode* meshNode = new PerspectiveMeshNode(mMeshes[1], mTextureIds[3]);
     lightSceneGraph->addChild(meshNode);
 
     // To blur the image
     ProgramNode* blurSceneGraph = new ProgramNode(*mBlurProgram);
-    mSceneGraphs.add(blurSceneGraph);
+    mSceneGraphs.push_back(blurSceneGraph);
     meshNode = new BlurMeshNode(mMeshes[0], mTextureIds[0], mTextureIds[1], mTextureIds[2],
             mFboWidth, mFboHeight);
     blurSceneGraph->addChild(meshNode);
 
     // Blur To screen
     ProgramNode* glowSceneGraph = new ProgramNode(*mMainProgram);
-    mSceneGraphs.add(glowSceneGraph);
+    mSceneGraphs.push_back(glowSceneGraph);
     Matrix* transformMatrix = Matrix::newScale(mFboRatio, 1.0f, 1.0f);
     TransformationNode* transformNode = new TransformationNode(transformMatrix);
     glowSceneGraph->addChild(transformNode);
diff --git a/suite/cts/hostTests/jank/src/com/android/cts/jank/CtsHostJankTest.java b/suite/cts/hostTests/jank/src/com/android/cts/jank/CtsHostJankTest.java
index e196bfb..78660cd 100644
--- a/suite/cts/hostTests/jank/src/com/android/cts/jank/CtsHostJankTest.java
+++ b/suite/cts/hostTests/jank/src/com/android/cts/jank/CtsHostJankTest.java
@@ -81,7 +81,7 @@
 
     public void runUiAutomatorTest(String testName) throws Exception {
         // Delete any existing result files
-        mDevice.executeShellCommand("rm -r " + DEVICE_LOCATION + "*.txt");
+        mDevice.executeShellCommand("rm -r " + DEVICE_LOCATION + "UiJankinessTestsOutput.txt");
 
         // Run ui automator test.
         mDevice.executeShellCommand(