Merge "Migrate Jank, OpenGl, and UI tests to CTSv2"
diff --git a/CtsTestCaseList.mk b/CtsTestCaseList.mk
index 75db5ea..b71f75f 100644
--- a/CtsTestCaseList.mk
+++ b/CtsTestCaseList.mk
@@ -79,17 +79,15 @@
     CtsAtraceTestApp \
     CtsCertInstallerApp \
     CtsDeviceAdmin \
-    CtsDeviceOpenGl \
     CtsWifiConfigCreator \
     CtsDeviceAndProfileOwnerApp \
     CtsDeviceAppUsageTestApp \
     CtsDeviceInfo \
     CtsDeviceOsTestApp \
     CtsDeviceOwnerApp \
-    CtsDeviceTaskswitchingAppA \
-    CtsDeviceTaskswitchingAppB \
-    CtsDeviceTaskswitchingControl \
-    CtsDeviceUi \
+    CtsDeviceTaskSwitchingAppA \
+    CtsDeviceTaskSwitchingAppB \
+    CtsDeviceTaskSwitchingControl \
     CtsHostsideNetworkTestsApp \
     CtsIntentReceiverApp \
     CtsIntentSenderApp \
@@ -128,10 +126,8 @@
 
 # Test packages that require an associated test package XML.
 cts_test_packages := \
-    CtsDeviceUi \
     CtsDeviceSimpleCpu \
     CtsDeviceVideoPerf \
-    CtsDeviceOpenGl \
     CtsDeviceTvProviderPerf \
     CtsAccelerationTestCases \
     CtsAccountManagerTestCases \
@@ -161,7 +157,7 @@
     CtsGraphicsTestCases \
     CtsGraphics2TestCases \
     CtsHardwareTestCases \
-    CtsJankTestCases \
+    CtsJankDeviceTestCases \
     CtsLeanbackJankTestCases \
     CtsJobSchedulerTestCases \
     CtsJniTestCases \
@@ -178,6 +174,7 @@
     CtsNetTestCasesLegacyPermission22 \
     CtsOpenGLTestCases \
     CtsOpenGlPerfTestCases \
+    CtsOpenGlPerf2TestCases \
     CtsOsTestCases \
     CtsPermissionTestCases \
     CtsPermission2TestCases \
@@ -203,6 +200,7 @@
     CtsTvTestCases \
     CtsUiAutomationTestCases \
     CtsUiRenderingTestCases \
+    CtsUiDeviceTestCases \
     CtsUsageStatsTestCases \
     CtsUtilTestCases \
     CtsViewTestCases \
@@ -223,15 +221,15 @@
     CtsAtraceHostTestCases \
     CtsDevicePolicyManagerTestCases \
     CtsDumpsysHostTestCases \
-    CtsHostJank \
+    CtsJankHostTestCases \
     CtsHostsideNetworkTests \
-    CtsHostUi \
     CtsJdwpSecurityHostTestCases \
     CtsMonkeyTestCases \
     CtsOsHostTestCases \
-    CtsThemeHostTestCases \
-    CtsUsageHostTestCases \
     CtsSecurityHostTestCases \
+    CtsThemeHostTestCases \
+    CtsUiHostTestCases \
+    CtsUsageHostTestCases \
     CtsUsbTests
 
 # List of native tests. For 32 bit targets, assumes that there will be
@@ -250,7 +248,7 @@
     CtsUiAutomatorTests
 
 cts_device_jars := \
-    CtsDeviceJank \
+    CtsJankTestJar \
     CtsJdwpApp
 
 cts_target_junit_tests := \
diff --git a/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/testtype/ModuleRepo.java b/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/testtype/ModuleRepo.java
index a9e8615..10db046 100644
--- a/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/testtype/ModuleRepo.java
+++ b/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/testtype/ModuleRepo.java
@@ -21,6 +21,7 @@
 import com.android.tradefed.config.ConfigurationException;
 import com.android.tradefed.config.ConfigurationFactory;
 import com.android.tradefed.config.IConfigurationFactory;
+import com.android.tradefed.log.LogUtil.CLog;
 import com.android.tradefed.targetprep.ITargetPreparer;
 import com.android.tradefed.testtype.IAbi;
 import com.android.tradefed.testtype.IRemoteTest;
diff --git a/suite/cts/hostTests/jank/Android.mk b/hostsidetests/jank/Android.mk
similarity index 75%
rename from suite/cts/hostTests/jank/Android.mk
rename to hostsidetests/jank/Android.mk
index a1f4d90..992d45c 100644
--- a/suite/cts/hostTests/jank/Android.mk
+++ b/hostsidetests/jank/Android.mk
@@ -20,22 +20,27 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_MODULE := CtsHostJank
+LOCAL_MODULE := CtsJankHostTestCases
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt
+LOCAL_JAVA_LIBRARIES := cts-tradefed_v2 compatibility-host-util tradefed-prebuilt
+
+LOCAL_STATIC_JAVA_LIBRARIES := cts-migration-lib
 
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
-LOCAL_CTS_TEST_PACKAGE := com.android.cts.jank
+LOCAL_CTS_TEST_PACKAGE := android.jank.cts
 
-LOCAL_DEVICE_JAR_ := CtsDeviceJank
+# Tag this module as a cts_v2 test artifact
+LOCAL_COMPATIBILITY_SUITE := cts_v2
+
+LOCAL_DEVICE_JAR_ := CtsJankTestJar
 cts_library_jar_ := $(CTS_TESTCASES_OUT)/$(LOCAL_DEVICE_JAR_).jar
 
 $(cts_library_jar_): $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_DEVICE_JAR_))/javalib.jar | $(ACP)
 	$(hide) mkdir -p $(CTS_TESTCASES_OUT)
 	$(hide) $(ACP) -fp $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_DEVICE_JAR_))/javalib.jar $@
 
-$(CTS_TESTCASES_OUT)/CtsHostJank.xml: $(cts_library_jar_)
+$(CTS_TESTCASES_OUT)/CtsJankHostTestCases.xml: $(cts_library_jar_)
 
 include $(BUILD_CTS_HOST_JAVA_LIBRARY)
 
diff --git a/suite/cts/deviceTests/jank2/OldAndroidTest.xml b/hostsidetests/jank/AndroidTest.xml
similarity index 84%
rename from suite/cts/deviceTests/jank2/OldAndroidTest.xml
rename to hostsidetests/jank/AndroidTest.xml
index 2fbbac7..e01153b 100644
--- a/suite/cts/deviceTests/jank2/OldAndroidTest.xml
+++ b/hostsidetests/jank/AndroidTest.xml
@@ -13,7 +13,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="CTS Jank test config">
+<configuration description="Config for CTS Jank Host Test Cases">
     <include name="common-config" />
-    <option name="cts-apk-installer:test-file-name" value="CtsDeviceUi.apk" />
+    <test class="android.jank.cts.opengl.CtsHostJankOpenGl" />
 </configuration>
diff --git a/suite/cts/hostTests/jank/app/Android.mk b/hostsidetests/jank/app/Android.mk
similarity index 88%
rename from suite/cts/hostTests/jank/app/Android.mk
rename to hostsidetests/jank/app/Android.mk
index 8f4fce6..13f917e 100644
--- a/suite/cts/hostTests/jank/app/Android.mk
+++ b/hostsidetests/jank/app/Android.mk
@@ -18,9 +18,12 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := CtsDeviceJank
+LOCAL_MODULE := CtsJankTestJar
 LOCAL_DEX_PREOPT := false
 
+# Tag this module as a cts_v2 test artifact
+LOCAL_COMPATIBILITY_SUITE := cts_v2
+
 LOCAL_JAVA_LIBRARIES := uiautomator.core
 
 LOCAL_STATIC_JAVA_LIBRARIES := com.android.uiautomator.platform.common
diff --git a/suite/cts/hostTests/jank/app/src/com/android/cts/jank/CtsJankTestBase.java b/hostsidetests/jank/app/src/android/jank/cts/CtsJankTestBase.java
similarity index 98%
rename from suite/cts/hostTests/jank/app/src/com/android/cts/jank/CtsJankTestBase.java
rename to hostsidetests/jank/app/src/android/jank/cts/CtsJankTestBase.java
index 6d5162b..1eda12f 100644
--- a/suite/cts/hostTests/jank/app/src/com/android/cts/jank/CtsJankTestBase.java
+++ b/hostsidetests/jank/app/src/android/jank/cts/CtsJankTestBase.java
@@ -12,7 +12,7 @@
  * the License.
  */
 
-package com.android.cts.jank;
+package android.jank.cts;
 
 import android.os.Bundle;
 import android.util.Log;
diff --git a/suite/cts/hostTests/jank/app/src/com/android/cts/jank/opengl/CtsDeviceJankOpenGl.java b/hostsidetests/jank/app/src/android/jank/cts/opengl/CtsDeviceJankOpenGl.java
similarity index 95%
rename from suite/cts/hostTests/jank/app/src/com/android/cts/jank/opengl/CtsDeviceJankOpenGl.java
rename to hostsidetests/jank/app/src/android/jank/cts/opengl/CtsDeviceJankOpenGl.java
index 5ba0613..46dc06c 100755
--- a/suite/cts/hostTests/jank/app/src/com/android/cts/jank/opengl/CtsDeviceJankOpenGl.java
+++ b/hostsidetests/jank/app/src/android/jank/cts/opengl/CtsDeviceJankOpenGl.java
@@ -12,16 +12,16 @@
  * the License.
  */
 
-package com.android.cts.jank.opengl;
+package android.jank.cts.opengl;
 
+import android.jank.cts.CtsJankTestBase;
 import android.util.Log;
 
-import com.android.cts.jank.CtsJankTestBase;
 import com.android.uiautomator.platform.SurfaceFlingerHelper;
 
 public class CtsDeviceJankOpenGl extends CtsJankTestBase {
     private final static String TAG = CtsDeviceJankOpenGl.class.getName();
-    private final static String PACKAGE = "com.android.cts.opengl";
+    private final static String PACKAGE = "android.opengl2.cts";
     private final static String COMPONENT =
             PACKAGE + "/" + PACKAGE + ".primitive.GLPrimitiveActivity";
     private static String APP_WINDOW_NAME = "SurfaceView";
diff --git a/suite/cts/hostTests/jank/src/com/android/cts/jank/CtsHostJankTest.java b/hostsidetests/jank/src/android/jank/cts/CtsHostJankTest.java
similarity index 78%
rename from suite/cts/hostTests/jank/src/com/android/cts/jank/CtsHostJankTest.java
rename to hostsidetests/jank/src/android/jank/cts/CtsHostJankTest.java
index 178fa4d..f202164 100644
--- a/suite/cts/hostTests/jank/src/com/android/cts/jank/CtsHostJankTest.java
+++ b/hostsidetests/jank/src/android/jank/cts/CtsHostJankTest.java
@@ -11,16 +11,14 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.cts.jank;
+package android.jank.cts;
 
 import com.android.compatibility.common.util.MetricsReportLog;
 import com.android.compatibility.common.util.ResultType;
 import com.android.compatibility.common.util.ResultUnit;
-import com.android.cts.tradefed.build.CtsBuildHelper;
-import com.android.ddmlib.IShellOutputReceiver;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.Log.LogLevel;
+import com.android.cts.migration.MigrationHelper;
 import com.android.tradefed.build.IBuildInfo;
+import com.android.tradefed.build.IFolderBuildInfo;
 import com.android.tradefed.device.ITestDevice;
 import com.android.tradefed.testtype.DeviceTestCase;
 import com.android.tradefed.testtype.IAbi;
@@ -42,7 +40,7 @@
     private final String mJarName;
     private final String mJarPath;
     protected ITestDevice mDevice;
-    protected CtsBuildHelper mBuild;
+    protected IFolderBuildInfo mBuild;
     protected IAbi mAbi;
 
     public CtsHostJankTest(String jarName, String deviceTestClass, String hostTestClass) {
@@ -59,7 +57,7 @@
 
     @Override
     public void setBuild(IBuildInfo buildInfo) {
-        mBuild = CtsBuildHelper.createBuildHelper(buildInfo);
+        mBuild = (IFolderBuildInfo) buildInfo;
     }
 
     @Override
@@ -67,7 +65,7 @@
         super.setUp();
         mDevice = getDevice();
         // Push jar to device.
-        File jarFile = mBuild.getTestApp(mJarName);
+        File jarFile = MigrationHelper.getTestFile(mBuild, mJarName);
         boolean result = mDevice.pushFile(jarFile, mJarPath);
         assertTrue("Failed to push file to " + mJarPath, result);
     }
@@ -85,29 +83,7 @@
 
         // Run ui automator test.
         mDevice.executeShellCommand(
-                String.format(RUN_UI_AUTOMATOR_CMD, mJarName, mDeviceTestClass + "#" + testName),
-                new IShellOutputReceiver() {
-                    private StringBuilder sb = new StringBuilder();
-
-                    @Override
-                    public void addOutput(byte[] data, int offset, int length) {
-                        byte[] raw = new byte[length];
-                        for (int i = 0; i < length; i++) {
-                            raw[i] = data[i + offset];
-                        }
-                        sb.append(new String(raw));
-                    }
-
-                    @Override
-                    public void flush() {
-                        Log.logAndDisplay(LogLevel.INFO, TAG, sb.toString());
-                    }
-
-                    @Override
-                    public boolean isCancelled() {
-                        return false;
-                    }
-                });
+                String.format(RUN_UI_AUTOMATOR_CMD, mJarName, mDeviceTestClass + "#" + testName));
 
         // Pull result file across
         File result = mDevice.pullFile(DEVICE_LOCATION + "UiJankinessTestsOutput.txt");
@@ -122,7 +98,6 @@
             }
         }
         in.close();
-        Log.logAndDisplay(LogLevel.INFO, TAG, "Results: " + results);
         assertEquals("Could not parse the results file: ", 4, results.size());
 
         double avgNumJanks = results.get("average number of jankiness");
diff --git a/suite/cts/hostTests/jank/src/com/android/cts/jank/opengl/CtsHostJankOpenGl.java b/hostsidetests/jank/src/android/jank/cts/opengl/CtsHostJankOpenGl.java
similarity index 76%
rename from suite/cts/hostTests/jank/src/com/android/cts/jank/opengl/CtsHostJankOpenGl.java
rename to hostsidetests/jank/src/android/jank/cts/opengl/CtsHostJankOpenGl.java
index 8acf169..193d543 100644
--- a/suite/cts/hostTests/jank/src/com/android/cts/jank/opengl/CtsHostJankOpenGl.java
+++ b/hostsidetests/jank/src/android/jank/cts/opengl/CtsHostJankOpenGl.java
@@ -11,20 +11,23 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.cts.jank.opengl;
+package android.jank.cts.opengl;
+
+import android.jank.cts.CtsHostJankTest;
 
 import com.android.compatibility.common.util.AbiUtils;
-import com.android.cts.jank.CtsHostJankTest;
+import com.android.cts.migration.MigrationHelper;
+
 import java.io.File;
 
 public class CtsHostJankOpenGl extends CtsHostJankTest {
 
-    private static final String APK_PACKAGE = "com.android.cts";
-    private static final String APK = "CtsDeviceOpenGl.apk";
-    private static final String PACKAGE = "com.android.cts.jank.opengl";
+    private static final String APK_PACKAGE = "android.opengl2.cts";
+    private static final String APK = "CtsOpenGlPerf2TestCases.apk";
+    private static final String PACKAGE = "android.jank.cts";
     private static final String HOST_CLASS = CtsHostJankOpenGl.class.getName();
-    private static final String DEVICE_CLASS = PACKAGE + ".CtsDeviceJankOpenGl";
-    private static final String JAR_NAME = "CtsDeviceJank.jar";
+    private static final String DEVICE_CLASS = PACKAGE + ".opengl.CtsDeviceJankOpenGl";
+    private static final String JAR_NAME = "CtsJankTestJar.jar";
 
     public CtsHostJankOpenGl() {
         super(JAR_NAME, DEVICE_CLASS, HOST_CLASS);
@@ -35,7 +38,7 @@
         super.setUp();
         // Install the app.
         mDevice.uninstallPackage(APK_PACKAGE);
-        File app = mBuild.getTestApp(APK);
+        File app = MigrationHelper.getTestFile(mBuild, APK);
         String[] options = {AbiUtils.createAbiFlag(mAbi.getName())};
         mDevice.installPackage(app, false, options);
     }
diff --git a/suite/cts/hostTests/uihost/Android.mk b/hostsidetests/ui/Android.mk
similarity index 75%
rename from suite/cts/hostTests/uihost/Android.mk
rename to hostsidetests/ui/Android.mk
index 67ebcbb..033105e 100644
--- a/suite/cts/hostTests/uihost/Android.mk
+++ b/hostsidetests/ui/Android.mk
@@ -20,13 +20,18 @@
 
 LOCAL_MODULE_TAGS := optional
 
-LOCAL_MODULE := CtsHostUi
+LOCAL_MODULE := CtsUiHostTestCases
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt
+LOCAL_JAVA_LIBRARIES := cts-tradefed_v2 compatibility-host-util tradefed-prebuilt
+
+LOCAL_STATIC_JAVA_LIBRARIES := cts-migration-lib
 
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
-LOCAL_CTS_TEST_PACKAGE := com.android.cts.uihost
+LOCAL_CTS_TEST_PACKAGE := android.ui.cts
+
+# Tag this module as a cts_v2 test artifact
+LOCAL_COMPATIBILITY_SUITE := cts_v2
 
 include $(BUILD_CTS_HOST_JAVA_LIBRARY)
 
diff --git a/suite/cts/deviceTests/jank2/OldAndroidTest.xml b/hostsidetests/ui/AndroidTest.xml
similarity index 80%
copy from suite/cts/deviceTests/jank2/OldAndroidTest.xml
copy to hostsidetests/ui/AndroidTest.xml
index 2fbbac7..492d9f1 100644
--- a/suite/cts/deviceTests/jank2/OldAndroidTest.xml
+++ b/hostsidetests/ui/AndroidTest.xml
@@ -13,7 +13,8 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="CTS Jank test config">
+<configuration description="Config for CTS UI Host Test Cases">
     <include name="common-config" />
-    <option name="cts-apk-installer:test-file-name" value="CtsDeviceUi.apk" />
+    <test class="android.ui.cts.InstallTimeTest" />
+    <test class="android.ui.cts.TaskSwitchingTest" />
 </configuration>
diff --git a/suite/cts/hostTests/uihost/appA/Android.mk b/hostsidetests/ui/appA/Android.mk
similarity index 87%
rename from suite/cts/hostTests/uihost/appA/Android.mk
rename to hostsidetests/ui/appA/Android.mk
index 17f076f..41bffeb 100644
--- a/suite/cts/hostTests/uihost/appA/Android.mk
+++ b/hostsidetests/ui/appA/Android.mk
@@ -24,7 +24,10 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := CtsDeviceTaskswitchingAppA
+LOCAL_PACKAGE_NAME := CtsDeviceTaskSwitchingAppA
+
+# Tag this module as a cts_v2 test artifact
+LOCAL_COMPATIBILITY_SUITE := cts_v2
 
 LOCAL_SDK_VERSION := current
 
diff --git a/suite/cts/hostTests/uihost/appA/AndroidManifest.xml b/hostsidetests/ui/appA/AndroidManifest.xml
similarity index 95%
rename from suite/cts/hostTests/uihost/appA/AndroidManifest.xml
rename to hostsidetests/ui/appA/AndroidManifest.xml
index b97325c..f336abd 100644
--- a/suite/cts/hostTests/uihost/appA/AndroidManifest.xml
+++ b/hostsidetests/ui/appA/AndroidManifest.xml
@@ -16,7 +16,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.android.cts.taskswitching.appa" >
+        package="android.taskswitching.appa">
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
 
diff --git a/suite/cts/hostTests/uihost/appA/src/com/android/cts/taskswitching/appa/AppAActivity.java b/hostsidetests/ui/appA/src/android/taskswitching/appa/AppAActivity.java
similarity index 92%
rename from suite/cts/hostTests/uihost/appA/src/com/android/cts/taskswitching/appa/AppAActivity.java
rename to hostsidetests/ui/appA/src/android/taskswitching/appa/AppAActivity.java
index a4207a0..32ccfc1 100644
--- a/suite/cts/hostTests/uihost/appA/src/com/android/cts/taskswitching/appa/AppAActivity.java
+++ b/hostsidetests/ui/appA/src/android/taskswitching/appa/AppAActivity.java
@@ -14,8 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.cts.taskswitching.appa;
-
+package android.taskswitching.appa;
 
 import android.app.ListActivity;
 import android.content.Intent;
@@ -33,11 +32,12 @@
 public class AppAActivity extends ListActivity {
     static final String TAG = "AppAActivity";
     private static final int NUMBER_ELEMENTS = 1000;
-    private static final String TASKSWITCHING_INTENT = "com.android.cts.taskswitching.appa";
+    private static final String TASKSWITCHING_INTENT = "android.taskswitching.appa";
     private Handler mHandler;
 
     private String[] mItems = new String[NUMBER_ELEMENTS];
 
+    @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
@@ -50,6 +50,7 @@
         mHandler = new Handler();
     }
 
+    @Override
     public void onResume() {
         super.onResume();
         mHandler.post(new Runnable() {
diff --git a/suite/cts/hostTests/uihost/appA/Android.mk b/hostsidetests/ui/appB/Android.mk
similarity index 87%
copy from suite/cts/hostTests/uihost/appA/Android.mk
copy to hostsidetests/ui/appB/Android.mk
index 17f076f..3b9cdae 100644
--- a/suite/cts/hostTests/uihost/appA/Android.mk
+++ b/hostsidetests/ui/appB/Android.mk
@@ -24,7 +24,10 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := CtsDeviceTaskswitchingAppA
+LOCAL_PACKAGE_NAME := CtsDeviceTaskSwitchingAppB
+
+# Tag this module as a cts_v2 test artifact
+LOCAL_COMPATIBILITY_SUITE := cts_v2
 
 LOCAL_SDK_VERSION := current
 
diff --git a/suite/cts/hostTests/uihost/appB/AndroidManifest.xml b/hostsidetests/ui/appB/AndroidManifest.xml
similarity index 95%
rename from suite/cts/hostTests/uihost/appB/AndroidManifest.xml
rename to hostsidetests/ui/appB/AndroidManifest.xml
index b96afe5..aaf7a2c 100644
--- a/suite/cts/hostTests/uihost/appB/AndroidManifest.xml
+++ b/hostsidetests/ui/appB/AndroidManifest.xml
@@ -15,7 +15,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="com.android.cts.taskswitching.appb">
+        package="android.taskswitching.appb">
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
 
diff --git a/suite/cts/hostTests/uihost/appB/src/com/android/cts/taskswitching/appb/AppBActivity.java b/hostsidetests/ui/appB/src/android/taskswitching/appb/AppBActivity.java
similarity index 89%
rename from suite/cts/hostTests/uihost/appB/src/com/android/cts/taskswitching/appb/AppBActivity.java
rename to hostsidetests/ui/appB/src/android/taskswitching/appb/AppBActivity.java
index 4df5e98..ea7f52a 100644
--- a/suite/cts/hostTests/uihost/appB/src/com/android/cts/taskswitching/appb/AppBActivity.java
+++ b/hostsidetests/ui/appB/src/android/taskswitching/appb/AppBActivity.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.cts.taskswitching.appb;
+package android.taskswitching.appb;
 
 import android.app.ListActivity;
 import android.content.Intent;
@@ -31,13 +31,13 @@
 public class AppBActivity extends ListActivity {
     static final String TAG = "AppBActivity";
     private static final int NUMBER_ELEMENTS = 1000;
-    private static final String TASKSWITCHING_INTENT = "com.android.cts.taskswitching.appb";
+    private static final String TASKSWITCHING_INTENT = "android.taskswitching.appb";
     private Handler mHandler;
 
     private String[] mItems = new String[NUMBER_ELEMENTS];
 
-    public void onCreate(Bundle icicle)
-    {
+    @Override
+    public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
         for (int i = 0; i < NUMBER_ELEMENTS; i++) {
@@ -49,8 +49,8 @@
         mHandler = new Handler();
     }
 
-    public void onResume()
-    {
+    @Override
+    public void onResume() {
         super.onResume();
         mHandler.post(new Runnable() {
 
diff --git a/suite/cts/hostTests/uihost/control/Android.mk b/hostsidetests/ui/control/Android.mk
similarity index 87%
rename from suite/cts/hostTests/uihost/control/Android.mk
rename to hostsidetests/ui/control/Android.mk
index de5a6b5..e1ff237 100644
--- a/suite/cts/hostTests/uihost/control/Android.mk
+++ b/hostsidetests/ui/control/Android.mk
@@ -24,7 +24,10 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := CtsDeviceTaskswitchingControl
+LOCAL_PACKAGE_NAME := CtsDeviceTaskSwitchingControl
+
+# Tag this module as a cts_v2 test artifact
+LOCAL_COMPATIBILITY_SUITE := cts_v2
 
 LOCAL_SDK_VERSION := current
 
diff --git a/suite/cts/hostTests/uihost/control/AndroidManifest.xml b/hostsidetests/ui/control/AndroidManifest.xml
similarity index 89%
rename from suite/cts/hostTests/uihost/control/AndroidManifest.xml
rename to hostsidetests/ui/control/AndroidManifest.xml
index e4b10f2..fd48287 100644
--- a/suite/cts/hostTests/uihost/control/AndroidManifest.xml
+++ b/hostsidetests/ui/control/AndroidManifest.xml
@@ -15,7 +15,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="com.android.cts.taskswitching.control">
+        package="android.taskswitching.control.cts">
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
 
@@ -23,7 +23,7 @@
         <uses-library android:name="android.test.runner" />
     </application>
     <instrumentation
-        android:targetPackage="com.android.cts.taskswitching.control"
+        android:targetPackage="android.taskswitching.control.cts"
         android:name="android.support.test.runner.AndroidJUnitRunner" >
         <meta-data
             android:name="listener"
diff --git a/suite/cts/hostTests/uihost/control/src/com/android/cts/taskswitching/control/TaskswitchingDeviceTest.java b/hostsidetests/ui/control/src/android/taskswitching/control/cts/TaskSwitchingDeviceTest.java
similarity index 90%
rename from suite/cts/hostTests/uihost/control/src/com/android/cts/taskswitching/control/TaskswitchingDeviceTest.java
rename to hostsidetests/ui/control/src/android/taskswitching/control/cts/TaskSwitchingDeviceTest.java
index 4bda0bb..13b60be 100644
--- a/suite/cts/hostTests/uihost/control/src/com/android/cts/taskswitching/control/TaskswitchingDeviceTest.java
+++ b/hostsidetests/ui/control/src/android/taskswitching/control/cts/TaskSwitchingDeviceTest.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.cts.taskswitching.control;
+package android.taskswitching.control.cts;
 
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
@@ -39,9 +39,9 @@
  * measure time for switching.
  * Completion of launch is notified via broadcast.
  */
-public class TaskswitchingDeviceTest extends CtsAndroidTestCase {
-    private static final String PKG_A = "com.android.cts.taskswitching.appa";
-    private static final String PKG_B = "com.android.cts.taskswitching.appb";
+public class TaskSwitchingDeviceTest extends CtsAndroidTestCase {
+    private static final String PKG_A = "android.taskswitching.appa";
+    private static final String PKG_B = "android.taskswitching.appb";
     private static final String ACTIVITY_A = "AppAActivity";
     private static final String ACTIVITY_B = "AppBActivity";
     private static final long TASK_SWITCHING_WAIT_TIME = 5;
@@ -85,9 +85,9 @@
             }
         });
         DeviceReportLog report = new DeviceReportLog();
-        report.addValues("taskswitching time", results, ResultType.LOWER_BETTER, ResultUnit.MS);
+        report.addValues("task switching time", results, ResultType.LOWER_BETTER, ResultUnit.MS);
         Stat.StatResult stat = Stat.getStat(results);
-        report.setSummary("taskswitching time", stat.mAverage,
+        report.setSummary("task switching time", stat.mAverage,
                 ResultType.LOWER_BETTER, ResultUnit.MS);
         report.submit(getInstrumentation());
     }
diff --git a/suite/cts/hostTests/uihost/src/com/android/cts/uihost/InstallTimeTest.java b/hostsidetests/ui/src/android/ui/cts/InstallTimeTest.java
similarity index 90%
rename from suite/cts/hostTests/uihost/src/com/android/cts/uihost/InstallTimeTest.java
rename to hostsidetests/ui/src/android/ui/cts/InstallTimeTest.java
index 4869e73..f41eabf 100644
--- a/suite/cts/hostTests/uihost/src/com/android/cts/uihost/InstallTimeTest.java
+++ b/hostsidetests/ui/src/android/ui/cts/InstallTimeTest.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.cts.uihost;
+package android.ui.cts;
 
 import com.android.compatibility.common.util.AbiUtils;
 import com.android.compatibility.common.util.MeasureRun;
@@ -23,9 +23,10 @@
 import com.android.compatibility.common.util.ResultType;
 import com.android.compatibility.common.util.ResultUnit;
 import com.android.compatibility.common.util.Stat;
-import com.android.cts.tradefed.build.CtsBuildHelper;
+import com.android.cts.migration.MigrationHelper;
 import com.android.ddmlib.Log;
 import com.android.tradefed.build.IBuildInfo;
+import com.android.tradefed.build.IFolderBuildInfo;
 import com.android.tradefed.device.ITestDevice;
 import com.android.tradefed.testtype.DeviceTestCase;
 import com.android.tradefed.testtype.IAbi;
@@ -38,7 +39,7 @@
  * Test to measure installation time of a APK.
  */
 public class InstallTimeTest extends DeviceTestCase implements IAbiReceiver, IBuildReceiver {
-    private CtsBuildHelper mBuild;
+    private IFolderBuildInfo mBuild;
     private ITestDevice mDevice;
     private IAbi mAbi;
 
@@ -54,7 +55,7 @@
 
     @Override
     public void setBuild(IBuildInfo buildInfo) {
-        mBuild = CtsBuildHelper.createBuildHelper(buildInfo);
+        mBuild = (IFolderBuildInfo) buildInfo;
     }
 
     @Override
@@ -74,7 +75,7 @@
         MetricsReportLog report = new MetricsReportLog(mDevice.getSerialNumber(), mAbi.getName(),
                 String.format("%s#%s", getClass().getName(), "testInstallTime"));
         final int NUMBER_REPEAT = 10;
-        final CtsBuildHelper build = mBuild;
+        final IFolderBuildInfo build = mBuild;
         final ITestDevice device = mDevice;
         double[] result = MeasureTime.measure(NUMBER_REPEAT, new MeasureRun() {
             @Override
@@ -83,7 +84,7 @@
             }
             @Override
             public void run(int i) throws Exception {
-                File app = build.getTestApp(APK);
+                File app = MigrationHelper.getTestFile(build, APK);
                 String[] options = {AbiUtils.createAbiFlag(mAbi.getName())};
                 device.installPackage(app, false, options);
             }
diff --git a/suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java b/hostsidetests/ui/src/android/ui/cts/TaskSwitchingTest.java
similarity index 85%
rename from suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java
rename to hostsidetests/ui/src/android/ui/cts/TaskSwitchingTest.java
index cea5715..cccf86d 100644
--- a/suite/cts/hostTests/uihost/src/com/android/cts/uihost/TaskSwitchingTest.java
+++ b/hostsidetests/ui/src/android/ui/cts/TaskSwitchingTest.java
@@ -14,17 +14,17 @@
  * limitations under the License.
  */
 
-package com.android.cts.uihost;
+package android.ui.cts;
 
 import com.android.compatibility.common.util.AbiUtils;
 import com.android.compatibility.common.util.MetricsStore;
 import com.android.compatibility.common.util.ReportLog;
-import com.android.cts.tradefed.build.CtsBuildHelper;
-import com.android.cts.util.TimeoutReq;
+import com.android.cts.migration.MigrationHelper;
 import com.android.ddmlib.testrunner.RemoteAndroidTestRunner;
 import com.android.ddmlib.testrunner.TestIdentifier;
 import com.android.ddmlib.testrunner.TestRunResult;
 import com.android.tradefed.build.IBuildInfo;
+import com.android.tradefed.build.IFolderBuildInfo;
 import com.android.tradefed.device.ITestDevice;
 import com.android.tradefed.result.CollectingTestListener;
 import com.android.tradefed.testtype.DeviceTestCase;
@@ -47,20 +47,20 @@
     private static final String TAG = "TaskSwitchingTest";
     private final static String RUNNER = "android.support.test.runner.AndroidJUnitRunner";
     private static final String RESULT_KEY = "COMPATIBILITY_TEST_RESULT";
-    private CtsBuildHelper mBuild;
+    private IFolderBuildInfo mBuild;
     private ITestDevice mDevice;
     private ReportLog mReport = null;
     private IAbi mAbi;
 
     static final String[] PACKAGES = {
-        "com.android.cts.taskswitching.control",
-        "com.android.cts.taskswitching.appa",
-        "com.android.cts.taskswitching.appb"
+        "android.taskswitching.control.cts",
+        "android.taskswitching.appa",
+        "android.taskswitching.appb"
     };
     static final String[] APKS = {
-        "CtsDeviceTaskswitchingControl.apk",
-        "CtsDeviceTaskswitchingAppA.apk",
-        "CtsDeviceTaskswitchingAppB.apk"
+        "CtsDeviceTaskSwitchingControl.apk",
+        "CtsDeviceTaskSwitchingAppA.apk",
+        "CtsDeviceTaskSwitchingAppB.apk"
     };
 
     @Override
@@ -70,7 +70,7 @@
 
     @Override
     public void setBuild(IBuildInfo buildInfo) {
-        mBuild = CtsBuildHelper.createBuildHelper(buildInfo);
+        mBuild = (IFolderBuildInfo) buildInfo;
     }
 
     @Override
@@ -80,7 +80,7 @@
         String[] options = {AbiUtils.createAbiFlag(mAbi.getName())};
         for (int i = 0; i < PACKAGES.length; i++) {
             mDevice.uninstallPackage(PACKAGES[i]);
-            File app = mBuild.getTestApp(APKS[i]);
+            File app = MigrationHelper.getTestFile(mBuild, APKS[i]);
             mDevice.installPackage(app, false, options);
         }
     }
@@ -94,8 +94,7 @@
         super.tearDown();
     }
 
-    @TimeoutReq(minutes = 30)
-    public void testTaskswitching() throws Exception {
+    public void testTaskSwitching() throws Exception {
         RemoteAndroidTestRunner testRunner = new RemoteAndroidTestRunner(PACKAGES[0], RUNNER,
                 mDevice.getIDevice());
         LocalListener listener = new LocalListener();
@@ -106,7 +105,7 @@
         }
         assertNotNull("no performance data", mReport);
         MetricsStore.storeResult(mDevice.getSerialNumber(), mAbi.getName(),
-                String.format("%s#%s", getClass().getName(), "testTaskswitching"), mReport);
+                String.format("%s#%s", getClass().getName(), "testTaskSwitching"), mReport);
 
     }
 
diff --git a/suite/cts/hostTests/uihost/appA/Android.mk b/libs/migration/Android.mk
similarity index 76%
copy from suite/cts/hostTests/uihost/appA/Android.mk
copy to libs/migration/Android.mk
index 17f076f..18dc837 100644
--- a/suite/cts/hostTests/uihost/appA/Android.mk
+++ b/libs/migration/Android.mk
@@ -13,19 +13,20 @@
 # limitations under the License.
 
 LOCAL_PATH:= $(call my-dir)
+
 include $(CLEAR_VARS)
 
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
-
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := CtsDeviceTaskswitchingAppA
+LOCAL_JAVA_LIBRARIES := tradefed-prebuilt
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_MODULE := cts-migration-lib
 
 LOCAL_SDK_VERSION := current
 
-include $(BUILD_CTS_SUPPORT_PACKAGE)
+# Tag this module as a cts_v2 test artifact
+LOCAL_COMPATIBILITY_SUITE := cts_v2
+
+include $(BUILD_HOST_JAVA_LIBRARY)
\ No newline at end of file
diff --git a/libs/migration/src/com/android/cts/migration/MigrationHelper.java b/libs/migration/src/com/android/cts/migration/MigrationHelper.java
new file mode 100644
index 0000000..d940cde
--- /dev/null
+++ b/libs/migration/src/com/android/cts/migration/MigrationHelper.java
@@ -0,0 +1,56 @@
+package com.android.cts.migration;
+
+import com.android.tradefed.build.IBuildInfo;
+import com.android.tradefed.build.IFolderBuildInfo;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/**
+ * A temporary helper to enable tests to work with both cts v1 and v2.
+ */
+public class MigrationHelper {
+
+    private static final String COMPATIBILITY_BUILD_HELPER =
+            "com.android.compatibility.common.tradefed.build.CompatibilityBuildHelper";
+    private static final String CTS_BUILD_HELPER =
+            "com.android.cts.tradefed.build.CtsBuildHelper";
+
+    public static File getTestFile(IFolderBuildInfo mBuild, String filename)
+            throws FileNotFoundException {
+        try {
+            Class<?> cls = Class.forName(COMPATIBILITY_BUILD_HELPER);
+            Constructor<?> cons = cls.getConstructor(IFolderBuildInfo.class);
+            Object instance = cons.newInstance(mBuild);
+            Method method = cls.getMethod("getTestsDir");
+            File dir = (File) method.invoke(instance);
+            File file = new File(dir, filename);
+            if (file.exists()) {
+                return file;
+            }
+        } catch (ClassNotFoundException | NoSuchMethodException | InstantiationException |
+                IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+            // Ignore and fall back to CtsBuildHelper
+            e.printStackTrace();
+        }
+        try {
+            Class<?> cls = Class.forName(CTS_BUILD_HELPER);
+            Method builder = cls.getMethod("createBuildHelper", IBuildInfo.class);
+            Object helper = builder.invoke(null, mBuild);
+            Method method = cls.getMethod("getTestApp", String.class);
+            File file = (File) method.invoke(helper, filename);
+            if (file.exists()) {
+                return file;
+            }
+        } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException |
+                IllegalArgumentException | InvocationTargetException e) {
+            // Ignore
+            e.printStackTrace();
+        }
+        throw new FileNotFoundException("Couldn't load file " + filename);
+    }
+
+}
diff --git a/suite/cts/hostTests/Android.mk b/suite/cts/hostTests/Android.mk
deleted file mode 100644
index c141484..0000000
--- a/suite/cts/hostTests/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (C) 2012 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-include $(call all-subdir-makefiles)
diff --git a/suite/cts/hostTests/uihost/.gitignore b/suite/cts/hostTests/uihost/.gitignore
deleted file mode 100644
index 5e56e04..0000000
--- a/suite/cts/hostTests/uihost/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/bin
diff --git a/suite/cts/hostTests/uihost/appB/Android.mk b/suite/cts/hostTests/uihost/appB/Android.mk
deleted file mode 100644
index ebb36d2..0000000
--- a/suite/cts/hostTests/uihost/appB/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2012 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsDeviceTaskswitchingAppB
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/dram/jni/Android.mk b/tests/dram/jni/Android.mk
index 1a5f25c..a86d4da 100644
--- a/tests/dram/jni/Android.mk
+++ b/tests/dram/jni/Android.mk
@@ -26,9 +26,6 @@
 
 LOCAL_SHARED_LIBRARIES := libnativehelper
 
-# Tag this module as a cts_v2 test artifact
-LOCAL_COMPATIBILITY_SUITE := cts_v2
-
 LOCAL_SDK_VERSION := 14
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/suite/cts/deviceTests/jank2/Android.mk b/tests/jank/Android.mk
similarity index 88%
rename from suite/cts/deviceTests/jank2/Android.mk
rename to tests/jank/Android.mk
index c719693..46db307 100644
--- a/suite/cts/deviceTests/jank2/Android.mk
+++ b/tests/jank/Android.mk
@@ -22,7 +22,10 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := CtsJankTestCases
+LOCAL_PACKAGE_NAME := CtsJankDeviceTestCases
+
+# Tag this module as a cts_v2 test artifact
+LOCAL_COMPATIBILITY_SUITE := cts_v2
 
 LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil compatibility-device-util ctstestrunner ub-uiautomator ub-janktesthelper
 
diff --git a/suite/cts/deviceTests/jank2/AndroidManifest.xml b/tests/jank/AndroidManifest.xml
similarity index 91%
rename from suite/cts/deviceTests/jank2/AndroidManifest.xml
rename to tests/jank/AndroidManifest.xml
index a4c8337..cbb4cba 100644
--- a/suite/cts/deviceTests/jank2/AndroidManifest.xml
+++ b/tests/jank/AndroidManifest.xml
@@ -17,14 +17,14 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="android.cts.jank">
+        package="android.jank.cts">
 
   <application>
       <uses-library android:name="android.test.runner"/>
   </application>
 
   <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
-                   android:targetPackage="android.cts.jank"
+                   android:targetPackage="android.jank.cts"
                    android:label="Jank tests">
         <meta-data android:name="listener"
             android:value="com.android.cts.runner.CtsTestRunListener" />
diff --git a/suite/cts/deviceTests/jank2/OldAndroidTest.xml b/tests/jank/AndroidTest.xml
similarity index 60%
copy from suite/cts/deviceTests/jank2/OldAndroidTest.xml
copy to tests/jank/AndroidTest.xml
index 2fbbac7..1a08f4f 100644
--- a/suite/cts/deviceTests/jank2/OldAndroidTest.xml
+++ b/tests/jank/AndroidTest.xml
@@ -13,7 +13,12 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="CTS Jank test config">
+<configuration description="Config for CTS Jank Test Cases">
     <include name="common-config" />
-    <option name="cts-apk-installer:test-file-name" value="CtsDeviceUi.apk" />
+    <option name="apk-installer:test-file-name" value="CtsUiDeviceTestCases.apk" />
+    <option name="apk-installer:test-file-name" value="CtsJankDeviceTestCases.apk" />
+    <test class="com.android.tradefed.testtype.InstrumentationTest" >
+        <option name="package" value="android.jank.cts" />
+        <option name="runner" value="android.support.test.runner.AndroidJUnitRunner" />
+    </test>
 </configuration>
diff --git a/suite/cts/deviceTests/jank2/OldAndroidTest.xml b/tests/jank/OldAndroidTest.xml
similarity index 82%
copy from suite/cts/deviceTests/jank2/OldAndroidTest.xml
copy to tests/jank/OldAndroidTest.xml
index 2fbbac7..633f650 100644
--- a/suite/cts/deviceTests/jank2/OldAndroidTest.xml
+++ b/tests/jank/OldAndroidTest.xml
@@ -13,7 +13,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="CTS Jank test config">
+<configuration description="Config for CTS Jank Test Cases">
     <include name="common-config" />
-    <option name="cts-apk-installer:test-file-name" value="CtsDeviceUi.apk" />
+    <option name="cts-apk-installer:test-file-name" value="CtsUiDeviceTestCases.apk" />
 </configuration>
diff --git a/suite/cts/deviceTests/jank2/src/android/cts/jank/CtsJankTestBase.java b/tests/jank/src/android/jank/cts/CtsJankTestBase.java
similarity index 98%
rename from suite/cts/deviceTests/jank2/src/android/cts/jank/CtsJankTestBase.java
rename to tests/jank/src/android/jank/cts/CtsJankTestBase.java
index c936a8b..fb2f867 100644
--- a/suite/cts/deviceTests/jank2/src/android/cts/jank/CtsJankTestBase.java
+++ b/tests/jank/src/android/jank/cts/CtsJankTestBase.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.cts.jank;
+package android.jank.cts;
 
 import android.os.Bundle;
 import android.support.test.jank.JankTestBase;
diff --git a/suite/cts/deviceTests/jank2/src/android/cts/jank/ui/CtsDeviceJankUi.java b/tests/jank/src/android/jank/cts/ui/CtsDeviceJankUi.java
similarity index 94%
rename from suite/cts/deviceTests/jank2/src/android/cts/jank/ui/CtsDeviceJankUi.java
rename to tests/jank/src/android/jank/cts/ui/CtsDeviceJankUi.java
index 884f83c..2e389d7 100644
--- a/suite/cts/deviceTests/jank2/src/android/cts/jank/ui/CtsDeviceJankUi.java
+++ b/tests/jank/src/android/jank/cts/ui/CtsDeviceJankUi.java
@@ -12,11 +12,11 @@
  * the License.
  */
 
-package android.cts.jank.ui;
+package android.jank.cts.ui;
 
 import android.content.ComponentName;
 import android.content.Intent;
-import android.cts.jank.CtsJankTestBase;
+import android.jank.cts.CtsJankTestBase;
 import android.os.SystemClock;
 import android.support.test.jank.JankTest;
 import android.support.test.jank.WindowContentFrameStatsMonitor;
@@ -31,7 +31,7 @@
     private final static int NUM_ELEMENTS = 1000;
     private static final long DEFAULT_ANIMATION_TIME = 2 * 1000;
     private static final long POST_SCROLL_IDLE_TIME = 2 *1000;
-    private final static String PACKAGE = "com.android.cts.ui";
+    private final static String PACKAGE = "android.ui.cts";
     private final static String CLASS = PACKAGE + ".ScrollingActivity";
 
     @Override
diff --git a/suite/cts/deviceTests/opengl/Android.mk b/tests/openglperf2/Android.mk
similarity index 89%
rename from suite/cts/deviceTests/opengl/Android.mk
rename to tests/openglperf2/Android.mk
index 3aada1b..a0488c2 100644
--- a/suite/cts/deviceTests/opengl/Android.mk
+++ b/tests/openglperf2/Android.mk
@@ -27,7 +27,10 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := CtsDeviceOpenGl
+LOCAL_PACKAGE_NAME := CtsOpenGlPerf2TestCases
+
+# Tag this module as a cts_v2 test artifact
+LOCAL_COMPATIBILITY_SUITE := cts_v2
 
 LOCAL_SDK_VERSION := 16
 
diff --git a/suite/cts/deviceTests/opengl/AndroidManifest.xml b/tests/openglperf2/AndroidManifest.xml
similarity index 92%
rename from suite/cts/deviceTests/opengl/AndroidManifest.xml
rename to tests/openglperf2/AndroidManifest.xml
index 05fb5be..b1051a4d 100644
--- a/suite/cts/deviceTests/opengl/AndroidManifest.xml
+++ b/tests/openglperf2/AndroidManifest.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.android.cts.opengl"
+    package="android.opengl2.cts"
     android:versionCode="1"
     android:versionName="1.0" >
 
@@ -47,7 +47,7 @@
 
     <instrumentation
         android:name="android.support.test.runner.AndroidJUnitRunner"
-        android:label="OpenGL ES 2.0 Benchmark"
-        android:targetPackage="com.android.cts.opengl" />
+        android:label="OpenGL ES Benchmark"
+        android:targetPackage="android.opengl2.cts" />
 
 </manifest>
\ No newline at end of file
diff --git a/suite/cts/deviceTests/jank2/OldAndroidTest.xml b/tests/openglperf2/AndroidTest.xml
similarity index 65%
copy from suite/cts/deviceTests/jank2/OldAndroidTest.xml
copy to tests/openglperf2/AndroidTest.xml
index 2fbbac7..2bae240 100644
--- a/suite/cts/deviceTests/jank2/OldAndroidTest.xml
+++ b/tests/openglperf2/AndroidTest.xml
@@ -13,7 +13,11 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="CTS Jank test config">
+<configuration description="Configuration for Location2 Tests">
     <include name="common-config" />
-    <option name="cts-apk-installer:test-file-name" value="CtsDeviceUi.apk" />
+    <option name="apk-installer:test-file-name" value="CtsOpenGlPerf2TestCases.apk" />
+    <test class="com.android.tradefed.testtype.InstrumentationTest" >
+        <option name="package" value="android.opengl2.cts" />
+        <option name="runner" value="android.support.test.runner.AndroidJUnitRunner" />
+    </test>
 </configuration>
diff --git a/suite/cts/deviceTests/opengl/README b/tests/openglperf2/README
similarity index 100%
rename from suite/cts/deviceTests/opengl/README
rename to tests/openglperf2/README
diff --git a/suite/cts/deviceTests/opengl/assets/fragment/basic b/tests/openglperf2/assets/fragment/basic
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/fragment/basic
rename to tests/openglperf2/assets/fragment/basic
diff --git a/suite/cts/deviceTests/opengl/assets/fragment/blur b/tests/openglperf2/assets/fragment/blur
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/fragment/blur
rename to tests/openglperf2/assets/fragment/blur
diff --git a/suite/cts/deviceTests/opengl/assets/fragment/perspective b/tests/openglperf2/assets/fragment/perspective
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/fragment/perspective
rename to tests/openglperf2/assets/fragment/perspective
diff --git a/suite/cts/deviceTests/opengl/assets/fragment/water b/tests/openglperf2/assets/fragment/water
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/fragment/water
rename to tests/openglperf2/assets/fragment/water
diff --git a/suite/cts/deviceTests/opengl/assets/mesh/arc.cob b/tests/openglperf2/assets/mesh/arc.cob
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/mesh/arc.cob
rename to tests/openglperf2/assets/mesh/arc.cob
Binary files differ
diff --git a/suite/cts/deviceTests/opengl/assets/mesh/fish.cob b/tests/openglperf2/assets/mesh/fish.cob
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/mesh/fish.cob
rename to tests/openglperf2/assets/mesh/fish.cob
Binary files differ
diff --git a/suite/cts/deviceTests/opengl/assets/mesh/plane.cob b/tests/openglperf2/assets/mesh/plane.cob
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/mesh/plane.cob
rename to tests/openglperf2/assets/mesh/plane.cob
Binary files differ
diff --git a/suite/cts/deviceTests/opengl/assets/texture/arc.png b/tests/openglperf2/assets/texture/arc.png
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/texture/arc.png
rename to tests/openglperf2/assets/texture/arc.png
Binary files differ
diff --git a/suite/cts/deviceTests/opengl/assets/texture/background.png b/tests/openglperf2/assets/texture/background.png
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/texture/background.png
rename to tests/openglperf2/assets/texture/background.png
Binary files differ
diff --git a/suite/cts/deviceTests/opengl/assets/texture/fish.png b/tests/openglperf2/assets/texture/fish.png
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/texture/fish.png
rename to tests/openglperf2/assets/texture/fish.png
Binary files differ
diff --git a/suite/cts/deviceTests/opengl/assets/texture/fish_dark.png b/tests/openglperf2/assets/texture/fish_dark.png
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/texture/fish_dark.png
rename to tests/openglperf2/assets/texture/fish_dark.png
Binary files differ
diff --git a/suite/cts/deviceTests/opengl/assets/texture/water1.png b/tests/openglperf2/assets/texture/water1.png
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/texture/water1.png
rename to tests/openglperf2/assets/texture/water1.png
Binary files differ
diff --git a/suite/cts/deviceTests/opengl/assets/texture/water2.png b/tests/openglperf2/assets/texture/water2.png
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/texture/water2.png
rename to tests/openglperf2/assets/texture/water2.png
Binary files differ
diff --git a/suite/cts/deviceTests/opengl/assets/vertex/basic b/tests/openglperf2/assets/vertex/basic
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/vertex/basic
rename to tests/openglperf2/assets/vertex/basic
diff --git a/suite/cts/deviceTests/opengl/assets/vertex/blur b/tests/openglperf2/assets/vertex/blur
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/vertex/blur
rename to tests/openglperf2/assets/vertex/blur
diff --git a/suite/cts/deviceTests/opengl/assets/vertex/perspective b/tests/openglperf2/assets/vertex/perspective
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/vertex/perspective
rename to tests/openglperf2/assets/vertex/perspective
diff --git a/suite/cts/deviceTests/opengl/assets/vertex/water b/tests/openglperf2/assets/vertex/water
similarity index 100%
rename from suite/cts/deviceTests/opengl/assets/vertex/water
rename to tests/openglperf2/assets/vertex/water
diff --git a/suite/cts/deviceTests/opengl/cob_exporter.py b/tests/openglperf2/cob_exporter.py
similarity index 100%
rename from suite/cts/deviceTests/opengl/cob_exporter.py
rename to tests/openglperf2/cob_exporter.py
diff --git a/suite/cts/deviceTests/opengl/jni/Android.mk b/tests/openglperf2/jni/Android.mk
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/Android.mk
rename to tests/openglperf2/jni/Android.mk
diff --git a/suite/cts/deviceTests/opengl/jni/Trace.h b/tests/openglperf2/jni/Trace.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/Trace.h
rename to tests/openglperf2/jni/Trace.h
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/GLUtils.cpp b/tests/openglperf2/jni/graphics/GLUtils.cpp
similarity index 98%
rename from suite/cts/deviceTests/opengl/jni/graphics/GLUtils.cpp
rename to tests/openglperf2/jni/graphics/GLUtils.cpp
index ea166a1..7786447 100644
--- a/suite/cts/deviceTests/opengl/jni/graphics/GLUtils.cpp
+++ b/tests/openglperf2/jni/graphics/GLUtils.cpp
@@ -59,7 +59,7 @@
 
 GLuint GLUtils::loadTexture(const char* path) {
     GLuint textureId = 0;
-    jclass activityClass = sEnv->FindClass("com/android/cts/opengl/reference/GLGameActivity");
+    jclass activityClass = sEnv->FindClass("android/opengl2/cts/reference/GLGameActivity");
     if (activityClass == NULL) {
         ALOGE("Couldn't find activity class");
         return -1;
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/GLUtils.h b/tests/openglperf2/jni/graphics/GLUtils.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/GLUtils.h
rename to tests/openglperf2/jni/graphics/GLUtils.h
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/Matrix.cpp b/tests/openglperf2/jni/graphics/Matrix.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/Matrix.cpp
rename to tests/openglperf2/jni/graphics/Matrix.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/Matrix.h b/tests/openglperf2/jni/graphics/Matrix.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/Matrix.h
rename to tests/openglperf2/jni/graphics/Matrix.h
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/Mesh.cpp b/tests/openglperf2/jni/graphics/Mesh.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/Mesh.cpp
rename to tests/openglperf2/jni/graphics/Mesh.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/Mesh.h b/tests/openglperf2/jni/graphics/Mesh.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/Mesh.h
rename to tests/openglperf2/jni/graphics/Mesh.h
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/MeshNode.cpp b/tests/openglperf2/jni/graphics/MeshNode.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/MeshNode.cpp
rename to tests/openglperf2/jni/graphics/MeshNode.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/MeshNode.h b/tests/openglperf2/jni/graphics/MeshNode.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/MeshNode.h
rename to tests/openglperf2/jni/graphics/MeshNode.h
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/PerspectiveMeshNode.cpp b/tests/openglperf2/jni/graphics/PerspectiveMeshNode.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/PerspectiveMeshNode.cpp
rename to tests/openglperf2/jni/graphics/PerspectiveMeshNode.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/PerspectiveMeshNode.h b/tests/openglperf2/jni/graphics/PerspectiveMeshNode.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/PerspectiveMeshNode.h
rename to tests/openglperf2/jni/graphics/PerspectiveMeshNode.h
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/PerspectiveProgram.cpp b/tests/openglperf2/jni/graphics/PerspectiveProgram.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/PerspectiveProgram.cpp
rename to tests/openglperf2/jni/graphics/PerspectiveProgram.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/PerspectiveProgram.h b/tests/openglperf2/jni/graphics/PerspectiveProgram.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/PerspectiveProgram.h
rename to tests/openglperf2/jni/graphics/PerspectiveProgram.h
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/Program.cpp b/tests/openglperf2/jni/graphics/Program.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/Program.cpp
rename to tests/openglperf2/jni/graphics/Program.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/Program.h b/tests/openglperf2/jni/graphics/Program.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/Program.h
rename to tests/openglperf2/jni/graphics/Program.h
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/ProgramNode.cpp b/tests/openglperf2/jni/graphics/ProgramNode.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/ProgramNode.cpp
rename to tests/openglperf2/jni/graphics/ProgramNode.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/ProgramNode.h b/tests/openglperf2/jni/graphics/ProgramNode.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/ProgramNode.h
rename to tests/openglperf2/jni/graphics/ProgramNode.h
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/Renderer.cpp b/tests/openglperf2/jni/graphics/Renderer.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/Renderer.cpp
rename to tests/openglperf2/jni/graphics/Renderer.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/Renderer.h b/tests/openglperf2/jni/graphics/Renderer.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/Renderer.h
rename to tests/openglperf2/jni/graphics/Renderer.h
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.cpp b/tests/openglperf2/jni/graphics/SceneGraphNode.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.cpp
rename to tests/openglperf2/jni/graphics/SceneGraphNode.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.h b/tests/openglperf2/jni/graphics/SceneGraphNode.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/SceneGraphNode.h
rename to tests/openglperf2/jni/graphics/SceneGraphNode.h
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/TexturedMeshNode.cpp b/tests/openglperf2/jni/graphics/TexturedMeshNode.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/TexturedMeshNode.cpp
rename to tests/openglperf2/jni/graphics/TexturedMeshNode.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/TexturedMeshNode.h b/tests/openglperf2/jni/graphics/TexturedMeshNode.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/TexturedMeshNode.h
rename to tests/openglperf2/jni/graphics/TexturedMeshNode.h
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/TransformationNode.cpp b/tests/openglperf2/jni/graphics/TransformationNode.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/TransformationNode.cpp
rename to tests/openglperf2/jni/graphics/TransformationNode.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/TransformationNode.h b/tests/openglperf2/jni/graphics/TransformationNode.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/TransformationNode.h
rename to tests/openglperf2/jni/graphics/TransformationNode.h
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/Vector2D.cpp b/tests/openglperf2/jni/graphics/Vector2D.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/Vector2D.cpp
rename to tests/openglperf2/jni/graphics/Vector2D.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/graphics/Vector2D.h b/tests/openglperf2/jni/graphics/Vector2D.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/graphics/Vector2D.h
rename to tests/openglperf2/jni/graphics/Vector2D.h
diff --git a/suite/cts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp b/tests/openglperf2/jni/primitive/GLPrimitive.cpp
similarity index 94%
rename from suite/cts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp
rename to tests/openglperf2/jni/primitive/GLPrimitive.cpp
index 856da1e..825cadf 100644
--- a/suite/cts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp
+++ b/tests/openglperf2/jni/primitive/GLPrimitive.cpp
@@ -38,7 +38,7 @@
 };
 
 extern "C" JNIEXPORT jboolean JNICALL
-Java_com_android_cts_opengl_primitive_GLPrimitiveActivity_startBenchmark(
+Java_android_opengl2_cts_primitive_GLPrimitiveActivity_startBenchmark(
         JNIEnv* env, jclass /*clazz*/, jint workload, jint numFrames, jdoubleArray frameTimes) {
     if (gRenderer == NULL) {
         return false;
@@ -74,7 +74,7 @@
 
 // The following functions create the renderers for the various benchmarks.
 extern "C" JNIEXPORT void JNICALL
-Java_com_android_cts_opengl_primitive_GLPrimitiveActivity_setupBenchmark(
+Java_android_opengl2_cts_primitive_GLPrimitiveActivity_setupBenchmark(
         JNIEnv* env, jclass /*clazz*/, jobject surface, jint benchmark,
         jboolean offscreen) {
     gNativeWindow = ANativeWindow_fromSurface(env, surface);
@@ -109,7 +109,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL
-Java_com_android_cts_opengl_primitive_GLPrimitiveActivity_tearDownBenchmark(
+Java_android_opengl2_cts_primitive_GLPrimitiveActivity_tearDownBenchmark(
         JNIEnv* /*env*/, jclass /*clazz*/) {
     if (gRenderer == NULL) {
         return;
diff --git a/suite/cts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.cpp b/tests/openglperf2/jni/primitive/contextswitch/ContextSwitchRenderer.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.cpp
rename to tests/openglperf2/jni/primitive/contextswitch/ContextSwitchRenderer.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.h b/tests/openglperf2/jni/primitive/contextswitch/ContextSwitchRenderer.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.h
rename to tests/openglperf2/jni/primitive/contextswitch/ContextSwitchRenderer.h
diff --git a/suite/cts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.cpp b/tests/openglperf2/jni/primitive/fullpipeline/FullPipelineRenderer.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.cpp
rename to tests/openglperf2/jni/primitive/fullpipeline/FullPipelineRenderer.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.h b/tests/openglperf2/jni/primitive/fullpipeline/FullPipelineRenderer.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.h
rename to tests/openglperf2/jni/primitive/fullpipeline/FullPipelineRenderer.h
diff --git a/suite/cts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.cpp b/tests/openglperf2/jni/primitive/pixeloutput/PixelOutputRenderer.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.cpp
rename to tests/openglperf2/jni/primitive/pixeloutput/PixelOutputRenderer.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.h b/tests/openglperf2/jni/primitive/pixeloutput/PixelOutputRenderer.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.h
rename to tests/openglperf2/jni/primitive/pixeloutput/PixelOutputRenderer.h
diff --git a/suite/cts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.cpp b/tests/openglperf2/jni/primitive/shaderperf/ShaderPerfRenderer.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.cpp
rename to tests/openglperf2/jni/primitive/shaderperf/ShaderPerfRenderer.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.h b/tests/openglperf2/jni/primitive/shaderperf/ShaderPerfRenderer.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.h
rename to tests/openglperf2/jni/primitive/shaderperf/ShaderPerfRenderer.h
diff --git a/suite/cts/deviceTests/opengl/jni/reference/GLReference.cpp b/tests/openglperf2/jni/reference/GLReference.cpp
similarity index 96%
rename from suite/cts/deviceTests/opengl/jni/reference/GLReference.cpp
rename to tests/openglperf2/jni/reference/GLReference.cpp
index dc0b4e2..9af018a 100644
--- a/suite/cts/deviceTests/opengl/jni/reference/GLReference.cpp
+++ b/tests/openglperf2/jni/reference/GLReference.cpp
@@ -22,7 +22,7 @@
 #include "ReferenceRenderer.h"
 
 extern "C" JNIEXPORT jboolean JNICALL
-Java_com_android_cts_opengl_reference_GLGameActivity_startBenchmark(
+Java_android_opengl2_cts_reference_GLGameActivity_startBenchmark(
     JNIEnv* env, jclass /*clazz*/, jobject assetManager, jobject surface, jint numFrames,
         jdoubleArray setUpTimes, jdoubleArray updateTimes, jdoubleArray renderTimes) {
 
diff --git a/suite/cts/deviceTests/opengl/jni/reference/ReferenceRenderer.cpp b/tests/openglperf2/jni/reference/ReferenceRenderer.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/ReferenceRenderer.cpp
rename to tests/openglperf2/jni/reference/ReferenceRenderer.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/reference/ReferenceRenderer.h b/tests/openglperf2/jni/reference/ReferenceRenderer.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/ReferenceRenderer.h
rename to tests/openglperf2/jni/reference/ReferenceRenderer.h
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/Scene.cpp b/tests/openglperf2/jni/reference/scene/Scene.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/scene/Scene.cpp
rename to tests/openglperf2/jni/reference/scene/Scene.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/Scene.h b/tests/openglperf2/jni/reference/scene/Scene.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/scene/Scene.h
rename to tests/openglperf2/jni/reference/scene/Scene.h
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/Boid.cpp b/tests/openglperf2/jni/reference/scene/flocking/Boid.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/scene/flocking/Boid.cpp
rename to tests/openglperf2/jni/reference/scene/flocking/Boid.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/Boid.h b/tests/openglperf2/jni/reference/scene/flocking/Boid.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/scene/flocking/Boid.h
rename to tests/openglperf2/jni/reference/scene/flocking/Boid.h
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.cpp b/tests/openglperf2/jni/reference/scene/flocking/FlockingScene.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.cpp
rename to tests/openglperf2/jni/reference/scene/flocking/FlockingScene.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.h b/tests/openglperf2/jni/reference/scene/flocking/FlockingScene.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.h
rename to tests/openglperf2/jni/reference/scene/flocking/FlockingScene.h
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/WaterMeshNode.cpp b/tests/openglperf2/jni/reference/scene/flocking/WaterMeshNode.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/scene/flocking/WaterMeshNode.cpp
rename to tests/openglperf2/jni/reference/scene/flocking/WaterMeshNode.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/WaterMeshNode.h b/tests/openglperf2/jni/reference/scene/flocking/WaterMeshNode.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/scene/flocking/WaterMeshNode.h
rename to tests/openglperf2/jni/reference/scene/flocking/WaterMeshNode.h
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/glowing/BlurMeshNode.cpp b/tests/openglperf2/jni/reference/scene/glowing/BlurMeshNode.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/scene/glowing/BlurMeshNode.cpp
rename to tests/openglperf2/jni/reference/scene/glowing/BlurMeshNode.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/glowing/BlurMeshNode.h b/tests/openglperf2/jni/reference/scene/glowing/BlurMeshNode.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/scene/glowing/BlurMeshNode.h
rename to tests/openglperf2/jni/reference/scene/glowing/BlurMeshNode.h
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.cpp b/tests/openglperf2/jni/reference/scene/glowing/GlowingScene.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.cpp
rename to tests/openglperf2/jni/reference/scene/glowing/GlowingScene.cpp
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.h b/tests/openglperf2/jni/reference/scene/glowing/GlowingScene.h
similarity index 100%
rename from suite/cts/deviceTests/opengl/jni/reference/scene/glowing/GlowingScene.h
rename to tests/openglperf2/jni/reference/scene/glowing/GlowingScene.h
diff --git a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/GLActivityIntentKeys.java b/tests/openglperf2/src/android/opengl2/cts/GLActivityIntentKeys.java
similarity index 97%
rename from suite/cts/deviceTests/opengl/src/com/android/cts/opengl/GLActivityIntentKeys.java
rename to tests/openglperf2/src/android/opengl2/cts/GLActivityIntentKeys.java
index 9a29caf..fcd5f1a 100644
--- a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/GLActivityIntentKeys.java
+++ b/tests/openglperf2/src/android/opengl2/cts/GLActivityIntentKeys.java
@@ -11,7 +11,7 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.cts.opengl;
+package android.opengl2.cts;
 
 public class GLActivityIntentKeys {
     /**
diff --git a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/BenchmarkName.java b/tests/openglperf2/src/android/opengl2/cts/primitive/BenchmarkName.java
similarity index 94%
rename from suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/BenchmarkName.java
rename to tests/openglperf2/src/android/opengl2/cts/primitive/BenchmarkName.java
index a6bd6db..02acfdc 100644
--- a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/BenchmarkName.java
+++ b/tests/openglperf2/src/android/opengl2/cts/primitive/BenchmarkName.java
@@ -11,7 +11,7 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.cts.opengl.primitive;
+package android.opengl2.cts.primitive;
 
 /**
  * Represents the different primitive benchmarks.
diff --git a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/GLPrimitiveActivity.java b/tests/openglperf2/src/android/opengl2/cts/primitive/GLPrimitiveActivity.java
similarity index 97%
rename from suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/GLPrimitiveActivity.java
rename to tests/openglperf2/src/android/opengl2/cts/primitive/GLPrimitiveActivity.java
index 6defdb7..6558786 100644
--- a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/GLPrimitiveActivity.java
+++ b/tests/openglperf2/src/android/opengl2/cts/primitive/GLPrimitiveActivity.java
@@ -11,18 +11,17 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.cts.opengl.primitive;
+package android.opengl2.cts.primitive;
 
 import android.app.Activity;
 import android.content.Intent;
 import android.cts.util.WatchDog;
+import android.opengl2.cts.GLActivityIntentKeys;
 import android.os.Bundle;
 import android.util.Log;
+import android.view.Surface;
 import android.view.SurfaceHolder;
 import android.view.SurfaceView;
-import android.view.Surface;
-
-import com.android.cts.opengl.GLActivityIntentKeys;
 
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Semaphore;
diff --git a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/GLPrimitiveBenchmark.java b/tests/openglperf2/src/android/opengl2/cts/primitive/GLPrimitiveBenchmark.java
similarity index 97%
rename from suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/GLPrimitiveBenchmark.java
rename to tests/openglperf2/src/android/opengl2/cts/primitive/GLPrimitiveBenchmark.java
index 171776b..d737dbf 100644
--- a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/primitive/GLPrimitiveBenchmark.java
+++ b/tests/openglperf2/src/android/opengl2/cts/primitive/GLPrimitiveBenchmark.java
@@ -11,15 +11,15 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.cts.opengl.primitive;
+package android.opengl2.cts.primitive;
 
 import android.content.Intent;
+import android.opengl2.cts.GLActivityIntentKeys;
 import android.test.ActivityInstrumentationTestCase2;
 
 import com.android.compatibility.common.util.DeviceReportLog;
 import com.android.compatibility.common.util.ResultType;
 import com.android.compatibility.common.util.ResultUnit;
-import com.android.cts.opengl.GLActivityIntentKeys;
 import com.android.cts.util.TimeoutReq;
 
 /**
diff --git a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLGameActivity.java b/tests/openglperf2/src/android/opengl2/cts/reference/GLGameActivity.java
similarity index 97%
rename from suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLGameActivity.java
rename to tests/openglperf2/src/android/opengl2/cts/reference/GLGameActivity.java
index 3b310f9..0bfb38b 100644
--- a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLGameActivity.java
+++ b/tests/openglperf2/src/android/opengl2/cts/reference/GLGameActivity.java
@@ -11,9 +11,7 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.cts.opengl.reference;
-
-import com.android.cts.opengl.GLActivityIntentKeys;
+package android.opengl2.cts.reference;
 
 import android.app.Activity;
 import android.content.Intent;
@@ -23,6 +21,7 @@
 import android.graphics.BitmapFactory;
 import android.opengl.GLES20;
 import android.opengl.GLUtils;
+import android.opengl2.cts.GLActivityIntentKeys;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
@@ -75,6 +74,7 @@
 
         // Spawns a worker.
         Worker worker = new Worker(new Handler() {
+            @Override
             public void handleMessage(Message msg) {
                 Intent intent = new Intent();
                 intent.putExtra(SET_UP_TIME, mSetUpTimes);
@@ -135,6 +135,7 @@
             mHandler.sendEmptyMessage((success) ? 1 : 0);
         }
 
+        @Override
         public void onTimeout() {
             mHandler.sendEmptyMessage(0);
         }
diff --git a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLReferenceActivity.java b/tests/openglperf2/src/android/opengl2/cts/reference/GLReferenceActivity.java
similarity index 96%
rename from suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLReferenceActivity.java
rename to tests/openglperf2/src/android/opengl2/cts/reference/GLReferenceActivity.java
index 8d34535..7a800a5 100644
--- a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLReferenceActivity.java
+++ b/tests/openglperf2/src/android/opengl2/cts/reference/GLReferenceActivity.java
@@ -11,12 +11,11 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.cts.opengl.reference;
-
-import com.android.cts.opengl.GLActivityIntentKeys;
+package android.opengl2.cts.reference;
 
 import android.app.Activity;
 import android.content.Intent;
+import android.opengl2.cts.GLActivityIntentKeys;
 import android.os.Bundle;
 
 import java.util.concurrent.Semaphore;
diff --git a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLReferenceBenchmark.java b/tests/openglperf2/src/android/opengl2/cts/reference/GLReferenceBenchmark.java
similarity index 96%
rename from suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLReferenceBenchmark.java
rename to tests/openglperf2/src/android/opengl2/cts/reference/GLReferenceBenchmark.java
index 2d2238a..196207c 100644
--- a/suite/cts/deviceTests/opengl/src/com/android/cts/opengl/reference/GLReferenceBenchmark.java
+++ b/tests/openglperf2/src/android/opengl2/cts/reference/GLReferenceBenchmark.java
@@ -11,19 +11,17 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.android.cts.opengl.reference;
+package android.opengl2.cts.reference;
+
+import android.content.Intent;
+import android.opengl2.cts.GLActivityIntentKeys;
+import android.test.ActivityInstrumentationTestCase2;
 
 import com.android.compatibility.common.util.DeviceReportLog;
 import com.android.compatibility.common.util.ResultType;
 import com.android.compatibility.common.util.ResultUnit;
-import com.android.cts.opengl.GLActivityIntentKeys;
-
-import android.test.ActivityInstrumentationTestCase2;
-
 import com.android.cts.util.TimeoutReq;
 
-import android.content.Intent;
-
 /**
  * Runs the Reference OpenGL ES 2.0 Benchmark.
  */
diff --git a/suite/cts/deviceTests/opengl/test/Android.mk b/tests/openglperf2/test/Android.mk
similarity index 100%
rename from suite/cts/deviceTests/opengl/test/Android.mk
rename to tests/openglperf2/test/Android.mk
diff --git a/suite/cts/deviceTests/opengl/test/MatrixTest.cpp b/tests/openglperf2/test/MatrixTest.cpp
similarity index 100%
rename from suite/cts/deviceTests/opengl/test/MatrixTest.cpp
rename to tests/openglperf2/test/MatrixTest.cpp
diff --git a/suite/cts/deviceTests/ui/Android.mk b/tests/ui/Android.mk
similarity index 88%
rename from suite/cts/deviceTests/ui/Android.mk
rename to tests/ui/Android.mk
index 5b5c8f9..e77f035 100644
--- a/suite/cts/deviceTests/ui/Android.mk
+++ b/tests/ui/Android.mk
@@ -24,7 +24,10 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := CtsDeviceUi
+LOCAL_PACKAGE_NAME := CtsUiDeviceTestCases
+
+# Tag this module as a cts_v2 test artifact
+LOCAL_COMPATIBILITY_SUITE := cts_v2
 
 LOCAL_SDK_VERSION := 16
 
diff --git a/suite/cts/deviceTests/ui/AndroidManifest.xml b/tests/ui/AndroidManifest.xml
similarity index 94%
rename from suite/cts/deviceTests/ui/AndroidManifest.xml
rename to tests/ui/AndroidManifest.xml
index b41008e7..5ed06b4 100644
--- a/suite/cts/deviceTests/ui/AndroidManifest.xml
+++ b/tests/ui/AndroidManifest.xml
@@ -16,7 +16,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.android.cts.ui" >
+    package="android.ui.cts" >
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -38,7 +38,7 @@
     <instrumentation
         android:name="android.support.test.runner.AndroidJUnitRunner"
         android:label="UI Latency measurement"
-        android:targetPackage="com.android.cts.ui" >
+        android:targetPackage="android.ui.cts" >
         <meta-data
             android:name="listener"
             android:value="com.android.cts.runner.CtsTestRunListener" />
diff --git a/suite/cts/deviceTests/jank2/OldAndroidTest.xml b/tests/ui/AndroidTest.xml
similarity index 65%
copy from suite/cts/deviceTests/jank2/OldAndroidTest.xml
copy to tests/ui/AndroidTest.xml
index 2fbbac7..2335d46 100644
--- a/suite/cts/deviceTests/jank2/OldAndroidTest.xml
+++ b/tests/ui/AndroidTest.xml
@@ -13,7 +13,11 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="CTS Jank test config">
+<configuration description="Config for CTS UI Test Cases">
     <include name="common-config" />
-    <option name="cts-apk-installer:test-file-name" value="CtsDeviceUi.apk" />
+    <option name="apk-installer:test-file-name" value="CtsUiDeviceTestCases.apk" />
+    <test class="com.android.tradefed.testtype.InstrumentationTest" >
+        <option name="package" value="android.ui.cts" />
+        <option name="runner" value="android.support.test.runner.AndroidJUnitRunner" />
+    </test>
 </configuration>
diff --git a/suite/cts/deviceTests/ui/src/com/android/cts/ui/ScrollingActivity.java b/tests/ui/src/android/ui/cts/ScrollingActivity.java
similarity index 98%
rename from suite/cts/deviceTests/ui/src/com/android/cts/ui/ScrollingActivity.java
rename to tests/ui/src/android/ui/cts/ScrollingActivity.java
index 2229e97..d5fc4b0 100644
--- a/suite/cts/deviceTests/ui/src/com/android/cts/ui/ScrollingActivity.java
+++ b/tests/ui/src/android/ui/cts/ScrollingActivity.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.cts.ui;
+package android.ui.cts;
 
 import android.app.ListActivity;
 import android.os.Bundle;
diff --git a/suite/cts/deviceTests/ui/src/com/android/cts/ui/ScrollingTest.java b/tests/ui/src/android/ui/cts/ScrollingTest.java
similarity index 98%
rename from suite/cts/deviceTests/ui/src/com/android/cts/ui/ScrollingTest.java
rename to tests/ui/src/android/ui/cts/ScrollingTest.java
index 7f8d025..4902807 100644
--- a/suite/cts/deviceTests/ui/src/com/android/cts/ui/ScrollingTest.java
+++ b/tests/ui/src/android/ui/cts/ScrollingTest.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.cts.ui;
+package android.ui.cts;
 
 import android.test.ActivityInstrumentationTestCase2;