Merge "Add documents UI CTS test to MTS." into qt-dev
am: a6c3f14e8b

Change-Id: I39bd610d108edcf7e2861247ad50a7eb742bf860
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
index aca54cd..39a0f35 100644
--- a/PREUPLOAD.cfg
+++ b/PREUPLOAD.cfg
@@ -13,6 +13,7 @@
                       tests/autofillservice/
                       tests/contentcaptureservice/
                       tests/tests/animation/
+                      tests/tests/carrierapi/
                       tests/tests/content/
                       tests/tests/graphics/
                       tests/tests/hardware/
@@ -20,6 +21,11 @@
                       tests/tests/permission/
                       tests/tests/preference/
                       tests/tests/print/
+                      tests/tests/telephony/
+                      tests/tests/telephony2/
+                      tests/tests/telephony3/
+                      tests/tests/telephony4/
+                      tests/tests/telephonyprovider/
                       tests/tests/text/
                       tests/tests/theme/
                       tests/tests/transition/
diff --git a/apps/CtsVerifier/Android.bp b/apps/CtsVerifier/Android.bp
new file mode 100644
index 0000000..01c579e
--- /dev/null
+++ b/apps/CtsVerifier/Android.bp
@@ -0,0 +1,4 @@
+filegroup {
+    name: "CtsVerifierMockVrListenerServiceFiles",
+    srcs: ["src/com/android/cts/verifier/vr/MockVrListenerService.java"],
+}
diff --git a/apps/CtsVerifier/jni/Android.mk b/apps/CtsVerifier/jni/Android.mk
deleted file mode 100644
index 4343259..0000000
--- a/apps/CtsVerifier/jni/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (C) 2010 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/apps/CtsVerifier/jni/audio_loopback/Android.bp b/apps/CtsVerifier/jni/audio_loopback/Android.bp
new file mode 100644
index 0000000..9227c75
--- /dev/null
+++ b/apps/CtsVerifier/jni/audio_loopback/Android.bp
@@ -0,0 +1,21 @@
+cc_test_library {
+    name: "libaudioloopback_jni",
+    srcs: [
+        "sles.cpp",
+        "jni_sles.c",
+        "audio_utils/atomic.c",
+        "audio_utils/fifo.c",
+        "audio_utils/roundup.c",
+    ],
+    shared_libs: [
+        "libOpenSLES",
+        "liblog",
+    ],
+    ldflags: ["-Wl,--hash-style=sysv"],
+    cflags: [
+        "-DSTDC_HEADERS",
+        "-Werror",
+        "-Wall",
+    ],
+    sdk_version: "23",
+}
diff --git a/apps/CtsVerifier/jni/audio_loopback/Android.mk b/apps/CtsVerifier/jni/audio_loopback/Android.mk
deleted file mode 100644
index 0223e4f..0000000
--- a/apps/CtsVerifier/jni/audio_loopback/Android.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE      := libaudioloopback_jni
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES   := \
-	sles.cpp \
-	jni_sles.c \
-	audio_utils/atomic.c \
-	audio_utils/fifo.c \
-	audio_utils/roundup.c
-
-LOCAL_SHARED_LIBRARIES := \
-	libOpenSLES \
-	liblog
-
-LOCAL_LDFLAGS := -Wl,--hash-style=sysv
-
-LOCAL_CFLAGS := -DSTDC_HEADERS \
-	-Werror -Wall
-
-LOCAL_SDK_VERSION := 23
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/apps/CtsVerifier/jni/midi/Android.bp b/apps/CtsVerifier/jni/midi/Android.bp
new file mode 100644
index 0000000..4e707eb
--- /dev/null
+++ b/apps/CtsVerifier/jni/midi/Android.bp
@@ -0,0 +1,41 @@
+//
+// Copyright (C) 2018 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.
+//
+
+cc_test_library {
+    name: "libctsnativemidi_jni",
+    srcs: [
+        "com_android_cts_verifier_audio_midilib_NativeMidiManager.cpp",
+        "MidiTestManager.cpp",
+    ],
+    include_dirs: [
+        "frameworks/base/media/native/midi/include",
+        "frameworks/av/media/ndk/include",
+        "system/core/include/cutils",
+    ],
+    sdk_version: "current",
+    //stl: "c++_static"
+    stl: "system",
+    shared_libs: [
+        "liblog",
+        "libamidi",
+    ],
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+        "-Wno-unused-variable",
+    ],
+}
diff --git a/apps/CtsVerifier/jni/midi/Android.mk b/apps/CtsVerifier/jni/midi/Android.mk
deleted file mode 100644
index c76f0c7..0000000
--- a/apps/CtsVerifier/jni/midi/Android.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Copyright (C) 2018 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)
-
-LOCAL_MODULE := libctsnativemidi_jni
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
-	com_android_cts_verifier_audio_midilib_NativeMidiManager.cpp \
-	MidiTestManager.cpp
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-LOCAL_C_INCLUDES += \
-    frameworks/base/media/native/midi/include \
-    frameworks/av/media/ndk/include \
-    system/core/include/cutils
-
-#LOCAL_CXX_STL := libc++_static
-#LOCAL_NDK_STL_VARIANT := libc++_static
-
-#APP_STL := stlport_static
-#APP_STL := gnustl_static
-
-LOCAL_SDK_VERSION := current
-LOCAL_NDK_STL_VARIANT := system
-
-LOCAL_SHARED_LIBRARIES := liblog libamidi \
-
-LOCAL_CFLAGS := \
-        -Wall -Werror \
-        -Wno-unused-parameter \
-        -Wno-unused-variable \
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/apps/CtsVerifier/jni/verifier/Android.bp b/apps/CtsVerifier/jni/verifier/Android.bp
new file mode 100644
index 0000000..ddd6743
--- /dev/null
+++ b/apps/CtsVerifier/jni/verifier/Android.bp
@@ -0,0 +1,33 @@
+//
+// Copyright (C) 2010 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.
+//
+
+cc_test_library {
+    name: "libctsverifier_jni",
+    srcs: [
+        "CtsVerifierJniOnLoad.cpp",
+        "com_android_cts_verifier_camera_StatsImage.cpp",
+    ],
+    sdk_version: "current",
+    stl: "system",
+    shared_libs: ["liblog"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+        "-Wno-unused-variable",
+    ],
+
+}
diff --git a/apps/CtsVerifier/jni/verifier/Android.mk b/apps/CtsVerifier/jni/verifier/Android.mk
deleted file mode 100644
index 9ee7eee..0000000
--- a/apps/CtsVerifier/jni/verifier/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Copyright (C) 2010 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)
-
-LOCAL_MODULE := libctsverifier_jni
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
-		CtsVerifierJniOnLoad.cpp \
-		com_android_cts_verifier_camera_StatsImage.cpp
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-LOCAL_SDK_VERSION := current
-LOCAL_NDK_STL_VARIANT := system
-
-LOCAL_SHARED_LIBRARIES := liblog \
-
-LOCAL_CFLAGS := \
-        -Wall -Werror \
-        -Wno-unused-parameter \
-        -Wno-unused-variable \
-
-include $(BUILD_SHARED_LIBRARY)
-
diff --git a/apps/VpnApp/latest/Android.mk b/apps/VpnApp/latest/Android.mk
index 0431bef..02da681 100755
--- a/apps/VpnApp/latest/Android.mk
+++ b/apps/VpnApp/latest/Android.mk
@@ -30,6 +30,6 @@
 LOCAL_PRIVATE_PLATFORM_APIS := true
 
 # tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
+LOCAL_COMPATIBILITY_SUITE := arcts cts vts general-tests
 
 include $(BUILD_CTS_PACKAGE)
diff --git a/common/device-side/util-axt/OWNERS b/common/device-side/util-axt/OWNERS
index 46dcfc6..b61fd53 100644
--- a/common/device-side/util-axt/OWNERS
+++ b/common/device-side/util-axt/OWNERS
@@ -1,16 +1,2 @@
-#  Android EngProd Approvers
-guangzhu@google.com
-fdeng@google.com
-moonk@google.com
-jdesprez@google.com
-sbasi@google.com
 
-# Android Partner Eng Approvers
-aaronholden@google.com
-yuji@google.com
-nickrose@google.com
-
-# Android Framework Eng Approvers
-felipeal@google.com
-
-per-file *Android.bp=*
+per-file Android.bp=guangzhu@google.com, fdeng@google.com, moonk@google.com, jdesprez@google.com, aaronholden@google.com, yuji@google.com, nickrose@google.com, felipeal@google.com
diff --git a/common/device-side/util-axt/src/com/android/compatibility/common/util/BatteryUtils.java b/common/device-side/util-axt/src/com/android/compatibility/common/util/BatteryUtils.java
index b671f5f..4ad538c 100644
--- a/common/device-side/util-axt/src/com/android/compatibility/common/util/BatteryUtils.java
+++ b/common/device-side/util-axt/src/com/android/compatibility/common/util/BatteryUtils.java
@@ -18,6 +18,8 @@
 import static com.android.compatibility.common.util.SettingsUtils.putGlobalSetting;
 import static com.android.compatibility.common.util.TestUtils.waitUntil;
 
+import android.content.Intent;
+import android.content.IntentFilter;
 import android.content.pm.PackageManager;
 import android.os.BatteryManager;
 import android.os.PowerManager;
@@ -129,6 +131,13 @@
 
     /** @return true if the device supports battery saver. */
     public static boolean isBatterySaverSupported() {
+        final Intent batteryInfo = InstrumentationRegistry.getContext().registerReceiver(
+                null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
+        if (!batteryInfo.getBooleanExtra(BatteryManager.EXTRA_PRESENT, true)) {
+            // Devices without battery does not support battery saver.
+            return false;
+        }
+
         final PackageManager pm = InstrumentationRegistry.getContext().getPackageManager();
         return !(pm.hasSystemFeature(PackageManager.FEATURE_WATCH) ||
             pm.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE));
diff --git a/common/device-side/util/OWNERS b/common/device-side/util/OWNERS
index 46dcfc6..b61fd53 100644
--- a/common/device-side/util/OWNERS
+++ b/common/device-side/util/OWNERS
@@ -1,16 +1,2 @@
-#  Android EngProd Approvers
-guangzhu@google.com
-fdeng@google.com
-moonk@google.com
-jdesprez@google.com
-sbasi@google.com
 
-# Android Partner Eng Approvers
-aaronholden@google.com
-yuji@google.com
-nickrose@google.com
-
-# Android Framework Eng Approvers
-felipeal@google.com
-
-per-file *Android.bp=*
+per-file Android.bp=guangzhu@google.com, fdeng@google.com, moonk@google.com, jdesprez@google.com, aaronholden@google.com, yuji@google.com, nickrose@google.com, felipeal@google.com
diff --git a/hostsidetests/abioverride/Android.bp b/hostsidetests/abioverride/Android.bp
new file mode 100644
index 0000000..7717acc
--- /dev/null
+++ b/hostsidetests/abioverride/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2016 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.
+
+java_test_host {
+    name: "CtsAbiOverrideHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    libs: [
+        "compatibility-host-util",
+        "cts-tradefed",
+        "tradefed",
+    ],
+}
diff --git a/hostsidetests/abioverride/Android.mk b/hostsidetests/abioverride/Android.mk
deleted file mode 100644
index 0877b43..0000000
--- a/hostsidetests/abioverride/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := CtsAbiOverrideHostTestCases
-
-LOCAL_MODULE_TAGS := tests
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_CTS_TEST_PACKAGE := android.host.abioverride
-
-LOCAL_JAVA_LIBRARIES := compatibility-host-util cts-tradefed tradefed
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/abioverride/app/Android.bp b/hostsidetests/abioverride/app/Android.bp
new file mode 100644
index 0000000..12923c0
--- /dev/null
+++ b/hostsidetests/abioverride/app/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsAbiOverrideTestApp",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+    ],
+    jni_libs: ["libctsabioverride"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/abioverride/app/Android.mk b/hostsidetests/abioverride/app/Android.mk
deleted file mode 100755
index d6016dd..0000000
--- a/hostsidetests/abioverride/app/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (C) 2016 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_MULTILIB := both
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-
-
-LOCAL_JNI_SHARED_LIBRARIES := libctsabioverride
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsAbiOverrideTestApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/abioverride/app/jni/Android.bp b/hostsidetests/abioverride/app/jni/Android.bp
new file mode 100644
index 0000000..f3a3f93
--- /dev/null
+++ b/hostsidetests/abioverride/app/jni/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2016 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.
+
+cc_test_library {
+    name: "libctsabioverride",
+    srcs: ["CtsAbiOverrideJniOnLoad.cpp"],
+    // Ignore unused parameters.
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+    ],
+    shared_libs: ["libnativehelper_compat_libc++"],
+    stl: "none",
+    sdk_version: "current",
+}
diff --git a/hostsidetests/abioverride/app/jni/Android.mk b/hostsidetests/abioverride/app/jni/Android.mk
deleted file mode 100644
index e8725bd..0000000
--- a/hostsidetests/abioverride/app/jni/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE := libctsabioverride
-
-# Don't include this package in any configuration by default.
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := CtsAbiOverrideJniOnLoad.cpp
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-# Ignore unused parameters.
-LOCAL_CFLAGS += -Wall -Werror -Wno-unused-parameter
-
-LOCAL_SHARED_LIBRARIES := libnativehelper_compat_libc++
-LOCAL_NDK_STL_VARIANT := none
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/hostsidetests/apex/src/android/apex/cts/ApexTest.java b/hostsidetests/apex/src/android/apex/cts/ApexTest.java
index 5c9df98..89936e1 100644
--- a/hostsidetests/apex/src/android/apex/cts/ApexTest.java
+++ b/hostsidetests/apex/src/android/apex/cts/ApexTest.java
@@ -97,7 +97,7 @@
       Assert.assertNotEquals("device supports updatable APEX, but is not using multiple mount namespaces",
           rootMountIdOfInit, rootMountIdOfVold);
     } else {
-      Assert.assertEquals("device doesn't support updatable APEX, but is using multiple mount namespaces",
+      Assert.assertEquals("device supports updatable APEX, but is using multiple mount namespaces",
           rootMountIdOfInit, rootMountIdOfVold);
     }
   }
diff --git a/hostsidetests/appsecurity/test-apps/AuthBoundKeyApp/Android.bp b/hostsidetests/appsecurity/test-apps/AuthBoundKeyApp/Android.bp
new file mode 100644
index 0000000..9d392de
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/AuthBoundKeyApp/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2019 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.
+
+android_test_helper_app {
+    name: "AuthBoundKeyApp",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    static_libs: ["androidx.test.rules"],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    // sign this app with a different cert than CtsUsePermissionDiffCert
+    certificate: ":cts-testkey1",
+}
diff --git a/hostsidetests/appsecurity/test-apps/AuthBoundKeyApp/Android.mk b/hostsidetests/appsecurity/test-apps/AuthBoundKeyApp/Android.mk
deleted file mode 100644
index 7bc32d9..0000000
--- a/hostsidetests/appsecurity/test-apps/AuthBoundKeyApp/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2019 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_PACKAGE_NAME := AuthBoundKeyApp
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-# sign this app with a different cert than CtsUsePermissionDiffCert
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/cts-testkey1
-
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/appsecurity/test-apps/DuplicatePermissionDeclareApp/Android.bp b/hostsidetests/appsecurity/test-apps/DuplicatePermissionDeclareApp/Android.bp
new file mode 100644
index 0000000..6bc0b8d
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/DuplicatePermissionDeclareApp/Android.bp
@@ -0,0 +1,29 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsDuplicatePermissionDeclareApp",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    static_libs: ["androidx.test.rules"],
+    // Use the same cert as the app that also defined the permission
+    certificate: ":cts-testkey1",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/appsecurity/test-apps/DuplicatePermissionDeclareApp/Android.mk b/hostsidetests/appsecurity/test-apps/DuplicatePermissionDeclareApp/Android.mk
deleted file mode 100644
index 3675bb5..0000000
--- a/hostsidetests/appsecurity/test-apps/DuplicatePermissionDeclareApp/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-
-LOCAL_PACKAGE_NAME := CtsDuplicatePermissionDeclareApp
-
-# Use the same cert as the app that also defined the permission
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/cts-testkey1
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/appsecurity/test-apps/EncryptionApp/Android.bp b/hostsidetests/appsecurity/test-apps/EncryptionApp/Android.bp
new file mode 100644
index 0000000..42a1c3e
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/EncryptionApp/Android.bp
@@ -0,0 +1,37 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test_helper_app {
+    name: "CtsEncryptionApp",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "test_current",
+    static_libs: [
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ub-uiautomator",
+        "truth-prebuilt",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    certificate: ":cts-testkey1",
+}
diff --git a/hostsidetests/appsecurity/test-apps/EncryptionApp/Android.mk b/hostsidetests/appsecurity/test-apps/EncryptionApp/Android.mk
deleted file mode 100644
index 98cb84e..0000000
--- a/hostsidetests/appsecurity/test-apps/EncryptionApp/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := test_current
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    truth-prebuilt \
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsEncryptionApp
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/cts-testkey1
-
-LOCAL_PROGUARD_ENABLED := disabled
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/appsecurity/test-apps/ExternalStorageApp/Android.bp b/hostsidetests/appsecurity/test-apps/ExternalStorageApp/Android.bp
index e214221..0dfc5c7 100644
--- a/hostsidetests/appsecurity/test-apps/ExternalStorageApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/ExternalStorageApp/Android.bp
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-android_test {
+android_test_helper_app {
     name: "CtsExternalStorageApp",
     defaults: ["cts_support_defaults"],
     sdk_version: "current",
diff --git a/hostsidetests/appsecurity/test-apps/ListeningPortsApp/Android.bp b/hostsidetests/appsecurity/test-apps/ListeningPortsApp/Android.bp
new file mode 100644
index 0000000..10938de
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/ListeningPortsApp/Android.bp
@@ -0,0 +1,28 @@
+// Copyright (C) 2014 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.
+
+android_test_helper_app {
+    name: "CtsListeningPortsTest",
+    defaults: ["cts_support_defaults"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    srcs: ["src/**/*.java"],
+    static_libs: ["androidx.test.rules"],
+    libs: ["android.test.base.stubs"],
+    platform_apis: true,
+}
diff --git a/hostsidetests/appsecurity/test-apps/ListeningPortsApp/Android.mk b/hostsidetests/appsecurity/test-apps/ListeningPortsApp/Android.mk
deleted file mode 100644
index 4d1206e..0000000
--- a/hostsidetests/appsecurity/test-apps/ListeningPortsApp/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2014 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)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_PACKAGE_NAME := CtsListeningPortsTest
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/appsecurity/test-apps/MediaStorageApp/Android.bp b/hostsidetests/appsecurity/test-apps/MediaStorageApp/Android.bp
new file mode 100644
index 0000000..22cc2f4
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/MediaStorageApp/Android.bp
@@ -0,0 +1,72 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsMediaStorageApp",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "test_current",
+    static_libs: [
+        "compatibility-device-util-axt",
+        "androidx.test.rules",
+        "ub-uiautomator",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    asset_dirs: ["assets"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
+
+android_test_helper_app {
+    name: "CtsMediaStorageApp28",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "test_current",
+    static_libs: [
+        "compatibility-device-util-axt",
+        "androidx.test.rules",
+        "ub-uiautomator",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    asset_dirs: ["assets"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    manifest: "AndroidManifest28.xml",
+}
+
+android_test_helper_app {
+    name: "CtsMediaStorageAppFull",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "test_current",
+    static_libs: [
+        "compatibility-device-util-axt",
+        "androidx.test.rules",
+        "ub-uiautomator",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    asset_dirs: ["assets"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    manifest: "AndroidManifestFull.xml",
+}
diff --git a/hostsidetests/appsecurity/test-apps/MediaStorageApp/Android.mk b/hostsidetests/appsecurity/test-apps/MediaStorageApp/Android.mk
deleted file mode 100644
index 92da12d..0000000
--- a/hostsidetests/appsecurity/test-apps/MediaStorageApp/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := test_current
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    androidx.test.rules \
-    ub-uiautomator
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_ASSET_DIR := $(LOCAL_PATH)/assets
-
-LOCAL_PACKAGE_NAME := CtsMediaStorageApp
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/appsecurity/test-apps/MediaStorageApp28/AndroidManifest.xml b/hostsidetests/appsecurity/test-apps/MediaStorageApp/AndroidManifest28.xml
similarity index 100%
rename from hostsidetests/appsecurity/test-apps/MediaStorageApp28/AndroidManifest.xml
rename to hostsidetests/appsecurity/test-apps/MediaStorageApp/AndroidManifest28.xml
diff --git a/hostsidetests/appsecurity/test-apps/MediaStorageAppFull/AndroidManifest.xml b/hostsidetests/appsecurity/test-apps/MediaStorageApp/AndroidManifestFull.xml
similarity index 100%
rename from hostsidetests/appsecurity/test-apps/MediaStorageAppFull/AndroidManifest.xml
rename to hostsidetests/appsecurity/test-apps/MediaStorageApp/AndroidManifestFull.xml
diff --git a/hostsidetests/appsecurity/test-apps/MediaStorageApp28/Android.mk b/hostsidetests/appsecurity/test-apps/MediaStorageApp28/Android.mk
deleted file mode 100644
index 97f8a2c..0000000
--- a/hostsidetests/appsecurity/test-apps/MediaStorageApp28/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := test_current
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    androidx.test.rules \
-    ub-uiautomator
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../MediaStorageApp/src/)
-LOCAL_ASSET_DIR := $(LOCAL_PATH)/../MediaStorageApp/assets
-
-LOCAL_PACKAGE_NAME := CtsMediaStorageApp28
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/appsecurity/test-apps/MediaStorageAppFull/Android.mk b/hostsidetests/appsecurity/test-apps/MediaStorageAppFull/Android.mk
deleted file mode 100644
index 7665c7e..0000000
--- a/hostsidetests/appsecurity/test-apps/MediaStorageAppFull/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := test_current
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    androidx.test.rules \
-    ub-uiautomator
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../MediaStorageApp/src/)
-LOCAL_ASSET_DIR := $(LOCAL_PATH)/../MediaStorageApp/assets
-
-LOCAL_PACKAGE_NAME := CtsMediaStorageAppFull
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/appsecurity/test-apps/PermissionDeclareApp/Android.bp b/hostsidetests/appsecurity/test-apps/PermissionDeclareApp/Android.bp
index b52a0b0..64a8e7c 100644
--- a/hostsidetests/appsecurity/test-apps/PermissionDeclareApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/PermissionDeclareApp/Android.bp
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-android_test {
+android_test_helper_app {
     name: "CtsPermissionDeclareApp",
     defaults: ["cts_support_defaults"],
     srcs: ["src/**/*.java"],
@@ -26,7 +26,10 @@
     ],
     // sign this app with a different cert than CtsUsePermissionDiffCert
     certificate: ":cts-testkey1",
-    dex_preopt: {
-        enabled: false,
-    },
+}
+
+java_library {
+    name: "CtsPermissionDeclareUtilLib",
+    srcs: ["src/com/android/cts/permissiondeclareapp/UtilsProvider.java"],
+    sdk_version: "current",
 }
diff --git a/hostsidetests/appsecurity/test-apps/StorageApp/Android.bp b/hostsidetests/appsecurity/test-apps/StorageApp/Android.bp
index 2d916f2..a110513 100644
--- a/hostsidetests/appsecurity/test-apps/StorageApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/StorageApp/Android.bp
@@ -8,3 +8,39 @@
         "ub-uiautomator",
     ],
 }
+
+android_test_helper_app {
+    name: "CtsStorageAppA",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "test_current",
+    static_libs: [
+        "androidx.test.rules",
+        "ub-uiautomator",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    manifest: "AndroidManifestA.xml",
+}
+
+android_test_helper_app {
+    name: "CtsStorageAppB",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "test_current",
+    static_libs: [
+        "androidx.test.rules",
+        "ub-uiautomator",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    manifest: "AndroidManifestB.xml",
+}
diff --git a/hostsidetests/appsecurity/test-apps/StorageAppA/AndroidManifest.xml b/hostsidetests/appsecurity/test-apps/StorageApp/AndroidManifestA.xml
similarity index 100%
rename from hostsidetests/appsecurity/test-apps/StorageAppA/AndroidManifest.xml
rename to hostsidetests/appsecurity/test-apps/StorageApp/AndroidManifestA.xml
diff --git a/hostsidetests/appsecurity/test-apps/StorageAppB/AndroidManifest.xml b/hostsidetests/appsecurity/test-apps/StorageApp/AndroidManifestB.xml
similarity index 100%
rename from hostsidetests/appsecurity/test-apps/StorageAppB/AndroidManifest.xml
rename to hostsidetests/appsecurity/test-apps/StorageApp/AndroidManifestB.xml
diff --git a/hostsidetests/appsecurity/test-apps/StorageAppA/Android.mk b/hostsidetests/appsecurity/test-apps/StorageAppA/Android.mk
deleted file mode 100644
index 75adae4..0000000
--- a/hostsidetests/appsecurity/test-apps/StorageAppA/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := test_current
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    ub-uiautomator
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../StorageApp/src/)
-
-LOCAL_PACKAGE_NAME := CtsStorageAppA
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/appsecurity/test-apps/StorageAppB/Android.mk b/hostsidetests/appsecurity/test-apps/StorageAppB/Android.mk
deleted file mode 100644
index bdcccaf..0000000
--- a/hostsidetests/appsecurity/test-apps/StorageAppB/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := test_current
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    ub-uiautomator
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../StorageApp/src/)
-
-LOCAL_PACKAGE_NAME := CtsStorageAppB
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/appsecurity/test-apps/UseEmbeddedDexApp/Android.bp b/hostsidetests/appsecurity/test-apps/UseEmbeddedDexApp/Android.bp
new file mode 100644
index 0000000..4c605e1
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/UseEmbeddedDexApp/Android.bp
@@ -0,0 +1,105 @@
+//
+// Copyright (C) 2019 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.
+//
+
+android_test_helper_app {
+    name: "CtsUseEmbeddedDexApp_Canonical",
+    defaults: ["cts_support_defaults"],
+    use_embedded_dex: true,
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    min_sdk_version: "27",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
+
+android_test_helper_app {
+    name: "CtsUseEmbeddedDexApp_DexCompressed",
+    defaults: ["cts_support_defaults"],
+    // Not specifying use_embedded_dex keeps dex compressed
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    min_sdk_version: "28",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
+
+android_test_helper_app {
+    name: "CtsUseEmbeddedDexApp_NotPreferred",
+    defaults: ["cts_support_defaults"],
+    manifest: "AndroidManifest_use_extracted_dex.xml",
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    min_sdk_version: "28",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
+
+android_test_helper_app {
+    name: "CtsUseEmbeddedDexAppSplit_Canonical",
+    defaults: ["cts_support_defaults"],
+    manifest: "feature_split/AndroidManifest.xml",
+    // We want the dex to be uncompressed, but there is a side effect of extra
+    // android:useEmbeddedDex in the manifest (which the framework will ignore
+    // for split).
+    use_embedded_dex: true,
+    srcs: ["feature_split/src/**/*.java"],
+    sdk_version: "current",
+    min_sdk_version: "27",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
+
+android_test_helper_app {
+    name: "CtsUseEmbeddedDexAppSplit_CompressedDex",
+    defaults: ["cts_support_defaults"],
+    manifest: "feature_split/AndroidManifest.xml",
+    srcs: ["feature_split/src/**/*.java"],
+    sdk_version: "current",
+    min_sdk_version: "27",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
+
+//android_test_helper_app {
+//    name: "CtsUseEmbeddedDexAppSplit_CompressedSo",
+//    defaults: ["cts_support_defaults"],
+//    manifest: "feature_split/AndroidManifest.xml",
+//    srcs: ["feature_split/src/**/*.java"],
+//    // ANDROIDMK TRANSLATION ERROR: unsupported assignment to LOCAL_PREBUILT_JNI_LIBS
+//    // LOCAL_PREBUILT_JNI_LIBS := dummy.so
+//    sdk_version: "current",
+//    min_sdk_version: "27",
+//    test_suites: [
+//        "cts",
+//        "vts",
+//        "general-tests",
+//    ],
+//}
diff --git a/hostsidetests/appsecurity/test-apps/UseEmbeddedDexApp/Android.mk b/hostsidetests/appsecurity/test-apps/UseEmbeddedDexApp/Android.mk
deleted file mode 100644
index fbd8789..0000000
--- a/hostsidetests/appsecurity/test-apps/UseEmbeddedDexApp/Android.mk
+++ /dev/null
@@ -1,120 +0,0 @@
-#
-# Copyright (C) 2019 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)
-
-LOCAL_PACKAGE_NAME := CtsUseEmbeddedDexApp_Canonical
-LOCAL_USE_EMBEDDED_DEX := true
-LOCAL_MANIFEST_FILE := AndroidManifest.xml
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 27
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_PROGUARD_ENABLED := disabled
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := CtsUseEmbeddedDexApp_DexCompressed
-# Not specifying LOCAL_USE_EMBEDDED_DEX keeps dex compressed
-LOCAL_MANIFEST_FILE := AndroidManifest.xml
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 28
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_PROGUARD_ENABLED := disabled
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := CtsUseEmbeddedDexApp_NotPreferred
-LOCAL_MANIFEST_FILE := AndroidManifest_use_extracted_dex.xml
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 28
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_PROGUARD_ENABLED := disabled
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := CtsUseEmbeddedDexAppSplit_Canonical
-LOCAL_MANIFEST_FILE := feature_split/AndroidManifest.xml
-
-# We want the dex to be uncompressed, but there is a side effect of extra
-# android:useEmbeddedDex in the manifest (which the framework will ignore
-# for split).
-LOCAL_USE_EMBEDDED_DEX := true
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := $(call all-java-files-under, feature_split/src)
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 27
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_PROGUARD_ENABLED := disabled
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := CtsUseEmbeddedDexAppSplit_CompressedDex
-LOCAL_MANIFEST_FILE := feature_split/AndroidManifest.xml
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := $(call all-java-files-under, feature_split/src)
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 27
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_PROGUARD_ENABLED := disabled
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-
-#include $(CLEAR_VARS)
-#
-#LOCAL_PACKAGE_NAME := CtsUseEmbeddedDexAppSplit_CompressedSo
-#LOCAL_MANIFEST_FILE := feature_split/AndroidManifest.xml
-#
-#LOCAL_MODULE_TAGS := tests
-#LOCAL_SRC_FILES := $(call all-java-files-under, feature_split/src)
-#LOCAL_PREBUILT_JNI_LIBS := dummy.so
-#LOCAL_SDK_VERSION := current
-#LOCAL_MIN_SDK_VERSION := 27
-#LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-#LOCAL_PROGUARD_ENABLED := disabled
-#LOCAL_DEX_PREOPT := false
-#
-#include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.bp b/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.bp
new file mode 100644
index 0000000..b11c4cc
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2009 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.
+
+android_test_helper_app {
+    name: "CtsUsePermissionDiffCert",
+    defaults: ["cts_support_defaults"],
+    srcs: [
+        "src/**/*.java",
+    ],
+    sdk_version: "current",
+    static_libs: [
+        "CtsPermissionDeclareUtilLib",
+        "androidx.test.rules",
+    ],
+    libs: ["android.test.base.stubs"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    // sign this app with a different cert than CtsPermissionDeclareApp
+    certificate: ":cts-testkey2",
+}
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.mk b/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.mk
deleted file mode 100644
index 9233605..0000000
--- a/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2009 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    ../PermissionDeclareApp/src/com/android/cts/permissiondeclareapp/UtilsProvider.java
-
-LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_PACKAGE_NAME := CtsUsePermissionDiffCert
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-# sign this app with a different cert than CtsPermissionDeclareApp
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/cts-testkey2
-
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.bp b/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.bp
new file mode 100644
index 0000000..660ab53
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.bp
@@ -0,0 +1,46 @@
+// 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.
+
+android_test_helper_app {
+    name: "CtsWriteExternalStorageApp",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "test_current",
+    static_libs: [
+        "CtsWriteExternalStorageWriteGiftLib",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    exclude_srcs: ["src/com/android/cts/writeexternalstorageapp/WriteGiftTest.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
+
+java_library {
+    name: "CtsWriteExternalStorageWriteGiftLib",
+    srcs: ["src/com/android/cts/writeexternalstorageapp/WriteGiftTest.java"],
+    static_libs: ["CtsExternalStorageTestLib"],
+    libs: [
+        "android.test.base.stubs",
+        "android.test.runner.stubs",
+    ],
+}
diff --git a/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.mk b/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.mk
deleted file mode 100644
index b3332fc..0000000
--- a/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.mk
+++ /dev/null
@@ -1,37 +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)
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := test_current
-LOCAL_STATIC_JAVA_LIBRARIES := \
-	androidx.test.rules \
-	compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    ../ExternalStorageApp/src/com/android/cts/externalstorageapp/CommonExternalStorageTest.java
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsWriteExternalStorageApp
-
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp2/Android.bp b/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp2/Android.bp
new file mode 100644
index 0000000..f45a3ff
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp2/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2019 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.
+
+android_test_helper_app {
+    name: "CtsWriteExternalStorageApp2",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "test_current",
+    static_libs: [
+        "CtsWriteExternalStorageWriteGiftLib",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp2/Android.mk b/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp2/Android.mk
deleted file mode 100644
index c99998b..0000000
--- a/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp2/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2019 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)
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := \
-	androidx.test.rules \
-	compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := \
-    ../WriteExternalStorageApp/src/com/android/cts/writeexternalstorageapp/WriteGiftTest.java \
-    ../ExternalStorageApp/src/com/android/cts/externalstorageapp/CommonExternalStorageTest.java
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsWriteExternalStorageApp2
-
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/appsecurity/test-apps/rro/Android.mk b/hostsidetests/appsecurity/test-apps/rro/Android.mk
deleted file mode 100644
index e09a84b..0000000
--- a/hostsidetests/appsecurity/test-apps/rro/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2019 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.
-
-# Build the test APK using its own makefile, and any other CTS-related packages
-include $(call all-subdir-makefiles)
\ No newline at end of file
diff --git a/hostsidetests/atrace/Android.bp b/hostsidetests/atrace/Android.bp
new file mode 100644
index 0000000..5e3cf77
--- /dev/null
+++ b/hostsidetests/atrace/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2014 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.
+
+java_test_host {
+    name: "CtsAtraceHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    // Must match the package name in CtsTestCaseList.mk
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+    ],
+    static_libs: ["trebuchet-core"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/atrace/Android.mk b/hostsidetests/atrace/Android.mk
deleted file mode 100644
index a4e5aca..0000000
--- a/hostsidetests/atrace/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2014 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Must match the package name in CtsTestCaseList.mk
-LOCAL_MODULE := CtsAtraceHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed
-LOCAL_STATIC_JAVA_LIBRARIES := trebuchet-core
-
-LOCAL_CTS_TEST_PACKAGE := android.host.atrace
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-# Enforce public / test api only
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/atrace/AtraceTestApp/Android.bp b/hostsidetests/atrace/AtraceTestApp/Android.bp
new file mode 100644
index 0000000..169ccbb
--- /dev/null
+++ b/hostsidetests/atrace/AtraceTestApp/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2009 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.
+
+android_test_helper_app {
+    name: "CtsAtraceTestApp",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    static_libs: ["androidx.test.rules"],
+    jni_libs: ["libctstrace_jni"],
+    compile_multilib: "both",
+    // sign this app with a different cert than CtsSimpleAppInstallDiffCert
+    //LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/cts-testkey1
+    //LOCAL_DEX_PREOPT := false
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/atrace/AtraceTestApp/Android.mk b/hostsidetests/atrace/AtraceTestApp/Android.mk
deleted file mode 100644
index cfeddf7..0000000
--- a/hostsidetests/atrace/AtraceTestApp/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2009 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-LOCAL_JNI_SHARED_LIBRARIES := libctstrace_jni
-LOCAL_MULTILIB := both
-
-LOCAL_PACKAGE_NAME := CtsAtraceTestApp
-
-# sign this app with a different cert than CtsSimpleAppInstallDiffCert
-#LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/cts-testkey1
-
-#LOCAL_DEX_PREOPT := false
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/atrace/AtraceTestApp/jni/Android.bp b/hostsidetests/atrace/AtraceTestApp/jni/Android.bp
new file mode 100644
index 0000000..a782ef6
--- /dev/null
+++ b/hostsidetests/atrace/AtraceTestApp/jni/Android.bp
@@ -0,0 +1,26 @@
+// Copyright 2018 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.
+
+cc_test_library {
+    name: "libctstrace_jni",
+    gtest: false,
+    srcs: ["CtsTrace.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    shared_libs: ["libandroid"],
+    sdk_version: "current",
+
+}
diff --git a/hostsidetests/atrace/AtraceTestApp/jni/Android.mk b/hostsidetests/atrace/AtraceTestApp/jni/Android.mk
deleted file mode 100644
index 845b245..0000000
--- a/hostsidetests/atrace/AtraceTestApp/jni/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 2018 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)
-
-LOCAL_MODULE := libctstrace_jni
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := \
-	CtsTrace.cpp
-
-LOCAL_CFLAGS += -Wall -Werror
-
-LOCAL_SHARED_LIBRARIES := libandroid
-LOCAL_NDK_STL_VARIANT := c++_static
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/hostsidetests/backup/AllowBackup/Android.bp b/hostsidetests/backup/AllowBackup/Android.bp
new file mode 100644
index 0000000..39ce56f
--- /dev/null
+++ b/hostsidetests/backup/AllowBackup/Android.bp
@@ -0,0 +1,23 @@
+// Copyright (C) 2017 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.
+
+java_library {
+    name: "CtsAllowBackupLib",
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/AllowBackup/Android.mk b/hostsidetests/backup/AllowBackup/Android.mk
deleted file mode 100644
index b798d87..0000000
--- a/hostsidetests/backup/AllowBackup/Android.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (C) 2017 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/hostsidetests/backup/AllowBackup/BackupAllowedApp/Android.bp b/hostsidetests/backup/AllowBackup/BackupAllowedApp/Android.bp
new file mode 100644
index 0000000..1f7fb9a4
--- /dev/null
+++ b/hostsidetests/backup/AllowBackup/BackupAllowedApp/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "BackupAllowedApp",
+    defaults: ["cts_defaults"],
+    static_libs: ["CtsAllowBackupLib"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/AllowBackup/BackupAllowedApp/Android.mk b/hostsidetests/backup/AllowBackup/BackupAllowedApp/Android.mk
deleted file mode 100644
index ba164a0..0000000
--- a/hostsidetests/backup/AllowBackup/BackupAllowedApp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := BackupAllowedApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/AllowBackup/BackupNotAllowedApp/Android.bp b/hostsidetests/backup/AllowBackup/BackupNotAllowedApp/Android.bp
new file mode 100644
index 0000000..a8e2fa3
--- /dev/null
+++ b/hostsidetests/backup/AllowBackup/BackupNotAllowedApp/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "BackupNotAllowedApp",
+    defaults: ["cts_defaults"],
+    static_libs: ["CtsAllowBackupLib"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/AllowBackup/BackupNotAllowedApp/Android.mk b/hostsidetests/backup/AllowBackup/BackupNotAllowedApp/Android.mk
deleted file mode 100644
index 124afe4..0000000
--- a/hostsidetests/backup/AllowBackup/BackupNotAllowedApp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := BackupNotAllowedApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/Android.bp b/hostsidetests/backup/Android.bp
new file mode 100644
index 0000000..98a36e0
--- /dev/null
+++ b/hostsidetests/backup/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2017 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.
+
+java_test_host {
+    name: "CtsBackupHostTestCases",
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "arcts",
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+        "truth-prebuilt",
+    ],
+}
diff --git a/hostsidetests/backup/Android.mk b/hostsidetests/backup/Android.mk
deleted file mode 100644
index bbe7d47..0000000
--- a/hostsidetests/backup/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := tests
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := arcts cts vts general-tests
-
-LOCAL_MODULE := CtsBackupHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util truth-prebuilt
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/backup/FullBackupOnly/Android.bp b/hostsidetests/backup/FullBackupOnly/Android.bp
new file mode 100644
index 0000000..acac2e1
--- /dev/null
+++ b/hostsidetests/backup/FullBackupOnly/Android.bp
@@ -0,0 +1,24 @@
+// Copyright (C) 2017 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.
+
+java_library {
+    name: "CtsFullBackupOnlyLib",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/FullBackupOnly/Android.mk b/hostsidetests/backup/FullBackupOnly/Android.mk
deleted file mode 100644
index 521ac4d..0000000
--- a/hostsidetests/backup/FullBackupOnly/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (C) 2017 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/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseNoAgentApp/Android.bp b/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseNoAgentApp/Android.bp
new file mode 100644
index 0000000..f14e5d0
--- /dev/null
+++ b/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseNoAgentApp/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "FullBackupOnlyFalseNoAgentApp",
+    defaults: ["cts_defaults"],
+    static_libs: ["CtsFullBackupOnlyLib"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseNoAgentApp/Android.mk b/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseNoAgentApp/Android.mk
deleted file mode 100644
index a520e78..0000000
--- a/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseNoAgentApp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := FullBackupOnlyFalseNoAgentApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseWithAgentApp/Android.bp b/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseWithAgentApp/Android.bp
new file mode 100644
index 0000000..01e25ef
--- /dev/null
+++ b/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseWithAgentApp/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "FullBackupOnlyFalseWithAgentApp",
+    defaults: ["cts_defaults"],
+    static_libs: ["CtsFullBackupOnlyLib"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseWithAgentApp/Android.mk b/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseWithAgentApp/Android.mk
deleted file mode 100644
index 2e6d68f..0000000
--- a/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseWithAgentApp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := FullBackupOnlyFalseWithAgentApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/FullBackupOnly/FullBackupOnlyTrueWithAgentApp/Android.bp b/hostsidetests/backup/FullBackupOnly/FullBackupOnlyTrueWithAgentApp/Android.bp
new file mode 100644
index 0000000..8fb4b4b
--- /dev/null
+++ b/hostsidetests/backup/FullBackupOnly/FullBackupOnlyTrueWithAgentApp/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "FullBackupOnlyTrueWithAgentApp",
+    defaults: ["cts_defaults"],
+    static_libs: ["CtsFullBackupOnlyLib"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/FullBackupOnly/FullBackupOnlyTrueWithAgentApp/Android.mk b/hostsidetests/backup/FullBackupOnly/FullBackupOnlyTrueWithAgentApp/Android.mk
deleted file mode 100644
index e1af880..0000000
--- a/hostsidetests/backup/FullBackupOnly/FullBackupOnlyTrueWithAgentApp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := FullBackupOnlyTrueWithAgentApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/KeyValueApp/Android.bp b/hostsidetests/backup/KeyValueApp/Android.bp
new file mode 100644
index 0000000..8619dd0
--- /dev/null
+++ b/hostsidetests/backup/KeyValueApp/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsKeyValueBackupRestoreApp",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+    ],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/KeyValueApp/Android.mk b/hostsidetests/backup/KeyValueApp/Android.mk
deleted file mode 100644
index 7635b63..0000000
--- a/hostsidetests/backup/KeyValueApp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsKeyValueBackupRestoreApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/OtherSoundsSettingsApp/Android.bp b/hostsidetests/backup/OtherSoundsSettingsApp/Android.bp
new file mode 100644
index 0000000..fac14e6
--- /dev/null
+++ b/hostsidetests/backup/OtherSoundsSettingsApp/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsBackupOtherSoundsSettingsApp",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+        "compatibility-device-util-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/backup/OtherSoundsSettingsApp/Android.mk b/hostsidetests/backup/OtherSoundsSettingsApp/Android.mk
deleted file mode 100644
index 2e959f1..0000000
--- a/hostsidetests/backup/OtherSoundsSettingsApp/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2018 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    platform-test-annotations \
-    compatibility-device-util-axt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsBackupOtherSoundsSettingsApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
-
-
diff --git a/hostsidetests/backup/ProfileFullBackupApp/Android.bp b/hostsidetests/backup/ProfileFullBackupApp/Android.bp
new file mode 100644
index 0000000..c5d7dd1
--- /dev/null
+++ b/hostsidetests/backup/ProfileFullBackupApp/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2019 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.
+
+android_test_helper_app {
+    name: "CtsProfileFullBackupApp",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+        "truth-prebuilt",
+    ],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/ProfileFullBackupApp/Android.mk b/hostsidetests/backup/ProfileFullBackupApp/Android.mk
deleted file mode 100644
index cbf29f8..0000000
--- a/hostsidetests/backup/ProfileFullBackupApp/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 2019 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    platform-test-annotations \
-    truth-prebuilt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsProfileFullBackupApp
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/ProfileKeyValueApp/Android.bp b/hostsidetests/backup/ProfileKeyValueApp/Android.bp
new file mode 100644
index 0000000..df6b009
--- /dev/null
+++ b/hostsidetests/backup/ProfileKeyValueApp/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2019 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.
+
+android_test_helper_app {
+    name: "CtsProfileKeyValueApp",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+        "truth-prebuilt",
+    ],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/backup/ProfileKeyValueApp/Android.mk b/hostsidetests/backup/ProfileKeyValueApp/Android.mk
deleted file mode 100644
index 3e543ec..0000000
--- a/hostsidetests/backup/ProfileKeyValueApp/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 2019 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    platform-test-annotations \
-    truth-prebuilt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsProfileKeyValueApp
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/ProfileSerialNumberApp/Android.bp b/hostsidetests/backup/ProfileSerialNumberApp/Android.bp
new file mode 100644
index 0000000..d8713cc
--- /dev/null
+++ b/hostsidetests/backup/ProfileSerialNumberApp/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2019 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.
+
+android_test_helper_app {
+    name: "CtsProfileSerialNumberApp",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+        "compatibility-device-util-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+    ],
+    // Uncomment when b/78787392 is fixed
+    // sdk_version: "system_test_current",
+    platform_apis: true,
+}
diff --git a/hostsidetests/backup/ProfileSerialNumberApp/Android.mk b/hostsidetests/backup/ProfileSerialNumberApp/Android.mk
deleted file mode 100644
index 0e6e5f7..0000000
--- a/hostsidetests/backup/ProfileSerialNumberApp/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2019 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules  \
-                               platform-test-annotations  \
-                               compatibility-device-util-axt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-
-LOCAL_PACKAGE_NAME := CtsProfileSerialNumberApp
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/RestoreAnyVersion/Android.bp b/hostsidetests/backup/RestoreAnyVersion/Android.bp
new file mode 100644
index 0000000..7ce7333
--- /dev/null
+++ b/hostsidetests/backup/RestoreAnyVersion/Android.bp
@@ -0,0 +1,24 @@
+// Copyright (C) 2017 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.
+
+java_library {
+    name: "CtsRestoreAnyVersionLib",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+    ],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/RestoreAnyVersion/Android.mk b/hostsidetests/backup/RestoreAnyVersion/Android.mk
deleted file mode 100644
index 521ac4d..0000000
--- a/hostsidetests/backup/RestoreAnyVersion/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (C) 2017 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/hostsidetests/backup/RestoreAnyVersion/NewVersionApp/Android.bp b/hostsidetests/backup/RestoreAnyVersion/NewVersionApp/Android.bp
new file mode 100644
index 0000000..5f536c3
--- /dev/null
+++ b/hostsidetests/backup/RestoreAnyVersion/NewVersionApp/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsBackupRestoreAnyVersionAppUpdate",
+    defaults: ["cts_defaults"],
+    static_libs: ["CtsRestoreAnyVersionLib"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/RestoreAnyVersion/NewVersionApp/Android.mk b/hostsidetests/backup/RestoreAnyVersion/NewVersionApp/Android.mk
deleted file mode 100644
index c68429c..0000000
--- a/hostsidetests/backup/RestoreAnyVersion/NewVersionApp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsBackupRestoreAnyVersionAppUpdate
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/RestoreAnyVersion/NoRestoreAnyVersionApp/Android.bp b/hostsidetests/backup/RestoreAnyVersion/NoRestoreAnyVersionApp/Android.bp
new file mode 100644
index 0000000..587ffb9
--- /dev/null
+++ b/hostsidetests/backup/RestoreAnyVersion/NoRestoreAnyVersionApp/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsBackupRestoreAnyVersionNoRestoreApp",
+    defaults: ["cts_defaults"],
+    static_libs: ["CtsRestoreAnyVersionLib"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/RestoreAnyVersion/NoRestoreAnyVersionApp/Android.mk b/hostsidetests/backup/RestoreAnyVersion/NoRestoreAnyVersionApp/Android.mk
deleted file mode 100644
index 854c35d..0000000
--- a/hostsidetests/backup/RestoreAnyVersion/NoRestoreAnyVersionApp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsBackupRestoreAnyVersionNoRestoreApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/RestoreAnyVersion/RestoreAnyVersionApp/Android.bp b/hostsidetests/backup/RestoreAnyVersion/RestoreAnyVersionApp/Android.bp
new file mode 100644
index 0000000..c7c63fe
--- /dev/null
+++ b/hostsidetests/backup/RestoreAnyVersion/RestoreAnyVersionApp/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsBackupRestoreAnyVersionApp",
+    defaults: ["cts_defaults"],
+    static_libs: ["CtsRestoreAnyVersionLib"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/RestoreAnyVersion/RestoreAnyVersionApp/Android.mk b/hostsidetests/backup/RestoreAnyVersion/RestoreAnyVersionApp/Android.mk
deleted file mode 100644
index 2606779..0000000
--- a/hostsidetests/backup/RestoreAnyVersion/RestoreAnyVersionApp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsBackupRestoreAnyVersionApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/SharedPreferencesRestoreApp/Android.bp b/hostsidetests/backup/SharedPreferencesRestoreApp/Android.bp
new file mode 100644
index 0000000..24131cc
--- /dev/null
+++ b/hostsidetests/backup/SharedPreferencesRestoreApp/Android.bp
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsSharedPreferencesRestoreApp",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+    ],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/SharedPreferencesRestoreApp/Android.mk b/hostsidetests/backup/SharedPreferencesRestoreApp/Android.mk
deleted file mode 100644
index d3e6cc3..0000000
--- a/hostsidetests/backup/SharedPreferencesRestoreApp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-
-LOCAL_PACKAGE_NAME := CtsSharedPreferencesRestoreApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/SuccessNotificationApp/Android.bp b/hostsidetests/backup/SuccessNotificationApp/Android.bp
new file mode 100644
index 0000000..f4ff7e0
--- /dev/null
+++ b/hostsidetests/backup/SuccessNotificationApp/Android.bp
@@ -0,0 +1,29 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsBackupSuccessNotificationApp",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+    ],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/SuccessNotificationApp/Android.mk b/hostsidetests/backup/SuccessNotificationApp/Android.mk
deleted file mode 100644
index bd10a97..0000000
--- a/hostsidetests/backup/SuccessNotificationApp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2018 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-
-LOCAL_PACKAGE_NAME := CtsBackupSuccessNotificationApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/SyncAdapterSettingsApp/Android.bp b/hostsidetests/backup/SyncAdapterSettingsApp/Android.bp
new file mode 100644
index 0000000..290c350
--- /dev/null
+++ b/hostsidetests/backup/SyncAdapterSettingsApp/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsBackupSyncAdapterSettingsApp",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+        "compatibility-device-util-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/backup/SyncAdapterSettingsApp/Android.mk b/hostsidetests/backup/SyncAdapterSettingsApp/Android.mk
deleted file mode 100644
index f256692..0000000
--- a/hostsidetests/backup/SyncAdapterSettingsApp/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 2018 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-        androidx.test.rules \
-        platform-test-annotations \
-        compatibility-device-util-axt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsBackupSyncAdapterSettingsApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/fullbackupapp/Android.bp b/hostsidetests/backup/fullbackupapp/Android.bp
new file mode 100644
index 0000000..696be0c
--- /dev/null
+++ b/hostsidetests/backup/fullbackupapp/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsFullbackupApp",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+    ],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "arcts",
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/fullbackupapp/Android.mk b/hostsidetests/backup/fullbackupapp/Android.mk
deleted file mode 100644
index 0d3f3b1..0000000
--- a/hostsidetests/backup/fullbackupapp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := arcts cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsFullbackupApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/backup/includeexcludeapp/Android.bp b/hostsidetests/backup/includeexcludeapp/Android.bp
new file mode 100644
index 0000000..5093888
--- /dev/null
+++ b/hostsidetests/backup/includeexcludeapp/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsIncludeExcludeApp",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+    ],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "arcts",
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/backup/includeexcludeapp/Android.mk b/hostsidetests/backup/includeexcludeapp/Android.mk
deleted file mode 100644
index 166ecae..0000000
--- a/hostsidetests/backup/includeexcludeapp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := arcts cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsIncludeExcludeApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/bootstats/Android.bp b/hostsidetests/bootstats/Android.bp
new file mode 100644
index 0000000..ca1e292
--- /dev/null
+++ b/hostsidetests/bootstats/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 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.
+
+java_test_host {
+    name: "CtsBootStatsTestCases",
+    defaults: ["cts_defaults"],
+    // Only compile source java files in this apk.
+    srcs: ["src/**/*.java"],
+    static_libs: ["framework-protos"],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+        "libprotobuf-java-full",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/bootstats/Android.mk b/hostsidetests/bootstats/Android.mk
deleted file mode 100644
index 87bff19..0000000
--- a/hostsidetests/bootstats/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2017 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)
-
-# Only compile source java files in this apk.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := CtsBootStatsTestCases
-LOCAL_STATIC_JAVA_LIBRARIES := framework-protos
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util libprotobuf-java-full
-
-LOCAL_CTS_TEST_PACKAGE := android.bootstats
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/classloaders/splits/Android.bp b/hostsidetests/classloaders/splits/Android.bp
index 17f02a7..592bbc3 100644
--- a/hostsidetests/classloaders/splits/Android.bp
+++ b/hostsidetests/classloaders/splits/Android.bp
@@ -31,4 +31,9 @@
         "CtsClassloaderSplitAppFeatureA",
         "CtsClassloaderSplitAppFeatureB",
     ],
+    data: [
+        ":CtsClassloaderSplitApp",
+        ":CtsClassloaderSplitAppFeatureA",
+        ":CtsClassloaderSplitAppFeatureB",
+    ],
 }
diff --git a/hostsidetests/classloaders/splits/apps/Android.bp b/hostsidetests/classloaders/splits/apps/Android.bp
index 380182d..c0975ac 100644
--- a/hostsidetests/classloaders/splits/apps/Android.bp
+++ b/hostsidetests/classloaders/splits/apps/Android.bp
@@ -21,9 +21,4 @@
         "androidx.test.rules",
         "ctstestrunner-axt",
     ],
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/classloaders/splits/apps/feature_a/Android.bp b/hostsidetests/classloaders/splits/apps/feature_a/Android.bp
index 0fd7091..7dd21cf 100644
--- a/hostsidetests/classloaders/splits/apps/feature_a/Android.bp
+++ b/hostsidetests/classloaders/splits/apps/feature_a/Android.bp
@@ -24,9 +24,4 @@
         "--package-id",
         "0x80",
     ],
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/classloaders/splits/apps/feature_b/Android.bp b/hostsidetests/classloaders/splits/apps/feature_b/Android.bp
index 2643840..84c1f53 100644
--- a/hostsidetests/classloaders/splits/apps/feature_b/Android.bp
+++ b/hostsidetests/classloaders/splits/apps/feature_b/Android.bp
@@ -27,9 +27,4 @@
         "--package-id",
         "0x81",
     ],
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/classloaders/useslibrary/Android.bp b/hostsidetests/classloaders/useslibrary/Android.bp
index 603b2ec..970f93b 100644
--- a/hostsidetests/classloaders/useslibrary/Android.bp
+++ b/hostsidetests/classloaders/useslibrary/Android.bp
@@ -27,4 +27,5 @@
         "general-tests",
     ],
     required: [ "CtsUsesLibraryApp" ],
+    data: [ ":CtsUsesLibraryApp" ],
 }
diff --git a/hostsidetests/classloaders/useslibrary/app/Android.bp b/hostsidetests/classloaders/useslibrary/app/Android.bp
index 1d444c6..e69db51 100644
--- a/hostsidetests/classloaders/useslibrary/app/Android.bp
+++ b/hostsidetests/classloaders/useslibrary/app/Android.bp
@@ -24,9 +24,4 @@
         "androidx.test.rules",
         "ctstestrunner-axt",
     ],
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/compilation/Android.bp b/hostsidetests/compilation/Android.bp
new file mode 100644
index 0000000..f522f7e
--- /dev/null
+++ b/hostsidetests/compilation/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2016 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.
+
+java_test_host {
+    name: "CtsCompilationTestCases",
+    srcs: ["src/**/*.java"],
+    java_resource_dirs: ["assets/"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+        "guava",
+    ],
+}
diff --git a/hostsidetests/compilation/Android.mk b/hostsidetests/compilation/Android.mk
deleted file mode 100644
index 5a27baf..0000000
--- a/hostsidetests/compilation/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_RESOURCE_DIRS := assets/
-
-LOCAL_MODULE_TAGS := tests
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MODULE := CtsCompilationTestCases
-
-LOCAL_MIN_SDK_VERSION := 23
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util guava
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/compilation/app/Android.bp b/hostsidetests/compilation/app/Android.bp
new file mode 100644
index 0000000..f4954c7
--- /dev/null
+++ b/hostsidetests/compilation/app/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsCompilationApp",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/compilation/app/Android.mk b/hostsidetests/compilation/app/Android.mk
deleted file mode 100644
index 4a51a21..0000000
--- a/hostsidetests/compilation/app/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2016 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 := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := 29
-
-LOCAL_PACKAGE_NAME := CtsCompilationApp
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/compilation/assets/CtsCompilationApp.apk b/hostsidetests/compilation/assets/CtsCompilationApp.apk
index ba89b24..18c76d3 100644
--- a/hostsidetests/compilation/assets/CtsCompilationApp.apk
+++ b/hostsidetests/compilation/assets/CtsCompilationApp.apk
Binary files differ
diff --git a/hostsidetests/cpptools/Android.bp b/hostsidetests/cpptools/Android.bp
new file mode 100644
index 0000000..208e734
--- /dev/null
+++ b/hostsidetests/cpptools/Android.bp
@@ -0,0 +1,29 @@
+// Copyright (C) 2014 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.
+
+java_test_host {
+    name: "CtsCppToolsTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "ddmlib-prebuilt",
+        "tradefed",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/cpptools/Android.mk b/hostsidetests/cpptools/Android.mk
index 8078290..10ba650 100644
--- a/hostsidetests/cpptools/Android.mk
+++ b/hostsidetests/cpptools/Android.mk
@@ -13,23 +13,4 @@
 # limitations under the License.
 
 LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := optional
-
-# Must match the package name in CtsTestCaseList.mk
-LOCAL_MODULE := CtsCppToolsTestCases
-
-LOCAL_JAVA_LIBRARIES := ddmlib-prebuilt tradefed
-
-LOCAL_CTS_TEST_PACKAGE := android.tests.cpptools
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
 include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/cpptools/test-apps/BasicApp/Android.bp b/hostsidetests/cpptools/test-apps/BasicApp/Android.bp
new file mode 100644
index 0000000..f96f5a5
--- /dev/null
+++ b/hostsidetests/cpptools/test-apps/BasicApp/Android.bp
@@ -0,0 +1,28 @@
+// Copyright (C) 2014 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.
+
+android_test_helper_app {
+    name: "CtsCppToolsApp",
+    defaults: ["cts_support_defaults"],
+    // Don't include this package in any target.
+    // When built, explicitly put it in the data partition.
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/cpptools/test-apps/BasicApp/Android.mk b/hostsidetests/cpptools/test-apps/BasicApp/Android.mk
deleted file mode 100644
index 2719cd9..0000000
--- a/hostsidetests/cpptools/test-apps/BasicApp/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2014 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
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsCppToolsApp
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/cpptools/test-apps/DomainSocketApp/Android.bp b/hostsidetests/cpptools/test-apps/DomainSocketApp/Android.bp
new file mode 100644
index 0000000..d4dab8b
--- /dev/null
+++ b/hostsidetests/cpptools/test-apps/DomainSocketApp/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2019 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.
+
+android_test_helper_app {
+    name: "CtsDomainSocket",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    static_libs: ["androidx.test.rules"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/cpptools/test-apps/DomainSocketApp/Android.mk b/hostsidetests/cpptools/test-apps/DomainSocketApp/Android.mk
deleted file mode 100644
index b018cc9..0000000
--- a/hostsidetests/cpptools/test-apps/DomainSocketApp/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2019 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-
-LOCAL_PACKAGE_NAME := CtsDomainSocket
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
\ No newline at end of file
diff --git a/hostsidetests/deviceidle/Android.bp b/hostsidetests/deviceidle/Android.bp
new file mode 100644
index 0000000..d7bb076
--- /dev/null
+++ b/hostsidetests/deviceidle/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 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.
+
+java_test_host {
+    name: "CtsDeviceIdleHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/deviceidle/Android.mk b/hostsidetests/deviceidle/Android.mk
deleted file mode 100644
index e73d70f..0000000
--- a/hostsidetests/deviceidle/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE := CtsDeviceIdleHostTestCases
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
-
-LOCAL_CTS_TEST_PACKAGE := android.deviceidle
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
diff --git a/hostsidetests/devicepolicy/Android.bp b/hostsidetests/devicepolicy/Android.bp
new file mode 100644
index 0000000..4eef832
--- /dev/null
+++ b/hostsidetests/devicepolicy/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2014 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.
+
+java_test_host {
+    name: "CtsDevicePolicyManagerTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "tools-common-prebuilt",
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+        "guava",
+        "truth-prebuilt",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "arcts",
+        "cts",
+        "general-tests",
+        "vts",
+    ],
+    java_resource_dirs: ["res"],
+    data: [":current-api-xml"],
+}
diff --git a/hostsidetests/devicepolicy/Android.mk b/hostsidetests/devicepolicy/Android.mk
deleted file mode 100644
index 307bb31..0000000
--- a/hostsidetests/devicepolicy/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2014 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)
-
-LOCAL_MODULE := CtsDevicePolicyManagerTestCases
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_RESOURCE_DIRS := res
-
-LOCAL_JAVA_LIBRARIES := \
-    tools-common-prebuilt \
-    cts-tradefed \
-    tradefed \
-    compatibility-host-util \
-    guava \
-    truth-prebuilt
-
-LOCAL_CTS_TEST_PACKAGE := android.adminhostside
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts arcts vts general-tests
-
-# Need the dependency to build/run the module solely by atest.
-LOCAL_TARGET_REQUIRED_MODULES := cts-current-api
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/devicepolicy/app/Android.mk b/hostsidetests/devicepolicy/app/Android.mk
deleted file mode 100644
index d44e88e..0000000
--- a/hostsidetests/devicepolicy/app/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2014 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)
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
\ No newline at end of file
diff --git a/hostsidetests/devicepolicy/app/CertInstaller/Android.bp b/hostsidetests/devicepolicy/app/CertInstaller/Android.bp
index 9b99054..a3ae108 100644
--- a/hostsidetests/devicepolicy/app/CertInstaller/Android.bp
+++ b/hostsidetests/devicepolicy/app/CertInstaller/Android.bp
@@ -31,6 +31,7 @@
     ],
     // tag this module as a cts test artifact
     test_suites: [
+        "arcts",
         "cts",
         "vts",
         "general-tests",
diff --git a/hostsidetests/devicepolicy/app/ContentSuggestionsApp/Android.bp b/hostsidetests/devicepolicy/app/ContentSuggestionsApp/Android.bp
new file mode 100644
index 0000000..2422d71
--- /dev/null
+++ b/hostsidetests/devicepolicy/app/ContentSuggestionsApp/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2019 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.
+
+android_test_helper_app {
+    name: "CtsDevicePolicyContentSuggestionsApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "arcts",
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "system_current",
+}
diff --git a/hostsidetests/devicepolicy/app/ContentSuggestionsApp/Android.mk b/hostsidetests/devicepolicy/app/ContentSuggestionsApp/Android.mk
deleted file mode 100644
index 90f56d6..0000000
--- a/hostsidetests/devicepolicy/app/ContentSuggestionsApp/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2019 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
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsDevicePolicyContentSuggestionsApp
-
-LOCAL_SDK_VERSION := system_current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := arcts cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/Android.bp b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/Android.bp
index 1062d2e..513eda2 100644
--- a/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/Android.bp
+++ b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/Android.bp
@@ -61,6 +61,7 @@
     min_sdk_version: "23",
     // tag this module as a cts test artifact
     test_suites: [
+        "arcts",
         "cts",
         "vts",
         "general-tests",
diff --git a/hostsidetests/devicepolicy/app/LauncherTests/Android.bp b/hostsidetests/devicepolicy/app/LauncherTests/Android.bp
new file mode 100644
index 0000000..5b9dd20
--- /dev/null
+++ b/hostsidetests/devicepolicy/app/LauncherTests/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2014 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.
+
+android_test_helper_app {
+    name: "CtsLauncherAppsTests",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "junit",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "androidx.legacy_legacy-support-v4",
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "ShortcutManagerTestUtils",
+        "testng",
+    ],
+    test_suites: [
+        "arcts",
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/devicepolicy/app/LauncherTests/Android.mk b/hostsidetests/devicepolicy/app/LauncherTests/Android.mk
deleted file mode 100644
index 3cfc542..0000000
--- a/hostsidetests/devicepolicy/app/LauncherTests/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2014 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)
-
-LOCAL_PACKAGE_NAME := CtsLauncherAppsTests
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := junit android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES = \
-	androidx.legacy_legacy-support-v4 \
-	ctstestrunner-axt \
-	androidx.test.rules \
-	compatibility-device-util-axt \
-	ShortcutManagerTestUtils \
-	testng
-
-LOCAL_SDK_VERSION := system_current
-LOCAL_MIN_SDK_VERSION := 21
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/devicepolicy/app/LauncherTestsSupport/Android.bp b/hostsidetests/devicepolicy/app/LauncherTestsSupport/Android.bp
index f134b69..c690f9c 100644
--- a/hostsidetests/devicepolicy/app/LauncherTestsSupport/Android.bp
+++ b/hostsidetests/devicepolicy/app/LauncherTestsSupport/Android.bp
@@ -21,6 +21,7 @@
     min_sdk_version: "21",
     // tag this module as a cts test artifact
     test_suites: [
+        "arcts",
         "cts",
         "vts",
         "general-tests",
diff --git a/hostsidetests/dexmetadata/Android.mk b/hostsidetests/dexmetadata/Android.mk
deleted file mode 100644
index 9af9f44..0000000
--- a/hostsidetests/dexmetadata/Android.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (C) 2018 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/hostsidetests/dexmetadata/app/Android.bp b/hostsidetests/dexmetadata/app/Android.bp
new file mode 100644
index 0000000..9be64e6
--- /dev/null
+++ b/hostsidetests/dexmetadata/app/Android.bp
@@ -0,0 +1,24 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsDexMetadataDeviceTestApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/dexmetadata/app/Android.mk b/hostsidetests/dexmetadata/app/Android.mk
deleted file mode 100644
index 8d17ebd..0000000
--- a/hostsidetests/dexmetadata/app/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsDexMetadataDeviceTestApp
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules compatibility-device-util-axt
-
-# Tag this module as test artifact for cts,
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
-
-# Include the make files below us.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/dexmetadata/app/SplitApp/Android.bp b/hostsidetests/dexmetadata/app/SplitApp/Android.bp
new file mode 100644
index 0000000..ec148f0
--- /dev/null
+++ b/hostsidetests/dexmetadata/app/SplitApp/Android.bp
@@ -0,0 +1,22 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsDexMetadataSplitApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as test artifact for cts
+    test_suites: ["cts"],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/dexmetadata/app/SplitApp/Android.mk b/hostsidetests/dexmetadata/app/SplitApp/Android.mk
deleted file mode 100644
index 41935d3..0000000
--- a/hostsidetests/dexmetadata/app/SplitApp/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsDexMetadataSplitApp
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as test artifact for cts
-LOCAL_COMPATIBILITY_SUITE := cts
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-
-# Include the make files below us
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/dexmetadata/app/SplitApp/SplitAppFeatureA/Android.bp b/hostsidetests/dexmetadata/app/SplitApp/SplitAppFeatureA/Android.bp
new file mode 100644
index 0000000..df0a8bc
--- /dev/null
+++ b/hostsidetests/dexmetadata/app/SplitApp/SplitAppFeatureA/Android.bp
@@ -0,0 +1,22 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsDexMetadataSplitAppFeatureA",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as test artifact for cts
+    test_suites: ["cts"],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/dexmetadata/app/SplitApp/SplitAppFeatureA/Android.mk b/hostsidetests/dexmetadata/app/SplitApp/SplitAppFeatureA/Android.mk
deleted file mode 100644
index 839ca5c..0000000
--- a/hostsidetests/dexmetadata/app/SplitApp/SplitAppFeatureA/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsDexMetadataSplitAppFeatureA
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as test artifact for cts
-LOCAL_COMPATIBILITY_SUITE := cts
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/dexmetadata/host/Android.bp b/hostsidetests/dexmetadata/host/Android.bp
new file mode 100644
index 0000000..d40cb6c
--- /dev/null
+++ b/hostsidetests/dexmetadata/host/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2018 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.
+
+java_test_host {
+    name: "CtsDexMetadataHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    java_resource_dirs: ["res"],
+    libs: [
+        "compatibility-host-util",
+        "cts-tradefed",
+        "tradefed",
+    ],
+    // tag this module as test artifact for cts
+    test_suites: [
+        "cts",
+        "general-tests",
+    ],
+    data: [":CtsDexMetadataDeviceTestApp"],
+}
diff --git a/hostsidetests/dexmetadata/host/Android.mk b/hostsidetests/dexmetadata/host/Android.mk
deleted file mode 100644
index cae13cd..0000000
--- a/hostsidetests/dexmetadata/host/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_MODULE := CtsDexMetadataHostTestCases
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := res
-
-LOCAL_JAVA_LIBRARIES := \
-    compatibility-host-util \
-    cts-tradefed \
-    tradefed
-
-# tag this module as test artifact for cts
-LOCAL_COMPATIBILITY_SUITE := cts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
diff --git a/hostsidetests/dumpsys/Android.bp b/hostsidetests/dumpsys/Android.bp
new file mode 100644
index 0000000..cdcd366
--- /dev/null
+++ b/hostsidetests/dumpsys/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2014 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.
+
+java_test_host {
+    name: "CtsDumpsysHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    // Must match the package name in CtsTestCaseList.mk
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/dumpsys/Android.mk b/hostsidetests/dumpsys/Android.mk
deleted file mode 100644
index d15996c..0000000
--- a/hostsidetests/dumpsys/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2014 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Must match the package name in CtsTestCaseList.mk
-LOCAL_MODULE := CtsDumpsysHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed
-
-LOCAL_CTS_TEST_PACKAGE := android.dumpsys
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/dumpsys/apps/Android.mk b/hostsidetests/dumpsys/apps/Android.mk
deleted file mode 100644
index 4a74e80..0000000
--- a/hostsidetests/dumpsys/apps/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2017 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)
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/dumpsys/apps/FramestatsTestApp/Android.bp b/hostsidetests/dumpsys/apps/FramestatsTestApp/Android.bp
new file mode 100644
index 0000000..1dcf148
--- /dev/null
+++ b/hostsidetests/dumpsys/apps/FramestatsTestApp/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2015 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.
+
+android_test_helper_app {
+    name: "CtsFramestatsTestApp",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    static_libs: ["androidx.test.rules"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/dumpsys/apps/FramestatsTestApp/Android.mk b/hostsidetests/dumpsys/apps/FramestatsTestApp/Android.mk
deleted file mode 100644
index a772a05..0000000
--- a/hostsidetests/dumpsys/apps/FramestatsTestApp/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-
-LOCAL_PACKAGE_NAME := CtsFramestatsTestApp
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/dumpsys/apps/ProcStatsHelperApp/Android.bp b/hostsidetests/dumpsys/apps/ProcStatsHelperApp/Android.bp
new file mode 100644
index 0000000..8bd1e8e
--- /dev/null
+++ b/hostsidetests/dumpsys/apps/ProcStatsHelperApp/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsProcStatsHelperApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: ["junit"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    sdk_version: "test_current",
+    min_sdk_version: "24",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/dumpsys/apps/ProcStatsHelperApp/Android.mk b/hostsidetests/dumpsys/apps/ProcStatsHelperApp/Android.mk
deleted file mode 100644
index bb33f34..0000000
--- a/hostsidetests/dumpsys/apps/ProcStatsHelperApp/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsProcStatsHelperApp
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := junit
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SDK_VERSION := test_current
-LOCAL_MIN_SDK_VERSION := 24
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/dumpsys/apps/ProcStatsTestApp/Android.bp b/hostsidetests/dumpsys/apps/ProcStatsTestApp/Android.bp
new file mode 100644
index 0000000..abaf6cd
--- /dev/null
+++ b/hostsidetests/dumpsys/apps/ProcStatsTestApp/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsProcStatsApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "android.test.runner.stubs",
+        "junit",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    sdk_version: "test_current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/dumpsys/apps/ProcStatsTestApp/Android.mk b/hostsidetests/dumpsys/apps/ProcStatsTestApp/Android.mk
deleted file mode 100644
index d58d18d..0000000
--- a/hostsidetests/dumpsys/apps/ProcStatsTestApp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsProcStatsApp
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs junit
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SDK_VERSION := test_current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/dumpsys/apps/storagedapp/Android.bp b/hostsidetests/dumpsys/apps/storagedapp/Android.bp
new file mode 100644
index 0000000..321d5f9
--- /dev/null
+++ b/hostsidetests/dumpsys/apps/storagedapp/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsStoragedTestApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "android.test.runner.stubs",
+        "junit",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    sdk_version: "test_current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/dumpsys/apps/storagedapp/Android.mk b/hostsidetests/dumpsys/apps/storagedapp/Android.mk
deleted file mode 100644
index 9192a44..0000000
--- a/hostsidetests/dumpsys/apps/storagedapp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsStoragedTestApp
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs junit
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SDK_VERSION := test_current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/edi/Android.bp b/hostsidetests/edi/Android.bp
new file mode 100644
index 0000000..d9a907e
--- /dev/null
+++ b/hostsidetests/edi/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 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.
+
+java_test_host {
+    name: "CtsEdiHostTestCases",
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+    ],
+}
diff --git a/hostsidetests/edi/Android.mk b/hostsidetests/edi/Android.mk
deleted file mode 100644
index a403cde..0000000
--- a/hostsidetests/edi/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := tests
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_MODULE := CtsEdiHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/gputools/Android.bp b/hostsidetests/gputools/Android.bp
new file mode 100644
index 0000000..dc8ac4f
--- /dev/null
+++ b/hostsidetests/gputools/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2017 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.
+
+java_test_host {
+    name: "CtsGpuToolsHostTestCases",
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: ["cts"],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+    ],
+    static_libs: ["platform-test-annotations-host"],
+}
diff --git a/hostsidetests/gputools/Android.mk b/hostsidetests/gputools/Android.mk
deleted file mode 100644
index b2946be..0000000
--- a/hostsidetests/gputools/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := tests
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts
-
-LOCAL_MODULE := CtsGpuToolsHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
-
-LOCAL_STATIC_JAVA_LIBRARIES := platform-test-annotations-host
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/gputools/apps/Android.bp b/hostsidetests/gputools/apps/Android.bp
new file mode 100644
index 0000000..4021140
--- /dev/null
+++ b/hostsidetests/gputools/apps/Android.bp
@@ -0,0 +1,76 @@
+// Copyright (C) 2017 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.
+
+cc_test_library {
+    name: "libctsgputools_jni",
+    gtest: false,
+    srcs: [
+        "jni/CtsGpuToolsJniOnLoad.cpp",
+        "jni/android_gputools_cts_RootlessGpuDebug.cpp",
+    ],
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    shared_libs: [
+        "libandroid",
+        "libvulkan",
+        "liblog",
+        "libandroid",
+        "libvulkan",
+        "libEGL",
+        "libGLESv3",
+        "liblog",
+    ],
+    stl: "c++_shared",
+    sdk_version: "current",
+}
+
+android_test_helper_app {
+    name: "CtsGpuToolsRootlessGpuDebugApp-DEBUG",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // tag this module as a cts test artifact
+    test_suites: ["cts"],
+    compile_multilib: "both",
+    jni_libs: ["libctsgputools_jni"],
+    aaptflags: [
+        "--rename-manifest-package",
+        "android.rootlessgpudebug.DEBUG.app",
+        "--debug-mode",
+    ],
+    use_embedded_native_libs: false,
+    stl: "c++_shared",
+}
+
+android_test_helper_app {
+    name: "CtsGpuToolsRootlessGpuDebugApp-RELEASE",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // tag this module as a cts test artifact
+    test_suites: ["cts"],
+    compile_multilib: "both",
+    jni_libs: [
+        "libctsgputools_jni",
+        "libVkLayer_nullLayerC",
+        "libGLES_glesLayerC",
+    ],
+    aaptflags: [
+        "--rename-manifest-package android.rootlessgpudebug.RELEASE.app",
+    ],
+    use_embedded_native_libs: false,
+    stl: "c++_shared",
+}
diff --git a/hostsidetests/gputools/apps/Android.mk b/hostsidetests/gputools/apps/Android.mk
deleted file mode 100644
index 5c422e3..0000000
--- a/hostsidetests/gputools/apps/Android.mk
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright (C) 2017 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)
-LOCAL_MODULE := libctsgputools_jni
-LOCAL_SRC_FILES := \
-    jni/CtsGpuToolsJniOnLoad.cpp \
-    jni/android_gputools_cts_RootlessGpuDebug.cpp
-LOCAL_CFLAGS += -Wall -Werror
-LOCAL_SHARED_LIBRARIES := libandroid libvulkan liblog
-LOCAL_SHARED_LIBRARIES := libandroid libvulkan libEGL libGLESv3 liblog
-LOCAL_NDK_STL_VARIANT := c++_static
-LOCAL_SDK_VERSION := current
-include $(BUILD_SHARED_LIBRARY)
-
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_MODULE_TAGS := tests
-LOCAL_PACKAGE_NAME := CtsGpuToolsRootlessGpuDebugApp-DEBUG
-LOCAL_SDK_VERSION := current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts
-
-LOCAL_MULTILIB := both
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-libctsgputools_jni
-
-LOCAL_AAPT_FLAGS := \
---rename-manifest-package android.rootlessgpudebug.DEBUG.app \
---debug-mode
-
-LOCAL_USE_EMBEDDED_NATIVE_LIBS := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_MODULE_TAGS := tests
-LOCAL_PACKAGE_NAME := CtsGpuToolsRootlessGpuDebugApp-RELEASE
-LOCAL_SDK_VERSION := current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts
-
-LOCAL_MULTILIB := both
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-libctsgputools_jni \
-libVkLayer_nullLayerC \
-libGLES_glesLayerC
-
-LOCAL_AAPT_FLAGS := \
---rename-manifest-package android.rootlessgpudebug.RELEASE.app
-
-LOCAL_USE_EMBEDDED_NATIVE_LIBS := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/gputools/layers/Android.bp b/hostsidetests/gputools/layers/Android.bp
new file mode 100644
index 0000000..9d12a7b
--- /dev/null
+++ b/hostsidetests/gputools/layers/Android.bp
@@ -0,0 +1,174 @@
+// Copyright (C) 2017 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.
+
+cc_test_library {
+    name: "libVkLayer_nullLayerA",
+    gtest: false,
+    srcs: ["jni/nullLayer.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-fvisibility=hidden",
+        "-DLAYERNAME=A",
+    ],
+    shared_libs: [
+        "libandroid",
+        "libvulkan",
+        "libEGL",
+        "libGLESv3",
+        "liblog",
+    ],
+    stl: "c++_shared",
+    sdk_version: "current",
+}
+
+cc_test_library {
+    name: "libVkLayer_nullLayerB",
+    gtest: false,
+    srcs: ["jni/nullLayer.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-fvisibility=hidden",
+        "-DLAYERNAME=B",
+    ],
+    shared_libs: [
+        "libandroid",
+        "libvulkan",
+        "libEGL",
+        "libGLESv3",
+        "liblog",
+    ],
+    stl: "c++_shared",
+    sdk_version: "current",
+}
+
+cc_test_library {
+    name: "libVkLayer_nullLayerC",
+    gtest: false,
+    srcs: ["jni/nullLayer.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-fvisibility=hidden",
+        "-DLAYERNAME=C",
+    ],
+    shared_libs: [
+        "libandroid",
+        "libvulkan",
+        "libEGL",
+        "libGLESv3",
+        "liblog",
+    ],
+    stl: "c++_shared",
+    sdk_version: "current",
+}
+
+cc_test_library {
+    name: "libGLES_glesLayerA",
+    gtest: false,
+    srcs: ["jni/glesLayer.cpp"],
+    cflags: [
+        "-std=c++14",
+        "-Wall",
+        "-Werror",
+        "-fvisibility=hidden",
+        "-DLAYERNAME=A",
+    ],
+    shared_libs: [
+        "libandroid",
+        "libEGL",
+        "libGLESv3",
+        "liblog",
+    ],
+    stl: "c++_shared",
+    sdk_version: "current",
+}
+
+cc_test_library {
+    name: "libGLES_glesLayerB",
+    gtest: false,
+    srcs: ["jni/glesLayer.cpp"],
+    cflags: [
+        "-std=c++14",
+        "-Wall",
+        "-Werror",
+        "-fvisibility=hidden",
+        "-DLAYERNAME=B",
+    ],
+    shared_libs: [
+        "libandroid",
+        "libEGL",
+        "libGLESv3",
+        "liblog",
+    ],
+    stl: "c++_shared",
+    sdk_version: "current",
+}
+
+cc_test_library {
+    name: "libGLES_glesLayerC",
+    gtest: false,
+    srcs: ["jni/glesLayer.cpp"],
+    cflags: [
+        "-std=c++14",
+        "-Wall",
+        "-Werror",
+        "-fvisibility=hidden",
+        "-DLAYERNAME=C",
+    ],
+    shared_libs: [
+        "libandroid",
+        "libEGL",
+        "libGLESv3",
+        "liblog",
+    ],
+    stl: "c++_shared",
+    sdk_version: "current",
+}
+
+android_test_helper_app {
+    name: "CtsGpuToolsRootlessGpuDebugApp-LAYERS",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "current",
+    // tag this module as a cts test artifact
+    test_suites: ["cts"],
+    compile_multilib: "both",
+    jni_libs: [
+        "libVkLayer_nullLayerA",
+        "libVkLayer_nullLayerB",
+        "libVkLayer_nullLayerC",
+    ],
+    use_embedded_native_libs: false,
+    stl: "c++_shared",
+}
+
+android_test_helper_app {
+    name: "CtsGpuToolsRootlessGpuDebugApp-GLES_LAYERS",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "current",
+    // tag this module as a cts test artifact
+    test_suites: ["cts"],
+    compile_multilib: "both",
+    jni_libs: [
+        "libGLES_glesLayerA",
+        "libGLES_glesLayerB",
+        "libGLES_glesLayerC",
+    ],
+    use_embedded_native_libs: false,
+    aaptflags: [
+        "--rename-manifest-package android.rootlessgpudebug.GLES_LAYERS.app",
+    ],
+    stl: "c++_shared",
+}
diff --git a/hostsidetests/gputools/layers/Android.mk b/hostsidetests/gputools/layers/Android.mk
deleted file mode 100644
index 019c15c..0000000
--- a/hostsidetests/gputools/layers/Android.mk
+++ /dev/null
@@ -1,131 +0,0 @@
-# Copyright (C) 2017 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)
-LOCAL_MODULE := libVkLayer_nullLayerA
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := jni/nullLayer.cpp
-LOCAL_CFLAGS += -Wall -Werror -fvisibility=hidden -DLAYERNAME="A"
-LOCAL_SHARED_LIBRARIES := libandroid libvulkan libEGL libGLESv3 liblog
-LOCAL_NDK_STL_VARIANT := c++_static
-LOCAL_SDK_VERSION := current
-include $(BUILD_SHARED_LIBRARY)
-
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libVkLayer_nullLayerB
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := jni/nullLayer.cpp
-LOCAL_CFLAGS += -Wall -Werror -fvisibility=hidden -DLAYERNAME="B"
-LOCAL_SHARED_LIBRARIES := libandroid libvulkan libEGL libGLESv3 liblog
-LOCAL_NDK_STL_VARIANT := c++_static
-LOCAL_SDK_VERSION := current
-include $(BUILD_SHARED_LIBRARY)
-
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libVkLayer_nullLayerC
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := jni/nullLayer.cpp
-LOCAL_CFLAGS += -Wall -Werror -fvisibility=hidden -DLAYERNAME="C"
-LOCAL_SHARED_LIBRARIES := libandroid libvulkan libEGL libGLESv3 liblog
-LOCAL_NDK_STL_VARIANT := c++_static
-LOCAL_SDK_VERSION := current
-include $(BUILD_SHARED_LIBRARY)
-
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libGLES_glesLayerA
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := jni/glesLayer.cpp
-LOCAL_CFLAGS += -std=c++14 -Wall -Werror -fvisibility=hidden -DLAYERNAME=A
-LOCAL_SHARED_LIBRARIES := libandroid libEGL libGLESv3 liblog
-LOCAL_NDK_STL_VARIANT := c++_static
-LOCAL_SDK_VERSION := current
-include $(BUILD_SHARED_LIBRARY)
-
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libGLES_glesLayerB
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := jni/glesLayer.cpp
-LOCAL_CFLAGS += -std=c++14 -Wall -Werror -fvisibility=hidden -DLAYERNAME=B
-LOCAL_SHARED_LIBRARIES := libandroid libEGL libGLESv3 liblog
-LOCAL_NDK_STL_VARIANT := c++_static
-LOCAL_SDK_VERSION := current
-include $(BUILD_SHARED_LIBRARY)
-
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libGLES_glesLayerC
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := jni/glesLayer.cpp
-LOCAL_CFLAGS += -std=c++14 -Wall -Werror -fvisibility=hidden -DLAYERNAME=C
-LOCAL_SHARED_LIBRARIES := libandroid libEGL libGLESv3 liblog
-LOCAL_NDK_STL_VARIANT := c++_static
-LOCAL_SDK_VERSION := current
-include $(BUILD_SHARED_LIBRARY)
-
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_PACKAGE_NAME := CtsGpuToolsRootlessGpuDebugApp-LAYERS
-LOCAL_SDK_VERSION := current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts
-
-LOCAL_MULTILIB := both
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-libVkLayer_nullLayerA \
-libVkLayer_nullLayerB \
-libVkLayer_nullLayerC
-
-LOCAL_USE_EMBEDDED_NATIVE_LIBS := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_PACKAGE_NAME := CtsGpuToolsRootlessGpuDebugApp-GLES_LAYERS
-LOCAL_SDK_VERSION := current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts
-
-LOCAL_MULTILIB := both
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-libGLES_glesLayerA \
-libGLES_glesLayerB \
-libGLES_glesLayerC
-
-LOCAL_USE_EMBEDDED_NATIVE_LIBS := false
-
-LOCAL_AAPT_FLAGS := \
---rename-manifest-package android.rootlessgpudebug.GLES_LAYERS.app
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/harmfulappwarning/Android.bp b/hostsidetests/harmfulappwarning/Android.bp
new file mode 100644
index 0000000..eef6b59
--- /dev/null
+++ b/hostsidetests/harmfulappwarning/Android.bp
@@ -0,0 +1,29 @@
+// Copyright (C) 2018 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.
+
+java_test_host {
+    name: "CtsHarmfulAppWarningHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/harmfulappwarning/Android.mk b/hostsidetests/harmfulappwarning/Android.mk
deleted file mode 100644
index 5ec2e99..0000000
--- a/hostsidetests/harmfulappwarning/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_MODULE := CtsHarmfulAppWarningHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed
-
-
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_CTS_TEST_PACKAGE := android.host.harmfulappwarning
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/harmfulappwarning/sampleapp/Android.bp b/hostsidetests/harmfulappwarning/sampleapp/Android.bp
new file mode 100644
index 0000000..e129af5
--- /dev/null
+++ b/hostsidetests/harmfulappwarning/sampleapp/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsHarmfulAppWarningSampleApp",
+    // Don't include this package in any target
+    // When built, explicitly put it in the data partition.
+    dex_preopt: {
+        enabled: false,
+    },
+    optimize: {
+        enabled: false,
+    },
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/harmfulappwarning/sampleapp/Android.mk b/hostsidetests/harmfulappwarning/sampleapp/Android.mk
deleted file mode 100644
index a0aba0d..0000000
--- a/hostsidetests/harmfulappwarning/sampleapp/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2018 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsHarmfulAppWarningSampleApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/harmfulappwarning/testapp/Android.bp b/hostsidetests/harmfulappwarning/testapp/Android.bp
new file mode 100644
index 0000000..9e1174f
--- /dev/null
+++ b/hostsidetests/harmfulappwarning/testapp/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsHarmfulAppWarningTestApp",
+    dex_preopt: {
+        enabled: false,
+    },
+    optimize: {
+        enabled: false,
+    },
+    static_libs: [
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "ub-uiautomator",
+    ],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/harmfulappwarning/testapp/Android.mk b/hostsidetests/harmfulappwarning/testapp/Android.mk
deleted file mode 100644
index 34854f4..0000000
--- a/hostsidetests/harmfulappwarning/testapp/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 2018 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    compatibility-device-util-axt \
-    ub-uiautomator
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsHarmfulAppWarningTestApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/incident/Android.bp b/hostsidetests/incident/Android.bp
new file mode 100644
index 0000000..1589078
--- /dev/null
+++ b/hostsidetests/incident/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2014 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.
+
+java_test_host {
+    name: "CtsIncidentHostTestCases",
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+        "platformprotos",
+    ],
+}
diff --git a/hostsidetests/incident/Android.mk b/hostsidetests/incident/Android.mk
deleted file mode 100644
index 898400d..0000000
--- a/hostsidetests/incident/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2014 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_MODULE_TAGS := tests
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MODULE := CtsIncidentHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util platformprotos
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/incident/apps/Android.mk b/hostsidetests/incident/apps/Android.mk
deleted file mode 100644
index 4a74e80..0000000
--- a/hostsidetests/incident/apps/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2017 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)
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/incident/apps/batterystatsapp/Android.bp b/hostsidetests/incident/apps/batterystatsapp/Android.bp
new file mode 100644
index 0000000..3cbe960
--- /dev/null
+++ b/hostsidetests/incident/apps/batterystatsapp/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsBatteryStatsApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "android.test.runner.stubs",
+        "junit",
+        "org.apache.http.legacy",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    sdk_version: "test_current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/incident/apps/batterystatsapp/Android.mk b/hostsidetests/incident/apps/batterystatsapp/Android.mk
deleted file mode 100644
index 534dbb2a..0000000
--- a/hostsidetests/incident/apps/batterystatsapp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsBatteryStatsApp
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs junit org.apache.http.legacy
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SDK_VERSION := test_current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/incident/apps/boundwidgetapp/Android.bp b/hostsidetests/incident/apps/boundwidgetapp/Android.bp
new file mode 100644
index 0000000..4e710d8
--- /dev/null
+++ b/hostsidetests/incident/apps/boundwidgetapp/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsAppWidgetApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "android.test.runner.stubs",
+        "junit",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    sdk_version: "test_current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/incident/apps/boundwidgetapp/Android.mk b/hostsidetests/incident/apps/boundwidgetapp/Android.mk
deleted file mode 100644
index d9c9eefe..0000000
--- a/hostsidetests/incident/apps/boundwidgetapp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsAppWidgetApp
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs junit android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SDK_VERSION := test_current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/incident/apps/errorsapp/Android.bp b/hostsidetests/incident/apps/errorsapp/Android.bp
new file mode 100644
index 0000000..738feb5
--- /dev/null
+++ b/hostsidetests/incident/apps/errorsapp/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsErrorsApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    compile_multilib: "both",
+    libs: [
+        "android.test.runner.stubs",
+        "junit",
+    ],
+    // Includes the jni code as a shared library
+    jni_libs: ["libcrash-jni"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    sdk_version: "test_current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/incident/apps/errorsapp/Android.mk b/hostsidetests/incident/apps/errorsapp/Android.mk
deleted file mode 100644
index c137656..0000000
--- a/hostsidetests/incident/apps/errorsapp/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsErrorsApp
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MULTILIB := both
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs junit
-
-# Includes the jni code as a shared library
-LOCAL_JNI_SHARED_LIBRARIES := libcrash-jni
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SDK_VERSION := test_current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/incident/apps/errorsapp/jni/Android.bp b/hostsidetests/incident/apps/errorsapp/jni/Android.bp
new file mode 100644
index 0000000..7c61818
--- /dev/null
+++ b/hostsidetests/incident/apps/errorsapp/jni/Android.bp
@@ -0,0 +1,24 @@
+// Copyright (C) 2017 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.
+
+cc_test_library {
+    name: "libcrash-jni",
+    srcs: ["crash-jni.c"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/incident/apps/errorsapp/jni/Android.mk b/hostsidetests/incident/apps/errorsapp/jni/Android.mk
deleted file mode 100644
index 75d1d09..0000000
--- a/hostsidetests/incident/apps/errorsapp/jni/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE    := libcrash-jni
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := crash-jni.c
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-LOCAL_CFLAGS := -Wall -Werror -Wno-unused-parameter
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/hostsidetests/incident/apps/graphicsstatsapp/Android.bp b/hostsidetests/incident/apps/graphicsstatsapp/Android.bp
new file mode 100644
index 0000000..52b5c74
--- /dev/null
+++ b/hostsidetests/incident/apps/graphicsstatsapp/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsGraphicsStatsApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "android.test.runner.stubs",
+        "junit",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    sdk_version: "test_current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/incident/apps/graphicsstatsapp/Android.mk b/hostsidetests/incident/apps/graphicsstatsapp/Android.mk
deleted file mode 100644
index 588b67b..0000000
--- a/hostsidetests/incident/apps/graphicsstatsapp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsGraphicsStatsApp
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs junit
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SDK_VERSION := test_current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
\ No newline at end of file
diff --git a/hostsidetests/incident/apps/netstatsapp/Android.bp b/hostsidetests/incident/apps/netstatsapp/Android.bp
new file mode 100644
index 0000000..551d27e
--- /dev/null
+++ b/hostsidetests/incident/apps/netstatsapp/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsNetStatsApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "android.test.runner.stubs",
+        "junit",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    sdk_version: "test_current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/incident/apps/netstatsapp/Android.mk b/hostsidetests/incident/apps/netstatsapp/Android.mk
deleted file mode 100644
index 41ebd09..0000000
--- a/hostsidetests/incident/apps/netstatsapp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsNetStatsApp
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs junit
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SDK_VERSION := test_current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/incident/apps/notificationsapp/Android.bp b/hostsidetests/incident/apps/notificationsapp/Android.bp
new file mode 100644
index 0000000..6bd3991
--- /dev/null
+++ b/hostsidetests/incident/apps/notificationsapp/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsNotificationIncidentTestApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "android.test.runner.stubs",
+        "junit",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    sdk_version: "test_current",
+    java_resource_dirs: ["res"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/incident/apps/notificationsapp/Android.mk b/hostsidetests/incident/apps/notificationsapp/Android.mk
deleted file mode 100644
index 2c9f3fd..0000000
--- a/hostsidetests/incident/apps/notificationsapp/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsNotificationIncidentTestApp
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs junit
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SDK_VERSION := test_current
-
-LOCAL_JAVA_RESOURCE_DIRS := res
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/incident/apps/procstatsapp/Android.bp b/hostsidetests/incident/apps/procstatsapp/Android.bp
new file mode 100644
index 0000000..0626e23
--- /dev/null
+++ b/hostsidetests/incident/apps/procstatsapp/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsProcStatsProtoApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "android.test.runner.stubs",
+        "junit",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    sdk_version: "test_current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/incident/apps/procstatsapp/Android.mk b/hostsidetests/incident/apps/procstatsapp/Android.mk
deleted file mode 100644
index 8fcad57..0000000
--- a/hostsidetests/incident/apps/procstatsapp/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsProcStatsProtoApp
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs junit
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SDK_VERSION := test_current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/inputmethodservice/Android.mk b/hostsidetests/inputmethodservice/Android.mk
deleted file mode 100644
index b798d87..0000000
--- a/hostsidetests/inputmethodservice/Android.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (C) 2017 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/hostsidetests/inputmethodservice/common/Android.bp b/hostsidetests/inputmethodservice/common/Android.bp
new file mode 100644
index 0000000..feb59a3
--- /dev/null
+++ b/hostsidetests/inputmethodservice/common/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2017 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.
+
+// Build the common library for use device-side
+java_test {
+    name: "CtsInputMethodServiceCommon",
+    srcs: ["src/**/*.java"],
+    libs: ["junit"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    sdk_version: "test_current",
+}
+
+// Build the common library for use host-side
+java_test_host {
+    name: "cts-inputmethodservice-common-host",
+    srcs: ["src/**/*.java"],
+    libs: ["junit"],
+}
diff --git a/hostsidetests/inputmethodservice/common/Android.mk b/hostsidetests/inputmethodservice/common/Android.mk
deleted file mode 100644
index a118474..0000000
--- a/hostsidetests/inputmethodservice/common/Android.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (C) 2017 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.
-
-###############################################################################
-# Build the common library for use device-side
-###############################################################################
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_LIBRARIES := junit
-
-LOCAL_MODULE_TAGS := tests
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_MODULE := CtsInputMethodServiceCommon
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
-
-###############################################################################
-# Build the common library for use host-side
-###############################################################################
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_LIBRARIES := junit
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_MODULE := cts-inputmethodservice-common-host
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/hostsidetests/inputmethodservice/deviceside/Android.mk b/hostsidetests/inputmethodservice/deviceside/Android.mk
deleted file mode 100644
index b798d87..0000000
--- a/hostsidetests/inputmethodservice/deviceside/Android.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (C) 2017 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/hostsidetests/inputmethodservice/deviceside/devicetest/Android.bp b/hostsidetests/inputmethodservice/deviceside/devicetest/Android.bp
new file mode 100644
index 0000000..7139b91
--- /dev/null
+++ b/hostsidetests/inputmethodservice/deviceside/devicetest/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2014 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.
+
+android_test {
+    name: "CtsInputMethodServiceDeviceTests",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: ["android.test.runner.stubs"],
+    static_libs: [
+        "androidx.test.rules",
+        "hamcrest",
+        "hamcrest-library",
+        "ub-uiautomator",
+        "CtsInputMethodServiceCommon",
+        "CtsInputMethodServiceLib",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    sdk_version: "test_current",
+    min_sdk_version: "19",
+}
diff --git a/hostsidetests/inputmethodservice/deviceside/devicetest/Android.mk b/hostsidetests/inputmethodservice/deviceside/devicetest/Android.mk
deleted file mode 100644
index 1a57e27..0000000
--- a/hostsidetests/inputmethodservice/deviceside/devicetest/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2014 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIR := res
-LOCAL_JAVA_LIBRARY := android.test.runner.stubs
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    hamcrest hamcrest-library \
-    ub-uiautomator \
-    CtsInputMethodServiceCommon \
-    CtsInputMethodServiceLib
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsInputMethodServiceDeviceTests
-
-LOCAL_SDK_VERSION := test_current
-LOCAL_MIN_SDK_VERSION := 19
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/inputmethodservice/deviceside/edittextapp/Android.bp b/hostsidetests/inputmethodservice/deviceside/edittextapp/Android.bp
new file mode 100644
index 0000000..fce63b4
--- /dev/null
+++ b/hostsidetests/inputmethodservice/deviceside/edittextapp/Android.bp
@@ -0,0 +1,29 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "EditTextApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    static_libs: ["CtsInputMethodServiceCommon"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    sdk_version: "test_current",
+    min_sdk_version: "28",
+}
diff --git a/hostsidetests/inputmethodservice/deviceside/edittextapp/Android.mk b/hostsidetests/inputmethodservice/deviceside/edittextapp/Android.mk
deleted file mode 100644
index a089809..0000000
--- a/hostsidetests/inputmethodservice/deviceside/edittextapp/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2018 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIR := res
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    CtsInputMethodServiceCommon
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := EditTextApp
-
-LOCAL_SDK_VERSION := test_current
-LOCAL_MIN_SDK_VERSION := 28
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/inputmethodservice/deviceside/ime1/Android.bp b/hostsidetests/inputmethodservice/deviceside/ime1/Android.bp
new file mode 100644
index 0000000..765fe2d
--- /dev/null
+++ b/hostsidetests/inputmethodservice/deviceside/ime1/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2014 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.
+
+android_test_helper_app {
+    name: "CtsInputMethod1",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "CtsInputMethodServiceCommon",
+        "CtsInputMethodServiceLib",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    sdk_version: "test_current",
+    min_sdk_version: "19",
+}
diff --git a/hostsidetests/inputmethodservice/deviceside/ime1/Android.mk b/hostsidetests/inputmethodservice/deviceside/ime1/Android.mk
deleted file mode 100644
index 3b98a87..0000000
--- a/hostsidetests/inputmethodservice/deviceside/ime1/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 2014 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIR := res
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    CtsInputMethodServiceCommon \
-    CtsInputMethodServiceLib
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsInputMethod1
-
-LOCAL_SDK_VERSION := test_current
-LOCAL_MIN_SDK_VERSION := 19
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/inputmethodservice/deviceside/ime2/Android.bp b/hostsidetests/inputmethodservice/deviceside/ime2/Android.bp
new file mode 100644
index 0000000..e8f865f
--- /dev/null
+++ b/hostsidetests/inputmethodservice/deviceside/ime2/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2014 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.
+
+android_test {
+    name: "CtsInputMethod2",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "CtsInputMethodServiceCommon",
+        "CtsInputMethodServiceLib",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    sdk_version: "test_current",
+    min_sdk_version: "19",
+}
diff --git a/hostsidetests/inputmethodservice/deviceside/ime2/Android.mk b/hostsidetests/inputmethodservice/deviceside/ime2/Android.mk
deleted file mode 100644
index 7b9ebeb..0000000
--- a/hostsidetests/inputmethodservice/deviceside/ime2/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 2014 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIR := res
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    CtsInputMethodServiceCommon \
-    CtsInputMethodServiceLib
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsInputMethod2
-
-LOCAL_SDK_VERSION := test_current
-LOCAL_MIN_SDK_VERSION := 19
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/inputmethodservice/deviceside/lib/Android.bp b/hostsidetests/inputmethodservice/deviceside/lib/Android.bp
new file mode 100644
index 0000000..cecc584
--- /dev/null
+++ b/hostsidetests/inputmethodservice/deviceside/lib/Android.bp
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 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.
+
+java_test_helper_library {
+    name: "CtsInputMethodServiceLib",
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "androidx.annotation_annotation",
+        "CtsInputMethodServiceCommon",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/inputmethodservice/deviceside/lib/Android.mk b/hostsidetests/inputmethodservice/deviceside/lib/Android.mk
deleted file mode 100644
index 9a99bdc..0000000
--- a/hostsidetests/inputmethodservice/deviceside/lib/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.annotation_annotation \
-    CtsInputMethodServiceCommon
-
-LOCAL_MODULE_TAGS := tests
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MODULE := CtsInputMethodServiceLib
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/hostsidetests/inputmethodservice/deviceside/provider/Android.bp b/hostsidetests/inputmethodservice/deviceside/provider/Android.bp
new file mode 100644
index 0000000..d9363e8
--- /dev/null
+++ b/hostsidetests/inputmethodservice/deviceside/provider/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsInputMethodServiceEventProvider",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "CtsInputMethodServiceCommon",
+        "CtsInputMethodServiceLib",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    sdk_version: "test_current",
+    min_sdk_version: "26",
+}
diff --git a/hostsidetests/inputmethodservice/deviceside/provider/Android.mk b/hostsidetests/inputmethodservice/deviceside/provider/Android.mk
deleted file mode 100644
index 73d4b84..0000000
--- a/hostsidetests/inputmethodservice/deviceside/provider/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    CtsInputMethodServiceCommon \
-    CtsInputMethodServiceLib
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsInputMethodServiceEventProvider
-
-LOCAL_SDK_VERSION := test_current
-LOCAL_MIN_SDK_VERSION := 26
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/inputmethodservice/hostside/Android.bp b/hostsidetests/inputmethodservice/hostside/Android.bp
new file mode 100644
index 0000000..5e99fdf
--- /dev/null
+++ b/hostsidetests/inputmethodservice/hostside/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 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.
+
+java_test_host {
+    name: "CtsInputMethodServiceHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    libs: [
+        "compatibility-host-util",
+        "cts-tradefed",
+        "tradefed",
+    ],
+    static_libs: ["cts-inputmethodservice-common-host"],
+}
diff --git a/hostsidetests/inputmethodservice/hostside/Android.mk b/hostsidetests/inputmethodservice/hostside/Android.mk
deleted file mode 100644
index 2cfca0e..0000000
--- a/hostsidetests/inputmethodservice/hostside/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := tests
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_MODULE := CtsInputMethodServiceHostTestCases
-
-LOCAL_JAVA_LIBRARIES := \
-    compatibility-host-util \
-    cts-tradefed \
-    tradefed
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    cts-inputmethodservice-common-host
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
diff --git a/hostsidetests/jdwpsecurity/Android.bp b/hostsidetests/jdwpsecurity/Android.bp
new file mode 100644
index 0000000..8e99529
--- /dev/null
+++ b/hostsidetests/jdwpsecurity/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2015 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.
+
+java_test_host {
+    name: "CtsJdwpSecurityHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    data: [":CtsJdwpApp"],
+}
diff --git a/hostsidetests/jdwpsecurity/Android.mk b/hostsidetests/jdwpsecurity/Android.mk
deleted file mode 100644
index c740f61..0000000
--- a/hostsidetests/jdwpsecurity/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := optional
-
-# Must match the package name in CtsTestCaseList.mk
-LOCAL_MODULE := CtsJdwpSecurityHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_CTS_TEST_PACKAGE := android.host.jdwpsecurity
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/jdwpsecurity/OWNERS b/hostsidetests/jdwpsecurity/OWNERS
new file mode 100644
index 0000000..6e06299
--- /dev/null
+++ b/hostsidetests/jdwpsecurity/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 86431
+include /hostsidetests/jvmti/run-tests/OWNERS
diff --git a/hostsidetests/jdwpsecurity/app/Android.bp b/hostsidetests/jdwpsecurity/app/Android.bp
new file mode 100644
index 0000000..93761b6
--- /dev/null
+++ b/hostsidetests/jdwpsecurity/app/Android.bp
@@ -0,0 +1,18 @@
+// Copyright (C) 2015 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.
+
+java_test_helper_library {
+    name: "CtsJdwpApp",
+    srcs: ["**/*.java"],
+}
diff --git a/hostsidetests/jdwpsecurity/app/Android.mk b/hostsidetests/jdwpsecurity/app/Android.mk
deleted file mode 100644
index e1523ab..0000000
--- a/hostsidetests/jdwpsecurity/app/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (C) 2015 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)
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := CtsJdwpApp
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-include $(BUILD_JAVA_LIBRARY)
diff --git a/hostsidetests/jdwptunnel/Android.bp b/hostsidetests/jdwptunnel/Android.bp
index 291dbd3..fbc18fa 100644
--- a/hostsidetests/jdwptunnel/Android.bp
+++ b/hostsidetests/jdwptunnel/Android.bp
@@ -27,6 +27,7 @@
     data: [
         // Include the JDI classes in the testcases directory.
         ":jdi-support",
+        ":CtsJdwpTunnelSampleApp",
     ],
 
     // Tag this module as a cts test artifact
@@ -37,5 +38,4 @@
     ],
 
     // LOCAL_CTS_TEST_PACKAGE := android.host.jdwptunnel
-
 }
diff --git a/hostsidetests/jdwptunnel/OWNERS b/hostsidetests/jdwptunnel/OWNERS
new file mode 100644
index 0000000..6e06299
--- /dev/null
+++ b/hostsidetests/jdwptunnel/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 86431
+include /hostsidetests/jvmti/run-tests/OWNERS
diff --git a/hostsidetests/jdwptunnel/sampleapp/Android.bp b/hostsidetests/jdwptunnel/sampleapp/Android.bp
index f932fa9..0ed8655 100644
--- a/hostsidetests/jdwptunnel/sampleapp/Android.bp
+++ b/hostsidetests/jdwptunnel/sampleapp/Android.bp
@@ -25,13 +25,6 @@
 
     srcs: ["src/**/*.java"],
 
-    // tag this module as a cts test artifact
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
-
     sdk_version: "current",
 
 }
diff --git a/hostsidetests/jvmti/allocation-tracking/OWNERS b/hostsidetests/jvmti/allocation-tracking/OWNERS
new file mode 100644
index 0000000..2dbff0d
--- /dev/null
+++ b/hostsidetests/jvmti/allocation-tracking/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 86431
+include ../run-tests/OWNERS
diff --git a/hostsidetests/jvmti/attaching/Android.bp b/hostsidetests/jvmti/attaching/Android.bp
index 161c0bf..48b095e 100644
--- a/hostsidetests/jvmti/attaching/Android.bp
+++ b/hostsidetests/jvmti/attaching/Android.bp
@@ -22,11 +22,6 @@
     },
     srcs: ["app/src/**/*.java"],
     manifest: "app/AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
     jni_libs: ["libctsjvmtiattachagent"],
     compile_multilib: "both",
     sdk_version: "test_current",
@@ -90,4 +85,5 @@
         "general-tests",
     ],
     test_config: "host/AndroidTest.xml",
+    data: [":CtsJvmtiAttachingDeviceApp"],
 }
diff --git a/hostsidetests/jvmti/attaching/OWNERS b/hostsidetests/jvmti/attaching/OWNERS
new file mode 100644
index 0000000..2dbff0d
--- /dev/null
+++ b/hostsidetests/jvmti/attaching/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 86431
+include ../run-tests/OWNERS
diff --git a/hostsidetests/jvmti/attaching/app/AndroidManifest.xml b/hostsidetests/jvmti/attaching/app/AndroidManifest.xml
index feb7b24..7c21f04 100755
--- a/hostsidetests/jvmti/attaching/app/AndroidManifest.xml
+++ b/hostsidetests/jvmti/attaching/app/AndroidManifest.xml
@@ -17,6 +17,8 @@
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="android.jvmti.cts.attaching">
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
 
     <application android:name="android.jvmti.JvmtiApplication" android:debuggable="true">
         <activity android:exported="true" android:name="android.jvmti.JvmtiActivity" >
diff --git a/hostsidetests/jvmti/attaching/app/src/android/jvmti/JvmtiActivity.java b/hostsidetests/jvmti/attaching/app/src/android/jvmti/JvmtiActivity.java
index 88a0fa9..aa8a5ed 100644
--- a/hostsidetests/jvmti/attaching/app/src/android/jvmti/JvmtiActivity.java
+++ b/hostsidetests/jvmti/attaching/app/src/android/jvmti/JvmtiActivity.java
@@ -18,20 +18,68 @@
 
 import android.app.Activity;
 import android.os.Bundle;
-
+import android.util.Log;
+import android.net.LocalSocket;
+import android.net.LocalSocketAddress;
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
 import java.lang.Override;
 
+import java.io.PrintStream;
+import java.nio.charset.Charset;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+
 /**
  * A specialized activity. This is separate from the other agent tests as we can't use
  * instrumentation for this.
  */
 public class JvmtiActivity extends Activity {
 
+    private static final String SOCK_NAME = "CtsJvmtiAttachingHostTestCases_SOCKET";
     private final static String APP_DESCRIPTOR = "Landroid/jvmti/JvmtiApplication;";
     @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
+        try {
+          runTest();
+          returnResult("SUCCESS");
+        } catch (Throwable e) {
+          ByteArrayOutputStream baos = new ByteArrayOutputStream();
+          e.printStackTrace(new PrintStream(baos));
 
+          returnResult("FAILED: " + baos.toString());
+        }
+    }
+
+    void returnResult(final String s) {
+      // Annoying, well-intentioned, 'sanity' checks prevent us from performing network actions on
+      // the current thread. Create another one and wait for it.
+      Thread t = new Thread(() -> {
+          try (LocalSocket ls = new LocalSocket()) {
+              // LocalSocket doesn't support timeout. It doesn't really matter since the host-side
+              // has one.
+              ls.connect(new LocalSocketAddress(SOCK_NAME));
+              DataOutputStream dos = new DataOutputStream(ls.getOutputStream());
+              dos.writeUTF(s);
+              dos.flush();
+              ls.shutdownOutput();
+              // Wait for the other end to close the connection.
+              while (-1 != ls.getInputStream().read()) {}
+          } catch (IOException e) {
+              ByteArrayOutputStream baos = new ByteArrayOutputStream();
+              e.printStackTrace(new PrintStream(baos));
+              Log.wtf("JvmtiActivity", "Could not connect to result socket! " + e + baos.toString());
+          }
+      });
+      t.start();
+      try {
+        t.join();
+      } catch (Exception e) {}
+    }
+
+    public void runTest() throws Exception {
         System.out.println("Checking for " + APP_DESCRIPTOR);
         if (!didSeeLoadOf(APP_DESCRIPTOR)) {
             throw new IllegalStateException("Did not see the load of the application class!");
diff --git a/hostsidetests/jvmti/attaching/host/src/android/jvmti/cts/JvmtiAttachingHostTest.java b/hostsidetests/jvmti/attaching/host/src/android/jvmti/cts/JvmtiAttachingHostTest.java
index 3af0b9e..059091f 100644
--- a/hostsidetests/jvmti/attaching/host/src/android/jvmti/cts/JvmtiAttachingHostTest.java
+++ b/hostsidetests/jvmti/attaching/host/src/android/jvmti/cts/JvmtiAttachingHostTest.java
@@ -25,10 +25,16 @@
 import com.android.tradefed.testtype.IAbiReceiver;
 import com.android.tradefed.testtype.IBuildReceiver;
 import com.android.tradefed.util.AbiUtils;
+import com.android.tradefed.util.ArrayUtil;
 import com.android.tradefed.util.FileUtil;
+import com.android.tradefed.util.IRunUtil;
+import com.android.tradefed.util.RunUtil;
 import com.android.tradefed.util.ZipUtil;
 
+import java.io.DataInputStream;
 import java.io.File;
+import java.net.ServerSocket;
+import java.net.Socket;
 import java.util.concurrent.TimeUnit;
 import java.util.zip.ZipFile;
 
@@ -67,6 +73,10 @@
 
     private final static String AGENT = "libctsjvmtiattachagent.so";
 
+    private final static String STARTUP_AGENT_DIR = "code_cache/startup_agents";
+
+    private static String REMOTE_SOCKET_NAME = "CtsJvmtiAttachingHostTestCases_SOCKET";
+
     @Override
     protected void setUp() throws Exception {
         mCurrentUser = getDevice().getCurrentUser();
@@ -109,6 +119,35 @@
         });
     }
 
+    public void testJvmtiAgentStartupAgents() throws Exception {
+        runJvmtiAgentLoadTest((ITestDevice device, String pkg, String apk, String abiName) -> {
+            String startup_dir = null;
+            try {
+                startup_dir = getPwd(device, pkg) + "/" + STARTUP_AGENT_DIR;
+                device.executeShellCommand(
+                        "run-as " + pkg + " --user " + mCurrentUser + " mkdir -p " + startup_dir);
+            } catch (Exception e) {
+                throw new RuntimeException("Failed to install startup-agents");
+            }
+            try {
+                installLibToDataData(device, pkg, abiName, apk, startup_dir, AGENT, AGENT);
+                // Run and check attach occurs.
+                runAttachTestCmd(device, pkg, "");
+                runAttachTestCmd(device, pkg, "");
+            } catch (Exception e) {
+                throw new RuntimeException("Failed startup_agents attaching", e);
+            } finally {
+                try {
+                    // Cleanup the startup-agents directory
+                    device.executeShellCommand(
+                            "run-as " + pkg + " --user " + mCurrentUser + " rm -rf " + startup_dir);
+                } catch (Exception e) {
+                    throw new RuntimeException("Failed to clean up " + startup_dir, e);
+                }
+            }
+        });
+    }
+
     public void testJvmtiAgentAppInternal() throws Exception {
         runJvmtiAgentLoadTest((ITestDevice device, String pkg, String apk, String abiName) -> {
             try {
@@ -132,16 +171,7 @@
     public void testJvmtiAgentAppExternal() throws Exception {
         runJvmtiAgentLoadTest((ITestDevice device, String pkg, String apk, String abiName) -> {
             try {
-                String pwd = device.executeShellCommand(
-                        "run-as " + pkg + " --user " + mCurrentUser + " pwd");
-                if (pwd == null) {
-                    throw new RuntimeException("pwd failed");
-                }
-                pwd = pwd.trim();
-                if (pwd.isEmpty()) {
-                    throw new RuntimeException("pwd failed");
-                }
-
+                String pwd = getPwd(device, pkg);
                 // Give it a different name, so we do not have "contamination" from
                 // the test APK.
                 String libInDataData = AGENT.substring(0, AGENT.length() - ".so".length())
@@ -167,6 +197,19 @@
         });
     }
 
+    private String getPwd(ITestDevice device, String pkg) throws Exception {
+        String pwd = device.executeShellCommand(
+                "run-as " + pkg + " --user " + mCurrentUser + " pwd");
+        if (pwd == null) {
+            throw new RuntimeException("pwd failed");
+        }
+        pwd = pwd.trim();
+        if (pwd.isEmpty()) {
+            throw new RuntimeException("pwd failed");
+        }
+        return pwd;
+    }
+
     private void runJvmtiAgentLoadTest(TestRun runner) throws Exception {
         final ITestDevice device = getDevice();
 
@@ -203,13 +246,33 @@
 
     private static void runAttachTestCmd(ITestDevice device, String pkg, String agentParams)
             throws Exception {
-        String attachCmd = "cmd activity start -S -W " + agentParams + " -n " + pkg
-                + "/android.jvmti.JvmtiActivity";
+        // Get a reverse socket setup
+        try (final ServerSocket ss = new ServerSocket(0)) {
+            device.executeAdbCommand(
+                    "reverse", "localabstract:" + REMOTE_SOCKET_NAME, "tcp:" + ss.getLocalPort());
+            String attachCmd = "cmd activity start -S -W " + agentParams + " -n " + pkg
+                    + "/android.jvmti.JvmtiActivity";
 
-        // Don't try to parse the output. The test will time out anyways if this didn't
-        // work.
-        device.executeShellCommand(attachCmd, NullOutputReceiver.getReceiver(), 10,
-                TimeUnit.SECONDS, 1);
+            // Don't try to parse the output. We'll get data from the socket or a timeout if it
+            // didn't start.
+            device.executeShellCommand(attachCmd, NullOutputReceiver.getReceiver(), 10,
+                  TimeUnit.SECONDS, 1);
+            // Wait for startup up to 30 seconds.
+            ss.setSoTimeout(30000);
+            try (Socket s = ss.accept()) {
+                DataInputStream dis = new DataInputStream(s.getInputStream());
+                String res = dis.readUTF();
+                s.shutdownInput();
+                s.shutdownOutput();
+                if (!res.trim().equals("SUCCESS")) {
+                    throw new RuntimeException("Failed test due to remote error: " + res);
+                }
+            } catch (Exception e) {
+                throw new RuntimeException("Failed to read output", e);
+            }
+        } finally {
+            device.executeAdbCommand("reverse", "--remove", "localabstract:" + REMOTE_SOCKET_NAME);
+        }
     }
 
     private String installLibToDataData(ITestDevice device, String pkg, String abiName,
diff --git a/hostsidetests/jvmti/redefining/Android.bp b/hostsidetests/jvmti/redefining/Android.bp
index 422292a..6de0131 100644
--- a/hostsidetests/jvmti/redefining/Android.bp
+++ b/hostsidetests/jvmti/redefining/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRedefineClassesDeviceApp"],
 }
diff --git a/hostsidetests/jvmti/redefining/OWNERS b/hostsidetests/jvmti/redefining/OWNERS
new file mode 100644
index 0000000..2dbff0d
--- /dev/null
+++ b/hostsidetests/jvmti/redefining/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 86431
+include ../run-tests/OWNERS
diff --git a/hostsidetests/jvmti/redefining/app/Android.bp b/hostsidetests/jvmti/redefining/app/Android.bp
index 7439a49..f6eaa91 100644
--- a/hostsidetests/jvmti/redefining/app/Android.bp
+++ b/hostsidetests/jvmti/redefining/app/Android.bp
@@ -16,11 +16,6 @@
     name: "CtsJvmtiRedefineClassesDeviceApp",
     srcs: ["src/**/*.java"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
     dex_preopt: {
         enabled: false,
     },
diff --git a/hostsidetests/jvmti/run-tests/test-1900/Android.bp b/hostsidetests/jvmti/run-tests/test-1900/Android.bp
index 50534c9..13f8765 100644
--- a/hostsidetests/jvmti/run-tests/test-1900/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1900/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1900DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1900/OWNERS b/hostsidetests/jvmti/run-tests/test-1900/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1900/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1900/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1900/app/Android.bp
index 829d5e2..7f66aa6 100644
--- a/hostsidetests/jvmti/run-tests/test-1900/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1900/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1900DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1900/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1900/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1900/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1901/Android.bp b/hostsidetests/jvmti/run-tests/test-1901/Android.bp
index 6dbaa8a..2c7c6a6 100644
--- a/hostsidetests/jvmti/run-tests/test-1901/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1901/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1901DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1901/OWNERS b/hostsidetests/jvmti/run-tests/test-1901/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1901/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1901/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1901/app/Android.bp
index ad7b20b..30362dc 100644
--- a/hostsidetests/jvmti/run-tests/test-1901/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1901/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1901DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1901/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1901/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1901/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1902/Android.bp b/hostsidetests/jvmti/run-tests/test-1902/Android.bp
index b027b13..3683e58 100644
--- a/hostsidetests/jvmti/run-tests/test-1902/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1902/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1902DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1902/OWNERS b/hostsidetests/jvmti/run-tests/test-1902/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1902/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1902/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1902/app/Android.bp
index f32da86..b4c7e96 100644
--- a/hostsidetests/jvmti/run-tests/test-1902/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1902/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1902DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1902/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1902/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1902/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1903/Android.bp b/hostsidetests/jvmti/run-tests/test-1903/Android.bp
index 6fbdc2e..cb8470f 100644
--- a/hostsidetests/jvmti/run-tests/test-1903/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1903/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1903DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1903/OWNERS b/hostsidetests/jvmti/run-tests/test-1903/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1903/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1903/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1903/app/Android.bp
index fbdca99..b2a9211 100644
--- a/hostsidetests/jvmti/run-tests/test-1903/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1903/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1903DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1903/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1903/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1903/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1904/Android.bp b/hostsidetests/jvmti/run-tests/test-1904/Android.bp
index 37a941a..0eb9b1d 100644
--- a/hostsidetests/jvmti/run-tests/test-1904/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1904/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1904DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1904/OWNERS b/hostsidetests/jvmti/run-tests/test-1904/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1904/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1904/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1904/app/Android.bp
index 7c94b54..e0ded3c 100644
--- a/hostsidetests/jvmti/run-tests/test-1904/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1904/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1904DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1904/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1904/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1904/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1906/Android.bp b/hostsidetests/jvmti/run-tests/test-1906/Android.bp
index 2970990..9aadc1a 100644
--- a/hostsidetests/jvmti/run-tests/test-1906/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1906/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1906DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1906/OWNERS b/hostsidetests/jvmti/run-tests/test-1906/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1906/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1906/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1906/app/Android.bp
index 34e8688..b7c2379 100644
--- a/hostsidetests/jvmti/run-tests/test-1906/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1906/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1906DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1906/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1906/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1906/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1907/Android.bp b/hostsidetests/jvmti/run-tests/test-1907/Android.bp
index 0133211..0f88968 100644
--- a/hostsidetests/jvmti/run-tests/test-1907/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1907/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1907DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1907/OWNERS b/hostsidetests/jvmti/run-tests/test-1907/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1907/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1907/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1907/app/Android.bp
index e4d49cc..e608f12 100644
--- a/hostsidetests/jvmti/run-tests/test-1907/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1907/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1907DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1907/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1907/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1907/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1908/Android.bp b/hostsidetests/jvmti/run-tests/test-1908/Android.bp
index 76dfb7d..308ebc6 100644
--- a/hostsidetests/jvmti/run-tests/test-1908/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1908/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1908DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1908/OWNERS b/hostsidetests/jvmti/run-tests/test-1908/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1908/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1908/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1908/app/Android.bp
index 089bf8f..1dc8780 100644
--- a/hostsidetests/jvmti/run-tests/test-1908/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1908/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1908DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1908/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1908/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1908/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1909/Android.bp b/hostsidetests/jvmti/run-tests/test-1909/Android.bp
index 34e698a..c8f7822 100644
--- a/hostsidetests/jvmti/run-tests/test-1909/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1909/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1909DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1909/OWNERS b/hostsidetests/jvmti/run-tests/test-1909/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1909/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1909/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1909/app/Android.bp
index 6655468..5ebbefc 100644
--- a/hostsidetests/jvmti/run-tests/test-1909/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1909/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1909DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1909/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1909/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1909/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1910/Android.bp b/hostsidetests/jvmti/run-tests/test-1910/Android.bp
index 4ad065a..1918925 100644
--- a/hostsidetests/jvmti/run-tests/test-1910/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1910/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1910DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1910/OWNERS b/hostsidetests/jvmti/run-tests/test-1910/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1910/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1910/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1910/app/Android.bp
index 00bb484..72f1704 100644
--- a/hostsidetests/jvmti/run-tests/test-1910/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1910/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1910DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1910/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1910/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1910/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1911/Android.bp b/hostsidetests/jvmti/run-tests/test-1911/Android.bp
index 1e46a63..74f484f 100644
--- a/hostsidetests/jvmti/run-tests/test-1911/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1911/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1911DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1911/OWNERS b/hostsidetests/jvmti/run-tests/test-1911/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1911/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1911/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1911/app/Android.bp
index 4191947..30648cd 100644
--- a/hostsidetests/jvmti/run-tests/test-1911/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1911/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1911DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1911/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1911/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1911/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1912/Android.bp b/hostsidetests/jvmti/run-tests/test-1912/Android.bp
index 3b7141a..e39ae46 100644
--- a/hostsidetests/jvmti/run-tests/test-1912/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1912/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1912DeviceApp"]
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1912/OWNERS b/hostsidetests/jvmti/run-tests/test-1912/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1912/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1912/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1912/app/Android.bp
index c9c5e57..0029625 100644
--- a/hostsidetests/jvmti/run-tests/test-1912/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1912/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1912DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1912/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1912/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1912/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1913/Android.bp b/hostsidetests/jvmti/run-tests/test-1913/Android.bp
index 6fe4e16..741c60d 100644
--- a/hostsidetests/jvmti/run-tests/test-1913/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1913/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1913DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1913/OWNERS b/hostsidetests/jvmti/run-tests/test-1913/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1913/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1913/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1913/app/Android.bp
index 8ee51c2..20c656f 100644
--- a/hostsidetests/jvmti/run-tests/test-1913/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1913/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1913DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1913/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1913/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1913/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1914/Android.bp b/hostsidetests/jvmti/run-tests/test-1914/Android.bp
index 3d07e78..a585538 100644
--- a/hostsidetests/jvmti/run-tests/test-1914/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1914/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1914DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1914/OWNERS b/hostsidetests/jvmti/run-tests/test-1914/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1914/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1914/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1914/app/Android.bp
index 2d89ba2..ab381ba 100644
--- a/hostsidetests/jvmti/run-tests/test-1914/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1914/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1914DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1914/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1914/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1914/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1915/Android.bp b/hostsidetests/jvmti/run-tests/test-1915/Android.bp
index 75d7ba0..aaf75cb 100644
--- a/hostsidetests/jvmti/run-tests/test-1915/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1915/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1915DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1915/OWNERS b/hostsidetests/jvmti/run-tests/test-1915/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1915/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1915/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1915/app/Android.bp
index e73e7fb..e69cbd8 100644
--- a/hostsidetests/jvmti/run-tests/test-1915/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1915/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1915DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1915/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1915/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1915/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1916/Android.bp b/hostsidetests/jvmti/run-tests/test-1916/Android.bp
index 665e68d..c737491 100644
--- a/hostsidetests/jvmti/run-tests/test-1916/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1916/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1916DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1916/OWNERS b/hostsidetests/jvmti/run-tests/test-1916/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1916/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1916/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1916/app/Android.bp
index 9c25f0a..fbfc346 100644
--- a/hostsidetests/jvmti/run-tests/test-1916/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1916/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1916DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1916/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1916/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1916/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1917/Android.bp b/hostsidetests/jvmti/run-tests/test-1917/Android.bp
index 8ce0cee..b9eb679 100644
--- a/hostsidetests/jvmti/run-tests/test-1917/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1917/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1917DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1917/OWNERS b/hostsidetests/jvmti/run-tests/test-1917/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1917/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1917/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1917/app/Android.bp
index e840eb4..6e00971 100644
--- a/hostsidetests/jvmti/run-tests/test-1917/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1917/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1917DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1917/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1917/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1917/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1920/Android.bp b/hostsidetests/jvmti/run-tests/test-1920/Android.bp
index a20c929..ce42c57 100644
--- a/hostsidetests/jvmti/run-tests/test-1920/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1920/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1920DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1920/OWNERS b/hostsidetests/jvmti/run-tests/test-1920/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1920/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1920/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1920/app/Android.bp
index d0cb888..85a13cb 100644
--- a/hostsidetests/jvmti/run-tests/test-1920/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1920/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1920DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1920/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1920/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1920/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1921/Android.bp b/hostsidetests/jvmti/run-tests/test-1921/Android.bp
index 9f999a9..553f8a1 100644
--- a/hostsidetests/jvmti/run-tests/test-1921/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1921/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1921DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1921/OWNERS b/hostsidetests/jvmti/run-tests/test-1921/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1921/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1921/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1921/app/Android.bp
index afa39f0..e55bcb6 100644
--- a/hostsidetests/jvmti/run-tests/test-1921/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1921/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1921DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1921/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1921/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1921/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1922/Android.bp b/hostsidetests/jvmti/run-tests/test-1922/Android.bp
index 05c2259..a38c5a9 100644
--- a/hostsidetests/jvmti/run-tests/test-1922/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1922/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1922DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1922/OWNERS b/hostsidetests/jvmti/run-tests/test-1922/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1922/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1922/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1922/app/Android.bp
index 0c9baff..7419c80 100644
--- a/hostsidetests/jvmti/run-tests/test-1922/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1922/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1922DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1922/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1922/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1922/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1923/Android.bp b/hostsidetests/jvmti/run-tests/test-1923/Android.bp
index 7b82915..7d49861 100644
--- a/hostsidetests/jvmti/run-tests/test-1923/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1923/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1923DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1923/OWNERS b/hostsidetests/jvmti/run-tests/test-1923/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1923/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1923/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1923/app/Android.bp
index 15ad9ed..df1e773 100644
--- a/hostsidetests/jvmti/run-tests/test-1923/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1923/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1923DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1923/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1923/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1923/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1924/Android.bp b/hostsidetests/jvmti/run-tests/test-1924/Android.bp
index 258ce4a..0f7dec9 100644
--- a/hostsidetests/jvmti/run-tests/test-1924/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1924/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1924DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1924/OWNERS b/hostsidetests/jvmti/run-tests/test-1924/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1924/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1924/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1924/app/Android.bp
index 1e95552..1a18d4f 100644
--- a/hostsidetests/jvmti/run-tests/test-1924/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1924/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1924DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1924/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1924/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1924/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1925/Android.bp b/hostsidetests/jvmti/run-tests/test-1925/Android.bp
index 4133595..4076977 100644
--- a/hostsidetests/jvmti/run-tests/test-1925/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1925/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1925DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1925/OWNERS b/hostsidetests/jvmti/run-tests/test-1925/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1925/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1925/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1925/app/Android.bp
index 969a191..9210b43 100644
--- a/hostsidetests/jvmti/run-tests/test-1925/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1925/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1925DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1925/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1925/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1925/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1926/Android.bp b/hostsidetests/jvmti/run-tests/test-1926/Android.bp
index 3a60363..50c1f42 100644
--- a/hostsidetests/jvmti/run-tests/test-1926/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1926/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1926DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1926/OWNERS b/hostsidetests/jvmti/run-tests/test-1926/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1926/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1926/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1926/app/Android.bp
index 50fa51f..d222132 100644
--- a/hostsidetests/jvmti/run-tests/test-1926/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1926/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1926DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1926/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1926/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1926/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1927/Android.bp b/hostsidetests/jvmti/run-tests/test-1927/Android.bp
index ccfd7d2..fb55fb4 100644
--- a/hostsidetests/jvmti/run-tests/test-1927/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1927/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1927DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1927/OWNERS b/hostsidetests/jvmti/run-tests/test-1927/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1927/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1927/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1927/app/Android.bp
index 29c8186..ee61952 100644
--- a/hostsidetests/jvmti/run-tests/test-1927/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1927/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1927DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1927/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1927/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1927/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1928/Android.bp b/hostsidetests/jvmti/run-tests/test-1928/Android.bp
index f4177bf..9f82560 100644
--- a/hostsidetests/jvmti/run-tests/test-1928/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1928/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1928DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1928/OWNERS b/hostsidetests/jvmti/run-tests/test-1928/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1928/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1928/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1928/app/Android.bp
index 129af10..54511d4 100644
--- a/hostsidetests/jvmti/run-tests/test-1928/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1928/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1928DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1928/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1928/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1928/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1930/Android.bp b/hostsidetests/jvmti/run-tests/test-1930/Android.bp
index 434736d..c7931c8 100644
--- a/hostsidetests/jvmti/run-tests/test-1930/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1930/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1930DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1930/OWNERS b/hostsidetests/jvmti/run-tests/test-1930/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1930/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1930/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1930/app/Android.bp
index a66ff0c..0dcd23e 100644
--- a/hostsidetests/jvmti/run-tests/test-1930/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1930/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1930DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1930/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1930/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1930/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1931/Android.bp b/hostsidetests/jvmti/run-tests/test-1931/Android.bp
index 4365f31..1ad7236 100644
--- a/hostsidetests/jvmti/run-tests/test-1931/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1931/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1931DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1931/OWNERS b/hostsidetests/jvmti/run-tests/test-1931/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1931/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1931/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1931/app/Android.bp
index 74ddcfd..c3fc64a 100644
--- a/hostsidetests/jvmti/run-tests/test-1931/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1931/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1931DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1931/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1931/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1931/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1932/Android.bp b/hostsidetests/jvmti/run-tests/test-1932/Android.bp
index ab6059b..acbebed 100644
--- a/hostsidetests/jvmti/run-tests/test-1932/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1932/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1932DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1932/OWNERS b/hostsidetests/jvmti/run-tests/test-1932/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1932/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1932/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1932/app/Android.bp
index 7fc1a48..a317ca5 100644
--- a/hostsidetests/jvmti/run-tests/test-1932/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1932/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1932DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1932/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1932/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1932/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1933/Android.bp b/hostsidetests/jvmti/run-tests/test-1933/Android.bp
index 89e3321..4fde3e5 100644
--- a/hostsidetests/jvmti/run-tests/test-1933/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1933/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1933DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1933/OWNERS b/hostsidetests/jvmti/run-tests/test-1933/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1933/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1933/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1933/app/Android.bp
index 1f245cd..62a62ea 100644
--- a/hostsidetests/jvmti/run-tests/test-1933/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1933/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1933DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1933/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1933/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1933/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1934/Android.bp b/hostsidetests/jvmti/run-tests/test-1934/Android.bp
index b408b5c..a7b003c 100644
--- a/hostsidetests/jvmti/run-tests/test-1934/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1934/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1934DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1934/OWNERS b/hostsidetests/jvmti/run-tests/test-1934/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1934/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1934/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1934/app/Android.bp
index 7fa7cfd..2b73db8 100644
--- a/hostsidetests/jvmti/run-tests/test-1934/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1934/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1934DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1934/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1934/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1934/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1936/Android.bp b/hostsidetests/jvmti/run-tests/test-1936/Android.bp
index d2c5a99..7c4b29d 100644
--- a/hostsidetests/jvmti/run-tests/test-1936/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1936/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1936DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1936/OWNERS b/hostsidetests/jvmti/run-tests/test-1936/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1936/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1936/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1936/app/Android.bp
index 447e90f..4f15834 100644
--- a/hostsidetests/jvmti/run-tests/test-1936/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1936/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1936DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1936/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1936/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1936/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1937/Android.bp b/hostsidetests/jvmti/run-tests/test-1937/Android.bp
index 22617dd..6814ef4 100644
--- a/hostsidetests/jvmti/run-tests/test-1937/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1937/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1937DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1937/OWNERS b/hostsidetests/jvmti/run-tests/test-1937/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1937/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1937/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1937/app/Android.bp
index 9657eee..b9005dd 100644
--- a/hostsidetests/jvmti/run-tests/test-1937/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1937/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1937DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1937/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1937/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1937/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1939/Android.bp b/hostsidetests/jvmti/run-tests/test-1939/Android.bp
index cb1080b..43685b9 100644
--- a/hostsidetests/jvmti/run-tests/test-1939/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1939/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1939DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1939/OWNERS b/hostsidetests/jvmti/run-tests/test-1939/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1939/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1939/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1939/app/Android.bp
index c6aa457..f0cf4dd 100644
--- a/hostsidetests/jvmti/run-tests/test-1939/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1939/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1939DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1939/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1939/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1939/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1941/Android.bp b/hostsidetests/jvmti/run-tests/test-1941/Android.bp
index 07c2281..94eeb35 100644
--- a/hostsidetests/jvmti/run-tests/test-1941/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1941/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1941DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1941/OWNERS b/hostsidetests/jvmti/run-tests/test-1941/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1941/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1941/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1941/app/Android.bp
index 45265c2..d0f3c0c 100644
--- a/hostsidetests/jvmti/run-tests/test-1941/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1941/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1941DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1941/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1941/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1941/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1942/Android.bp b/hostsidetests/jvmti/run-tests/test-1942/Android.bp
index 5775ddf..b7dd9aa 100644
--- a/hostsidetests/jvmti/run-tests/test-1942/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1942/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1942DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1942/OWNERS b/hostsidetests/jvmti/run-tests/test-1942/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1942/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1942/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1942/app/Android.bp
index 0b1c83c..7a7d4a8 100644
--- a/hostsidetests/jvmti/run-tests/test-1942/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1942/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1942DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1942/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1942/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1942/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1943/Android.bp b/hostsidetests/jvmti/run-tests/test-1943/Android.bp
index bd9b921..9266e79 100644
--- a/hostsidetests/jvmti/run-tests/test-1943/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1943/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1943DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1943/OWNERS b/hostsidetests/jvmti/run-tests/test-1943/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1943/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1943/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1943/app/Android.bp
index 6ffc57a..afcbbd0 100644
--- a/hostsidetests/jvmti/run-tests/test-1943/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1943/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1943DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1943/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1943/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1943/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1953/Android.bp b/hostsidetests/jvmti/run-tests/test-1953/Android.bp
index 758baa6..b428f90 100644
--- a/hostsidetests/jvmti/run-tests/test-1953/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1953/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1953DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1953/OWNERS b/hostsidetests/jvmti/run-tests/test-1953/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1953/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1953/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1953/app/Android.bp
index 60209cb..663050b 100644
--- a/hostsidetests/jvmti/run-tests/test-1953/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1953/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1953DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1953/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1953/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1953/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1958/Android.bp b/hostsidetests/jvmti/run-tests/test-1958/Android.bp
index b082c83..661582e 100644
--- a/hostsidetests/jvmti/run-tests/test-1958/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1958/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest1958DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1958/OWNERS b/hostsidetests/jvmti/run-tests/test-1958/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1958/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-1958/app/Android.bp b/hostsidetests/jvmti/run-tests/test-1958/app/Android.bp
index 270d31e..c3cd926 100644
--- a/hostsidetests/jvmti/run-tests/test-1958/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-1958/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest1958DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-1958/app/OWNERS b/hostsidetests/jvmti/run-tests/test-1958/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-1958/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-902/Android.bp b/hostsidetests/jvmti/run-tests/test-902/Android.bp
index 6d4d49b..380b464 100644
--- a/hostsidetests/jvmti/run-tests/test-902/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-902/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest902DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-902/OWNERS b/hostsidetests/jvmti/run-tests/test-902/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-902/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-902/app/Android.bp b/hostsidetests/jvmti/run-tests/test-902/app/Android.bp
index 0f97bb9..3083d65 100644
--- a/hostsidetests/jvmti/run-tests/test-902/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-902/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest902DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-902/app/OWNERS b/hostsidetests/jvmti/run-tests/test-902/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-902/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-903/Android.bp b/hostsidetests/jvmti/run-tests/test-903/Android.bp
index c600f83..966fc5f 100644
--- a/hostsidetests/jvmti/run-tests/test-903/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-903/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest903DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-903/OWNERS b/hostsidetests/jvmti/run-tests/test-903/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-903/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-903/app/Android.bp b/hostsidetests/jvmti/run-tests/test-903/app/Android.bp
index 66ce734..bee2731 100644
--- a/hostsidetests/jvmti/run-tests/test-903/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-903/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest903DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-903/app/OWNERS b/hostsidetests/jvmti/run-tests/test-903/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-903/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-904/Android.bp b/hostsidetests/jvmti/run-tests/test-904/Android.bp
index bcd7354..82966af 100644
--- a/hostsidetests/jvmti/run-tests/test-904/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-904/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest904DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-904/OWNERS b/hostsidetests/jvmti/run-tests/test-904/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-904/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-904/app/Android.bp b/hostsidetests/jvmti/run-tests/test-904/app/Android.bp
index 392b402..966dd2d 100644
--- a/hostsidetests/jvmti/run-tests/test-904/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-904/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest904DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-904/app/OWNERS b/hostsidetests/jvmti/run-tests/test-904/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-904/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-905/Android.bp b/hostsidetests/jvmti/run-tests/test-905/Android.bp
index d01e55d..cbf9100 100644
--- a/hostsidetests/jvmti/run-tests/test-905/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-905/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest905DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-905/OWNERS b/hostsidetests/jvmti/run-tests/test-905/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-905/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-905/app/Android.bp b/hostsidetests/jvmti/run-tests/test-905/app/Android.bp
index d894cc1..70ade13 100644
--- a/hostsidetests/jvmti/run-tests/test-905/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-905/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest905DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-905/app/OWNERS b/hostsidetests/jvmti/run-tests/test-905/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-905/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-906/Android.bp b/hostsidetests/jvmti/run-tests/test-906/Android.bp
index d3c42ef..c172214 100644
--- a/hostsidetests/jvmti/run-tests/test-906/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-906/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest906DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-906/OWNERS b/hostsidetests/jvmti/run-tests/test-906/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-906/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-906/app/Android.bp b/hostsidetests/jvmti/run-tests/test-906/app/Android.bp
index 6c7fde1..057dee2 100644
--- a/hostsidetests/jvmti/run-tests/test-906/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-906/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest906DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-906/app/OWNERS b/hostsidetests/jvmti/run-tests/test-906/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-906/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-907/Android.bp b/hostsidetests/jvmti/run-tests/test-907/Android.bp
index 359a621..39e9d20 100644
--- a/hostsidetests/jvmti/run-tests/test-907/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-907/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest907DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-907/OWNERS b/hostsidetests/jvmti/run-tests/test-907/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-907/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-907/app/Android.bp b/hostsidetests/jvmti/run-tests/test-907/app/Android.bp
index b5cc68b..3d6a249 100644
--- a/hostsidetests/jvmti/run-tests/test-907/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-907/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest907DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-907/app/OWNERS b/hostsidetests/jvmti/run-tests/test-907/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-907/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-908/Android.bp b/hostsidetests/jvmti/run-tests/test-908/Android.bp
index 698a775..ec637cb 100644
--- a/hostsidetests/jvmti/run-tests/test-908/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-908/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest908DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-908/OWNERS b/hostsidetests/jvmti/run-tests/test-908/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-908/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-908/app/Android.bp b/hostsidetests/jvmti/run-tests/test-908/app/Android.bp
index 4f836eb..b49570d 100644
--- a/hostsidetests/jvmti/run-tests/test-908/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-908/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest908DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-908/app/OWNERS b/hostsidetests/jvmti/run-tests/test-908/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-908/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-910/Android.bp b/hostsidetests/jvmti/run-tests/test-910/Android.bp
index ea8c0db..6005632 100644
--- a/hostsidetests/jvmti/run-tests/test-910/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-910/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest910DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-910/OWNERS b/hostsidetests/jvmti/run-tests/test-910/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-910/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-910/app/Android.bp b/hostsidetests/jvmti/run-tests/test-910/app/Android.bp
index 7b9df82..9ef6822 100644
--- a/hostsidetests/jvmti/run-tests/test-910/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-910/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest910DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-910/app/OWNERS b/hostsidetests/jvmti/run-tests/test-910/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-910/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-911/Android.bp b/hostsidetests/jvmti/run-tests/test-911/Android.bp
index 8edcff1..762739e 100644
--- a/hostsidetests/jvmti/run-tests/test-911/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-911/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest911DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-911/OWNERS b/hostsidetests/jvmti/run-tests/test-911/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-911/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-911/app/Android.bp b/hostsidetests/jvmti/run-tests/test-911/app/Android.bp
index 8b0b9e0..74ef5a4 100644
--- a/hostsidetests/jvmti/run-tests/test-911/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-911/app/Android.bp
@@ -16,11 +16,6 @@
     name: "CtsJvmtiRunTest911DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
     optimize: {
         enabled: false,
     }
diff --git a/hostsidetests/jvmti/run-tests/test-911/app/OWNERS b/hostsidetests/jvmti/run-tests/test-911/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-911/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-912/Android.bp b/hostsidetests/jvmti/run-tests/test-912/Android.bp
index f1ed01a..2c7e7a2 100644
--- a/hostsidetests/jvmti/run-tests/test-912/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-912/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest912DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-912/OWNERS b/hostsidetests/jvmti/run-tests/test-912/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-912/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-912/app/Android.bp b/hostsidetests/jvmti/run-tests/test-912/app/Android.bp
index 1724940..9c8d015 100644
--- a/hostsidetests/jvmti/run-tests/test-912/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-912/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest912DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-912/app/OWNERS b/hostsidetests/jvmti/run-tests/test-912/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-912/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-913/Android.bp b/hostsidetests/jvmti/run-tests/test-913/Android.bp
index cf8de73..c0a3a7c 100644
--- a/hostsidetests/jvmti/run-tests/test-913/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-913/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest913DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-913/OWNERS b/hostsidetests/jvmti/run-tests/test-913/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-913/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-913/app/Android.bp b/hostsidetests/jvmti/run-tests/test-913/app/Android.bp
index a9a514d..3871fa6 100644
--- a/hostsidetests/jvmti/run-tests/test-913/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-913/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest913DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-913/app/OWNERS b/hostsidetests/jvmti/run-tests/test-913/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-913/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-914/Android.bp b/hostsidetests/jvmti/run-tests/test-914/Android.bp
index 285c739..6024041 100644
--- a/hostsidetests/jvmti/run-tests/test-914/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-914/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest914DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-914/OWNERS b/hostsidetests/jvmti/run-tests/test-914/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-914/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-914/app/Android.bp b/hostsidetests/jvmti/run-tests/test-914/app/Android.bp
index ba1c78d..4357172 100644
--- a/hostsidetests/jvmti/run-tests/test-914/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-914/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest914DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-914/app/OWNERS b/hostsidetests/jvmti/run-tests/test-914/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-914/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-915/Android.bp b/hostsidetests/jvmti/run-tests/test-915/Android.bp
index c03473f..c67eeb4 100644
--- a/hostsidetests/jvmti/run-tests/test-915/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-915/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest915DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-915/OWNERS b/hostsidetests/jvmti/run-tests/test-915/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-915/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-915/app/Android.bp b/hostsidetests/jvmti/run-tests/test-915/app/Android.bp
index 0493d92..ba6d2c6 100644
--- a/hostsidetests/jvmti/run-tests/test-915/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-915/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest915DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-915/app/OWNERS b/hostsidetests/jvmti/run-tests/test-915/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-915/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-917/Android.bp b/hostsidetests/jvmti/run-tests/test-917/Android.bp
index 20b0a59..05cc057 100644
--- a/hostsidetests/jvmti/run-tests/test-917/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-917/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest917DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-917/OWNERS b/hostsidetests/jvmti/run-tests/test-917/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-917/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-917/app/Android.bp b/hostsidetests/jvmti/run-tests/test-917/app/Android.bp
index 20e2223..353c142 100644
--- a/hostsidetests/jvmti/run-tests/test-917/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-917/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest917DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-917/app/OWNERS b/hostsidetests/jvmti/run-tests/test-917/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-917/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-918/Android.bp b/hostsidetests/jvmti/run-tests/test-918/Android.bp
index 1f5b46f..925c560 100644
--- a/hostsidetests/jvmti/run-tests/test-918/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-918/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest918DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-918/OWNERS b/hostsidetests/jvmti/run-tests/test-918/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-918/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-918/app/Android.bp b/hostsidetests/jvmti/run-tests/test-918/app/Android.bp
index d517035..6d7951a 100644
--- a/hostsidetests/jvmti/run-tests/test-918/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-918/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest918DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-918/app/OWNERS b/hostsidetests/jvmti/run-tests/test-918/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-918/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-919/Android.bp b/hostsidetests/jvmti/run-tests/test-919/Android.bp
index ca9f7a2..059344b 100644
--- a/hostsidetests/jvmti/run-tests/test-919/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-919/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest919DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-919/OWNERS b/hostsidetests/jvmti/run-tests/test-919/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-919/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-919/app/Android.bp b/hostsidetests/jvmti/run-tests/test-919/app/Android.bp
index 43df778..9839bd9 100644
--- a/hostsidetests/jvmti/run-tests/test-919/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-919/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest919DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-919/app/OWNERS b/hostsidetests/jvmti/run-tests/test-919/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-919/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-920/Android.bp b/hostsidetests/jvmti/run-tests/test-920/Android.bp
index 30f2ae9..5c60573 100644
--- a/hostsidetests/jvmti/run-tests/test-920/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-920/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest920DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-920/OWNERS b/hostsidetests/jvmti/run-tests/test-920/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-920/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-920/app/Android.bp b/hostsidetests/jvmti/run-tests/test-920/app/Android.bp
index bff1755..2e3b0a0 100644
--- a/hostsidetests/jvmti/run-tests/test-920/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-920/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest920DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-920/app/OWNERS b/hostsidetests/jvmti/run-tests/test-920/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-920/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-922/Android.bp b/hostsidetests/jvmti/run-tests/test-922/Android.bp
index 9dc24b8..6e2f8b5 100644
--- a/hostsidetests/jvmti/run-tests/test-922/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-922/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest922DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-922/OWNERS b/hostsidetests/jvmti/run-tests/test-922/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-922/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-922/app/Android.bp b/hostsidetests/jvmti/run-tests/test-922/app/Android.bp
index dbe842c..37bb079 100644
--- a/hostsidetests/jvmti/run-tests/test-922/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-922/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest922DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-922/app/OWNERS b/hostsidetests/jvmti/run-tests/test-922/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-922/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-923/Android.bp b/hostsidetests/jvmti/run-tests/test-923/Android.bp
index 2638834..93f69da 100644
--- a/hostsidetests/jvmti/run-tests/test-923/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-923/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest923DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-923/OWNERS b/hostsidetests/jvmti/run-tests/test-923/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-923/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-923/app/Android.bp b/hostsidetests/jvmti/run-tests/test-923/app/Android.bp
index 1cc88db..9f1659e 100644
--- a/hostsidetests/jvmti/run-tests/test-923/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-923/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest923DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-923/app/OWNERS b/hostsidetests/jvmti/run-tests/test-923/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-923/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-924/Android.bp b/hostsidetests/jvmti/run-tests/test-924/Android.bp
index 94a56bf..ac01e56 100644
--- a/hostsidetests/jvmti/run-tests/test-924/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-924/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest924DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-924/OWNERS b/hostsidetests/jvmti/run-tests/test-924/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-924/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-924/app/Android.bp b/hostsidetests/jvmti/run-tests/test-924/app/Android.bp
index 88fed1c..3700ade 100644
--- a/hostsidetests/jvmti/run-tests/test-924/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-924/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest924DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-924/app/OWNERS b/hostsidetests/jvmti/run-tests/test-924/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-924/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-926/Android.bp b/hostsidetests/jvmti/run-tests/test-926/Android.bp
index 0c8b0bc..4b17ff2 100644
--- a/hostsidetests/jvmti/run-tests/test-926/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-926/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest926DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-926/OWNERS b/hostsidetests/jvmti/run-tests/test-926/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-926/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-926/app/Android.bp b/hostsidetests/jvmti/run-tests/test-926/app/Android.bp
index 2694b0a..afb334a 100644
--- a/hostsidetests/jvmti/run-tests/test-926/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-926/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest926DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-926/app/OWNERS b/hostsidetests/jvmti/run-tests/test-926/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-926/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-927/Android.bp b/hostsidetests/jvmti/run-tests/test-927/Android.bp
index 699c1a9..8703cce 100644
--- a/hostsidetests/jvmti/run-tests/test-927/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-927/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest927DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-927/OWNERS b/hostsidetests/jvmti/run-tests/test-927/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-927/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-927/app/Android.bp b/hostsidetests/jvmti/run-tests/test-927/app/Android.bp
index 2b5a0ab..47d4f11 100644
--- a/hostsidetests/jvmti/run-tests/test-927/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-927/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest927DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-927/app/OWNERS b/hostsidetests/jvmti/run-tests/test-927/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-927/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-928/Android.bp b/hostsidetests/jvmti/run-tests/test-928/Android.bp
index 4bc65ec..ac39f3d 100644
--- a/hostsidetests/jvmti/run-tests/test-928/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-928/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest928DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-928/OWNERS b/hostsidetests/jvmti/run-tests/test-928/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-928/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-928/app/Android.bp b/hostsidetests/jvmti/run-tests/test-928/app/Android.bp
index cdc2974..120fe11 100644
--- a/hostsidetests/jvmti/run-tests/test-928/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-928/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest928DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-928/app/OWNERS b/hostsidetests/jvmti/run-tests/test-928/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-928/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-930/Android.bp b/hostsidetests/jvmti/run-tests/test-930/Android.bp
index 6f63689..c428847 100644
--- a/hostsidetests/jvmti/run-tests/test-930/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-930/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest930DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-930/OWNERS b/hostsidetests/jvmti/run-tests/test-930/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-930/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-930/app/Android.bp b/hostsidetests/jvmti/run-tests/test-930/app/Android.bp
index 0eb05be..09302fb 100644
--- a/hostsidetests/jvmti/run-tests/test-930/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-930/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest930DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-930/app/OWNERS b/hostsidetests/jvmti/run-tests/test-930/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-930/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-931/Android.bp b/hostsidetests/jvmti/run-tests/test-931/Android.bp
index dd7810d..bf11253 100644
--- a/hostsidetests/jvmti/run-tests/test-931/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-931/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest931DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-931/OWNERS b/hostsidetests/jvmti/run-tests/test-931/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-931/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-931/app/Android.bp b/hostsidetests/jvmti/run-tests/test-931/app/Android.bp
index d5cd422..f925396 100644
--- a/hostsidetests/jvmti/run-tests/test-931/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-931/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest931DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-931/app/OWNERS b/hostsidetests/jvmti/run-tests/test-931/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-931/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-932/Android.bp b/hostsidetests/jvmti/run-tests/test-932/Android.bp
index 09dfbcc..424551e 100644
--- a/hostsidetests/jvmti/run-tests/test-932/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-932/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest932DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-932/OWNERS b/hostsidetests/jvmti/run-tests/test-932/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-932/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-932/app/Android.bp b/hostsidetests/jvmti/run-tests/test-932/app/Android.bp
index 99a08fb..a698d46 100644
--- a/hostsidetests/jvmti/run-tests/test-932/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-932/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest932DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-932/app/OWNERS b/hostsidetests/jvmti/run-tests/test-932/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-932/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-940/Android.bp b/hostsidetests/jvmti/run-tests/test-940/Android.bp
index a580400..385371a 100644
--- a/hostsidetests/jvmti/run-tests/test-940/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-940/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest940DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-940/OWNERS b/hostsidetests/jvmti/run-tests/test-940/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-940/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-940/app/Android.bp b/hostsidetests/jvmti/run-tests/test-940/app/Android.bp
index 7ece7ff..f3ef9ff 100644
--- a/hostsidetests/jvmti/run-tests/test-940/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-940/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest940DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-940/app/OWNERS b/hostsidetests/jvmti/run-tests/test-940/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-940/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-942/Android.bp b/hostsidetests/jvmti/run-tests/test-942/Android.bp
index ba04df9..bed04be 100644
--- a/hostsidetests/jvmti/run-tests/test-942/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-942/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest942DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-942/OWNERS b/hostsidetests/jvmti/run-tests/test-942/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-942/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-942/app/Android.bp b/hostsidetests/jvmti/run-tests/test-942/app/Android.bp
index 6a4a362..e52ee99 100644
--- a/hostsidetests/jvmti/run-tests/test-942/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-942/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest942DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-942/app/OWNERS b/hostsidetests/jvmti/run-tests/test-942/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-942/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-944/Android.bp b/hostsidetests/jvmti/run-tests/test-944/Android.bp
index 5f5fcc3..ef75ef1 100644
--- a/hostsidetests/jvmti/run-tests/test-944/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-944/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest944DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-944/OWNERS b/hostsidetests/jvmti/run-tests/test-944/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-944/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-944/app/Android.bp b/hostsidetests/jvmti/run-tests/test-944/app/Android.bp
index c7250ba..6f9fe08 100644
--- a/hostsidetests/jvmti/run-tests/test-944/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-944/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest944DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-944/app/OWNERS b/hostsidetests/jvmti/run-tests/test-944/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-944/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-945/Android.bp b/hostsidetests/jvmti/run-tests/test-945/Android.bp
index 33c537c..e5ae43f 100644
--- a/hostsidetests/jvmti/run-tests/test-945/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-945/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest945DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-945/OWNERS b/hostsidetests/jvmti/run-tests/test-945/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-945/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-945/app/Android.bp b/hostsidetests/jvmti/run-tests/test-945/app/Android.bp
index 0a82c02..614d8a3 100644
--- a/hostsidetests/jvmti/run-tests/test-945/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-945/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest945DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-945/app/OWNERS b/hostsidetests/jvmti/run-tests/test-945/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-945/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-947/Android.bp b/hostsidetests/jvmti/run-tests/test-947/Android.bp
index 6489dc3..10b3914 100644
--- a/hostsidetests/jvmti/run-tests/test-947/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-947/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest947DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-947/OWNERS b/hostsidetests/jvmti/run-tests/test-947/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-947/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-947/app/Android.bp b/hostsidetests/jvmti/run-tests/test-947/app/Android.bp
index be83b34..64e3550 100644
--- a/hostsidetests/jvmti/run-tests/test-947/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-947/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest947DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-947/app/OWNERS b/hostsidetests/jvmti/run-tests/test-947/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-947/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-951/Android.bp b/hostsidetests/jvmti/run-tests/test-951/Android.bp
index f374b9f..c903e9b 100644
--- a/hostsidetests/jvmti/run-tests/test-951/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-951/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest951DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-951/OWNERS b/hostsidetests/jvmti/run-tests/test-951/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-951/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-951/app/Android.bp b/hostsidetests/jvmti/run-tests/test-951/app/Android.bp
index 44d9b1e..7384400 100644
--- a/hostsidetests/jvmti/run-tests/test-951/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-951/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest951DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-951/app/OWNERS b/hostsidetests/jvmti/run-tests/test-951/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-951/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-982/Android.bp b/hostsidetests/jvmti/run-tests/test-982/Android.bp
index 8e82f07..2410aa7 100644
--- a/hostsidetests/jvmti/run-tests/test-982/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-982/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest982DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-982/OWNERS b/hostsidetests/jvmti/run-tests/test-982/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-982/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-982/app/Android.bp b/hostsidetests/jvmti/run-tests/test-982/app/Android.bp
index b64b95f..6519a10 100644
--- a/hostsidetests/jvmti/run-tests/test-982/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-982/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest982DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-982/app/OWNERS b/hostsidetests/jvmti/run-tests/test-982/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-982/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-983/Android.bp b/hostsidetests/jvmti/run-tests/test-983/Android.bp
index cb1583b..6739b4c 100644
--- a/hostsidetests/jvmti/run-tests/test-983/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-983/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest983DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-983/OWNERS b/hostsidetests/jvmti/run-tests/test-983/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-983/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-983/app/Android.bp b/hostsidetests/jvmti/run-tests/test-983/app/Android.bp
index 6c68edb..635cde8 100644
--- a/hostsidetests/jvmti/run-tests/test-983/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-983/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest983DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-983/app/OWNERS b/hostsidetests/jvmti/run-tests/test-983/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-983/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-984/Android.bp b/hostsidetests/jvmti/run-tests/test-984/Android.bp
index 0eed4cf..3662e48 100644
--- a/hostsidetests/jvmti/run-tests/test-984/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-984/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest984DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-984/OWNERS b/hostsidetests/jvmti/run-tests/test-984/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-984/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-984/app/Android.bp b/hostsidetests/jvmti/run-tests/test-984/app/Android.bp
index 52c522d..93937ec 100644
--- a/hostsidetests/jvmti/run-tests/test-984/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-984/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest984DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-984/app/OWNERS b/hostsidetests/jvmti/run-tests/test-984/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-984/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-985/Android.bp b/hostsidetests/jvmti/run-tests/test-985/Android.bp
index 3f4b491..934f932 100644
--- a/hostsidetests/jvmti/run-tests/test-985/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-985/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest985DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-985/OWNERS b/hostsidetests/jvmti/run-tests/test-985/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-985/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-985/app/Android.bp b/hostsidetests/jvmti/run-tests/test-985/app/Android.bp
index e591c24..4faad8b 100644
--- a/hostsidetests/jvmti/run-tests/test-985/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-985/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest985DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-985/app/OWNERS b/hostsidetests/jvmti/run-tests/test-985/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-985/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-986/Android.bp b/hostsidetests/jvmti/run-tests/test-986/Android.bp
index 9abbfa2..278a581 100644
--- a/hostsidetests/jvmti/run-tests/test-986/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-986/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest986DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-986/OWNERS b/hostsidetests/jvmti/run-tests/test-986/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-986/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-986/app/Android.bp b/hostsidetests/jvmti/run-tests/test-986/app/Android.bp
index 6bd3b37..d056900 100644
--- a/hostsidetests/jvmti/run-tests/test-986/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-986/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest986DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-986/app/OWNERS b/hostsidetests/jvmti/run-tests/test-986/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-986/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-988/Android.bp b/hostsidetests/jvmti/run-tests/test-988/Android.bp
index 921a122..b5d1d63 100644
--- a/hostsidetests/jvmti/run-tests/test-988/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-988/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest988DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-988/OWNERS b/hostsidetests/jvmti/run-tests/test-988/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-988/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-988/app/Android.bp b/hostsidetests/jvmti/run-tests/test-988/app/Android.bp
index 4276da2..fd2fdad 100644
--- a/hostsidetests/jvmti/run-tests/test-988/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-988/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest988DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-988/app/OWNERS b/hostsidetests/jvmti/run-tests/test-988/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-988/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-989/Android.bp b/hostsidetests/jvmti/run-tests/test-989/Android.bp
index bdcb252..ea56478 100644
--- a/hostsidetests/jvmti/run-tests/test-989/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-989/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest989DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-989/OWNERS b/hostsidetests/jvmti/run-tests/test-989/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-989/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-989/app/Android.bp b/hostsidetests/jvmti/run-tests/test-989/app/Android.bp
index ceba702..b433eec 100644
--- a/hostsidetests/jvmti/run-tests/test-989/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-989/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest989DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-989/app/OWNERS b/hostsidetests/jvmti/run-tests/test-989/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-989/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-990/Android.bp b/hostsidetests/jvmti/run-tests/test-990/Android.bp
index 7331467..03553cd 100644
--- a/hostsidetests/jvmti/run-tests/test-990/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-990/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest990DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-990/OWNERS b/hostsidetests/jvmti/run-tests/test-990/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-990/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-990/app/Android.bp b/hostsidetests/jvmti/run-tests/test-990/app/Android.bp
index 8d2df9b..59f59a7 100644
--- a/hostsidetests/jvmti/run-tests/test-990/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-990/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest990DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-990/app/OWNERS b/hostsidetests/jvmti/run-tests/test-990/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-990/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-991/Android.bp b/hostsidetests/jvmti/run-tests/test-991/Android.bp
index fcfc185..1ce2875 100644
--- a/hostsidetests/jvmti/run-tests/test-991/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-991/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest991DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-991/OWNERS b/hostsidetests/jvmti/run-tests/test-991/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-991/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-991/app/Android.bp b/hostsidetests/jvmti/run-tests/test-991/app/Android.bp
index 8c8a9ec..30d419e 100644
--- a/hostsidetests/jvmti/run-tests/test-991/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-991/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest991DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-991/app/OWNERS b/hostsidetests/jvmti/run-tests/test-991/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-991/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-992/Android.bp b/hostsidetests/jvmti/run-tests/test-992/Android.bp
index df5f255d..9abfe40 100644
--- a/hostsidetests/jvmti/run-tests/test-992/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-992/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest992DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-992/OWNERS b/hostsidetests/jvmti/run-tests/test-992/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-992/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-992/app/Android.bp b/hostsidetests/jvmti/run-tests/test-992/app/Android.bp
index 026f6ce..cf388ea 100644
--- a/hostsidetests/jvmti/run-tests/test-992/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-992/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest992DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-992/app/OWNERS b/hostsidetests/jvmti/run-tests/test-992/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-992/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-993/Android.bp b/hostsidetests/jvmti/run-tests/test-993/Android.bp
index b4aa75d..47d25d4 100644
--- a/hostsidetests/jvmti/run-tests/test-993/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-993/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest993DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-993/OWNERS b/hostsidetests/jvmti/run-tests/test-993/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-993/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-993/app/Android.bp b/hostsidetests/jvmti/run-tests/test-993/app/Android.bp
index 0503ee7..c903584 100644
--- a/hostsidetests/jvmti/run-tests/test-993/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-993/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest993DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-993/app/OWNERS b/hostsidetests/jvmti/run-tests/test-993/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-993/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-994/Android.bp b/hostsidetests/jvmti/run-tests/test-994/Android.bp
index ce99c15..97df559 100644
--- a/hostsidetests/jvmti/run-tests/test-994/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-994/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest994DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-994/OWNERS b/hostsidetests/jvmti/run-tests/test-994/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-994/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-994/app/Android.bp b/hostsidetests/jvmti/run-tests/test-994/app/Android.bp
index c8acf18..401f44c 100644
--- a/hostsidetests/jvmti/run-tests/test-994/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-994/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest994DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-994/app/OWNERS b/hostsidetests/jvmti/run-tests/test-994/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-994/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-995/Android.bp b/hostsidetests/jvmti/run-tests/test-995/Android.bp
index 05d05bf..50d4f24 100644
--- a/hostsidetests/jvmti/run-tests/test-995/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-995/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest995DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-995/OWNERS b/hostsidetests/jvmti/run-tests/test-995/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-995/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-995/app/Android.bp b/hostsidetests/jvmti/run-tests/test-995/app/Android.bp
index 527cf9a..e6333c4 100644
--- a/hostsidetests/jvmti/run-tests/test-995/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-995/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest995DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-995/app/OWNERS b/hostsidetests/jvmti/run-tests/test-995/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-995/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-996/Android.bp b/hostsidetests/jvmti/run-tests/test-996/Android.bp
index 2b00fde67..9dfdeef 100644
--- a/hostsidetests/jvmti/run-tests/test-996/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-996/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest996DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-996/OWNERS b/hostsidetests/jvmti/run-tests/test-996/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-996/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-996/app/Android.bp b/hostsidetests/jvmti/run-tests/test-996/app/Android.bp
index 985d6f5..11ed826 100644
--- a/hostsidetests/jvmti/run-tests/test-996/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-996/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest996DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-996/app/OWNERS b/hostsidetests/jvmti/run-tests/test-996/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-996/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-997/Android.bp b/hostsidetests/jvmti/run-tests/test-997/Android.bp
index 3a7f967..8b1733d 100644
--- a/hostsidetests/jvmti/run-tests/test-997/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-997/Android.bp
@@ -21,4 +21,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiRunTest997DeviceApp"],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-997/OWNERS b/hostsidetests/jvmti/run-tests/test-997/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-997/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/run-tests/test-997/app/Android.bp b/hostsidetests/jvmti/run-tests/test-997/app/Android.bp
index dbd5242..7985c45 100644
--- a/hostsidetests/jvmti/run-tests/test-997/app/Android.bp
+++ b/hostsidetests/jvmti/run-tests/test-997/app/Android.bp
@@ -16,9 +16,4 @@
     name: "CtsJvmtiRunTest997DeviceApp",
     defaults: ["cts-run-jvmti-defaults"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/hostsidetests/jvmti/run-tests/test-997/app/OWNERS b/hostsidetests/jvmti/run-tests/test-997/app/OWNERS
deleted file mode 100644
index d6078e0..0000000
--- a/hostsidetests/jvmti/run-tests/test-997/app/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# DO NOT DELETE: OWNERS is intended to be empty as module owner and bug component are defined
-# in parent directory. This file is needed as a placeholder for verification purpose as we
-# need to tell the difference between "no owner is specified for this module" vs "explicitly
-# defer to parent OWNERS file"
diff --git a/hostsidetests/jvmti/tagging/Android.bp b/hostsidetests/jvmti/tagging/Android.bp
index dcdec61..29b16d3 100644
--- a/hostsidetests/jvmti/tagging/Android.bp
+++ b/hostsidetests/jvmti/tagging/Android.bp
@@ -22,4 +22,5 @@
         "vts",
         "general-tests",
     ],
+    data: [":CtsJvmtiTaggingDeviceApp"],
 }
diff --git a/hostsidetests/jvmti/tagging/OWNERS b/hostsidetests/jvmti/tagging/OWNERS
new file mode 100644
index 0000000..2dbff0d
--- /dev/null
+++ b/hostsidetests/jvmti/tagging/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 86431
+include ../run-tests/OWNERS
diff --git a/hostsidetests/jvmti/tagging/app/Android.bp b/hostsidetests/jvmti/tagging/app/Android.bp
index 02f8e30..45e4d78 100644
--- a/hostsidetests/jvmti/tagging/app/Android.bp
+++ b/hostsidetests/jvmti/tagging/app/Android.bp
@@ -22,11 +22,6 @@
     },
     srcs: ["src/**/*.java"],
     manifest: "AndroidManifest.xml",
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
     static_libs: ["CtsJvmtiDeviceAppBase"],
     jni_libs: ["libctsjvmtiagent"],
     compile_multilib: "both",
diff --git a/hostsidetests/media/Android.bp b/hostsidetests/media/Android.bp
new file mode 100644
index 0000000..e6b114a
--- /dev/null
+++ b/hostsidetests/media/Android.bp
@@ -0,0 +1,42 @@
+//
+// Copyright (C) 2017 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.
+//
+
+java_test_host {
+    name: "CtsMediaHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: [
+        "src/**/*.java",
+        ":CtsMediaSessionTestCommon",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+    ],
+}
+
+filegroup {
+    name: "CtsMediaSessionTestCommon",
+    srcs: ["common/**/*.java"],
+}
diff --git a/hostsidetests/media/Android.mk b/hostsidetests/media/Android.mk
deleted file mode 100644
index 4823ec8..0000000
--- a/hostsidetests/media/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Copyright (C) 2017 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)
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, common) \
-    $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := tests
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_MODULE := CtsMediaHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-include $(call first-makefiles-under,$(LOCAL_PATH))
-
diff --git a/hostsidetests/media/app/MediaSessionTest/Android.bp b/hostsidetests/media/app/MediaSessionTest/Android.bp
new file mode 100644
index 0000000..07d1c35
--- /dev/null
+++ b/hostsidetests/media/app/MediaSessionTest/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsMediaSessionHostTestApp",
+    defaults: ["cts_defaults"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    srcs: [
+        "src/**/*.java",
+        ":CtsMediaSessionTestCommon",
+    ],
+    static_libs: [
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+    ],
+    sdk_version: "test_current",
+    min_sdk_version: "26",
+}
diff --git a/hostsidetests/media/app/MediaSessionTest/Android.mk b/hostsidetests/media/app/MediaSessionTest/Android.mk
deleted file mode 100644
index 3901276..0000000
--- a/hostsidetests/media/app/MediaSessionTest/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsMediaSessionHostTestApp
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../../common)
-
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    compatibility-device-util-axt \
-
-
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 26
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/media/app/MediaSessionTestHelper/Android.bp b/hostsidetests/media/app/MediaSessionTestHelper/Android.bp
new file mode 100644
index 0000000..31e2d54
--- /dev/null
+++ b/hostsidetests/media/app/MediaSessionTestHelper/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsMediaSessionTestHelper",
+    defaults: ["cts_defaults"],
+    srcs: [
+        "src/**/*.java",
+        ":CtsMediaSessionTestCommon",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/media/app/MediaSessionTestHelper/Android.mk b/hostsidetests/media/app/MediaSessionTestHelper/Android.mk
deleted file mode 100644
index 514f86a..0000000
--- a/hostsidetests/media/app/MediaSessionTestHelper/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../../common)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsMediaSessionTestHelper
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
-
diff --git a/hostsidetests/media/bitstreams/Android.bp b/hostsidetests/media/bitstreams/Android.bp
new file mode 100644
index 0000000..186a0ef
--- /dev/null
+++ b/hostsidetests/media/bitstreams/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 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.
+
+java_test_host {
+    name: "CtsMediaBitstreamsTestCases",
+    srcs: [
+        "src/**/*.java",
+	"common/src/**/*.java"],
+    libs: [
+        "compatibility-host-util",
+        "cts-tradefed",
+        "tradefed",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    java_resources: ["DynamicConfig.xml"],
+    required: ["cts-dynamic-config"],
+}
diff --git a/hostsidetests/media/bitstreams/Android.mk b/hostsidetests/media/bitstreams/Android.mk
deleted file mode 100644
index 8f161c9..0000000
--- a/hostsidetests/media/bitstreams/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SRC_FILES += $(call all-java-files-under, common/src)
-
-LOCAL_JAVA_LIBRARIES := compatibility-host-util cts-tradefed tradefed
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE := CtsMediaBitstreamsTestCases
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_JAVA_RESOURCE_FILES := $(LOCAL_PATH)/DynamicConfig.xml
-
-LOCAL_REQUIRED_MODULES := cts-dynamic-config
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/media/bitstreams/app/Android.bp b/hostsidetests/media/bitstreams/app/Android.bp
new file mode 100644
index 0000000..f7e0395
--- /dev/null
+++ b/hostsidetests/media/bitstreams/app/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsMediaBitstreamsDeviceSideTestApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "media-bitstreams-common-devicesidelib",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/media/bitstreams/app/Android.mk b/hostsidetests/media/bitstreams/app/Android.mk
deleted file mode 100644
index 9ed5506..0000000
--- a/hostsidetests/media/bitstreams/app/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules compatibility-device-util-axt media-bitstreams-common-devicesidelib
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsMediaBitstreamsDeviceSideTestApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/media/bitstreams/common/Android.bp b/hostsidetests/media/bitstreams/common/Android.bp
new file mode 100644
index 0000000..a21bd21
--- /dev/null
+++ b/hostsidetests/media/bitstreams/common/Android.bp
@@ -0,0 +1,23 @@
+// Copyright (C) 2017 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.
+
+//##############################################################################
+// Build the common library for use device-side
+//##############################################################################
+
+java_library {
+    name: "media-bitstreams-common-devicesidelib",
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/media/bitstreams/common/Android.mk b/hostsidetests/media/bitstreams/common/Android.mk
deleted file mode 100644
index 1691257..0000000
--- a/hostsidetests/media/bitstreams/common/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2017 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.
-
-###############################################################################
-# Build the common library for use device-side
-###############################################################################
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE := media-bitstreams-common-devicesidelib
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/hostsidetests/monkey/Android.bp b/hostsidetests/monkey/Android.bp
new file mode 100644
index 0000000..28b2501
--- /dev/null
+++ b/hostsidetests/monkey/Android.bp
@@ -0,0 +1,30 @@
+// 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.
+
+java_test_host {
+    name: "CtsMonkeyTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/monkey/Android.mk b/hostsidetests/monkey/Android.mk
deleted file mode 100644
index 052313c..0000000
--- a/hostsidetests/monkey/Android.mk
+++ /dev/null
@@ -1,35 +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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE := CtsMonkeyTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
-
-# prefix zzz intentional to run this last
-LOCAL_CTS_TEST_PACKAGE := zzz.android.monkey
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/monkey/test-apps/Android.mk b/hostsidetests/monkey/test-apps/Android.mk
deleted file mode 100644
index b189007..0000000
--- a/hostsidetests/monkey/test-apps/Android.mk
+++ /dev/null
@@ -1,19 +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)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/monkey/test-apps/CtsMonkeyApp/Android.bp b/hostsidetests/monkey/test-apps/CtsMonkeyApp/Android.bp
new file mode 100644
index 0000000..a3022eb
--- /dev/null
+++ b/hostsidetests/monkey/test-apps/CtsMonkeyApp/Android.bp
@@ -0,0 +1,26 @@
+// 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.
+
+android_test_helper_app {
+    name: "CtsMonkeyApp",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/monkey/test-apps/CtsMonkeyApp/Android.mk b/hostsidetests/monkey/test-apps/CtsMonkeyApp/Android.mk
deleted file mode 100644
index 868a3bd..0000000
--- a/hostsidetests/monkey/test-apps/CtsMonkeyApp/Android.mk
+++ /dev/null
@@ -1,36 +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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_PACKAGE_NAME := CtsMonkeyApp
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/monkey/test-apps/CtsMonkeyApp2/Android.bp b/hostsidetests/monkey/test-apps/CtsMonkeyApp2/Android.bp
new file mode 100644
index 0000000..52c812a
--- /dev/null
+++ b/hostsidetests/monkey/test-apps/CtsMonkeyApp2/Android.bp
@@ -0,0 +1,26 @@
+// 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.
+
+android_test_helper_app {
+    name: "CtsMonkeyApp2",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/monkey/test-apps/CtsMonkeyApp2/Android.mk b/hostsidetests/monkey/test-apps/CtsMonkeyApp2/Android.mk
deleted file mode 100644
index 150d0b6..0000000
--- a/hostsidetests/monkey/test-apps/CtsMonkeyApp2/Android.mk
+++ /dev/null
@@ -1,36 +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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_PACKAGE_NAME := CtsMonkeyApp2
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/multiuser/Android.bp b/hostsidetests/multiuser/Android.bp
new file mode 100644
index 0000000..cc4bd81
--- /dev/null
+++ b/hostsidetests/multiuser/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2016 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.
+
+java_test_host {
+    name: "CtsMultiUserHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "tools-common-prebuilt",
+        "cts-tradefed",
+        "tradefed",
+        "platform-test-annotations-host",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/multiuser/Android.mk b/hostsidetests/multiuser/Android.mk
deleted file mode 100644
index e4c654d..0000000
--- a/hostsidetests/multiuser/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE := CtsMultiUserHostTestCases
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := tools-common-prebuilt cts-tradefed tradefed platform-test-annotations-host
-
-LOCAL_CTS_TEST_PACKAGE := android.host.multiuser
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/net/Android.bp b/hostsidetests/net/Android.bp
new file mode 100644
index 0000000..b6f5142
--- /dev/null
+++ b/hostsidetests/net/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2014 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.
+
+java_test_host {
+    name: "CtsHostsideNetworkTests",
+    defaults: ["cts_defaults"],
+    // Only compile source java files in this apk.
+    srcs: ["src/**/*.java"],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/net/Android.mk b/hostsidetests/net/Android.mk
deleted file mode 100644
index 7270580..0000000
--- a/hostsidetests/net/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2014 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)
-
-# Only compile source java files in this apk.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := CtsHostsideNetworkTests
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed
-
-LOCAL_CTS_TEST_PACKAGE := android.net.hostsidenetwork
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/net/AndroidTest.xml b/hostsidetests/net/AndroidTest.xml
index c7cab7b..dbff179 100644
--- a/hostsidetests/net/AndroidTest.xml
+++ b/hostsidetests/net/AndroidTest.xml
@@ -18,6 +18,7 @@
     <option name="config-descriptor:metadata" key="component" value="networking" />
     <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
+    <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
 
     <target_preparer class="com.android.cts.net.NetPolicyTestsPreparer" />
 
diff --git a/hostsidetests/net/aidl/Android.bp b/hostsidetests/net/aidl/Android.bp
new file mode 100644
index 0000000..320a1fa
--- /dev/null
+++ b/hostsidetests/net/aidl/Android.bp
@@ -0,0 +1,24 @@
+// Copyright (C) 2016 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.
+
+java_test_helper_library {
+    name: "CtsHostsideNetworkTestsAidl",
+    sdk_version: "current",
+    srcs: [
+        "com/android/cts/net/hostside/IMyService.aidl",
+        "com/android/cts/net/hostside/INetworkCallback.aidl",
+        "com/android/cts/net/hostside/INetworkStateObserver.aidl",
+        "com/android/cts/net/hostside/IRemoteSocketFactory.aidl",
+    ],
+}
diff --git a/hostsidetests/net/aidl/Android.mk b/hostsidetests/net/aidl/Android.mk
deleted file mode 100644
index 20dabc1..0000000
--- a/hostsidetests/net/aidl/Android.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2016 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)
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := \
-        com/android/cts/net/hostside/IMyService.aidl \
-        com/android/cts/net/hostside/INetworkCallback.aidl \
-        com/android/cts/net/hostside/INetworkStateObserver.aidl \
-        com/android/cts/net/hostside/IRemoteSocketFactory.aidl
-LOCAL_MODULE := CtsHostsideNetworkTestsAidl
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/hostsidetests/net/app/Android.bp b/hostsidetests/net/app/Android.bp
new file mode 100644
index 0000000..d66b71b
--- /dev/null
+++ b/hostsidetests/net/app/Android.bp
@@ -0,0 +1,39 @@
+//
+// Copyright (C) 2014 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.
+//
+
+android_test_helper_app {
+    name: "CtsHostsideNetworkTestsApp",
+    defaults: ["cts_support_defaults"],
+    //sdk_version: "current",
+    platform_apis: true,
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ub-uiautomator",
+        "CtsHostsideNetworkTestsAidl",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/net/app/Android.mk b/hostsidetests/net/app/Android.mk
deleted file mode 100644
index 11f6bb1..0000000
--- a/hostsidetests/net/app/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# Copyright (C) 2014 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)
-
-LOCAL_MODULE_TAGS := tests
-#LOCAL_SDK_VERSION := current
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util-axt ctstestrunner-axt ub-uiautomator \
-        CtsHostsideNetworkTestsAidl
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsHostsideNetworkTestsApp
-
-LOCAL_PROGUARD_ENABLED := disabled
-LOCAL_DEX_PREOPT := false
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/net/app2/Android.bp b/hostsidetests/net/app2/Android.bp
new file mode 100644
index 0000000..8a3c8e7
--- /dev/null
+++ b/hostsidetests/net/app2/Android.bp
@@ -0,0 +1,30 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test_helper_app {
+    name: "CtsHostsideNetworkTestsApp2",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "current",
+    static_libs: ["CtsHostsideNetworkTestsAidl"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    certificate: ":cts-net-app",
+}
diff --git a/hostsidetests/net/app2/Android.mk b/hostsidetests/net/app2/Android.mk
deleted file mode 100644
index 5c0bae1..0000000
--- a/hostsidetests/net/app2/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := CtsHostsideNetworkTestsAidl
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsHostsideNetworkTestsApp2
-
-LOCAL_PROGUARD_ENABLED := disabled
-LOCAL_DEX_PREOPT := false
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_CERTIFICATE := cts/hostsidetests/net/certs/cts-net-app
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/net/certs/Android.bp b/hostsidetests/net/certs/Android.bp
new file mode 100644
index 0000000..ab4cf34
--- /dev/null
+++ b/hostsidetests/net/certs/Android.bp
@@ -0,0 +1,4 @@
+android_app_certificate {
+    name: "cts-net-app",
+    certificate: "cts-net-app",
+}
diff --git a/hostsidetests/numberblocking/Android.bp b/hostsidetests/numberblocking/Android.bp
new file mode 100644
index 0000000..9c50e44
--- /dev/null
+++ b/hostsidetests/numberblocking/Android.bp
@@ -0,0 +1,29 @@
+// Copyright (C) 2016 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.
+
+java_test_host {
+    name: "CtsHostsideNumberBlockingTestCases",
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+    ],
+}
diff --git a/hostsidetests/numberblocking/Android.mk b/hostsidetests/numberblocking/Android.mk
deleted file mode 100644
index d57a0d9..0000000
--- a/hostsidetests/numberblocking/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := tests
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MODULE := CtsHostsideNumberBlockingTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/numberblocking/app/Android.bp b/hostsidetests/numberblocking/app/Android.bp
new file mode 100644
index 0000000..2716f87
--- /dev/null
+++ b/hostsidetests/numberblocking/app/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsHostsideNumberBlockingAppTest",
+    dex_preopt: {
+        enabled: false,
+    },
+    optimize: {
+        enabled: false,
+    },
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+    ],
+    libs: ["android.test.base.stubs"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/numberblocking/app/Android.mk b/hostsidetests/numberblocking/app/Android.mk
deleted file mode 100644
index 08bf132..0000000
--- a/hostsidetests/numberblocking/app/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2016 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt androidx.test.rules
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsHostsideNumberBlockingAppTest
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/os/Android.bp b/hostsidetests/os/Android.bp
new file mode 100644
index 0000000..c359656
--- /dev/null
+++ b/hostsidetests/os/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2015 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.
+
+java_test_host {
+    // Must match the package name in CtsTestCaseList.mk
+    name: "CtsOsHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/hostsidetests/os/Android.mk b/hostsidetests/os/Android.mk
deleted file mode 100644
index 932e2cf..0000000
--- a/hostsidetests/os/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_MODULE_TAGS := optional
-
-# Must match the package name in CtsTestCaseList.mk
-LOCAL_MODULE := CtsOsHostTestCases
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
-
-LOCAL_CTS_TEST_PACKAGE := android.host.os
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/os/app/Android.bp b/hostsidetests/os/app/Android.bp
new file mode 100644
index 0000000..384ab55
--- /dev/null
+++ b/hostsidetests/os/app/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2015 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.
+
+android_test_helper_app {
+    name: "CtsDeviceOsTestApp",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/hostsidetests/os/app/Android.mk b/hostsidetests/os/app/Android.mk
deleted file mode 100644
index 31e2812..0000000
--- a/hostsidetests/os/app/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2015 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 := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsDeviceOsTestApp
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/os/test-apps/Android.mk b/hostsidetests/os/test-apps/Android.mk
deleted file mode 100644
index 0767e4b..0000000
--- a/hostsidetests/os/test-apps/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (C) 2016 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)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/os/test-apps/HostLinkVerificationApp/Android.bp b/hostsidetests/os/test-apps/HostLinkVerificationApp/Android.bp
new file mode 100644
index 0000000..fb22fad
--- /dev/null
+++ b/hostsidetests/os/test-apps/HostLinkVerificationApp/Android.bp
@@ -0,0 +1,28 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test_helper_app {
+    name: "CtsHostLinkVerificationApp",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/hostsidetests/os/test-apps/HostLinkVerificationApp/Android.mk b/hostsidetests/os/test-apps/HostLinkVerificationApp/Android.mk
deleted file mode 100644
index 99c2e1d..0000000
--- a/hostsidetests/os/test-apps/HostLinkVerificationApp/Android.mk
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := current
-
-LOCAL_PACKAGE_NAME := CtsHostLinkVerificationApp
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/os/test-apps/ProcfsTestApp/Android.bp b/hostsidetests/os/test-apps/ProcfsTestApp/Android.bp
new file mode 100644
index 0000000..df61619
--- /dev/null
+++ b/hostsidetests/os/test-apps/ProcfsTestApp/Android.bp
@@ -0,0 +1,29 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test_helper_app {
+    name: "CtsHostProcfsTestApp",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "current",
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/hostsidetests/os/test-apps/ProcfsTestApp/Android.mk b/hostsidetests/os/test-apps/ProcfsTestApp/Android.mk
deleted file mode 100644
index e42804f..0000000
--- a/hostsidetests/os/test-apps/ProcfsTestApp/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := current
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsHostProcfsTestApp
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/Android.bp b/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/Android.bp
new file mode 100644
index 0000000..1e78ba5
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/Android.bp
@@ -0,0 +1,33 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test_helper_app {
+    name: "CtsStaticSharedLibConsumerApp1",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+    ],
+    libs: ["CtsStaticSharedLibProviderApp1"],
+    platform_apis: true,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/Android.mk b/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/Android.mk
deleted file mode 100644
index 85aade7..0000000
--- a/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    compatibility-device-util-axt
-
-LOCAL_RES_LIBRARIES := CtsStaticSharedLibProviderApp1
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedLibConsumerApp1
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/os/test-apps/StaticSharedLibConsumerApp2/Android.bp b/hostsidetests/os/test-apps/StaticSharedLibConsumerApp2/Android.bp
new file mode 100644
index 0000000..b4537c4
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedLibConsumerApp2/Android.bp
@@ -0,0 +1,29 @@
+// Copyright (C) 2016 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.
+//
+
+android_test_helper_app {
+    name: "CtsStaticSharedLibConsumerApp2",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    static_libs: ["androidx.test.rules"],
+    libs: ["CtsStaticSharedLibProviderApp4"],
+    sdk_version: "current",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedLibConsumerApp2/Android.mk b/hostsidetests/os/test-apps/StaticSharedLibConsumerApp2/Android.mk
deleted file mode 100644
index 9e35c0e..0000000
--- a/hostsidetests/os/test-apps/StaticSharedLibConsumerApp2/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-
-LOCAL_RES_LIBRARIES := CtsStaticSharedLibProviderApp4
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedLibConsumerApp2
-LOCAL_SDK_VERSION := current
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/os/test-apps/StaticSharedLibConsumerApp3/Android.bp b/hostsidetests/os/test-apps/StaticSharedLibConsumerApp3/Android.bp
new file mode 100644
index 0000000..4d4f7c9
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedLibConsumerApp3/Android.bp
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 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.
+//
+
+android_test_helper_app {
+    name: "CtsStaticSharedLibConsumerApp3",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    static_libs: ["androidx.test.rules"],
+    libs: ["CtsStaticSharedLibProviderApp7"],
+    sdk_version: "current",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedLibConsumerApp3/Android.mk b/hostsidetests/os/test-apps/StaticSharedLibConsumerApp3/Android.mk
deleted file mode 100644
index 6bb0f71..0000000
--- a/hostsidetests/os/test-apps/StaticSharedLibConsumerApp3/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-
-LOCAL_RES_LIBRARIES := CtsStaticSharedLibProviderApp7
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedLibConsumerApp3
-LOCAL_SDK_VERSION := current
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_USE_AAPT2 := true
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp1/Android.bp b/hostsidetests/os/test-apps/StaticSharedLibProviderApp1/Android.bp
new file mode 100644
index 0000000..1a9c933
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedLibProviderApp1/Android.bp
@@ -0,0 +1,35 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test_helper_app {
+    name: "CtsStaticSharedLibProviderApp1",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    certificate: ":cts-keyset-test-b",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    optimize: {
+        enabled: false,
+    },
+    aaptflags: ["--shared-lib"],
+    libs: ["CtsStaticSharedLibProviderRecursive"],
+    export_package_resources: true,
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp1/Android.mk b/hostsidetests/os/test-apps/StaticSharedLibProviderApp1/Android.mk
deleted file mode 100644
index 85ee025..0000000
--- a/hostsidetests/os/test-apps/StaticSharedLibProviderApp1/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedLibProviderApp1
-LOCAL_SDK_VERSION := current
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/keysets/cts-keyset-test-b
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_AAPT_FLAGS := --shared-lib
-
-LOCAL_RES_LIBRARIES := CtsStaticSharedLibProviderRecursive
-
-LOCAL_EXPORT_PACKAGE_RESOURCES := true
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp2/Android.bp b/hostsidetests/os/test-apps/StaticSharedLibProviderApp2/Android.bp
new file mode 100644
index 0000000..0904361
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedLibProviderApp2/Android.bp
@@ -0,0 +1,30 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test_helper_app {
+    name: "CtsStaticSharedLibProviderApp2",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "current",
+    certificate: ":cts-keyset-test-b",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    aaptflags: ["--shared-lib"],
+    export_package_resources: true,
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp2/Android.mk b/hostsidetests/os/test-apps/StaticSharedLibProviderApp2/Android.mk
deleted file mode 100644
index 97606eb..0000000
--- a/hostsidetests/os/test-apps/StaticSharedLibProviderApp2/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedLibProviderApp2
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/keysets/cts-keyset-test-b
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_AAPT_FLAGS := --shared-lib
-
-LOCAL_EXPORT_PACKAGE_RESOURCES := true
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp3/Android.bp b/hostsidetests/os/test-apps/StaticSharedLibProviderApp3/Android.bp
new file mode 100644
index 0000000..c866c6f
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedLibProviderApp3/Android.bp
@@ -0,0 +1,29 @@
+//
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsStaticSharedLibProviderApp3",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "current",
+    certificate: ":cts-keyset-test-b",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    aaptflags: ["--shared-lib"],
+    export_package_resources: true,
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp3/Android.mk b/hostsidetests/os/test-apps/StaticSharedLibProviderApp3/Android.mk
deleted file mode 100644
index add7087..0000000
--- a/hostsidetests/os/test-apps/StaticSharedLibProviderApp3/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedLibProviderApp3
-LOCAL_SDK_VERSION := current
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/keysets/cts-keyset-test-b
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_AAPT_FLAGS := --shared-lib
-
-LOCAL_EXPORT_PACKAGE_RESOURCES := true
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp4/Android.bp b/hostsidetests/os/test-apps/StaticSharedLibProviderApp4/Android.bp
new file mode 100644
index 0000000..8989e22
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedLibProviderApp4/Android.bp
@@ -0,0 +1,33 @@
+//
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsStaticSharedLibProviderApp4",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    certificate: ":cts-keyset-test-a",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    optimize: {
+        enabled: false,
+    },
+    aaptflags: ["--shared-lib"],
+    export_package_resources: true,
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp4/Android.mk b/hostsidetests/os/test-apps/StaticSharedLibProviderApp4/Android.mk
deleted file mode 100644
index 9bba678..0000000
--- a/hostsidetests/os/test-apps/StaticSharedLibProviderApp4/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedLibProviderApp4
-LOCAL_SDK_VERSION := current
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/keysets/cts-keyset-test-a
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_AAPT_FLAGS := --shared-lib
-
-LOCAL_EXPORT_PACKAGE_RESOURCES := true
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp5/Android.bp b/hostsidetests/os/test-apps/StaticSharedLibProviderApp5/Android.bp
new file mode 100644
index 0000000..d77f030
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedLibProviderApp5/Android.bp
@@ -0,0 +1,30 @@
+//
+// Copyright (C) 2017 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.
+//
+
+android_test_helper_app {
+    name: "CtsStaticSharedLibProviderApp5",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "current",
+    certificate: ":cts-keyset-test-b",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    aaptflags: ["--shared-lib"],
+    export_package_resources: true,
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp5/Android.mk b/hostsidetests/os/test-apps/StaticSharedLibProviderApp5/Android.mk
deleted file mode 100644
index 84fc7b6..0000000
--- a/hostsidetests/os/test-apps/StaticSharedLibProviderApp5/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedLibProviderApp5
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/keysets/cts-keyset-test-b
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_AAPT_FLAGS := --shared-lib
-
-LOCAL_EXPORT_PACKAGE_RESOURCES := true
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp6/Android.bp b/hostsidetests/os/test-apps/StaticSharedLibProviderApp6/Android.bp
new file mode 100644
index 0000000..9048774
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedLibProviderApp6/Android.bp
@@ -0,0 +1,30 @@
+//
+// Copyright (C) 2017 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.
+//
+
+android_test_helper_app {
+    name: "CtsStaticSharedLibProviderApp6",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "current",
+    certificate: ":cts-keyset-test-b",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    aaptflags: ["--shared-lib"],
+    export_package_resources: true,
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp6/Android.mk b/hostsidetests/os/test-apps/StaticSharedLibProviderApp6/Android.mk
deleted file mode 100644
index 13cb9bd..0000000
--- a/hostsidetests/os/test-apps/StaticSharedLibProviderApp6/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedLibProviderApp6
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/keysets/cts-keyset-test-b
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_AAPT_FLAGS := --shared-lib
-
-LOCAL_EXPORT_PACKAGE_RESOURCES := true
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp7/Android.bp b/hostsidetests/os/test-apps/StaticSharedLibProviderApp7/Android.bp
new file mode 100644
index 0000000..253aa34
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedLibProviderApp7/Android.bp
@@ -0,0 +1,35 @@
+//
+// Copyright (C) 2017 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.
+//
+
+android_test_helper_app {
+    name: "CtsStaticSharedLibProviderApp7",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    certificate: ":cts-keyset-test-b",
+    additional_certificates: [":cts-keyset-test-a"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    optimize: {
+        enabled: false,
+    },
+    aaptflags: ["--shared-lib"],
+    export_package_resources: true,
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderApp7/Android.mk b/hostsidetests/os/test-apps/StaticSharedLibProviderApp7/Android.mk
deleted file mode 100644
index 7788e25..0000000
--- a/hostsidetests/os/test-apps/StaticSharedLibProviderApp7/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedLibProviderApp7
-LOCAL_SDK_VERSION := current
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/keysets/cts-keyset-test-b
-
-LOCAL_ADDITIONAL_CERTIFICATES := cts/hostsidetests/appsecurity/certs/keysets/cts-keyset-test-a
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_AAPT_FLAGS := --shared-lib
-
-LOCAL_EXPORT_PACKAGE_RESOURCES := true
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderAppRecursive/Android.bp b/hostsidetests/os/test-apps/StaticSharedLibProviderAppRecursive/Android.bp
new file mode 100644
index 0000000..0812dc0
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedLibProviderAppRecursive/Android.bp
@@ -0,0 +1,34 @@
+//
+// Copyright (C) 2017 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.
+//
+
+android_test_helper_app {
+    name: "CtsStaticSharedLibProviderRecursive",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    certificate: ":cts-keyset-test-b",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    optimize: {
+        enabled: false,
+    },
+    aaptflags: ["--shared-lib"],
+    export_package_resources: true,
+    sdk_version: "current",
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedLibProviderAppRecursive/Android.mk b/hostsidetests/os/test-apps/StaticSharedLibProviderAppRecursive/Android.mk
deleted file mode 100644
index 0631904..0000000
--- a/hostsidetests/os/test-apps/StaticSharedLibProviderAppRecursive/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedLibProviderRecursive
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/keysets/cts-keyset-test-b
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_AAPT_FLAGS := --shared-lib
-
-LOCAL_EXPORT_PACKAGE_RESOURCES := true
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/os/test-apps/StaticSharedNativeLibConsumer/Android.bp b/hostsidetests/os/test-apps/StaticSharedNativeLibConsumer/Android.bp
new file mode 100644
index 0000000..578c338
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedNativeLibConsumer/Android.bp
@@ -0,0 +1,48 @@
+//
+// Copyright (C) 2017 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.
+//
+
+android_test_helper_app {
+    name: "CtsStaticSharedNativeLibConsumer",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    static_libs: ["androidx.test.rules"],
+    jni_libs: ["libstaticsharednativelibconsumerjni"],
+    sdk_version: "current",
+    compile_multilib: "both",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
+
+cc_test_library {
+    name: "libstaticsharednativelibconsumerjni",
+    gtest: false,
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Werror",
+    ],
+    srcs: ["**/*.cpp"],
+    shared_libs: [
+        "liblog",
+        "libstaticsharednativelibprovider",
+    ],
+    sdk_version: "current",
+    stl: "none",
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedNativeLibConsumer/Android.mk b/hostsidetests/os/test-apps/StaticSharedNativeLibConsumer/Android.mk
deleted file mode 100644
index 9564193..0000000
--- a/hostsidetests/os/test-apps/StaticSharedNativeLibConsumer/Android.mk
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules
-
-LOCAL_JNI_SHARED_LIBRARIES := libstaticsharednativelibconsumerjni
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedNativeLibConsumer
-LOCAL_SDK_VERSION := current
-
-LOCAL_MULTILIB := both
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-#########################################################################
-# Build JNI Shared Library
-#########################################################################
-
-LOCAL_PATH:= $(LOCAL_PATH)/jni
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := -Wall -Wextra -Werror
-
-LOCAL_SRC_FILES := $(call all-cpp-files-under)
-
-LOCAL_SHARED_LIBRARIES := liblog \
-    libstaticsharednativelibprovider
-
-LOCAL_SDK_VERSION := current
-LOCAL_NDK_STL_VARIANT := none
-
-LOCAL_C_INCLUDES += \
-    $(JNI_H_INCLUDE) \
-    $(LOCAL_PATH)/../CtsStaticSharedNativeLibProvider/native/version.h
-
-LOCAL_MODULE := libstaticsharednativelibconsumerjni
-
-include $(BUILD_SHARED_LIBRARY)
-
diff --git a/hostsidetests/os/test-apps/StaticSharedNativeLibProvider/Android.bp b/hostsidetests/os/test-apps/StaticSharedNativeLibProvider/Android.bp
new file mode 100644
index 0000000..c76e6d8
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedNativeLibProvider/Android.bp
@@ -0,0 +1,50 @@
+//
+// Copyright (C) 2017 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.
+//
+
+android_test_helper_app {
+    name: "CtsStaticSharedNativeLibProvider",
+    defaults: ["cts_support_defaults"],
+    jni_libs: ["libstaticsharednativelibprovider"],
+    sdk_version: "current",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    optimize: {
+        enabled: false,
+    },
+    aaptflags: ["--shared-lib"],
+    export_package_resources: true,
+    compile_multilib: "both",
+    certificate: ":cts-keyset-test-b",
+}
+
+cc_test_library {
+    name: "libstaticsharednativelibprovider",
+    gtest: false,
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Werror",
+    ],
+    srcs: ["**/*.cpp"],
+    sdk_version: "current",
+    local_include_dirs: ["native"],
+    export_include_dirs: ["native"],
+    stl: "none",
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedNativeLibProvider/Android.mk b/hostsidetests/os/test-apps/StaticSharedNativeLibProvider/Android.mk
deleted file mode 100644
index 655adea..0000000
--- a/hostsidetests/os/test-apps/StaticSharedNativeLibProvider/Android.mk
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_JNI_SHARED_LIBRARIES := libstaticsharednativelibprovider
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedNativeLibProvider
-LOCAL_SDK_VERSION := current
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_AAPT_FLAGS := --shared-lib
-
-LOCAL_EXPORT_PACKAGE_RESOURCES := true
-
-LOCAL_MULTILIB := both
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/keysets/cts-keyset-test-b
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-#########################################################################
-# Build Shared Library
-#########################################################################
-
-LOCAL_PATH:= $(LOCAL_PATH)/native
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := -Wall -Wextra -Werror
-
-LOCAL_SRC_FILES := $(call all-cpp-files-under)
-
-LOCAL_MODULE := libstaticsharednativelibprovider
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/native/version.h
-
-LOCAL_NDK_STL_VARIANT := none
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/hostsidetests/os/test-apps/StaticSharedNativeLibProvider1/Android.bp b/hostsidetests/os/test-apps/StaticSharedNativeLibProvider1/Android.bp
new file mode 100644
index 0000000..005553b
--- /dev/null
+++ b/hostsidetests/os/test-apps/StaticSharedNativeLibProvider1/Android.bp
@@ -0,0 +1,35 @@
+//
+// Copyright (C) 2017 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.
+//
+
+android_test_helper_app {
+    name: "CtsStaticSharedNativeLibProvider1",
+    defaults: ["cts_support_defaults"],
+    jni_libs: ["libstaticsharednativelibprovider"],
+    sdk_version: "current",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    optimize: {
+        enabled: false,
+    },
+    aaptflags: ["--shared-lib"],
+    export_package_resources: true,
+    compile_multilib: "both",
+    certificate: ":cts-keyset-test-b",
+}
diff --git a/hostsidetests/os/test-apps/StaticSharedNativeLibProvider1/Android.mk b/hostsidetests/os/test-apps/StaticSharedNativeLibProvider1/Android.mk
deleted file mode 100644
index b26939a..0000000
--- a/hostsidetests/os/test-apps/StaticSharedNativeLibProvider1/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_JNI_SHARED_LIBRARIES := libstaticsharednativelibprovider
-
-LOCAL_PACKAGE_NAME := CtsStaticSharedNativeLibProvider1
-LOCAL_SDK_VERSION := current
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_AAPT_FLAGS := --shared-lib
-
-LOCAL_EXPORT_PACKAGE_RESOURCES := true
-
-LOCAL_MULTILIB := both
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/keysets/cts-keyset-test-b
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/sample/Android.bp b/hostsidetests/sample/Android.bp
new file mode 100644
index 0000000..489bedc
--- /dev/null
+++ b/hostsidetests/sample/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2014 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.
+
+java_test_host {
+    name: "CtsSampleHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+    ],
+    data: [
+        ":CtsSampleDeviceApp",
+        ":CtsSampleDeviceApp2",
+    ],
+}
diff --git a/hostsidetests/sample/Android.mk b/hostsidetests/sample/Android.mk
deleted file mode 100644
index 1b9bd44..0000000
--- a/hostsidetests/sample/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2014 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := tests
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_MODULE := CtsSampleHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/sample/app/Android.bp b/hostsidetests/sample/app/Android.bp
new file mode 100644
index 0000000..2597717
--- /dev/null
+++ b/hostsidetests/sample/app/Android.bp
@@ -0,0 +1,20 @@
+// Copyright (C) 2014 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.
+
+android_test_helper_app {
+    name: "CtsSampleDeviceApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/sample/app/Android.mk b/hostsidetests/sample/app/Android.mk
deleted file mode 100644
index bc271b6..0000000
--- a/hostsidetests/sample/app/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2014 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsSampleDeviceApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_PACKAGE)
diff --git a/hostsidetests/sample/app2/Android.bp b/hostsidetests/sample/app2/Android.bp
new file mode 100644
index 0000000..1fc25ed
--- /dev/null
+++ b/hostsidetests/sample/app2/Android.bp
@@ -0,0 +1,21 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsSampleDeviceApp2",
+    defaults: ["cts_defaults"],
+    static_libs: ["androidx.test.rules"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/sample/app2/Android.mk b/hostsidetests/sample/app2/Android.mk
deleted file mode 100644
index e050412..0000000
--- a/hostsidetests/sample/app2/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2016 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsSampleDeviceApp2
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/seccomp/Android.bp b/hostsidetests/seccomp/Android.bp
new file mode 100644
index 0000000..cb61ad4
--- /dev/null
+++ b/hostsidetests/seccomp/Android.bp
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 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.
+
+java_test_host {
+    name: "CtsSeccompHostTestCases",
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+    ],
+}
diff --git a/hostsidetests/seccomp/Android.mk b/hostsidetests/seccomp/Android.mk
deleted file mode 100644
index 2c1c077..0000000
--- a/hostsidetests/seccomp/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := tests
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MODULE := CtsSeccompHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/seccomp/app/Android.bp b/hostsidetests/seccomp/app/Android.bp
new file mode 100644
index 0000000..da78d53
--- /dev/null
+++ b/hostsidetests/seccomp/app/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsSeccompDeviceApp",
+    compile_multilib: "both",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+    ],
+    jni_libs: [
+        "libctsseccomp_jni",
+        "libcts_jni",
+        "libnativehelper_compat_libc++",
+    ],
+    srcs: ["src/**/*.java"],
+    asset_dirs: ["assets"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/seccomp/app/Android.mk b/hostsidetests/seccomp/app/Android.mk
deleted file mode 100644
index 216a3c5..0000000
--- a/hostsidetests/seccomp/app/Android.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright (C) 2017 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 := tests
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-          androidx.test.rules \
-          compatibility-device-util-axt \
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-          libctsseccomp_jni \
-          libcts_jni \
-          libnativehelper_compat_libc++ \
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_ASSET_DIR := $(LOCAL_PATH)/assets
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsSeccompDeviceApp
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/seccomp/app/jni/Android.bp b/hostsidetests/seccomp/app/jni/Android.bp
new file mode 100644
index 0000000..3dc4f1c
--- /dev/null
+++ b/hostsidetests/seccomp/app/jni/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 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.
+
+cc_test_library {
+    name: "libctsseccomp_jni",
+    gtest: false,
+    srcs: [
+        "CtsSeccompJniOnLoad.cpp",
+        "android_seccomp_cts_app_SeccompDeviceTest.cpp",
+    ],
+    sdk_version: "current",
+    static_libs: ["cpufeatures"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    shared_libs: [
+        "liblog",
+    ],
+    stl: "c++_static",
+}
diff --git a/hostsidetests/seccomp/app/jni/Android.mk b/hostsidetests/seccomp/app/jni/Android.mk
deleted file mode 100644
index 3637f27..0000000
--- a/hostsidetests/seccomp/app/jni/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE := libctsseccomp_jni
-
-# Don't include this package in any configuration by default.
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
-		CtsSeccompJniOnLoad.cpp \
-		android_seccomp_cts_app_SeccompDeviceTest.cpp \
-
-LOCAL_SDK_VERSION := current
-LOCAL_LDLIBS := -llog
-LOCAL_C_INCLUDES += ndk/sources/cpufeatures
-LOCAL_STATIC_LIBRARIES := cpufeatures
-
-LOCAL_CFLAGS := -Wall -Werror
-
-LOCAL_NDK_STL_VARIANT := c++_static
-include $(BUILD_SHARED_LIBRARY)
diff --git a/hostsidetests/shortcuts/Android.mk b/hostsidetests/shortcuts/Android.mk
deleted file mode 100644
index 3d02f9c..0000000
--- a/hostsidetests/shortcuts/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2016 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 $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/shortcuts/deviceside/Android.bp b/hostsidetests/shortcuts/deviceside/Android.bp
new file mode 100644
index 0000000..df7acb7
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/Android.bp
@@ -0,0 +1,9 @@
+java_defaults {
+    name: "hostsidetests-shortcuts-deviceside-defaults",
+    static_libs: [
+        "hostsidetests-shortcuts-deviceside-common",
+        "ShortcutManagerTestUtils",
+    ],
+    libs: ["android.test.base.stubs"],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/shortcuts/deviceside/Android.mk b/hostsidetests/shortcuts/deviceside/Android.mk
deleted file mode 100644
index 3d02f9c..0000000
--- a/hostsidetests/shortcuts/deviceside/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2016 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 $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/shortcuts/deviceside/backup/Android.mk b/hostsidetests/shortcuts/deviceside/backup/Android.mk
deleted file mode 100644
index 3d02f9c..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2016 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 $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher1/Android.bp b/hostsidetests/shortcuts/deviceside/backup/launcher1/Android.bp
new file mode 100644
index 0000000..8a5bf93
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher1/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupLauncher1",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+
+    srcs: [
+        "src/**/*.java",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher1/Android.mk b/hostsidetests/shortcuts/deviceside/backup/launcher1/Android.mk
deleted file mode 100644
index 2c647d3..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/launcher1/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2016 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupLauncher1
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher2/Android.bp b/hostsidetests/shortcuts/deviceside/backup/launcher2/Android.bp
new file mode 100644
index 0000000..73b4f75
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher2/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupLauncher2",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+
+    srcs: [
+        "src/**/*.java",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher2/Android.mk b/hostsidetests/shortcuts/deviceside/backup/launcher2/Android.mk
deleted file mode 100644
index 4279ea6..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/launcher2/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2016 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupLauncher2
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher3/Android.bp b/hostsidetests/shortcuts/deviceside/backup/launcher3/Android.bp
new file mode 100644
index 0000000..3f2b17c
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher3/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupLauncher3",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+
+    srcs: [
+        "src/**/*.java",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher3/Android.mk b/hostsidetests/shortcuts/deviceside/backup/launcher3/Android.mk
deleted file mode 100644
index f4f3cdd..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/launcher3/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2016 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupLauncher3
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher4new/Android.bp b/hostsidetests/shortcuts/deviceside/backup/launcher4new/Android.bp
new file mode 100644
index 0000000..81276ff
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher4new/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupLauncher4new",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    static_libs: [
+        "CtsShortcutBackupPublisher4oldLib",
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher4new/Android.mk b/hostsidetests/shortcuts/deviceside/backup/launcher4new/Android.mk
deleted file mode 100644
index 8509b88..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/launcher4new/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2017 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupLauncher4new
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../launcher4old/src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher4old/Android.bp b/hostsidetests/shortcuts/deviceside/backup/launcher4old/Android.bp
new file mode 100644
index 0000000..89a4ab9
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher4old/Android.bp
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupLauncher4old",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    static_libs: [
+        "CtsShortcutBackupPublisher4oldLib",
+        "compatibility-device-util-axt",
+    ],
+}
+
+android_library {
+    name: "CtsShortcutBackupLauncher4oldLib",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+    srcs: ["src/**/*.java"],
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher4old/Android.mk b/hostsidetests/shortcuts/deviceside/backup/launcher4old/Android.mk
deleted file mode 100644
index 2ac1739..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/launcher4old/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2017 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupLauncher4old
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher1/Android.bp b/hostsidetests/shortcuts/deviceside/backup/publisher1/Android.bp
new file mode 100644
index 0000000..f8db411
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher1/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupPublisher1",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    srcs: [
+        "src/**/*.java",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher1/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher1/Android.mk
deleted file mode 100644
index 16e42c2..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/publisher1/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2016 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupPublisher1
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher2/Android.bp b/hostsidetests/shortcuts/deviceside/backup/publisher2/Android.bp
new file mode 100644
index 0000000..1b4e96a
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher2/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupPublisher2",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    srcs: [
+        "src/**/*.java",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher2/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher2/Android.mk
deleted file mode 100644
index bd54e76..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/publisher2/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2016 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupPublisher2
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher3/Android.bp b/hostsidetests/shortcuts/deviceside/backup/publisher3/Android.bp
new file mode 100644
index 0000000..f473520
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher3/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupPublisher3",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+
+    srcs: [
+        "src/**/*.java",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher3/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher3/Android.mk
deleted file mode 100644
index ec0d201..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/publisher3/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2016 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupPublisher3
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new/Android.bp b/hostsidetests/shortcuts/deviceside/backup/publisher4new/Android.bp
new file mode 100644
index 0000000..54fc458
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4new/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupPublisher4new",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    static_libs: [
+        "CtsShortcutBackupPublisher4oldLib",
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher4new/Android.mk
deleted file mode 100644
index 8f4993a..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4new/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2017 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupPublisher4new
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../publisher4old/src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/../publisher4old/res
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/Android.bp b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/Android.bp
new file mode 100644
index 0000000..895d2e6
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupPublisher4new_nobackup",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    static_libs: [
+        "CtsShortcutBackupPublisher4oldLib",
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/Android.mk
deleted file mode 100644
index 456da8f..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2017 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupPublisher4new_nobackup
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../publisher4old/src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/../publisher4old/res
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/Android.bp b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/Android.bp
new file mode 100644
index 0000000..3b739fa
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupPublisher4new_nomanifest",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    static_libs: [
+        "CtsShortcutBackupPublisher4oldLib",
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/Android.mk
deleted file mode 100644
index 6b7e3af..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2017 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupPublisher4new_nomanifest
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../publisher4old/src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/../publisher4old/res
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/Android.bp b/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/Android.bp
new file mode 100644
index 0000000..ae33f42
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupPublisher4new_wrongkey",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    static_libs: [
+        "CtsShortcutBackupPublisher4oldLib",
+        "compatibility-device-util-axt",
+    ],
+    certificate: ":cts-testkey1",
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/Android.mk
deleted file mode 100644
index 1f46743..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (C) 2017 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupPublisher4new_wrongkey
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../publisher4old/src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/../publisher4old/res
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/cts-testkey1
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4old/Android.bp b/hostsidetests/shortcuts/deviceside/backup/publisher4old/Android.bp
new file mode 100644
index 0000000..1a8929e
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4old/Android.bp
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupPublisher4old",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    static_libs: [
+        "CtsShortcutBackupPublisher4oldLib",
+        "compatibility-device-util-axt",
+    ],
+}
+
+android_library {
+    name: "CtsShortcutBackupPublisher4oldLib",
+    srcs: ["src/**/*.java"],
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4old/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher4old/Android.mk
deleted file mode 100644
index 0e84c87..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4old/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2017 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupPublisher4old
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/Android.bp b/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/Android.bp
new file mode 100644
index 0000000..ce09a9c
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsShortcutBackupPublisher4old_nomanifest",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    static_libs: [
+        "CtsShortcutBackupPublisher4oldLib",
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/Android.mk
deleted file mode 100644
index 1f772a9..0000000
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2017 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutBackupPublisher4old_nomanifest
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../publisher4old/src) \
-    $(call all-java-files-under, ../../common/src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/../publisher4old/res
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/common/Android.bp b/hostsidetests/shortcuts/deviceside/common/Android.bp
new file mode 100644
index 0000000..ea69333
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/common/Android.bp
@@ -0,0 +1,9 @@
+java_library {
+    name: "hostsidetests-shortcuts-deviceside-common",
+    srcs: ["src/**/*.java"],
+    libs: [
+        "android.test.base.stubs",
+        "ShortcutManagerTestUtils",
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/multiuser/Android.bp b/hostsidetests/shortcuts/deviceside/multiuser/Android.bp
new file mode 100644
index 0000000..d20151e
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/multiuser/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsShortcutMultiuserTest",
+    defaults: [
+        "cts_defaults",
+        "hostsidetests-shortcuts-deviceside-defaults",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    srcs: [
+        "src/**/*.java",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/multiuser/Android.mk b/hostsidetests/shortcuts/deviceside/multiuser/Android.mk
deleted file mode 100644
index 255b569..0000000
--- a/hostsidetests/shortcuts/deviceside/multiuser/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2016 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.
-
-# We build two APKs from the same source files, each with a different set of resources.
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutMultiuserTest
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/deviceside/upgrade/Android.bp b/hostsidetests/shortcuts/deviceside/upgrade/Android.bp
new file mode 100644
index 0000000..a0e435f
--- /dev/null
+++ b/hostsidetests/shortcuts/deviceside/upgrade/Android.bp
@@ -0,0 +1,49 @@
+// Copyright (C) 2016 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.
+
+// We build two APKs from the same source files, each with a different set of resources.
+android_test_helper_app {
+    name: "CtsShortcutUpgradeVersion1",
+    defaults: [
+        "hostsidetests-shortcuts-deviceside-defaults",
+        "cts_defaults",
+    ],
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["version1/res"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
+
+android_test_helper_app {
+    name: "CtsShortcutUpgradeVersion2",
+    defaults: [
+        "hostsidetests-shortcuts-deviceside-defaults",
+        "cts_defaults",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["version2/res"],
+    static_libs: [
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/hostsidetests/shortcuts/deviceside/upgrade/Android.mk b/hostsidetests/shortcuts/deviceside/upgrade/Android.mk
deleted file mode 100644
index 0397afc..0000000
--- a/hostsidetests/shortcuts/deviceside/upgrade/Android.mk
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright (C) 2016 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.
-
-# We build two APKs from the same source files, each with a different set of resources.
-
-# =================================
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutUpgradeVersion1
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../common/src)
-
-LOCAL_RESOURCE_DIR :=  $(LOCAL_PATH)/version1/res
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
-
-# =============================
-
-include $(CLEAR_VARS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutUpgradeVersion2
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../common/src)
-
-LOCAL_RESOURCE_DIR :=  $(LOCAL_PATH)/version2/res
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/shortcuts/hostside/Android.bp b/hostsidetests/shortcuts/hostside/Android.bp
new file mode 100644
index 0000000..2188702
--- /dev/null
+++ b/hostsidetests/shortcuts/hostside/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2014 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.
+
+java_test_host {
+    name: "CtsShortcutHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "tools-common-prebuilt",
+        "cts-tradefed",
+        "tradefed",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/shortcuts/hostside/Android.mk b/hostsidetests/shortcuts/hostside/Android.mk
deleted file mode 100644
index f8bf4dd..0000000
--- a/hostsidetests/shortcuts/hostside/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2014 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)
-
-LOCAL_MODULE := CtsShortcutHostTestCases
-
-LOCAL_CTS_TEST_PACKAGE := android.shortcutshostside
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := tools-common-prebuilt cts-tradefed tradefed
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/stagedinstall/app/src/com/android/tests/stagedinstall/PackageInstallerSessionInfoSubject.java b/hostsidetests/stagedinstall/app/src/com/android/tests/stagedinstall/PackageInstallerSessionInfoSubject.java
index e56e00f..e78e5f3 100644
--- a/hostsidetests/stagedinstall/app/src/com/android/tests/stagedinstall/PackageInstallerSessionInfoSubject.java
+++ b/hostsidetests/stagedinstall/app/src/com/android/tests/stagedinstall/PackageInstallerSessionInfoSubject.java
@@ -18,9 +18,8 @@
 
 import android.content.pm.PackageInstaller;
 
-import com.google.common.truth.FailureStrategy;
+import com.google.common.truth.FailureMetadata;
 import com.google.common.truth.Subject;
-import com.google.common.truth.SubjectFactory;
 import com.google.common.truth.Truth;
 
 import javax.annotation.Nullable;
@@ -28,19 +27,19 @@
 final class PackageInstallerSessionInfoSubject extends
         Subject<PackageInstallerSessionInfoSubject, PackageInstaller.SessionInfo> {
 
-    private PackageInstallerSessionInfoSubject(FailureStrategy failureStrategy,
+    private PackageInstallerSessionInfoSubject(FailureMetadata failureMetadata,
             @Nullable PackageInstaller.SessionInfo subject) {
-        super(failureStrategy, subject);
+        super(failureMetadata, subject);
     }
 
-    private static SubjectFactory<PackageInstallerSessionInfoSubject,
+    private static Subject.Factory<PackageInstallerSessionInfoSubject,
             PackageInstaller.SessionInfo> sessions() {
-        return new SubjectFactory<PackageInstallerSessionInfoSubject,
+        return new Subject.Factory<PackageInstallerSessionInfoSubject,
                 PackageInstaller.SessionInfo>() {
             @Override
-            public PackageInstallerSessionInfoSubject getSubject(FailureStrategy failureStrategy,
+            public PackageInstallerSessionInfoSubject createSubject(FailureMetadata failureMetadata,
                     PackageInstaller.SessionInfo session) {
-                return new PackageInstallerSessionInfoSubject(failureStrategy, session);
+                return new PackageInstallerSessionInfoSubject(failureMetadata, session);
             }
         };
     }
@@ -51,17 +50,17 @@
     }
 
     public void isStagedSessionReady() {
-        check().withFailureMessage(failureMessage("in state READY")).that(
+        check().withMessage(failureMessage("in state READY")).that(
                 getSubject().isStagedSessionReady()).isTrue();
     }
 
     public void isStagedSessionApplied() {
-        check().withFailureMessage(failureMessage("in state APPLIED")).that(
+        check().withMessage(failureMessage("in state APPLIED")).that(
                 getSubject().isStagedSessionApplied()).isTrue();
     }
 
     public void isStagedSessionFailed() {
-        check().withFailureMessage(failureMessage("in state FAILED")).that(
+        check().withMessage(failureMessage("in state FAILED")).that(
                 getSubject().isStagedSessionFailed()).isTrue();
     }
 
diff --git a/hostsidetests/statsd/Android.bp b/hostsidetests/statsd/Android.bp
new file mode 100644
index 0000000..68a2d15
--- /dev/null
+++ b/hostsidetests/statsd/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2014 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.
+
+java_test_host {
+    name: "CtsStatsdHostTestCases",
+
+    srcs: ["src/**/*.java"],
+
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+        "host-libprotobuf-java-full",
+        "platformprotos",
+        "truth-host-prebuilt",
+    ],
+    data: ["**/*.pbtxt"],
+}
diff --git a/hostsidetests/statsd/Android.mk b/hostsidetests/statsd/Android.mk
deleted file mode 100644
index f1937de..0000000
--- a/hostsidetests/statsd/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2014 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_MODULE_TAGS := tests
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MODULE := CtsStatsdHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util host-libprotobuf-java-full \
-	platformprotos truth-host-prebuilt
-
-LOCAL_COMPATIBILITY_SUPPORT_FILES := \
-	$(foreach file, $(call find-subdir-files, *.pbtxt), $(LOCAL_PATH)/$(file))
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/statsd/apps/Android.mk b/hostsidetests/statsd/apps/Android.mk
deleted file mode 100644
index 4a74e80..0000000
--- a/hostsidetests/statsd/apps/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2017 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)
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/systemui/Android.bp b/hostsidetests/systemui/Android.bp
new file mode 100644
index 0000000..f263446
--- /dev/null
+++ b/hostsidetests/systemui/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2016 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.
+
+java_test_host {
+    name: "CtsSystemUiHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/systemui/Android.mk b/hostsidetests/systemui/Android.mk
deleted file mode 100644
index ba437b9..0000000
--- a/hostsidetests/systemui/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_MODULE := CtsSystemUiHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
-
-LOCAL_CTS_TEST_PACKAGE := android.host.systemui
-
-LOCAL_SDK_VERSION := current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/systemui/app/Android.bp b/hostsidetests/systemui/app/Android.bp
new file mode 100644
index 0000000..7083b80
--- /dev/null
+++ b/hostsidetests/systemui/app/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsSystemUiDeviceApp",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/systemui/app/Android.mk b/hostsidetests/systemui/app/Android.mk
deleted file mode 100644
index fed7a9f..0000000
--- a/hostsidetests/systemui/app/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2016 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsSystemUiDeviceApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/theme/Android.mk b/hostsidetests/theme/Android.mk
index 3764442..e2b6f70 100644
--- a/hostsidetests/theme/Android.mk
+++ b/hostsidetests/theme/Android.mk
@@ -38,7 +38,7 @@
 LOCAL_SDK_VERSION := current
 
 # Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
+LOCAL_COMPATIBILITY_SUITE := cts vts
 
 include $(BUILD_CTS_HOST_JAVA_LIBRARY)
 
diff --git a/hostsidetests/theme/assets/R/260dpi.zip b/hostsidetests/theme/assets/R/260dpi.zip
new file mode 100644
index 0000000..ba5d363
--- /dev/null
+++ b/hostsidetests/theme/assets/R/260dpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/280dpi.zip b/hostsidetests/theme/assets/R/280dpi.zip
new file mode 100644
index 0000000..34ea14c
--- /dev/null
+++ b/hostsidetests/theme/assets/R/280dpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/300dpi.zip b/hostsidetests/theme/assets/R/300dpi.zip
new file mode 100644
index 0000000..7595d24
--- /dev/null
+++ b/hostsidetests/theme/assets/R/300dpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/340dpi.zip b/hostsidetests/theme/assets/R/340dpi.zip
new file mode 100644
index 0000000..8ce960c
--- /dev/null
+++ b/hostsidetests/theme/assets/R/340dpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/360dpi.zip b/hostsidetests/theme/assets/R/360dpi.zip
new file mode 100644
index 0000000..aae3adc
--- /dev/null
+++ b/hostsidetests/theme/assets/R/360dpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/400dpi.zip b/hostsidetests/theme/assets/R/400dpi.zip
new file mode 100644
index 0000000..363d602
--- /dev/null
+++ b/hostsidetests/theme/assets/R/400dpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/420dpi.zip b/hostsidetests/theme/assets/R/420dpi.zip
new file mode 100644
index 0000000..0f2ce47
--- /dev/null
+++ b/hostsidetests/theme/assets/R/420dpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/440dpi.zip b/hostsidetests/theme/assets/R/440dpi.zip
new file mode 100644
index 0000000..2328c61
--- /dev/null
+++ b/hostsidetests/theme/assets/R/440dpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/560dpi.zip b/hostsidetests/theme/assets/R/560dpi.zip
new file mode 100644
index 0000000..5f1bb0b
--- /dev/null
+++ b/hostsidetests/theme/assets/R/560dpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/hdpi.zip b/hostsidetests/theme/assets/R/hdpi.zip
new file mode 100644
index 0000000..6d82318
--- /dev/null
+++ b/hostsidetests/theme/assets/R/hdpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/ldpi.zip b/hostsidetests/theme/assets/R/ldpi.zip
new file mode 100644
index 0000000..cc60027
--- /dev/null
+++ b/hostsidetests/theme/assets/R/ldpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/mdpi.zip b/hostsidetests/theme/assets/R/mdpi.zip
new file mode 100644
index 0000000..66d41d4
--- /dev/null
+++ b/hostsidetests/theme/assets/R/mdpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/tvdpi.zip b/hostsidetests/theme/assets/R/tvdpi.zip
new file mode 100644
index 0000000..b43032f
--- /dev/null
+++ b/hostsidetests/theme/assets/R/tvdpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/xhdpi.zip b/hostsidetests/theme/assets/R/xhdpi.zip
new file mode 100644
index 0000000..64905f3
--- /dev/null
+++ b/hostsidetests/theme/assets/R/xhdpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/xxhdpi.zip b/hostsidetests/theme/assets/R/xxhdpi.zip
new file mode 100644
index 0000000..b2cb422
--- /dev/null
+++ b/hostsidetests/theme/assets/R/xxhdpi.zip
Binary files differ
diff --git a/hostsidetests/theme/assets/R/xxxhdpi.zip b/hostsidetests/theme/assets/R/xxxhdpi.zip
new file mode 100644
index 0000000..d00dbbd
--- /dev/null
+++ b/hostsidetests/theme/assets/R/xxxhdpi.zip
Binary files differ
diff --git a/hostsidetests/trustedvoice/Android.bp b/hostsidetests/trustedvoice/Android.bp
new file mode 100644
index 0000000..8394d6d
--- /dev/null
+++ b/hostsidetests/trustedvoice/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2016 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.
+
+java_test_host {
+    name: "CtsTrustedVoiceHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    // Must match the package name in CtsTestCaseList.mk
+    libs: [
+        "cts-tradefed",
+        "ddmlib-prebuilt",
+        "tradefed",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/trustedvoice/Android.mk b/hostsidetests/trustedvoice/Android.mk
deleted file mode 100644
index 34806f3..0000000
--- a/hostsidetests/trustedvoice/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := optional
-
-# Must match the package name in CtsTestCaseList.mk
-LOCAL_MODULE := CtsTrustedVoiceHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed ddmlib-prebuilt tradefed
-
-LOCAL_CTS_TEST_PACKAGE := android.host.trustedvoice
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/trustedvoice/app/Android.bp b/hostsidetests/trustedvoice/app/Android.bp
new file mode 100644
index 0000000..3841b80
--- /dev/null
+++ b/hostsidetests/trustedvoice/app/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsTrustedVoiceApp",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/hostsidetests/trustedvoice/app/Android.mk b/hostsidetests/trustedvoice/app/Android.mk
deleted file mode 100644
index 5127579..0000000
--- a/hostsidetests/trustedvoice/app/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2016 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
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsTrustedVoiceApp
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/tv/Android.bp b/hostsidetests/tv/Android.bp
new file mode 100644
index 0000000..01d598fe
--- /dev/null
+++ b/hostsidetests/tv/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2016 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.
+
+java_test_host {
+    name: "CtsHostsideTvTests",
+    defaults: ["cts_defaults"],
+    // Only compile source java files in this apk.
+    srcs: ["src/**/*.java"],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/tv/Android.mk b/hostsidetests/tv/Android.mk
deleted file mode 100644
index 79f976a..0000000
--- a/hostsidetests/tv/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2016 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)
-
-# Only compile source java files in this apk.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := CtsHostsideTvTests
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
-
-LOCAL_CTS_TEST_PACKAGE := android.tv.hostsidetv
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/tv/app/Android.bp b/hostsidetests/tv/app/Android.bp
new file mode 100644
index 0000000..b6151be
--- /dev/null
+++ b/hostsidetests/tv/app/Android.bp
@@ -0,0 +1,38 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test_helper_app {
+    name: "CtsHostsideTvInputApp",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "test_current",
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    optimize: {
+        enabled: false,
+    },
+    dex_preopt: {
+        enabled: false,
+    },
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/tv/app/Android.mk b/hostsidetests/tv/app/Android.mk
deleted file mode 100644
index 0b49885..0000000
--- a/hostsidetests/tv/app/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util-axt ctstestrunner-axt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsHostsideTvInputApp
-
-LOCAL_PROGUARD_ENABLED := disabled
-LOCAL_DEX_PREOPT := false
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/tv/app2/Android.bp b/hostsidetests/tv/app2/Android.bp
new file mode 100644
index 0000000..e8d31f7
--- /dev/null
+++ b/hostsidetests/tv/app2/Android.bp
@@ -0,0 +1,33 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test_helper_app {
+    name: "CtsHostsideTvInputMonitor",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    srcs: ["src/**/*.java"],
+    libs: ["android.test.runner.stubs"],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/tv/app2/Android.mk b/hostsidetests/tv/app2/Android.mk
deleted file mode 100644
index 8257909..0000000
--- a/hostsidetests/tv/app2/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsHostsideTvInputMonitor
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util-axt ctstestrunner-axt
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/tzdata/Android.bp b/hostsidetests/tzdata/Android.bp
new file mode 100644
index 0000000..cec8a3b
--- /dev/null
+++ b/hostsidetests/tzdata/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 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.
+
+java_test_host {
+    name: "CtsHostTzDataTests",
+    defaults: ["cts_defaults"],
+    // Only compile source java files in this apk.
+    srcs: ["src/**/*.java"],
+    libs: ["tradefed"],
+    static_libs: [
+        "tzdata-testing",
+        "time_zone_distro",
+        "time_zone_distro_builder",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/tzdata/Android.mk b/hostsidetests/tzdata/Android.mk
deleted file mode 100644
index f5bd2f1..0000000
--- a/hostsidetests/tzdata/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2017 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)
-
-# Only compile source java files in this apk.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := CtsHostTzDataTests
-
-LOCAL_JAVA_LIBRARIES := tradefed
-
-LOCAL_STATIC_JAVA_LIBRARIES := tzdata-testing time_zone_distro time_zone_distro_builder
-
-LOCAL_CTS_TEST_PACKAGE := android.host.tzdata
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
diff --git a/hostsidetests/tzdata/OWNERS b/hostsidetests/tzdata/OWNERS
new file mode 100644
index 0000000..2d36574
--- /dev/null
+++ b/hostsidetests/tzdata/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 24949
+include platform/libcore:/OWNERS
diff --git a/hostsidetests/tzdata/src/com/android/cts/tzdata/TzDataCheckTest.java b/hostsidetests/tzdata/src/com/android/cts/tzdata/TzDataCheckTest.java
index b2c65d5..e86809b 100644
--- a/hostsidetests/tzdata/src/com/android/cts/tzdata/TzDataCheckTest.java
+++ b/hostsidetests/tzdata/src/com/android/cts/tzdata/TzDataCheckTest.java
@@ -137,14 +137,13 @@
     }
 
     /**
-     * Test the real base files exist in the expected locations - tzcdatacheck relies on some of
-     * them via a command line argument hardcoded in system/core/rootdir/init.rc.
+     * Test the base file used by tzdatacheck exists in the expected location - tzcdatacheck relies
+     * on this file to determine the version of tzdata on device. The path is passed to tzdatacheck
+     * via a command line argument hardcoded in system/core/rootdir/init.rc.
      */
     public void testExpectedBaseFilesExist() throws Exception {
-        String baseTzFilesDir = "/apex/com.android.runtime/etc/tz/";
+        String baseTzFilesDir = "/apex/com.android.tzdata/etc/tz/";
         assertDeviceFileExists(baseTzFilesDir + "tz_version");
-        assertDeviceFileExists(baseTzFilesDir + "tzdata");
-        assertDeviceFileExists(baseTzFilesDir + "tzlookup.xml");
     }
 
     public void testTooFewArgs() throws Exception {
diff --git a/hostsidetests/ui/appA/Android.bp b/hostsidetests/ui/appA/Android.bp
new file mode 100644
index 0000000..9b92163
--- /dev/null
+++ b/hostsidetests/ui/appA/Android.bp
@@ -0,0 +1,31 @@
+// 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.
+
+android_test_helper_app {
+    name: "CtsDeviceTaskSwitchingAppA",
+    defaults: ["cts_support_defaults"],
+    // don't include this package in any target
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/ui/appA/Android.mk b/hostsidetests/ui/appA/Android.mk
deleted file mode 100644
index 17da676..0000000
--- a/hostsidetests/ui/appA/Android.mk
+++ /dev/null
@@ -1,37 +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 := \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsDeviceTaskSwitchingAppA
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/ui/appB/Android.bp b/hostsidetests/ui/appB/Android.bp
new file mode 100644
index 0000000..60f5853
--- /dev/null
+++ b/hostsidetests/ui/appB/Android.bp
@@ -0,0 +1,31 @@
+// 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.
+
+android_test_helper_app {
+    name: "CtsDeviceTaskSwitchingAppB",
+    defaults: ["cts_support_defaults"],
+    // don't include this package in any target
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/ui/appB/Android.mk b/hostsidetests/ui/appB/Android.mk
deleted file mode 100644
index 11fc2b0..0000000
--- a/hostsidetests/ui/appB/Android.mk
+++ /dev/null
@@ -1,37 +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 := \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsDeviceTaskSwitchingAppB
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/ui/control/Android.bp b/hostsidetests/ui/control/Android.bp
new file mode 100644
index 0000000..4ff73a0
--- /dev/null
+++ b/hostsidetests/ui/control/Android.bp
@@ -0,0 +1,34 @@
+// 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.
+
+android_test {
+    name: "CtsDeviceTaskSwitchingControl",
+    defaults: ["cts_support_defaults"],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/hostsidetests/ui/control/Android.mk b/hostsidetests/ui/control/Android.mk
deleted file mode 100644
index 2a30338..0000000
--- a/hostsidetests/ui/control/Android.mk
+++ /dev/null
@@ -1,36 +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 := compatibility-device-util-axt ctstestrunner-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsDeviceTaskSwitchingControl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/usage/Android.bp b/hostsidetests/usage/Android.bp
new file mode 100644
index 0000000..5ebeb54
--- /dev/null
+++ b/hostsidetests/usage/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2015 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.
+
+java_test_host {
+    name: "CtsAppUsageHostTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    // Must match the package name in CtsTestCaseList.mk
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/hostsidetests/usage/Android.mk b/hostsidetests/usage/Android.mk
deleted file mode 100644
index ff4f5e0..0000000
--- a/hostsidetests/usage/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Must match the package name in CtsTestCaseList.mk
-LOCAL_MODULE := CtsAppUsageHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed
-
-LOCAL_CTS_TEST_PACKAGE := android.host.app.usage
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/usage/app/Android.bp b/hostsidetests/usage/app/Android.bp
new file mode 100644
index 0000000..48a30d9
--- /dev/null
+++ b/hostsidetests/usage/app/Android.bp
@@ -0,0 +1,45 @@
+// Copyright (C) 2015 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.
+
+android_test_helper_app {
+    name: "CtsAppUsageTestApp",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
+
+// Build a second one similar to the first
+
+android_test_helper_app {
+    name: "CtsAppUsageTestAppToo",
+    defaults: ["cts_support_defaults"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    aaptflags: [
+        "--rename-manifest-package",
+        "android.app.usage.apptoo",
+    ],
+}
diff --git a/hostsidetests/usage/app/Android.mk b/hostsidetests/usage/app/Android.mk
deleted file mode 100644
index 3d51230..0000000
--- a/hostsidetests/usage/app/Android.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright (C) 2015 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 := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_PACKAGE_NAME := CtsAppUsageTestApp
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
-# Build a second one similar to the first
-
-include $(CLEAR_VARS)
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_PACKAGE_NAME := CtsAppUsageTestAppToo
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_AAPT_FLAGS += --rename-manifest-package android.app.usage.apptoo
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/usb/Android.bp b/hostsidetests/usb/Android.bp
new file mode 100644
index 0000000..8c0bd95
--- /dev/null
+++ b/hostsidetests/usb/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2013 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.
+
+java_test_host {
+    name: "CtsUsbTests",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "cts-tradefed",
+        "tradefed",
+        "compatibility-host-util",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/hostsidetests/usb/Android.mk b/hostsidetests/usb/Android.mk
deleted file mode 100644
index 116fa39..0000000
--- a/hostsidetests/usb/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2013 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)
-
-# Only compile source java files in this apk.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := CtsUsbTests
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
-
-LOCAL_CTS_TEST_PACKAGE := android.usb
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/usb/SerialTestApp/Android.bp b/hostsidetests/usb/SerialTestApp/Android.bp
new file mode 100644
index 0000000..ec06142
--- /dev/null
+++ b/hostsidetests/usb/SerialTestApp/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2013 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.
+
+android_test_helper_app {
+    name: "CtsUsbSerialTestApp",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "test_current",
+    min_sdk_version: "27",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/hostsidetests/usb/SerialTestApp/Android.mk b/hostsidetests/usb/SerialTestApp/Android.mk
deleted file mode 100644
index d14bcc0..0000000
--- a/hostsidetests/usb/SerialTestApp/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2013 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 := ctstestrunner-axt \
-	compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsUsbSerialTestApp
-
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 27
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/hostsidetests/webkit/Android.bp b/hostsidetests/webkit/Android.bp
new file mode 100644
index 0000000..afbb007
--- /dev/null
+++ b/hostsidetests/webkit/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2014 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.
+
+java_test_host {
+    name: "CtsHostsideWebViewTests",
+    defaults: ["cts_defaults"],
+    // Only compile source java files in this apk.
+    srcs: ["src/**/*.java"],
+    libs: [
+        "tradefed",
+        "compatibility-host-util",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/hostsidetests/webkit/Android.mk b/hostsidetests/webkit/Android.mk
deleted file mode 100644
index 814760a..0000000
--- a/hostsidetests/webkit/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2014 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)
-
-# Only compile source java files in this apk.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := CtsHostsideWebViewTests
-
-LOCAL_JAVA_LIBRARIES := tradefed compatibility-host-util
-
-LOCAL_CTS_TEST_PACKAGE := android.webkit.hostside
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-# Build the test APKs using their own makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/webkit/app/Android.bp b/hostsidetests/webkit/app/Android.bp
new file mode 100644
index 0000000..b2ce1f2
--- /dev/null
+++ b/hostsidetests/webkit/app/Android.bp
@@ -0,0 +1,40 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test_helper_app {
+    name: "CtsWebViewStartupApp",
+    defaults: ["cts_support_defaults"],
+    // Don't include this package in any target.
+    sdk_version: "test_current",
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctsdeviceutillegacy-axt",
+        "ctstestserver",
+        "ctstestrunner-axt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/hostsidetests/webkit/app/Android.mk b/hostsidetests/webkit/app/Android.mk
deleted file mode 100644
index 98a7092..0000000
--- a/hostsidetests/webkit/app/Android.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# Copyright (C) 2016 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 := tests
-LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    ctsdeviceutillegacy-axt \
-    ctstestserver \
-    ctstestrunner-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-# When built, explicitly put it in the data partition.
-#LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsWebViewStartupApp
-
-LOCAL_PROGUARD_ENABLED := disabled
-LOCAL_DEX_PREOPT := false
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/libs/rollback/src/com/android/cts/rollback/lib/RollbackInfoSubject.java b/libs/rollback/src/com/android/cts/rollback/lib/RollbackInfoSubject.java
index 2769b80..8bc9247 100644
--- a/libs/rollback/src/com/android/cts/rollback/lib/RollbackInfoSubject.java
+++ b/libs/rollback/src/com/android/cts/rollback/lib/RollbackInfoSubject.java
@@ -20,9 +20,8 @@
 import android.content.rollback.PackageRollbackInfo;
 import android.content.rollback.RollbackInfo;
 
-import com.google.common.truth.FailureStrategy;
+import com.google.common.truth.FailureMetadata;
 import com.google.common.truth.Subject;
-import com.google.common.truth.SubjectFactory;
 import com.google.common.truth.Truth;
 
 import java.util.ArrayList;
@@ -42,20 +41,20 @@
     /**
      * Gets the subject factory for RollbackInfo.
      */
-    public static SubjectFactory<RollbackInfoSubject, RollbackInfo> rollbacks() {
+    public static Subject.Factory<RollbackInfoSubject, RollbackInfo> rollbacks() {
         return SUBJECT_FACTORY;
     }
 
-    private static final SubjectFactory<RollbackInfoSubject, RollbackInfo> SUBJECT_FACTORY =
-            new SubjectFactory<RollbackInfoSubject, RollbackInfo>() {
+    private static final Subject.Factory<RollbackInfoSubject, RollbackInfo> SUBJECT_FACTORY =
+            new Subject.Factory<RollbackInfoSubject, RollbackInfo>() {
                 @Override
-                public RollbackInfoSubject getSubject(FailureStrategy fs, RollbackInfo that) {
+                public RollbackInfoSubject createSubject(FailureMetadata fs, RollbackInfo that) {
                     return new RollbackInfoSubject(fs, that);
                 }
             };
 
-    private RollbackInfoSubject(FailureStrategy failureStrategy, RollbackInfo subject) {
-        super(failureStrategy, subject);
+    private RollbackInfoSubject(FailureMetadata failureMetadata, RollbackInfo subject) {
+        super(failureMetadata, subject);
     }
 
     /**
diff --git a/libs/testserver/src/android/webkit/cts/CtsTestServer.java b/libs/testserver/src/android/webkit/cts/CtsTestServer.java
index f8ab413..64f0507 100644
--- a/libs/testserver/src/android/webkit/cts/CtsTestServer.java
+++ b/libs/testserver/src/android/webkit/cts/CtsTestServer.java
@@ -946,7 +946,6 @@
                     }
                     return;
                 } catch (IOException e) {
-                    Log.w(TAG, e);
                     if (--retry == 0) {
                         throw e;
                     }
diff --git a/libs/vogar-expect/src/vogar/AnnotatedOutcome.java b/libs/vogar-expect/src/vogar/AnnotatedOutcome.java
deleted file mode 100644
index a27ab9e..0000000
--- a/libs/vogar-expect/src/vogar/AnnotatedOutcome.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-package vogar;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Ordering;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.SortedMap;
-
-/**
- * Contains an outcome for a test, along with some metadata pertaining to the history of this test,
- * including a list of previous outcomes, an outcome corresponding to the tag Vogar is being run
- * with, if applicable, and the expectation for this test, so that result value information is
- * available.
- */
-public final class AnnotatedOutcome {
-    public static Ordering<AnnotatedOutcome> ORDER_BY_NAME = new Ordering<AnnotatedOutcome>() {
-        @Override public int compare(AnnotatedOutcome a, AnnotatedOutcome b) {
-            return a.getName().compareTo(b.getName());
-       }
-    };
-
-    private final Expectation expectation;
-    private final Outcome outcome;
-    /** a list of previous outcomes for the same action, sorted in chronological order */
-    private final SortedMap<Long, Outcome> previousOutcomes;
-    /** will be null if not comparing to a tag */
-    private final String tagName;
-    private final Outcome tagOutcome;
-    private final boolean hasMetadata;
-
-    AnnotatedOutcome(Outcome outcome, Expectation expectation,
-            SortedMap<Long, Outcome> previousOutcomes, String tagName, Outcome tagOutcome,
-            boolean hasMetadata) {
-        if (previousOutcomes == null) {
-            throw new NullPointerException();
-        }
-        this.expectation = expectation;
-        this.outcome = outcome;
-        this.previousOutcomes = previousOutcomes;
-        this.tagName = tagName;
-        this.tagOutcome = tagOutcome;
-        this.hasMetadata = hasMetadata;
-    }
-
-    public Outcome getOutcome() {
-        return outcome;
-    }
-
-    public String getName() {
-        return outcome.getName();
-    }
-
-    public ResultValue getResultValue() {
-        return outcome.getResultValue(expectation);
-    }
-
-    public List<ResultValue> getPreviousResultValues() {
-        List<ResultValue> previousResultValues = new ArrayList<ResultValue>();
-        for (Outcome previousOutcome : previousOutcomes.values()) {
-            previousResultValues.add(previousOutcome.getResultValue(expectation));
-        }
-        return previousResultValues;
-    }
-
-    /**
-     * Returns the most recent result value of a run of this test (before the current run).
-     */
-    public ResultValue getMostRecentResultValue(ResultValue defaultValue) {
-        List<ResultValue> previousResultValues = getPreviousResultValues();
-        return previousResultValues.isEmpty() ?
-                defaultValue :
-                previousResultValues.get(previousResultValues.size() - 1);
-    }
-
-    public boolean hasTag() {
-        return tagOutcome != null;
-    }
-
-    public String getTagName() {
-        return tagName;
-    }
-
-    public ResultValue getTagResultValue() {
-        return tagOutcome == null ? null : tagOutcome.getResultValue(expectation);
-    }
-
-    /**
-     * Returns true if the outcome is noteworthy given the result value and previous history.
-     */
-    public boolean isNoteworthy() {
-        return getResultValue() != ResultValue.OK || recentlyChanged() || changedSinceTag();
-    }
-
-    public boolean outcomeChanged() {
-        List<Outcome> previousOutcomesList = getOutcomeList();
-        return previousOutcomesList.isEmpty()
-                || !outcome.equals(previousOutcomesList.get(previousOutcomesList.size() - 1));
-    }
-
-    private ArrayList<Outcome> getOutcomeList() {
-        return new ArrayList<Outcome>(previousOutcomes.values());
-    }
-
-    /**
-     * Returns true if the outcome recently changed in result value.
-     */
-    private boolean recentlyChanged() {
-        List<ResultValue> previousResultValues = getPreviousResultValues();
-        if (previousResultValues.isEmpty()) {
-            return false;
-        }
-        return previousResultValues.get(previousResultValues.size() - 1) != getResultValue();
-    }
-
-    private boolean changedSinceTag() {
-        ResultValue tagResultValue = getTagResultValue();
-        return tagResultValue != null && tagResultValue != getResultValue();
-    }
-
-    /**
-     * Returns a Long representing the time the outcome was last run. Returns {@code defaultValue}
-     * if the outcome is not known to have run before.
-     */
-    public Long lastRun(Long defaultValue) {
-        if (!hasMetadata) {
-            return defaultValue;
-        }
-        List<Long> runTimes = Lists.newArrayList(previousOutcomes.keySet());
-        return runTimes.isEmpty() ? defaultValue : runTimes.get(runTimes.size() - 1);
-    }
-}
diff --git a/libs/vogar-expect/src/vogar/Expectation.java b/libs/vogar-expect/src/vogar/Expectation.java
deleted file mode 100644
index ddbc233..0000000
--- a/libs/vogar-expect/src/vogar/Expectation.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-package vogar;
-
-import java.util.LinkedHashSet;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-/**
- * The expected result of an action execution. This is typically encoded in the
- * expectations text file, which has the following format:
- * <pre>
- * test java.io.StreamTokenizer.Reset
- * result UNSUPPORTED
- * pattern .*should get token \[, but get -1.*
- *
- * # should we fix this?
- * test java.util.Arrays.CopyMethods
- * result COMPILE_FAILED
- * pattern .*cannot find symbol.*
- * </pre>
- */
-public final class Expectation {
-
-    /** Justification for this expectation */
-    private final String description;
-
-    /** The action's expected result, such as {@code EXEC_FAILED}. */
-    private final Result result;
-
-    /** The pattern the expected output will match. */
-    private final Pattern pattern;
-
-    /** Attributes of this test. */
-    private final Set<String> tags;
-
-    /** The tracking bug ID */
-    private final long bug;
-
-    /** True if the identified bug still active. */
-    private boolean bugIsOpen = false;
-
-    public Expectation(Result result, Pattern pattern, Set<String> tags, String description, long bug) {
-        if (result == null || description == null || pattern == null) {
-            throw new IllegalArgumentException(
-                    "result=" + result + " description=" + description + " pattern=" + pattern);
-        }
-
-        this.description = description;
-        this.result = result;
-        this.pattern = pattern;
-        this.tags = new LinkedHashSet<String>(tags);
-        this.bug = bug;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public long getBug() {
-        return bug;
-    }
-
-    public Result getResult() {
-        return result;
-    }
-
-    public Set<String> getTags() {
-        return tags;
-    }
-
-    /**
-     * Set the current status of this expectation's bug. When a bug is open,
-     * any result (success or failure) is permitted.
-     */
-    public void setBugIsOpen(boolean bugIsOpen) {
-        this.bugIsOpen = bugIsOpen;
-    }
-
-    /**
-     * Returns true if {@code outcome} matches this expectation.
-     */
-    public boolean matches(Outcome outcome) {
-        return patternMatches(outcome) && (bugIsOpen || result == outcome.getResult());
-    }
-
-    private boolean patternMatches(Outcome outcome) {
-        return pattern.matcher(outcome.getOutput()).matches();
-    }
-
-    @Override public String toString() {
-        return "Expectation[description=" + description + " pattern=" + pattern.pattern() + "]";
-    }
-}
diff --git a/libs/vogar-expect/src/vogar/ExpectationStore.java b/libs/vogar-expect/src/vogar/ExpectationStore.java
deleted file mode 100644
index bf87b46..0000000
--- a/libs/vogar-expect/src/vogar/ExpectationStore.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-package vogar;
-
-import com.android.json.stream.JsonReader;
-import com.google.common.base.Joiner;
-import com.google.common.base.Splitter;
-import com.google.common.collect.Iterables;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.URL;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Pattern;
-import vogar.commands.Command;
-import vogar.util.Log;
-
-/**
- * A database of expected outcomes. Entries in this database come in two forms.
- * <ul>
- *   <li>Outcome expectations name an outcome (or its prefix, such as
- *       "java.util"), its expected result, and an optional pattern to match
- *       the expected output.
- *   <li>Failure expectations include a pattern that may match the output of any
- *       outcome. These expectations are useful for hiding failures caused by
- *       cross-cutting features that aren't supported.
- * </ul>
- *
- * <p>If an outcome matches both an outcome expectation and a failure
- * expectation, the outcome expectation will be returned.
- */
-public final class ExpectationStore {
-
-    /** The pattern to use when no expected output is specified */
-    private static final Pattern MATCH_ALL_PATTERN
-            = Pattern.compile(".*", Pattern.MULTILINE | Pattern.DOTALL);
-
-    /** The expectation of a general successful run. */
-    private static final Expectation SUCCESS = new Expectation(Result.SUCCESS, MATCH_ALL_PATTERN,
-            Collections.<String>emptySet(), "", -1);
-
-    private static final int PATTERN_FLAGS = Pattern.MULTILINE | Pattern.DOTALL;
-
-    private final Map<String, Expectation> outcomes = new LinkedHashMap<String, Expectation>();
-    private final Map<String, Expectation> failures = new LinkedHashMap<String, Expectation>();
-
-    private ExpectationStore() {}
-
-    /**
-     * Finds the expected result for the specified action or outcome name. This
-     * returns a value for all names, even if no explicit expectation was set.
-     */
-    public Expectation get(String name) {
-        Expectation byName = getByNameOrPackage(name);
-        return byName != null ? byName : SUCCESS;
-    }
-
-    /**
-     * Finds the expected result for the specified outcome after it has
-     * completed. Unlike {@code get()}, this also takes into account the
-     * outcome's output.
-     *
-     * <p>For outcomes that have both a name match and an output match,
-     * exact name matches are preferred, then output matches, then inexact
-     * name matches.
-     */
-    public Expectation get(Outcome outcome) {
-        Expectation exactNameMatch = outcomes.get(outcome.getName());
-        if (exactNameMatch != null) {
-            return exactNameMatch;
-        }
-
-        for (Map.Entry<String, Expectation> entry : failures.entrySet()) {
-            if (entry.getValue().matches(outcome)) {
-                return entry.getValue();
-            }
-        }
-
-        Expectation byName = getByNameOrPackage(outcome.getName());
-        return byName != null ? byName : SUCCESS;
-    }
-
-    private Expectation getByNameOrPackage(String name) {
-        while (true) {
-            Expectation expectation = outcomes.get(name);
-            if (expectation != null) {
-                return expectation;
-            }
-
-            int dotOrHash = Math.max(name.lastIndexOf('.'), name.lastIndexOf('#'));
-            if (dotOrHash == -1) {
-                return null;
-            }
-
-            name = name.substring(0, dotOrHash);
-        }
-    }
-
-    public static ExpectationStore parse(Set<File> expectationFiles, ModeId mode) throws IOException {
-        ExpectationStore result = new ExpectationStore();
-        for (File f : expectationFiles) {
-            if (f.exists()) {
-                result.parse(f, mode);
-            }
-        }
-        return result;
-    }
-
-    /**
-     * Create an {@link ExpectationStore} that is populated from expectation resources.
-     * @param owningClass the class from which the resources are loaded.
-     * @param expectationResources the set of paths to the expectation resources; the paths are
-     * either relative to the owning class, or absolute (starting with a /).
-     * @param mode the mode within which the tests are to be run.
-     * @return the populated {@link ExpectationStore}.
-     * @throws IOException if there was a problem loading
-     */
-    public static ExpectationStore parseResources(
-            Class<?> owningClass, Set<String> expectationResources, ModeId mode)
-            throws IOException {
-        ExpectationStore result = new ExpectationStore();
-        for (String expectationsPath : expectationResources) {
-            URL url = owningClass.getResource(expectationsPath);
-            if (url == null) {
-                Log.warn("Could not find resource '" + expectationsPath
-                        + "' relative to " + owningClass);
-            } else {
-                result.parse(url, mode);
-            }
-        }
-        return result;
-    }
-
-    private void parse(URL url, ModeId mode) throws IOException {
-        Log.verbose("loading expectations from " + url);
-
-        try (InputStream is = url.openStream();
-             Reader reader = new InputStreamReader(is)) {
-            parse(reader, url.toString(), mode);
-        }
-    }
-
-    public void parse(File expectationsFile, ModeId mode) throws IOException {
-        Log.verbose("loading expectations file " + expectationsFile);
-
-        try (Reader fileReader = new FileReader(expectationsFile)) {
-            String source = expectationsFile.toString();
-            parse(fileReader, source, mode);
-        }
-    }
-
-    private void parse(Reader reader, String source, ModeId mode) throws IOException {
-        int count = 0;
-        try (JsonReader jsonReader = new JsonReader(reader)) {
-            jsonReader.setLenient(true);
-            jsonReader.beginArray();
-            while (jsonReader.hasNext()) {
-                readExpectation(jsonReader, mode);
-                count++;
-            }
-            jsonReader.endArray();
-
-            Log.verbose("loaded " + count + " expectations from " + source);
-        }
-    }
-
-    private void readExpectation(JsonReader reader, ModeId mode) throws IOException {
-        boolean isFailure = false;
-        Result result = Result.EXEC_FAILED;
-        Pattern pattern = MATCH_ALL_PATTERN;
-        Set<String> names = new LinkedHashSet<String>();
-        Set<String> tags = new LinkedHashSet<String>();
-        Set<ModeId> modes = null;
-        String description = "";
-        long buganizerBug = -1;
-
-        reader.beginObject();
-        while (reader.hasNext()) {
-            String name = reader.nextName();
-            if (name.equals("result")) {
-                result = Result.valueOf(reader.nextString());
-            } else if (name.equals("name")) {
-                names.add(reader.nextString());
-            } else if (name.equals("names")) {
-                readStrings(reader, names);
-            } else if (name.equals("failure")) {
-                // isFailure is somewhat arbitrarily keyed on the existence of a "failure"
-                // element instead of looking at the "result" field. There are only about 5
-                // expectations in our entire expectation store that have this tag.
-                //
-                // TODO: Get rid of it and the "failures" map and just use the outcomes
-                // map for everything. Both uses seem useless.
-                isFailure = true;
-                names.add(reader.nextString());
-            } else if (name.equals("pattern")) {
-                pattern = Pattern.compile(reader.nextString(), PATTERN_FLAGS);
-            } else if (name.equals("substring")) {
-                pattern = Pattern.compile(".*" + Pattern.quote(reader.nextString()) + ".*", PATTERN_FLAGS);
-            } else if (name.equals("tags")) {
-                readStrings(reader, tags);
-            } else if (name.equals("description")) {
-                Iterable<String> split = Splitter.on("\n").omitEmptyStrings().trimResults().split(reader.nextString());
-                description = Joiner.on("\n").join(split);
-            } else if (name.equals("bug")) {
-                buganizerBug = reader.nextLong();
-            } else if (name.equals("modes")) {
-                modes = readModes(reader);
-            } else {
-                Log.warn("Unhandled name in expectations file: " + name);
-                reader.skipValue();
-            }
-        }
-        reader.endObject();
-
-        if (names.isEmpty()) {
-            throw new IllegalArgumentException("Missing 'name' or 'failure' key in " + reader);
-        }
-        if (modes != null && !modes.contains(mode)) {
-            return;
-        }
-
-        Expectation expectation = new Expectation(result, pattern, tags, description, buganizerBug);
-        Map<String, Expectation> map = isFailure ? failures : outcomes;
-        for (String name : names) {
-            if (map.put(name, expectation) != null) {
-                throw new IllegalArgumentException("Duplicate expectations for " + name);
-            }
-        }
-    }
-
-    private void readStrings(JsonReader reader, Set<String> output) throws IOException {
-        reader.beginArray();
-        while (reader.hasNext()) {
-            output.add(reader.nextString());
-        }
-        reader.endArray();
-    }
-
-    private Set<ModeId> readModes(JsonReader reader) throws IOException {
-        Set<ModeId> result = new LinkedHashSet<ModeId>();
-        reader.beginArray();
-        while (reader.hasNext()) {
-            result.add(ModeId.valueOf(reader.nextString().toUpperCase()));
-        }
-        reader.endArray();
-        return result;
-    }
-
-    /**
-     * Sets the bugIsOpen status on all expectations by querying an external bug
-     * tracker.
-     */
-    public void loadBugStatuses(String openBugsCommand) {
-        Iterable<Expectation> allExpectations = Iterables.concat(outcomes.values(), failures.values());
-
-        // figure out what bug IDs we're interested in
-        Set<String> bugs = new LinkedHashSet<String>();
-        for (Expectation expectation : allExpectations) {
-            if (expectation.getBug() != -1) {
-                bugs.add(Long.toString(expectation.getBug()));
-            }
-        }
-        if (bugs.isEmpty()) {
-            return;
-        }
-
-        // query the external app for open bugs
-        List<String> openBugs = new Command.Builder()
-                .args(openBugsCommand)
-                .args(bugs)
-                .execute();
-        Set<Long> openBugsSet = new LinkedHashSet<Long>();
-        for (String bug : openBugs) {
-            openBugsSet.add(Long.parseLong(bug));
-        }
-
-        Log.verbose("tracking " + openBugsSet.size() + " open bugs: " + openBugs);
-
-        // update our expectations with that set
-        for (Expectation expectation : allExpectations) {
-            if (openBugsSet.contains(expectation.getBug())) {
-                expectation.setBugIsOpen(true);
-            }
-        }
-    }
-
-    public Map<String, Expectation> getAllOutComes() {
-        return outcomes;
-    }
-
-    public Map<String, Expectation> getAllFailures() {
-        return failures;
-    }
-}
diff --git a/libs/vogar-expect/src/vogar/ModeId.java b/libs/vogar-expect/src/vogar/ModeId.java
deleted file mode 100644
index 3b24cc1..0000000
--- a/libs/vogar-expect/src/vogar/ModeId.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-package vogar;
-
-public enum ModeId {
-    DEVICE, JVM, ACTIVITY, SIM, HOST;
-
-    public boolean acceptsVmArgs() {
-        return this != ACTIVITY;
-    }
-
-    public boolean isHost() {
-        return this == JVM || this == SIM || this == HOST;
-    }
-
-    public boolean requiresAndroidSdk() {
-        return this == DEVICE || this == ACTIVITY || this == SIM || this == HOST;
-    }
-}
diff --git a/libs/vogar-expect/src/vogar/Outcome.java b/libs/vogar-expect/src/vogar/Outcome.java
deleted file mode 100644
index 3d7c68f..0000000
--- a/libs/vogar-expect/src/vogar/Outcome.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-package vogar;
-
-import com.google.common.collect.Lists;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import vogar.util.Strings;
-
-/**
- * An outcome of an action. Some actions may have multiple outcomes. For
- * example, JUnit tests have one outcome for each test method.
- */
-public final class Outcome {
-
-    private final String outcomeName;
-    private final Result result;
-    private final String output;
-    private final Date date;
-
-    public Outcome(String outcomeName, Result result, List<String> outputLines) {
-        this.outcomeName = outcomeName;
-        this.result = result;
-        this.output = sanitizeOutputLines(outputLines);
-        this.date = new Date();
-    }
-
-    public Outcome(String outcomeName, Result result, String outputLine, Date date) {
-        this.outcomeName = outcomeName;
-        this.result = result;
-        this.output = sanitizeOutputLine(outputLine);
-        this.date = date;
-    }
-
-    public Outcome(String outcomeName, Result result, String outputLine) {
-        this.outcomeName = outcomeName;
-        this.result = result;
-        this.output = sanitizeOutputLine(outputLine);
-        this.date = new Date();
-    }
-
-    public Outcome(String outcomeName, Result result, Throwable throwable) {
-        this.outcomeName = outcomeName;
-        this.result = result;
-        this.output = sanitizeOutputLines(throwableToLines(throwable));
-        this.date = new Date();
-    }
-
-    private String sanitizeOutputLines(List<String> outputLines) {
-        List<String> sanitizedStrings = Lists.newArrayList();
-        for (String line : outputLines) {
-            sanitizedStrings.add(sanitizeOutputLine(line));
-        }
-        return Strings.join(sanitizedStrings, "\n");
-    }
-
-    private String sanitizeOutputLine(String outputLine) {
-        return Strings.xmlSanitize(outputLine.replaceAll("\r\n?", "\n"));
-    }
-
-    public Date getDate() {
-        return date;
-    }
-
-    public String getName() {
-        return outcomeName;
-    }
-
-    public Result getResult() {
-        return result;
-    }
-
-    public String getOutput() {
-        return output;
-    }
-
-    public List<String> getOutputLines() {
-        return Arrays.asList(output.split("\n"));
-    }
-
-    private static List<String> throwableToLines(Throwable t) {
-        StringWriter writer = new StringWriter();
-        PrintWriter out = new PrintWriter(writer);
-        t.printStackTrace(out);
-        return Arrays.asList(writer.toString().split("\\n"));
-    }
-
-    /**
-     * Returns the action's suite name, such as java.lang.Integer or
-     * java.lang.IntegerTest.
-     */
-    public String getSuiteName() {
-        int split = split(outcomeName);
-        return split == -1 ? "defaultpackage" : outcomeName.substring(0, split);
-    }
-
-    /**
-     * Returns the specific action name, such as BitTwiddle or testBitTwiddle.
-     */
-    public String getTestName() {
-        int split = split(outcomeName);
-        return split == -1 ? outcomeName : outcomeName.substring(split + 1);
-    }
-
-    private static int split(String name) {
-        int lastHash = name.indexOf('#');
-        return lastHash == -1 ? name.lastIndexOf('.') : lastHash;
-    }
-
-    /**
-     * Returns whether the result indicates that the contents of the Outcome are important.
-     *
-     * For example, for a test skipped because it is unsupported, we don't care about the result.
-     */
-    private boolean matters() {
-        return result != Result.UNSUPPORTED;
-    }
-
-    public ResultValue getResultValue(Expectation expectation) {
-        if (matters()) {
-            return expectation.matches(this) ? ResultValue.OK : ResultValue.FAIL;
-        }
-        return ResultValue.IGNORE;
-    }
-
-    /**
-     * Returns a filesystem db path for this outcome. For example, a path for an outcome with name
-     * "foo.bar.baz#testName" would be "foo/bar/baz/testName".
-     */
-    public String getPath() {
-        return outcomeName.replaceAll("[\\.#]", "/");
-    }
-
-    @Override public boolean equals(Object o) {
-        if (o instanceof Outcome) {
-            Outcome outcome = (Outcome) o;
-            return outcomeName.equals(outcome.outcomeName)
-                    && result == outcome.result
-                    && output.equals(outcome.output);
-        }
-        return false;
-    }
-
-    @Override public int hashCode() {
-        int hashCode = 17;
-        hashCode = 37 * hashCode + outcomeName.hashCode();
-        hashCode  = 37 * hashCode + result.hashCode();
-        hashCode = 37 * hashCode + output.hashCode();
-        return hashCode;
-    }
-
-    @Override public String toString() {
-        return "Outcome[name=" + outcomeName + " output=" + output + "]";
-    }
-
-}
diff --git a/libs/vogar-expect/src/vogar/Result.java b/libs/vogar-expect/src/vogar/Result.java
deleted file mode 100644
index 45c88ce..0000000
--- a/libs/vogar-expect/src/vogar/Result.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-package vogar;
-
-/**
- * The result of a test or benchmark execution.
- */
-public enum Result {
-
-    /**
-     * An action that cannot be run by this harness, such as a shell script.
-     */
-    UNSUPPORTED,
-
-    COMPILE_FAILED,
-    EXEC_FAILED,
-    EXEC_TIMEOUT,
-    ERROR,
-    SUCCESS
-}
diff --git a/libs/vogar-expect/src/vogar/ResultValue.java b/libs/vogar-expect/src/vogar/ResultValue.java
deleted file mode 100644
index 2e450f4..0000000
--- a/libs/vogar-expect/src/vogar/ResultValue.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-package vogar;
-
-/**
- * Represents an evaluation of the goodness of a result.
- */
-public enum ResultValue {
-    OK,
-    IGNORE,
-    FAIL
-}
diff --git a/libs/vogar-expect/src/vogar/commands/Command.java b/libs/vogar-expect/src/vogar/commands/Command.java
deleted file mode 100644
index d60d77e..0000000
--- a/libs/vogar-expect/src/vogar/commands/Command.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-package vogar.commands;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import vogar.util.Log;
-import vogar.util.Strings;
-import vogar.util.Threads;
-
-/**
- * An out of process executable.
- */
-public final class Command {
-    private final List<String> args;
-    private final Map<String, String> env;
-    private final File workingDirectory;
-    private final boolean permitNonZeroExitStatus;
-    private final PrintStream tee;
-    private final boolean nativeOutput;
-    private volatile Process process;
-
-    public Command(String... args) {
-        this(Arrays.asList(args));
-    }
-
-    public Command(List<String> args) {
-        this.args = new ArrayList<String>(args);
-        this.env = Collections.emptyMap();
-        this.workingDirectory = null;
-        this.permitNonZeroExitStatus = false;
-        this.tee = null;
-        this.nativeOutput = false;
-    }
-
-    private Command(Builder builder) {
-        this.args = new ArrayList<String>(builder.args);
-        this.env = builder.env;
-        this.workingDirectory = builder.workingDirectory;
-        this.permitNonZeroExitStatus = builder.permitNonZeroExitStatus;
-        this.tee = builder.tee;
-        if (builder.maxLength != -1) {
-            String string = toString();
-            if (string.length() > builder.maxLength) {
-                throw new IllegalStateException("Maximum command length " + builder.maxLength
-                                                + " exceeded by: " + string);
-            }
-        }
-        this.nativeOutput = builder.nativeOutput;
-    }
-
-    public void start() throws IOException {
-        if (isStarted()) {
-            throw new IllegalStateException("Already started!");
-        }
-
-        Log.verbose("executing " + this);
-
-        ProcessBuilder processBuilder = new ProcessBuilder()
-                .command(args)
-                .redirectErrorStream(true);
-        if (workingDirectory != null) {
-            processBuilder.directory(workingDirectory);
-        }
-
-        processBuilder.environment().putAll(env);
-
-        process = processBuilder.start();
-    }
-
-    public boolean isStarted() {
-        return process != null;
-    }
-
-    public InputStream getInputStream() {
-        if (!isStarted()) {
-            throw new IllegalStateException("Not started!");
-        }
-
-        return process.getInputStream();
-    }
-
-    public List<String> gatherOutput()
-            throws IOException, InterruptedException {
-        if (!isStarted()) {
-            throw new IllegalStateException("Not started!");
-        }
-
-        BufferedReader in = new BufferedReader(
-                new InputStreamReader(getInputStream(), "UTF-8"));
-        List<String> outputLines = new ArrayList<String>();
-        String outputLine;
-        while ((outputLine = in.readLine()) != null) {
-            if (tee != null) {
-                tee.println(outputLine);
-            }
-            if (nativeOutput) {
-                Log.nativeOutput(outputLine);
-            }
-            outputLines.add(outputLine);
-        }
-
-        if (process.waitFor() != 0 && !permitNonZeroExitStatus) {
-            StringBuilder message = new StringBuilder();
-            for (String line : outputLines) {
-                message.append("\n").append(line);
-            }
-            throw new CommandFailedException(args, outputLines);
-        }
-
-        return outputLines;
-    }
-
-    public List<String> execute() {
-        try {
-            start();
-            return gatherOutput();
-        } catch (IOException e) {
-            throw new RuntimeException("Failed to execute process: " + args, e);
-        } catch (InterruptedException e) {
-            throw new RuntimeException("Interrupted while executing process: " + args, e);
-        }
-    }
-
-    /**
-     * Executes a command with a specified timeout. If the process does not
-     * complete normally before the timeout has elapsed, it will be destroyed.
-     *
-     * @param timeoutSeconds how long to wait, or 0 to wait indefinitely
-     * @return the command's output, or null if the command timed out
-     */
-    public List<String> executeWithTimeout(int timeoutSeconds)
-            throws TimeoutException {
-        if (timeoutSeconds == 0) {
-            return execute();
-        }
-
-        try {
-            return executeLater().get(timeoutSeconds, TimeUnit.SECONDS);
-        } catch (InterruptedException e) {
-            throw new RuntimeException("Interrupted while executing process: " + args, e);
-        } catch (ExecutionException e) {
-            throw new RuntimeException(e);
-        } finally {
-            destroy();
-        }
-    }
-
-    /**
-     * Executes the command on a new background thread. This method returns
-     * immediately.
-     *
-     * @return a future to retrieve the command's output.
-     */
-    public Future<List<String>> executeLater() {
-        ExecutorService executor = Threads.fixedThreadsExecutor("command", 1);
-        Future<List<String>> result = executor.submit(new Callable<List<String>>() {
-            public List<String> call() throws Exception {
-                start();
-                return gatherOutput();
-            }
-        });
-        executor.shutdown();
-        return result;
-    }
-
-    /**
-     * Destroys the underlying process and closes its associated streams.
-     */
-    public void destroy() {
-        if (process == null) {
-            return;
-        }
-
-        process.destroy();
-        try {
-            process.waitFor();
-            int exitValue = process.exitValue();
-            Log.verbose("received exit value " + exitValue
-                    + " from destroyed command " + this);
-        } catch (IllegalThreadStateException destroyUnsuccessful) {
-            Log.warn("couldn't destroy " + this);
-        } catch (InterruptedException e) {
-            Log.warn("couldn't destroy " + this);
-        }
-    }
-
-    @Override public String toString() {
-        String envString = !env.isEmpty() ? (Strings.join(env.entrySet(), " ") + " ") : "";
-        return envString + Strings.join(args, " ");
-    }
-
-    public static class Builder {
-        private final List<String> args = new ArrayList<String>();
-        private final Map<String, String> env = new LinkedHashMap<String, String>();
-        private File workingDirectory;
-        private boolean permitNonZeroExitStatus = false;
-        private PrintStream tee = null;
-        private boolean nativeOutput;
-        private int maxLength = -1;
-
-        public Builder args(Object... objects) {
-            for (Object object : objects) {
-                args(object.toString());
-            }
-            return this;
-        }
-
-        public Builder setNativeOutput(boolean nativeOutput) {
-            this.nativeOutput = nativeOutput;
-            return this;
-        }
-
-        public Builder args(String... args) {
-            return args(Arrays.asList(args));
-        }
-
-        public Builder args(Collection<String> args) {
-            this.args.addAll(args);
-            return this;
-        }
-
-        public Builder env(String key, String value) {
-            env.put(key, value);
-            return this;
-        }
-
-        /**
-         * Sets the working directory from which the command will be executed.
-         * This must be a <strong>local</strong> directory; Commands run on
-         * remote devices (ie. via {@code adb shell}) require a local working
-         * directory.
-         */
-        public Builder workingDirectory(File workingDirectory) {
-            this.workingDirectory = workingDirectory;
-            return this;
-        }
-
-        public Builder tee(PrintStream printStream) {
-            tee = printStream;
-            return this;
-        }
-
-        public Builder maxLength(int maxLength) {
-            this.maxLength = maxLength;
-            return this;
-        }
-
-        public Command build() {
-            return new Command(this);
-        }
-
-        public List<String> execute() {
-            return build().execute();
-        }
-    }
-}
diff --git a/libs/vogar-expect/src/vogar/commands/CommandFailedException.java b/libs/vogar-expect/src/vogar/commands/CommandFailedException.java
deleted file mode 100644
index 3e08c11..0000000
--- a/libs/vogar-expect/src/vogar/commands/CommandFailedException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-package vogar.commands;
-
-import java.util.List;
-
-/**
- * Thrown when an out of process executable does not return normally.
- */
-public class CommandFailedException extends RuntimeException {
-
-    private final List<String> args;
-    private final List<String> outputLines;
-
-    public CommandFailedException(List<String> args, List<String> outputLines) {
-        super(formatMessage(args, outputLines));
-        this.args = args;
-        this.outputLines = outputLines;
-    }
-
-    public List<String> getArgs() {
-        return args;
-    }
-
-    public List<String> getOutputLines() {
-        return outputLines;
-    }
-
-    public static String formatMessage(List<String> args, List<String> outputLines) {
-        StringBuilder result = new StringBuilder();
-        result.append("Command failed:");
-        for (String arg : args) {
-            result.append(" ").append(arg);
-        }
-        for (String outputLine : outputLines) {
-            result.append("\n  ").append(outputLine);
-        }
-        return result.toString();
-    }
-
-    private static final long serialVersionUID = 0;
-}
diff --git a/libs/vogar-expect/src/vogar/commands/Mkdir.java b/libs/vogar-expect/src/vogar/commands/Mkdir.java
deleted file mode 100644
index fc08f1b..0000000
--- a/libs/vogar-expect/src/vogar/commands/Mkdir.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-package vogar.commands;
-
-import java.io.File;
-
-/**
- * A mkdir command.
- */
-public final class Mkdir {
-
-    public void mkdirs(File directory) {
-        new Command("mkdir", "-p", directory.getPath()).execute();
-    }
-}
diff --git a/libs/vogar-expect/src/vogar/commands/Rm.java b/libs/vogar-expect/src/vogar/commands/Rm.java
deleted file mode 100644
index 5b39144..0000000
--- a/libs/vogar-expect/src/vogar/commands/Rm.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-package vogar.commands;
-
-import java.io.File;
-
-/**
- * A rm command.
- */
-public final class Rm {
-
-    public void file(File file) {
-        new Command("rm", "-f", file.getPath()).execute();
-    }
-
-    public void directoryTree(File directory) {
-        new Command("rm", "-rf", directory.getPath()).execute();
-    }
-}
diff --git a/libs/vogar-expect/src/vogar/expect/Expectation.java b/libs/vogar-expect/src/vogar/expect/Expectation.java
new file mode 100644
index 0000000..8ccd0bd
--- /dev/null
+++ b/libs/vogar-expect/src/vogar/expect/Expectation.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+package vogar.expect;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+/**
+ * The expected result of an action execution. This is typically encoded in the
+ * expectations text file, which has the following format:
+ * <pre>
+ * test java.io.StreamTokenizer.Reset
+ * result UNSUPPORTED
+ * pattern .*should get token \[, but get -1.*
+ *
+ * # should we fix this?
+ * test java.util.Arrays.CopyMethods
+ * result COMPILE_FAILED
+ * pattern .*cannot find symbol.*
+ * </pre>
+ */
+public final class Expectation {
+
+    /** Justification for this expectation */
+    private final String description;
+
+    /** The action's expected result, such as {@code EXEC_FAILED}. */
+    private final Result result;
+
+    /** The pattern the expected output will match. */
+    private final Pattern pattern;
+
+    /** Attributes of this test. */
+    private final Set<String> tags;
+
+    /** The tracking bug ID */
+    private final long bug;
+
+    /** True if the identified bug still active. */
+    private boolean bugIsOpen = false;
+
+    public Expectation(Result result, Pattern pattern, Set<String> tags, String description, long bug) {
+        if (result == null || description == null || pattern == null) {
+            throw new IllegalArgumentException(
+                    "result=" + result + " description=" + description + " pattern=" + pattern);
+        }
+
+        this.description = description;
+        this.result = result;
+        this.pattern = pattern;
+        this.tags = new LinkedHashSet<String>(tags);
+        this.bug = bug;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public long getBug() {
+        return bug;
+    }
+
+    public Result getResult() {
+        return result;
+    }
+
+    public Set<String> getTags() {
+        return tags;
+    }
+
+    /**
+     * Set the current status of this expectation's bug. When a bug is open,
+     * any result (success or failure) is permitted.
+     */
+    public void setBugIsOpen(boolean bugIsOpen) {
+        this.bugIsOpen = bugIsOpen;
+    }
+
+    /**
+     * Returns true if {@code outcome} matches this expectation.
+     */
+    public boolean matches(Outcome outcome) {
+        return patternMatches(outcome) && (bugIsOpen || result == outcome.getResult());
+    }
+
+    private boolean patternMatches(Outcome outcome) {
+        return pattern.matcher(outcome.getOutput()).matches();
+    }
+
+    @Override public String toString() {
+        return "Expectation[description=" + description + " pattern=" + pattern.pattern() + "]";
+    }
+}
diff --git a/libs/vogar-expect/src/vogar/expect/ExpectationStore.java b/libs/vogar-expect/src/vogar/expect/ExpectationStore.java
new file mode 100644
index 0000000..6807f17
--- /dev/null
+++ b/libs/vogar-expect/src/vogar/expect/ExpectationStore.java
@@ -0,0 +1,275 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+package vogar.expect;
+
+import com.android.json.stream.JsonReader;
+import com.google.common.base.Joiner;
+import com.google.common.base.Splitter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.URL;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Pattern;
+import vogar.expect.util.Log;
+
+/**
+ * A database of expected outcomes. Entries in this database come in two forms.
+ * <ul>
+ *   <li>Outcome expectations name an outcome (or its prefix, such as
+ *       "java.util"), its expected result, and an optional pattern to match
+ *       the expected output.
+ *   <li>Failure expectations include a pattern that may match the output of any
+ *       outcome. These expectations are useful for hiding failures caused by
+ *       cross-cutting features that aren't supported.
+ * </ul>
+ *
+ * <p>If an outcome matches both an outcome expectation and a failure
+ * expectation, the outcome expectation will be returned.
+ */
+public final class ExpectationStore {
+
+    /** The pattern to use when no expected output is specified */
+    private static final Pattern MATCH_ALL_PATTERN
+            = Pattern.compile(".*", Pattern.MULTILINE | Pattern.DOTALL);
+
+    /** The expectation of a general successful run. */
+    private static final Expectation SUCCESS = new Expectation(Result.SUCCESS, MATCH_ALL_PATTERN,
+            Collections.<String>emptySet(), "", -1);
+
+    private static final int PATTERN_FLAGS = Pattern.MULTILINE | Pattern.DOTALL;
+
+    private final Map<String, Expectation> outcomes = new LinkedHashMap<String, Expectation>();
+    private final Map<String, Expectation> failures = new LinkedHashMap<String, Expectation>();
+
+    private ExpectationStore() {}
+
+    /**
+     * Finds the expected result for the specified action or outcome name. This
+     * returns a value for all names, even if no explicit expectation was set.
+     */
+    public Expectation get(String name) {
+        Expectation byName = getByNameOrPackage(name);
+        return byName != null ? byName : SUCCESS;
+    }
+
+    /**
+     * Finds the expected result for the specified outcome after it has
+     * completed. Unlike {@code get()}, this also takes into account the
+     * outcome's output.
+     *
+     * <p>For outcomes that have both a name match and an output match,
+     * exact name matches are preferred, then output matches, then inexact
+     * name matches.
+     */
+    public Expectation get(Outcome outcome) {
+        Expectation exactNameMatch = outcomes.get(outcome.getName());
+        if (exactNameMatch != null) {
+            return exactNameMatch;
+        }
+
+        for (Map.Entry<String, Expectation> entry : failures.entrySet()) {
+            if (entry.getValue().matches(outcome)) {
+                return entry.getValue();
+            }
+        }
+
+        Expectation byName = getByNameOrPackage(outcome.getName());
+        return byName != null ? byName : SUCCESS;
+    }
+
+    private Expectation getByNameOrPackage(String name) {
+        while (true) {
+            Expectation expectation = outcomes.get(name);
+            if (expectation != null) {
+                return expectation;
+            }
+
+            int dotOrHash = Math.max(name.lastIndexOf('.'), name.lastIndexOf('#'));
+            if (dotOrHash == -1) {
+                return null;
+            }
+
+            name = name.substring(0, dotOrHash);
+        }
+    }
+
+    public static ExpectationStore parse(Set<File> expectationFiles, ModeId mode) throws IOException {
+        ExpectationStore result = new ExpectationStore();
+        for (File f : expectationFiles) {
+            if (f.exists()) {
+                result.parse(f, mode);
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Create an {@link ExpectationStore} that is populated from expectation resources.
+     * @param owningClass the class from which the resources are loaded.
+     * @param expectationResources the set of paths to the expectation resources; the paths are
+     * either relative to the owning class, or absolute (starting with a /).
+     * @param mode the mode within which the tests are to be run.
+     * @return the populated {@link ExpectationStore}.
+     * @throws IOException if there was a problem loading
+     */
+    public static ExpectationStore parseResources(
+            Class<?> owningClass, Set<String> expectationResources, ModeId mode)
+            throws IOException {
+        ExpectationStore result = new ExpectationStore();
+        for (String expectationsPath : expectationResources) {
+            URL url = owningClass.getResource(expectationsPath);
+            if (url == null) {
+                Log.warn("Could not find resource '" + expectationsPath
+                        + "' relative to " + owningClass);
+            } else {
+                result.parse(url, mode);
+            }
+        }
+        return result;
+    }
+
+    private void parse(URL url, ModeId mode) throws IOException {
+        Log.verbose("loading expectations from " + url);
+
+        try (InputStream is = url.openStream();
+             Reader reader = new InputStreamReader(is)) {
+            parse(reader, url.toString(), mode);
+        }
+    }
+
+    public void parse(File expectationsFile, ModeId mode) throws IOException {
+        Log.verbose("loading expectations file " + expectationsFile);
+
+        try (Reader fileReader = new FileReader(expectationsFile)) {
+            String source = expectationsFile.toString();
+            parse(fileReader, source, mode);
+        }
+    }
+
+    private void parse(Reader reader, String source, ModeId mode) throws IOException {
+        int count = 0;
+        try (JsonReader jsonReader = new JsonReader(reader)) {
+            jsonReader.setLenient(true);
+            jsonReader.beginArray();
+            while (jsonReader.hasNext()) {
+                readExpectation(jsonReader, mode);
+                count++;
+            }
+            jsonReader.endArray();
+
+            Log.verbose("loaded " + count + " expectations from " + source);
+        }
+    }
+
+    private void readExpectation(JsonReader reader, ModeId mode) throws IOException {
+        boolean isFailure = false;
+        Result result = Result.EXEC_FAILED;
+        Pattern pattern = MATCH_ALL_PATTERN;
+        Set<String> names = new LinkedHashSet<String>();
+        Set<String> tags = new LinkedHashSet<String>();
+        Set<ModeId> modes = null;
+        String description = "";
+        long buganizerBug = -1;
+
+        reader.beginObject();
+        while (reader.hasNext()) {
+            String name = reader.nextName();
+            if (name.equals("result")) {
+                result = Result.valueOf(reader.nextString());
+            } else if (name.equals("name")) {
+                names.add(reader.nextString());
+            } else if (name.equals("names")) {
+                readStrings(reader, names);
+            } else if (name.equals("failure")) {
+                // isFailure is somewhat arbitrarily keyed on the existence of a "failure"
+                // element instead of looking at the "result" field. There are only about 5
+                // expectations in our entire expectation store that have this tag.
+                //
+                // TODO: Get rid of it and the "failures" map and just use the outcomes
+                // map for everything. Both uses seem useless.
+                isFailure = true;
+                names.add(reader.nextString());
+            } else if (name.equals("pattern")) {
+                pattern = Pattern.compile(reader.nextString(), PATTERN_FLAGS);
+            } else if (name.equals("substring")) {
+                pattern = Pattern.compile(".*" + Pattern.quote(reader.nextString()) + ".*", PATTERN_FLAGS);
+            } else if (name.equals("tags")) {
+                readStrings(reader, tags);
+            } else if (name.equals("description")) {
+                Iterable<String> split = Splitter.on("\n").omitEmptyStrings().trimResults().split(reader.nextString());
+                description = Joiner.on("\n").join(split);
+            } else if (name.equals("bug")) {
+                buganizerBug = reader.nextLong();
+            } else if (name.equals("modes")) {
+                modes = readModes(reader);
+            } else {
+                Log.warn("Unhandled name in expectations file: " + name);
+                reader.skipValue();
+            }
+        }
+        reader.endObject();
+
+        if (names.isEmpty()) {
+            throw new IllegalArgumentException("Missing 'name' or 'failure' key in " + reader);
+        }
+        if (modes != null && !modes.contains(mode)) {
+            return;
+        }
+
+        Expectation expectation = new Expectation(result, pattern, tags, description, buganizerBug);
+        Map<String, Expectation> map = isFailure ? failures : outcomes;
+        for (String name : names) {
+            if (map.put(name, expectation) != null) {
+                throw new IllegalArgumentException("Duplicate expectations for " + name);
+            }
+        }
+    }
+
+    private void readStrings(JsonReader reader, Set<String> output) throws IOException {
+        reader.beginArray();
+        while (reader.hasNext()) {
+            output.add(reader.nextString());
+        }
+        reader.endArray();
+    }
+
+    private Set<ModeId> readModes(JsonReader reader) throws IOException {
+        Set<ModeId> result = new LinkedHashSet<ModeId>();
+        reader.beginArray();
+        while (reader.hasNext()) {
+            result.add(ModeId.valueOf(reader.nextString().toUpperCase()));
+        }
+        reader.endArray();
+        return result;
+    }
+
+    public Map<String, Expectation> getAllOutComes() {
+        return outcomes;
+    }
+
+    public Map<String, Expectation> getAllFailures() {
+        return failures;
+    }
+}
diff --git a/libs/vogar-expect/src/vogar/expect/ModeId.java b/libs/vogar-expect/src/vogar/expect/ModeId.java
new file mode 100644
index 0000000..0ebf60c
--- /dev/null
+++ b/libs/vogar-expect/src/vogar/expect/ModeId.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2009 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.
+ */
+
+package vogar.expect;
+
+public enum ModeId {
+    DEVICE, JVM, ACTIVITY, SIM, HOST;
+
+    public boolean acceptsVmArgs() {
+        return this != ACTIVITY;
+    }
+
+    public boolean isHost() {
+        return this == JVM || this == SIM || this == HOST;
+    }
+
+    public boolean requiresAndroidSdk() {
+        return this == DEVICE || this == ACTIVITY || this == SIM || this == HOST;
+    }
+}
diff --git a/libs/vogar-expect/src/vogar/expect/Outcome.java b/libs/vogar-expect/src/vogar/expect/Outcome.java
new file mode 100644
index 0000000..cbe2abe
--- /dev/null
+++ b/libs/vogar-expect/src/vogar/expect/Outcome.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+package vogar.expect;
+
+import com.google.common.collect.Lists;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import vogar.expect.util.Strings;
+
+/**
+ * An outcome of an action. Some actions may have multiple outcomes. For
+ * example, JUnit tests have one outcome for each test method.
+ */
+public final class Outcome {
+
+    private final String outcomeName;
+    private final Result result;
+    private final String output;
+    private final Date date;
+
+    public Outcome(String outcomeName, Result result, List<String> outputLines) {
+        this.outcomeName = outcomeName;
+        this.result = result;
+        this.output = sanitizeOutputLines(outputLines);
+        this.date = new Date();
+    }
+
+    public Outcome(String outcomeName, Result result, String outputLine, Date date) {
+        this.outcomeName = outcomeName;
+        this.result = result;
+        this.output = sanitizeOutputLine(outputLine);
+        this.date = date;
+    }
+
+    public Outcome(String outcomeName, Result result, String outputLine) {
+        this.outcomeName = outcomeName;
+        this.result = result;
+        this.output = sanitizeOutputLine(outputLine);
+        this.date = new Date();
+    }
+
+    public Outcome(String outcomeName, Result result, Throwable throwable) {
+        this.outcomeName = outcomeName;
+        this.result = result;
+        this.output = sanitizeOutputLines(throwableToLines(throwable));
+        this.date = new Date();
+    }
+
+    private String sanitizeOutputLines(List<String> outputLines) {
+        List<String> sanitizedStrings = Lists.newArrayList();
+        for (String line : outputLines) {
+            sanitizedStrings.add(sanitizeOutputLine(line));
+        }
+        return Strings.join(sanitizedStrings, "\n");
+    }
+
+    private String sanitizeOutputLine(String outputLine) {
+        return Strings.xmlSanitize(outputLine.replaceAll("\r\n?", "\n"));
+    }
+
+    public Date getDate() {
+        return date;
+    }
+
+    public String getName() {
+        return outcomeName;
+    }
+
+    public Result getResult() {
+        return result;
+    }
+
+    public String getOutput() {
+        return output;
+    }
+
+    public List<String> getOutputLines() {
+        return Arrays.asList(output.split("\n"));
+    }
+
+    private static List<String> throwableToLines(Throwable t) {
+        StringWriter writer = new StringWriter();
+        PrintWriter out = new PrintWriter(writer);
+        t.printStackTrace(out);
+        return Arrays.asList(writer.toString().split("\\n"));
+    }
+
+    /**
+     * Returns the action's suite name, such as java.lang.Integer or
+     * java.lang.IntegerTest.
+     */
+    public String getSuiteName() {
+        int split = split(outcomeName);
+        return split == -1 ? "defaultpackage" : outcomeName.substring(0, split);
+    }
+
+    /**
+     * Returns the specific action name, such as BitTwiddle or testBitTwiddle.
+     */
+    public String getTestName() {
+        int split = split(outcomeName);
+        return split == -1 ? outcomeName : outcomeName.substring(split + 1);
+    }
+
+    private static int split(String name) {
+        int lastHash = name.indexOf('#');
+        return lastHash == -1 ? name.lastIndexOf('.') : lastHash;
+    }
+
+    /**
+     * Returns whether the result indicates that the contents of the Outcome are important.
+     *
+     * For example, for a test skipped because it is unsupported, we don't care about the result.
+     */
+    private boolean matters() {
+        return result != Result.UNSUPPORTED;
+    }
+
+    public ResultValue getResultValue(Expectation expectation) {
+        if (matters()) {
+            return expectation.matches(this) ? ResultValue.OK : ResultValue.FAIL;
+        }
+        return ResultValue.IGNORE;
+    }
+
+    /**
+     * Returns a filesystem db path for this outcome. For example, a path for an outcome with name
+     * "foo.bar.baz#testName" would be "foo/bar/baz/testName".
+     */
+    public String getPath() {
+        return outcomeName.replaceAll("[\\.#]", "/");
+    }
+
+    @Override public boolean equals(Object o) {
+        if (o instanceof Outcome) {
+            Outcome outcome = (Outcome) o;
+            return outcomeName.equals(outcome.outcomeName)
+                    && result == outcome.result
+                    && output.equals(outcome.output);
+        }
+        return false;
+    }
+
+    @Override public int hashCode() {
+        int hashCode = 17;
+        hashCode = 37 * hashCode + outcomeName.hashCode();
+        hashCode  = 37 * hashCode + result.hashCode();
+        hashCode = 37 * hashCode + output.hashCode();
+        return hashCode;
+    }
+
+    @Override public String toString() {
+        return "Outcome[name=" + outcomeName + " output=" + output + "]";
+    }
+
+}
diff --git a/libs/vogar-expect/src/vogar/expect/Result.java b/libs/vogar-expect/src/vogar/expect/Result.java
new file mode 100644
index 0000000..b94c0a0
--- /dev/null
+++ b/libs/vogar-expect/src/vogar/expect/Result.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2009 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.
+ */
+
+package vogar.expect;
+
+/**
+ * The result of a test or benchmark execution.
+ */
+public enum Result {
+
+    /**
+     * An action that cannot be run by this harness, such as a shell script.
+     */
+    UNSUPPORTED,
+
+    COMPILE_FAILED,
+    EXEC_FAILED,
+    EXEC_TIMEOUT,
+    ERROR,
+    SUCCESS
+}
diff --git a/libs/vogar-expect/src/vogar/expect/ResultValue.java b/libs/vogar-expect/src/vogar/expect/ResultValue.java
new file mode 100644
index 0000000..46716d8
--- /dev/null
+++ b/libs/vogar-expect/src/vogar/expect/ResultValue.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+package vogar.expect;
+
+/**
+ * Represents an evaluation of the goodness of a result.
+ */
+public enum ResultValue {
+    OK,
+    IGNORE,
+    FAIL
+}
diff --git a/libs/vogar-expect/src/vogar/expect/util/Log.java b/libs/vogar-expect/src/vogar/expect/util/Log.java
new file mode 100644
index 0000000..9aa016f
--- /dev/null
+++ b/libs/vogar-expect/src/vogar/expect/util/Log.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+package vogar.expect.util;
+
+import java.util.List;
+
+public class Log {
+
+    private static LogOutput sLogoutput = null;
+
+    public static void setOutput(LogOutput logOutput) {
+        sLogoutput = logOutput;
+    }
+
+    public static void verbose(String s) {
+        if (sLogoutput != null) {
+            sLogoutput.verbose(s);
+        }
+    }
+
+    public static void warn(String message) {
+        if (sLogoutput != null) {
+            sLogoutput.warn(message);
+        }
+    }
+
+    /**
+     * Warns, and also puts a list of strings afterwards.
+     */
+    public static void warn(String message, List<String> list) {
+        if (sLogoutput != null) {
+            sLogoutput.warn(message, list);
+        }
+    }
+
+    public static void info(String s) {
+        if (sLogoutput != null) {
+            sLogoutput.info(s);
+        }
+    }
+
+    public static void info(String message, Throwable throwable) {
+        if (sLogoutput != null) {
+            sLogoutput.info(message, throwable);
+        }
+    }
+
+    public static void nativeOutput(String outputLine) {
+        if (sLogoutput != null) {
+            sLogoutput.nativeOutput(outputLine);
+        }
+
+    }
+}
diff --git a/libs/vogar-expect/src/vogar/expect/util/LogOutput.java b/libs/vogar-expect/src/vogar/expect/util/LogOutput.java
new file mode 100644
index 0000000..7e60d07
--- /dev/null
+++ b/libs/vogar-expect/src/vogar/expect/util/LogOutput.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+package vogar.expect.util;
+
+import java.util.List;
+
+public interface LogOutput {
+
+    void verbose(String s);
+
+    void warn(String message);
+
+    /**
+     * Warns, and also puts a list of strings afterwards.
+     */
+    void warn(String message, List<String> list);
+
+    void info(String s);
+
+    void info(String message, Throwable throwable);
+
+    void nativeOutput(String outputLine);
+
+}
diff --git a/libs/vogar-expect/src/vogar/expect/util/Strings.java b/libs/vogar-expect/src/vogar/expect/util/Strings.java
new file mode 100644
index 0000000..208cbda
--- /dev/null
+++ b/libs/vogar-expect/src/vogar/expect/util/Strings.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2009 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.
+ */
+
+
+package vogar.expect.util;
+
+//import com.google.common.collect.Lists;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Utility methods for strings.
+ */
+public class Strings {
+
+    private static final Pattern XML_INVALID_CHARS
+            = Pattern.compile("[^\\u0009\\u000A\\u000D\\u0020-\\uD7FF\\uE000-\\uFFFD]+");
+
+    public static String readStream(Reader reader) throws IOException {
+        StringBuilder result = new StringBuilder();
+        BufferedReader in = new BufferedReader(reader);
+        String line;
+        while ((line = in.readLine()) != null) {
+            result.append(line);
+            result.append('\n');
+        }
+        in.close();
+        return result.toString();
+    }
+
+    public static String readFile(File f) throws IOException {
+        return readStream(new InputStreamReader(new FileInputStream(f), "UTF-8"));
+    }
+
+    public static List<String> readFileLines(File f) throws IOException {
+        BufferedReader in =
+                new BufferedReader(new InputStreamReader(new FileInputStream(f), "UTF-8"));
+        List<String> list = new ArrayList<String>();
+        String line;
+        while ((line = in.readLine()) != null) {
+            list.add(line);
+        }
+        in.close();
+        return list;
+    }
+
+    public static String join(String delimiter, Object... objects) {
+        return join(Arrays.asList(objects), delimiter);
+    }
+
+    public static String join(Iterable<?> objects, String delimiter) {
+        Iterator<?> i = objects.iterator();
+        if (!i.hasNext()) {
+            return "";
+        }
+
+        StringBuilder result = new StringBuilder();
+        result.append(i.next());
+        while(i.hasNext()) {
+            result.append(delimiter).append(i.next());
+        }
+        return result.toString();
+    }
+
+    public static String[] objectsToStrings(Object[] objects) {
+        String[] result = new String[objects.length];
+        int i = 0;
+        for (Object o : objects) {
+            result[i++] = o.toString();
+        }
+        return result;
+    }
+
+    public static String[] objectsToStrings(Collection<?> objects) {
+        return objectsToStrings(objects.toArray());
+    }
+
+    /**
+     * Replaces XML-invalid characters with the corresponding U+XXXX code point escapes.
+     */
+    public static String xmlSanitize(String text) {
+        StringBuffer result = new StringBuffer();
+        Matcher matcher = XML_INVALID_CHARS.matcher(text);
+        while (matcher.find()) {
+            matcher.appendReplacement(result, "");
+            result.append(escapeCodePoint(matcher.group()));
+        }
+        matcher.appendTail(result);
+        return result.toString();
+    }
+
+    private static String escapeCodePoint(CharSequence cs) {
+        StringBuilder result = new StringBuilder();
+        for (int i = 0; i < cs.length(); ++i) {
+            result.append(String.format("U+%04X", (int) cs.charAt(i)));
+        }
+        return result.toString();
+    }
+}
diff --git a/libs/vogar-expect/src/vogar/util/IoUtils.java b/libs/vogar-expect/src/vogar/util/IoUtils.java
deleted file mode 100644
index 4f1fba1..0000000
--- a/libs/vogar-expect/src/vogar/util/IoUtils.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-package vogar.util;
-
-import java.io.Closeable;
-import java.io.IOException;
-import java.net.Socket;
-
-public final class IoUtils {
-
-    public static void closeQuietly(Closeable c) {
-        if (c != null) {
-            try {
-                c.close();
-            } catch (IOException ignored) {
-            }
-        }
-    }
-
-    public static void closeQuietly(Socket c) {
-        if (c != null) {
-            try {
-                c.close();
-            } catch (IOException ignored) {
-            }
-        }
-    }
-}
diff --git a/libs/vogar-expect/src/vogar/util/Log.java b/libs/vogar-expect/src/vogar/util/Log.java
deleted file mode 100644
index 99c0807..0000000
--- a/libs/vogar-expect/src/vogar/util/Log.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-package vogar.util;
-
-import java.util.List;
-
-public class Log {
-
-    private static LogOutput sLogoutput = null;
-
-    public static void setOutput(LogOutput logOutput) {
-        sLogoutput = logOutput;
-    }
-
-    public static void verbose(String s) {
-        if (sLogoutput != null) {
-            sLogoutput.verbose(s);
-        }
-    }
-
-    public static void warn(String message) {
-        if (sLogoutput != null) {
-            sLogoutput.warn(message);
-        }
-    }
-
-    /**
-     * Warns, and also puts a list of strings afterwards.
-     */
-    public static void warn(String message, List<String> list) {
-        if (sLogoutput != null) {
-            sLogoutput.warn(message, list);
-        }
-    }
-
-    public static void info(String s) {
-        if (sLogoutput != null) {
-            sLogoutput.info(s);
-        }
-    }
-
-    public static void info(String message, Throwable throwable) {
-        if (sLogoutput != null) {
-            sLogoutput.info(message, throwable);
-        }
-    }
-
-    public static void nativeOutput(String outputLine) {
-        if (sLogoutput != null) {
-            sLogoutput.nativeOutput(outputLine);
-        }
-
-    }
-}
diff --git a/libs/vogar-expect/src/vogar/util/LogOutput.java b/libs/vogar-expect/src/vogar/util/LogOutput.java
deleted file mode 100644
index 8123a81..0000000
--- a/libs/vogar-expect/src/vogar/util/LogOutput.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-package vogar.util;
-
-import java.util.List;
-
-public interface LogOutput {
-
-    void verbose(String s);
-
-    void warn(String message);
-
-    /**
-     * Warns, and also puts a list of strings afterwards.
-     */
-    void warn(String message, List<String> list);
-
-    void info(String s);
-
-    void info(String message, Throwable throwable);
-
-    void nativeOutput(String outputLine);
-
-}
diff --git a/libs/vogar-expect/src/vogar/util/MarkResetConsole.java b/libs/vogar-expect/src/vogar/util/MarkResetConsole.java
deleted file mode 100644
index d88ce31..0000000
--- a/libs/vogar-expect/src/vogar/util/MarkResetConsole.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-package vogar.util;
-
-import java.io.PrintStream;
-
-/**
- * A console that can erase output back to a previously marked position.
- */
-public final class MarkResetConsole {
-
-    private final PrintStream out;
-    private int row;
-    private final StringBuilder rowContent = new StringBuilder();
-
-    public MarkResetConsole(PrintStream out) {
-        this.out = out;
-    }
-
-    public void println(String text) {
-        print(text + "\n");
-    }
-
-    public void print(String text) {
-        for (int i = 0; i < text.length(); i++) {
-            if (text.charAt(i) == '\n') {
-                row++;
-                rowContent.delete(0, rowContent.length());
-            } else {
-                rowContent.append(text.charAt(i));
-            }
-        }
-
-        out.print(text);
-        out.flush();
-    }
-
-    public Mark mark() {
-        return new Mark();
-    }
-
-    public class Mark {
-        private final int markRow = row;
-        private final String markRowContent = rowContent.toString();
-
-        private Mark() {}
-
-        public void reset() {
-            /*
-             * ANSI escapes
-             * http://en.wikipedia.org/wiki/ANSI_escape_code
-             *
-             *  \u001b[K   clear the rest of the current line
-             *  \u001b[nA  move the cursor up n lines
-             *  \u001b[nB  move the cursor down n lines
-             *  \u001b[nC  move the cursor right n lines
-             *  \u001b[nD  move the cursor left n columns
-             */
-
-            for (int r = row; r > markRow; r--) {
-                // clear the line, up a line
-                System.out.print("\u001b[0G\u001b[K\u001b[1A");
-            }
-
-            // clear the line, reprint the line
-            out.print("\u001b[0G\u001b[K");
-            out.print(markRowContent);
-            rowContent.delete(0, rowContent.length());
-            rowContent.append(markRowContent);
-            row = markRow;
-        }
-    }
-}
diff --git a/libs/vogar-expect/src/vogar/util/Strings.java b/libs/vogar-expect/src/vogar/util/Strings.java
deleted file mode 100644
index f92edd8..0000000
--- a/libs/vogar-expect/src/vogar/util/Strings.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-
-package vogar.util;
-
-//import com.google.common.collect.Lists;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Utility methods for strings.
- */
-public class Strings {
-
-    private static final Pattern XML_INVALID_CHARS
-            = Pattern.compile("[^\\u0009\\u000A\\u000D\\u0020-\\uD7FF\\uE000-\\uFFFD]+");
-
-    public static String readStream(Reader reader) throws IOException {
-        StringBuilder result = new StringBuilder();
-        BufferedReader in = new BufferedReader(reader);
-        String line;
-        while ((line = in.readLine()) != null) {
-            result.append(line);
-            result.append('\n');
-        }
-        in.close();
-        return result.toString();
-    }
-
-    public static String readFile(File f) throws IOException {
-        return readStream(new InputStreamReader(new FileInputStream(f), "UTF-8"));
-    }
-
-    public static List<String> readFileLines(File f) throws IOException {
-        BufferedReader in =
-                new BufferedReader(new InputStreamReader(new FileInputStream(f), "UTF-8"));
-        List<String> list = new ArrayList<String>();
-        String line;
-        while ((line = in.readLine()) != null) {
-            list.add(line);
-        }
-        in.close();
-        return list;
-    }
-
-    public static String join(String delimiter, Object... objects) {
-        return join(Arrays.asList(objects), delimiter);
-    }
-
-    public static String join(Iterable<?> objects, String delimiter) {
-        Iterator<?> i = objects.iterator();
-        if (!i.hasNext()) {
-            return "";
-        }
-
-        StringBuilder result = new StringBuilder();
-        result.append(i.next());
-        while(i.hasNext()) {
-            result.append(delimiter).append(i.next());
-        }
-        return result.toString();
-    }
-
-    public static String[] objectsToStrings(Object[] objects) {
-        String[] result = new String[objects.length];
-        int i = 0;
-        for (Object o : objects) {
-            result[i++] = o.toString();
-        }
-        return result;
-    }
-
-    public static String[] objectsToStrings(Collection<?> objects) {
-        return objectsToStrings(objects.toArray());
-    }
-
-    /**
-     * Replaces XML-invalid characters with the corresponding U+XXXX code point escapes.
-     */
-    public static String xmlSanitize(String text) {
-        StringBuffer result = new StringBuffer();
-        Matcher matcher = XML_INVALID_CHARS.matcher(text);
-        while (matcher.find()) {
-            matcher.appendReplacement(result, "");
-            result.append(escapeCodePoint(matcher.group()));
-        }
-        matcher.appendTail(result);
-        return result.toString();
-    }
-
-    private static String escapeCodePoint(CharSequence cs) {
-        StringBuilder result = new StringBuilder();
-        for (int i = 0; i < cs.length(); ++i) {
-            result.append(String.format("U+%04X", (int) cs.charAt(i)));
-        }
-        return result.toString();
-    }
-}
diff --git a/libs/vogar-expect/src/vogar/util/Threads.java b/libs/vogar-expect/src/vogar/util/Threads.java
deleted file mode 100644
index 83410d5..0000000
--- a/libs/vogar-expect/src/vogar/util/Threads.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-package vogar.util;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Utility methods for working with threads.
- */
-public final class Threads {
-    private Threads() {}
-
-    public static ThreadFactory daemonThreadFactory(final String name) {
-        return new ThreadFactory() {
-            private int nextId = 0;
-            public synchronized Thread newThread(Runnable r) {
-                Thread thread = new Thread(r, name + "-" + (nextId++));
-                thread.setDaemon(true);
-                return thread;
-            }
-        };
-    }
-
-    public static ExecutorService threadPerCpuExecutor(String name) {
-        return fixedThreadsExecutor(name, Runtime.getRuntime().availableProcessors());
-    }
-
-    public static ExecutorService fixedThreadsExecutor(String name, int count) {
-        ThreadFactory threadFactory = daemonThreadFactory(name);
-
-        return new ThreadPoolExecutor(count, count, 10, TimeUnit.SECONDS,
-                new LinkedBlockingQueue<Runnable>(Integer.MAX_VALUE), threadFactory) {
-            @Override protected void afterExecute(Runnable runnable, Throwable throwable) {                if (throwable != null) {
-                    Log.info("Unexpected failure from " + runnable, throwable);
-                }
-            }
-        };
-    }
-}
diff --git a/libs/vogar-expect/src/vogar/util/TimeUtilities.java b/libs/vogar-expect/src/vogar/util/TimeUtilities.java
deleted file mode 100644
index c5a7e3b..0000000
--- a/libs/vogar-expect/src/vogar/util/TimeUtilities.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-package vogar.util;
-
-/**
- * Utilities to make it easier to work with ISO 8601 dates and times.
- * This is a subset of the original class from http://software.jessies.org/salma-hayek/ --- please submit fixes upstream.
- */
-public class TimeUtilities {
-    /**
-     * Returns the ISO 8601-format String corresponding to the given duration (measured in milliseconds).
-     */
-    public static String msToIsoString(long duration) {
-        long milliseconds = duration % 1000;
-        duration /= 1000;
-        long seconds = duration % 60;
-        duration /= 60;
-        long minutes = duration % 60;
-        duration /= 60;
-        long hours = duration;
-
-        StringBuilder result = new StringBuilder("P");
-        if (hours != 0) {
-            result.append(hours);
-            result.append('H');
-        }
-        if (result.length() > 1 || minutes != 0) {
-            result.append(minutes);
-            result.append('M');
-        }
-        result.append(seconds);
-        if (milliseconds != 0) {
-            result.append('.');
-            result.append(milliseconds);
-        }
-        result.append('S');
-        return result.toString();
-    }
-    
-    /**
-     * Returns a string representation of the given number of milliseconds.
-     */
-    public static String msToString(long ms) {
-        return nsToString(ms * 1000000);
-    }
-    
-    /**
-     * Returns a string representation of the given number of nanoseconds.
-     */
-    public static String nsToString(long ns) {
-        if (ns < 1000L) {
-            return Long.toString(ns) + "ns";
-        } else if (ns < 1000000L) {
-            return Long.toString(ns/1000L) + "us";
-        } else if (ns < 1000000000L) {
-            return Long.toString(ns/1000000L) + "ms";
-        } else if (ns < 60000000000L) {
-            return String.format("%.2fs", nsToS(ns));
-        } else {
-            long duration = ns;
-            long nanoseconds = duration % 1000;
-            duration /= 1000;
-            long microseconds = duration % 1000;
-            duration /= 1000;
-            long milliseconds = duration % 1000;
-            duration /= 1000;
-            long seconds = duration % 60;
-            duration /= 60;
-            long minutes = duration % 60;
-            duration /= 60;
-            long hours = duration % 24;
-            duration /= 24;
-            long days = duration;
-            
-            StringBuilder result = new StringBuilder();
-            if (days != 0) {
-                result.append(days);
-                result.append('d');
-            }
-            if (result.length() > 1 || hours != 0) {
-                result.append(hours);
-                result.append('h');
-            }
-            if (result.length() > 1 || minutes != 0) {
-                result.append(minutes);
-                result.append('m');
-            }
-            result.append(seconds);
-            result.append('s');
-            return result.toString();
-        }
-    }
-    
-    /**
-     * Converts nanoseconds into (fractional) seconds.
-     */
-    public static double nsToS(long ns) {
-        return ((double) ns)/1000000000.0;
-    }
-
-    private TimeUtilities() {
-    }
-}
diff --git a/tests/JobSchedulerSharedUid/Android.bp b/tests/JobSchedulerSharedUid/Android.bp
new file mode 100644
index 0000000..1320dc2
--- /dev/null
+++ b/tests/JobSchedulerSharedUid/Android.bp
@@ -0,0 +1,39 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsJobSchedulerSharedUidTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ub-uiautomator",
+        "androidx.test.rules",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: [
+        "src/**/*.java",
+        "JobSharedUidTestApp/src/**/*.java",
+        "jobperm/src/**/*.java",
+        "shareduid/src/**/*.java",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    //sdk_version: "current"
+    platform_apis: true,
+
+}
diff --git a/tests/JobSchedulerSharedUid/Android.mk b/tests/JobSchedulerSharedUid/Android.mk
deleted file mode 100755
index 0b9912c..0000000
--- a/tests/JobSchedulerSharedUid/Android.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright (C) 2018 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
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util-axt ub-uiautomator androidx.test.rules
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SRC_FILES += $(call all-java-files-under, JobSharedUidTestApp/src)
-LOCAL_SRC_FILES += $(call all-java-files-under, jobperm/src)
-LOCAL_SRC_FILES += $(call all-java-files-under, shareduid/src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-# Must match the package name in CtsTestCaseList.mk
-LOCAL_PACKAGE_NAME := CtsJobSchedulerSharedUidTestCases
-
-#LOCAL_SDK_VERSION := current
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/JobSchedulerSharedUid/JobSharedUidTestApp/Android.bp b/tests/JobSchedulerSharedUid/JobSharedUidTestApp/Android.bp
new file mode 100644
index 0000000..6ff76da
--- /dev/null
+++ b/tests/JobSchedulerSharedUid/JobSharedUidTestApp/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsJobSharedUidTestApp",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/tests/JobSchedulerSharedUid/JobSharedUidTestApp/Android.mk b/tests/JobSchedulerSharedUid/JobSharedUidTestApp/Android.mk
deleted file mode 100644
index f3d36db..0000000
--- a/tests/JobSchedulerSharedUid/JobSharedUidTestApp/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2018 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 := tests
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsJobSharedUidTestApp
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/JobSchedulerSharedUid/jobperm/Android.bp b/tests/JobSchedulerSharedUid/jobperm/Android.bp
new file mode 100644
index 0000000..e20fc55
--- /dev/null
+++ b/tests/JobSchedulerSharedUid/jobperm/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsJobSchedulerJobPerm",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "android-support-annotations",
+        "compatibility-device-util-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    platform_apis: true,
+}
diff --git a/tests/JobSchedulerSharedUid/jobperm/Android.mk b/tests/JobSchedulerSharedUid/jobperm/Android.mk
deleted file mode 100644
index 2a1b2ae..0000000
--- a/tests/JobSchedulerSharedUid/jobperm/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2018 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 := tests
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    android-support-annotations \
-    compatibility-device-util-axt \
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsJobSchedulerJobPerm
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/JobSchedulerSharedUid/shareduid/Android.bp b/tests/JobSchedulerSharedUid/shareduid/Android.bp
new file mode 100644
index 0000000..68ed7f5
--- /dev/null
+++ b/tests/JobSchedulerSharedUid/shareduid/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsJobSchedulerSharedUid",
+    defaults: ["cts_defaults"],
+    static_libs: ["compatibility-device-util-axt"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/JobSchedulerSharedUid/shareduid/Android.mk b/tests/JobSchedulerSharedUid/shareduid/Android.mk
deleted file mode 100644
index cfc89cd..0000000
--- a/tests/JobSchedulerSharedUid/shareduid/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2018 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 := tests
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsJobSchedulerSharedUid
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/acceleration/Android.bp b/tests/acceleration/Android.bp
new file mode 100644
index 0000000..5ab6a1c
--- /dev/null
+++ b/tests/acceleration/Android.bp
@@ -0,0 +1,41 @@
+// Copyright (C) 2011 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.
+
+android_test {
+    name: "CtsAccelerationTestCases",
+    defaults: ["cts_defaults"],
+    dex_preopt: {
+        enabled: false,
+    },
+    optimize: {
+        enabled: false,
+    },
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/acceleration/Android.mk b/tests/acceleration/Android.mk
deleted file mode 100644
index 33ecfb4..0000000
--- a/tests/acceleration/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2011 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsAccelerationTestCases
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/accessibilityservice/Android.bp b/tests/accessibilityservice/Android.bp
new file mode 100644
index 0000000..cf37486
--- /dev/null
+++ b/tests/accessibilityservice/Android.bp
@@ -0,0 +1,39 @@
+// Copyright (C) 2010 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.
+
+android_test {
+    name: "CtsAccessibilityServiceTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "hamcrest-library",
+        "mockito-target-minus-junit4",
+        "platform-test-annotations",
+        "CtsAccessibilityCommon",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    sdk_version: "test_current",
+    data: [":CtsAccessibilityWidgetProvider"],
+}
diff --git a/tests/accessibilityservice/Android.mk b/tests/accessibilityservice/Android.mk
deleted file mode 100644
index c4480d7..0000000
--- a/tests/accessibilityservice/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2010 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    hamcrest-library \
-    mockito-target-minus-junit4 \
-    platform-test-annotations \
-    CtsAccessibilityCommon
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsAccessibilityServiceTestCases
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/accessibilityservice/test-apps/WidgetProvider/Android.bp b/tests/accessibilityservice/test-apps/WidgetProvider/Android.bp
index c594ace..960d96b 100644
--- a/tests/accessibilityservice/test-apps/WidgetProvider/Android.bp
+++ b/tests/accessibilityservice/test-apps/WidgetProvider/Android.bp
@@ -16,12 +16,5 @@
     name: "CtsAccessibilityWidgetProvider",
     defaults: ["cts_support_defaults"],
     srcs: ["src/**/*.java"],
-    // Tag this module as a cts test artifact
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-        "cts_instant",
-    ],
     sdk_version: "test_current",
 }
diff --git a/tests/admin/Android.bp b/tests/admin/Android.bp
new file mode 100644
index 0000000..93ebf89
--- /dev/null
+++ b/tests/admin/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2011 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.
+
+android_test {
+    name: "CtsAdminTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "mockito-target-minus-junit4",
+        "truth-prebuilt",
+        "testng",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    instrumentation_for: "CtsAdminApp",
+    sdk_version: "test_current",
+}
diff --git a/tests/admin/Android.mk b/tests/admin/Android.mk
deleted file mode 100644
index bc2a36a..0000000
--- a/tests/admin/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2011 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt mockito-target-minus-junit4 truth-prebuilt testng
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsAdminTestCases
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_INSTRUMENTATION_FOR := CtsAdminApp
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/app/Android.bp b/tests/app/Android.bp
new file mode 100644
index 0000000..9e25fea
--- /dev/null
+++ b/tests/app/Android.bp
@@ -0,0 +1,114 @@
+// Copyright (C) 2008 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.
+
+android_test {
+    name: "CtsAppTestCases",
+    defaults: ["cts_defaults"],
+    libs: [
+        "android.test.runner.stubs",
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ctstestserver",
+        "cts-wm-util",
+        "mockito-target-minus-junit4",
+        "androidx.test.ext.junit",
+        "androidx.test.rules",
+        "platform-test-annotations",
+        "platformprotosnano",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    instrumentation_for: "CtsAppTestStubs",
+    sdk_version: "test_current",
+    min_sdk_version: "14",
+}
+
+android_test {
+    name: "CtsDownloadManagerApi28",
+    defaults: ["cts_defaults"],
+    libs: [
+        "android.test.runner.stubs",
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ctstestserver",
+        "mockito-target-minus-junit4",
+        "androidx.test.rules",
+        "platform-test-annotations",
+        "androidx.test.rules",
+    ],
+    srcs: [
+        "DownloadManagerApi28Test/src/**/*.java",
+        "src/android/app/cts/DownloadManagerTestBase.java",
+    ],
+    resource_dirs: ["app/res"],
+    asset_dirs: ["app/assets"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+    min_sdk_version: "14",
+    manifest: "DownloadManagerApi28Test/AndroidManifest.xml",
+    test_config: "DownloadManagerApi28Test/AndroidTest.xml",
+}
+
+android_test {
+    name: "CtsDownloadManagerLegacy",
+    defaults: ["cts_defaults"],
+    libs: [
+        "android.test.runner.stubs",
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ctstestserver",
+        "mockito-target-minus-junit4",
+        "androidx.test.rules",
+        "platform-test-annotations",
+        "androidx.test.rules",
+    ],
+    srcs: [
+        "DownloadManagerLegacyTest/src/**/*.java",
+        "src/android/app/cts/DownloadManagerTestBase.java",
+    ],
+    resource_dirs: ["app/res"],
+    asset_dirs: ["app/assets"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+    min_sdk_version: "14",
+    manifest: "DownloadManagerLegacyTest/AndroidManifest.xml",
+    test_config: "DownloadManagerLegacyTest/AndroidTest.xml",
+}
diff --git a/tests/app/Android.mk b/tests/app/Android.mk
deleted file mode 100644
index 8051d83..0000000
--- a/tests/app/Android.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (C) 2008 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := \
-    android.test.runner.stubs \
-    org.apache.http.legacy \
-    android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ctstestserver \
-    mockito-target-minus-junit4 \
-    androidx.test.rules \
-    androidx.test.ext.junit \
-    platform-test-annotations \
-    cts-wm-util \
-    androidx.test.rules \
-    platformprotosnano
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsAppTestCases
-
-LOCAL_INSTRUMENTATION_FOR := CtsAppTestStubs
-
-LOCAL_SDK_VERSION := test_current
-LOCAL_MIN_SDK_VERSION := 11
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/app/CantSaveState1/Android.bp b/tests/app/CantSaveState1/Android.bp
new file mode 100644
index 0000000..401d7e3
--- /dev/null
+++ b/tests/app/CantSaveState1/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsCantSaveState1",
+    defaults: ["cts_support_defaults"],
+    srcs: ["**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/tests/app/CantSaveState1/Android.mk b/tests/app/CantSaveState1/Android.mk
deleted file mode 100644
index 72c762d..0000000
--- a/tests/app/CantSaveState1/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2017 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsCantSaveState1
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/app/CantSaveState2/Android.bp b/tests/app/CantSaveState2/Android.bp
new file mode 100644
index 0000000..77a1487
--- /dev/null
+++ b/tests/app/CantSaveState2/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsCantSaveState2",
+    defaults: ["cts_support_defaults"],
+    srcs: ["**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/tests/app/CantSaveState2/Android.mk b/tests/app/CantSaveState2/Android.mk
deleted file mode 100644
index 4023063..0000000
--- a/tests/app/CantSaveState2/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2017 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsCantSaveState2
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/app/DownloadManagerApi28Test/Android.mk b/tests/app/DownloadManagerApi28Test/Android.mk
deleted file mode 100644
index 51f4dde..0000000
--- a/tests/app/DownloadManagerApi28Test/Android.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (C) 2019 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := \
-    android.test.runner.stubs \
-    org.apache.http.legacy \
-    android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ctstestserver \
-    mockito-target-minus-junit4 \
-    androidx.test.rules \
-    platform-test-annotations \
-    androidx.test.rules \
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-    ../src/android/app/cts/DownloadManagerTestBase.java
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/../app/res
-
-LOCAL_ASSET_DIR := $(LOCAL_PATH)/../app/assets
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsDownloadManagerApi28
-
-LOCAL_SDK_VERSION := test_current
-LOCAL_MIN_SDK_VERSION := 11
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
\ No newline at end of file
diff --git a/tests/app/DownloadManagerLegacyTest/Android.mk b/tests/app/DownloadManagerLegacyTest/Android.mk
deleted file mode 100644
index 8f1bcba..0000000
--- a/tests/app/DownloadManagerLegacyTest/Android.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (C) 2019 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := \
-    android.test.runner.stubs \
-    org.apache.http.legacy \
-    android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ctstestserver \
-    mockito-target-minus-junit4 \
-    androidx.test.rules \
-    platform-test-annotations \
-    androidx.test.rules \
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-    ../src/android/app/cts/DownloadManagerTestBase.java
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/../app/res
-
-LOCAL_ASSET_DIR := $(LOCAL_PATH)/../app/assets
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsDownloadManagerLegacy
-
-LOCAL_SDK_VERSION := test_current
-LOCAL_MIN_SDK_VERSION := 11
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
\ No newline at end of file
diff --git a/tests/app/NotificationDelegator/Android.bp b/tests/app/NotificationDelegator/Android.bp
new file mode 100644
index 0000000..13b0cac
--- /dev/null
+++ b/tests/app/NotificationDelegator/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "NotificationDelegator",
+    defaults: ["cts_support_defaults"],
+    srcs: ["**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/tests/app/NotificationDelegator/Android.mk b/tests/app/NotificationDelegator/Android.mk
deleted file mode 100644
index dde1787..0000000
--- a/tests/app/NotificationDelegator/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2018 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := NotificationDelegator
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/app/app/Android.bp b/tests/app/app/Android.bp
new file mode 100644
index 0000000..a7a77d4
--- /dev/null
+++ b/tests/app/app/Android.bp
@@ -0,0 +1,142 @@
+// Copyright (C) 2008 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.
+
+android_test_helper_app {
+    name: "CtsAppTestStubs",
+    defaults: ["cts_support_defaults"],
+    libs: [
+        "android.test.runner.stubs",
+        "telephony-common",
+        "voip-common",
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ctstestserver",
+        "mockito-target-minus-junit4",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "src/android/app/stubs/ISecondary.aidl",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    platform_apis: true,
+}
+
+android_test_helper_app {
+    name: "CtsAppTestStubsApp1",
+    defaults: ["cts_support_defaults"],
+    libs: [
+        "android.test.runner.stubs",
+        "telephony-common",
+        "voip-common",
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ctstestserver",
+        "mockito-target-minus-junit4",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "src/android/app/stubs/ISecondary.aidl",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    platform_apis: true,
+    aaptflags: [
+        "--rename-manifest-package com.android.app1",
+    ],
+}
+
+android_test {
+    name: "CtsAppTestStubsApp2",
+    defaults: ["cts_support_defaults"],
+    libs: [
+        "android.test.runner.stubs",
+        "telephony-common",
+        "voip-common",
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ctstestserver",
+        "mockito-target-minus-junit4",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "src/android/app/stubs/ISecondary.aidl",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    platform_apis: true,
+    aaptflags: [
+        "--rename-manifest-package com.android.app2",
+    ],
+}
+
+android_test_helper_app {
+    name: "CtsAppTestStubsApp3",
+    defaults: ["cts_support_defaults"],
+    libs: [
+        "android.test.runner.stubs",
+        "telephony-common",
+        "voip-common",
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ctstestserver",
+        "mockito-target-minus-junit4",
+        "androidx.legacy_legacy-support-v4",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "src/android/app/stubs/ISecondary.aidl",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    platform_apis: true,
+    aaptflags: [
+        "--rename-manifest-package com.android.app3",
+    ],
+}
diff --git a/tests/app/app/Android.mk b/tests/app/app/Android.mk
deleted file mode 100644
index d973bab..0000000
--- a/tests/app/app/Android.mk
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (C) 2008 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_JAVA_LIBRARIES := \
-    android.test.runner.stubs \
-    telephony-common \
-    voip-common \
-    org.apache.http.legacy \
-    android.test.base.stubs \
-
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ctstestserver \
-    mockito-target-minus-junit4 \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-              src/android/app/stubs/ISecondary.aidl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsAppTestStubs
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_USE_AAPT2 := true
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/app/app1/Android.mk b/tests/app/app1/Android.mk
deleted file mode 100644
index 9286c88..0000000
--- a/tests/app/app1/Android.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (C) 2018 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)/../app
-
-include $(CLEAR_VARS)
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_JAVA_LIBRARIES := \
-    android.test.runner.stubs \
-    telephony-common \
-    voip-common \
-    org.apache.http.legacy \
-    android.test.base.stubs \
-
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ctstestserver \
-    mockito-target-minus-junit4 \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-              src/android/app/stubs/ISecondary.aidl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsAppTestStubsApp1
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_AAPT_FLAGS += --rename-manifest-package com.android.app1
-
-# Disable AAPT2 manifest checks to fix:
-# cts/tests/app/app/AndroidManifest.xml:25: error: unexpected element <meta-data> found in <manifest><permission>.
-# TODO(b/79755007): Remove when AAPT2 recognizes the manifest elements.
-LOCAL_AAPT_FLAGS += --warn-manifest-validation
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/app/app2/Android.mk b/tests/app/app2/Android.mk
deleted file mode 100644
index 3e2543b..0000000
--- a/tests/app/app2/Android.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (C) 2018 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)/../app
-
-include $(CLEAR_VARS)
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_JAVA_LIBRARIES := \
-    android.test.runner.stubs \
-    telephony-common \
-    voip-common \
-    org.apache.http.legacy \
-    android.test.base.stubs \
-
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ctstestserver \
-    mockito-target-minus-junit4 \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-              src/android/app/stubs/ISecondary.aidl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsAppTestStubsApp2
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_AAPT_FLAGS += --rename-manifest-package com.android.app2
-
-# Disable AAPT2 manifest checks to fix:
-# cts/tests/app/app/AndroidManifest.xml:25: error: unexpected element <meta-data> found in <manifest><permission>.
-# TODO(b/79755007): Remove when AAPT2 recognizes the manifest elements.
-LOCAL_AAPT_FLAGS += --warn-manifest-validation
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/app/app3/Android.mk b/tests/app/app3/Android.mk
deleted file mode 100644
index 79e9c98..0000000
--- a/tests/app/app3/Android.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (C) 2018 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)/../app
-
-include $(CLEAR_VARS)
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_JAVA_LIBRARIES := \
-    android.test.runner.stubs \
-    telephony-common \
-    voip-common \
-    org.apache.http.legacy \
-    android.test.base.stubs \
-
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ctstestserver \
-    mockito-target-minus-junit4 \
-    androidx.legacy_legacy-support-v4
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-              src/android/app/stubs/ISecondary.aidl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsAppTestStubsApp3
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_AAPT_FLAGS += --rename-manifest-package com.android.app3
-
-# Disable AAPT2 manifest checks to fix:
-# cts/tests/app/app/AndroidManifest.xml:25: error: unexpected element <meta-data> found in <manifest><permission>.
-# TODO(b/79755007): Remove when AAPT2 recognizes the manifest elements.
-LOCAL_AAPT_FLAGS += --warn-manifest-validation
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/app/src/android/app/cts/SystemFeaturesTest.java b/tests/app/src/android/app/cts/SystemFeaturesTest.java
index 2257689..fa7e980 100644
--- a/tests/app/src/android/app/cts/SystemFeaturesTest.java
+++ b/tests/app/src/android/app/cts/SystemFeaturesTest.java
@@ -327,6 +327,24 @@
     }
 
     @Test
+    public void testNfcFeatures() {
+        if (NfcAdapter.getDefaultAdapter(mContext) != null) {
+            // Watches MAY support all FEATURE_NFC features when an NfcAdapter is available, but
+            // non-watches MUST support them both.
+            if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_WATCH)) {
+                assertOneAvailable(PackageManager.FEATURE_NFC,
+                    PackageManager.FEATURE_NFC_HOST_CARD_EMULATION);
+            } else {
+                assertAvailable(PackageManager.FEATURE_NFC);
+                assertAvailable(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION);
+            }
+        } else {
+            assertNotAvailable(PackageManager.FEATURE_NFC);
+            assertNotAvailable(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION);
+        }
+    }
+
+    @Test
     public void testScreenFeatures() {
         assertTrue(mPackageManager.hasSystemFeature(PackageManager.FEATURE_SCREEN_LANDSCAPE)
                 || mPackageManager.hasSystemFeature(PackageManager.FEATURE_SCREEN_PORTRAIT));
diff --git a/tests/camera/src/android/hardware/camera2/cts/common.rs b/tests/camera/src/android/hardware/camera2/cts/common.rscript
similarity index 100%
rename from tests/camera/src/android/hardware/camera2/cts/common.rs
rename to tests/camera/src/android/hardware/camera2/cts/common.rscript
diff --git a/tests/camera/src/android/hardware/camera2/cts/crop_yuvf_420_to_yuvx_444.rs b/tests/camera/src/android/hardware/camera2/cts/crop_yuvf_420_to_yuvx_444.rs
deleted file mode 100644
index f930f58..0000000
--- a/tests/camera/src/android/hardware/camera2/cts/crop_yuvf_420_to_yuvx_444.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2014 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 "common.rs"
-
-// Must be YUV 420 888 (flexible YUV)
-rs_allocation mInput;
-
-// Input globals
-uint32_t src_x;
-uint32_t src_y;
-
-// Crop each pixel from mInput
-yuvx_444 RS_KERNEL crop(uint32_t x, uint32_t y) {
-
-    uchar py = rsGetElementAtYuv_uchar_Y(mInput, x + src_x, y + src_y);
-    uchar pu = rsGetElementAtYuv_uchar_U(mInput, x + src_x, y + src_y);
-    uchar pv = rsGetElementAtYuv_uchar_V(mInput, x + src_x, y + src_y);
-
-    yuvx_444 yuv = { py, pu, pv };
-
-    return yuv;
-}
-
diff --git a/tests/camera/src/android/hardware/camera2/cts/crop_yuvf_420_to_yuvx_444.rscript b/tests/camera/src/android/hardware/camera2/cts/crop_yuvf_420_to_yuvx_444.rscript
new file mode 100644
index 0000000..31aac46
--- /dev/null
+++ b/tests/camera/src/android/hardware/camera2/cts/crop_yuvf_420_to_yuvx_444.rscript
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2014 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 "common.rscript"
+
+// Must be YUV 420 888 (flexible YUV)
+rs_allocation mInput;
+
+// Input globals
+uint32_t src_x;
+uint32_t src_y;
+
+// Crop each pixel from mInput
+yuvx_444 RS_KERNEL crop(uint32_t x, uint32_t y) {
+
+    uchar py = rsGetElementAtYuv_uchar_Y(mInput, x + src_x, y + src_y);
+    uchar pu = rsGetElementAtYuv_uchar_U(mInput, x + src_x, y + src_y);
+    uchar pv = rsGetElementAtYuv_uchar_V(mInput, x + src_x, y + src_y);
+
+    yuvx_444 yuv = { py, pu, pv };
+
+    return yuv;
+}
+
diff --git a/tests/camera/src/android/hardware/camera2/cts/means_yuvx_444_1d_to_single.rs b/tests/camera/src/android/hardware/camera2/cts/means_yuvx_444_1d_to_single.rs
deleted file mode 100644
index 052052f..0000000
--- a/tests/camera/src/android/hardware/camera2/cts/means_yuvx_444_1d_to_single.rs
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2014 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 "common.rs"
-
-// #define LOG_DEBUG 1
-
-// Must be yuvx_444 (interleaved yuv)
-rs_allocation mInput;
-
-uint32_t width;
-float inv_width; // must be set to 1/w
-
-// Average 1D array -> Single element
-// Input: mInput must be yuvx_444
-yuvx_444 RS_KERNEL means_yuvx_444(void) {
-
-    uint3 sum  = { 0, 0, 0 };
-
-    LOGD("width", width);
-
-    for (uint32_t i = 0; i < width; ++i) {
-        yuvx_444 elem = rsGetElementAt_yuvx_444(mInput, i);
-
-        LOGD("elem", elem);
-        LOGD("i", i);
-
-        sum.x += elem.x;
-        sum.y += elem.y;
-        sum.z += elem.z;
-    }
-
-    sum.x *= inv_width; // multiply by 1/w
-    sum.y *= inv_width; // multiply by 1/w
-    sum.z *= inv_width; // multiply by 1/w
-
-    yuvx_444 avg = convert_yuvx_444(sum);
-
-    return avg;
-}
-
diff --git a/tests/camera/src/android/hardware/camera2/cts/means_yuvx_444_1d_to_single.rscript b/tests/camera/src/android/hardware/camera2/cts/means_yuvx_444_1d_to_single.rscript
new file mode 100644
index 0000000..45b43c5
--- /dev/null
+++ b/tests/camera/src/android/hardware/camera2/cts/means_yuvx_444_1d_to_single.rscript
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2014 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 "common.rscript"
+
+// #define LOG_DEBUG 1
+
+// Must be yuvx_444 (interleaved yuv)
+rs_allocation mInput;
+
+uint32_t width;
+float inv_width; // must be set to 1/w
+
+// Average 1D array -> Single element
+// Input: mInput must be yuvx_444
+yuvx_444 RS_KERNEL means_yuvx_444(void) {
+
+    uint3 sum  = { 0, 0, 0 };
+
+    LOGD("width", width);
+
+    for (uint32_t i = 0; i < width; ++i) {
+        yuvx_444 elem = rsGetElementAt_yuvx_444(mInput, i);
+
+        LOGD("elem", elem);
+        LOGD("i", i);
+
+        sum.x += elem.x;
+        sum.y += elem.y;
+        sum.z += elem.z;
+    }
+
+    sum.x *= inv_width; // multiply by 1/w
+    sum.y *= inv_width; // multiply by 1/w
+    sum.z *= inv_width; // multiply by 1/w
+
+    yuvx_444 avg = convert_yuvx_444(sum);
+
+    return avg;
+}
+
diff --git a/tests/camera/src/android/hardware/camera2/cts/means_yuvx_444_2d_to_1d.rs b/tests/camera/src/android/hardware/camera2/cts/means_yuvx_444_2d_to_1d.rs
deleted file mode 100644
index 7dc4e0d..0000000
--- a/tests/camera/src/android/hardware/camera2/cts/means_yuvx_444_2d_to_1d.rs
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2014 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 "common.rs"
-
-// #define LOG_DEBUG 1
-
-// Must be YUV 420 888 (flexible YUV)
-rs_allocation mInput;
-
-uint32_t width;
-float inv_width; // 1/w
-uint32_t src_x; // x-offset from mInput
-uint32_t src_y; // y-offset from mInput
-
-// Average a 2D array -> 1D array (by each row)
-// Input: mInput must be yuvf_420
-yuvx_444 RS_KERNEL means_yuvf_420(uint32_t x) {
-
-    LOGD("x", x);
-
-    uint3 sum = { 0, 0, 0 };
-
-    for (uint32_t i = 0; i < width; ++i) {
-        uchar py = rsGetElementAtYuv_uchar_Y(mInput, src_x + i, src_y + x);
-        uchar pu = rsGetElementAtYuv_uchar_U(mInput, src_x + i, src_y + x);
-        uchar pv = rsGetElementAtYuv_uchar_V(mInput, src_x + i, src_y + x);
-
-        yuvx_444 elem = { py, pu, pv };
-
-        LOGD("elem", elem);
-
-        sum.x += elem.x;
-        sum.y += elem.y;
-        sum.z += elem.z;
-    }
-
-    sum.x *= inv_width; // multiply by 1/w
-    sum.y *= inv_width; // multiply by 1/w
-    sum.z *= inv_width; // multiply by 1/w
-
-    yuvx_444 avg = convert_yuvx_444(sum);
-
-    return avg;
-}
-
-// Average a 2D array -> 1D array (by each row)
-// Input: mInput must be yuvx_444
-yuvx_444 RS_KERNEL means_yuvx_444(uint32_t x) {
-
-    LOGD("x", x);
-
-    uint3 sum = { 0, 0, 0 };
-
-    for (uint32_t i = 0; i < width; ++i) {
-        yuvx_444 elem = rsGetElementAt_yuvx_444(mInput, src_x + i, src_y + x);
-
-        LOGD("elem", elem);
-
-        sum.x += elem.x;
-        sum.y += elem.y;
-        sum.z += elem.z;
-    }
-
-    sum.x *= inv_width; // multiply by 1/w
-    sum.y *= inv_width; // multiply by 1/w
-    sum.z *= inv_width; // multiply by 1/w
-
-    yuvx_444 avg = convert_yuvx_444(sum);
-
-    return avg;
-}
-
diff --git a/tests/camera/src/android/hardware/camera2/cts/means_yuvx_444_2d_to_1d.rscript b/tests/camera/src/android/hardware/camera2/cts/means_yuvx_444_2d_to_1d.rscript
new file mode 100644
index 0000000..a42e84d
--- /dev/null
+++ b/tests/camera/src/android/hardware/camera2/cts/means_yuvx_444_2d_to_1d.rscript
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2014 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 "common.rscript"
+
+// #define LOG_DEBUG 1
+
+// Must be YUV 420 888 (flexible YUV)
+rs_allocation mInput;
+
+uint32_t width;
+float inv_width; // 1/w
+uint32_t src_x; // x-offset from mInput
+uint32_t src_y; // y-offset from mInput
+
+// Average a 2D array -> 1D array (by each row)
+// Input: mInput must be yuvf_420
+yuvx_444 RS_KERNEL means_yuvf_420(uint32_t x) {
+
+    LOGD("x", x);
+
+    uint3 sum = { 0, 0, 0 };
+
+    for (uint32_t i = 0; i < width; ++i) {
+        uchar py = rsGetElementAtYuv_uchar_Y(mInput, src_x + i, src_y + x);
+        uchar pu = rsGetElementAtYuv_uchar_U(mInput, src_x + i, src_y + x);
+        uchar pv = rsGetElementAtYuv_uchar_V(mInput, src_x + i, src_y + x);
+
+        yuvx_444 elem = { py, pu, pv };
+
+        LOGD("elem", elem);
+
+        sum.x += elem.x;
+        sum.y += elem.y;
+        sum.z += elem.z;
+    }
+
+    sum.x *= inv_width; // multiply by 1/w
+    sum.y *= inv_width; // multiply by 1/w
+    sum.z *= inv_width; // multiply by 1/w
+
+    yuvx_444 avg = convert_yuvx_444(sum);
+
+    return avg;
+}
+
+// Average a 2D array -> 1D array (by each row)
+// Input: mInput must be yuvx_444
+yuvx_444 RS_KERNEL means_yuvx_444(uint32_t x) {
+
+    LOGD("x", x);
+
+    uint3 sum = { 0, 0, 0 };
+
+    for (uint32_t i = 0; i < width; ++i) {
+        yuvx_444 elem = rsGetElementAt_yuvx_444(mInput, src_x + i, src_y + x);
+
+        LOGD("elem", elem);
+
+        sum.x += elem.x;
+        sum.y += elem.y;
+        sum.z += elem.z;
+    }
+
+    sum.x *= inv_width; // multiply by 1/w
+    sum.y *= inv_width; // multiply by 1/w
+    sum.z *= inv_width; // multiply by 1/w
+
+    yuvx_444 avg = convert_yuvx_444(sum);
+
+    return avg;
+}
+
diff --git a/tests/camera/src/android/hardware/camera2/cts/rs/raw_converter.rs b/tests/camera/src/android/hardware/camera2/cts/rs/raw_converter.rs
deleted file mode 100644
index e1146fc..0000000
--- a/tests/camera/src/android/hardware/camera2/cts/rs/raw_converter.rs
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Copyright 2015 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 "../common.rs"
-
-// This file includes a conversion kernel for RGGB, GRBG, GBRG, and BGGR Bayer patterns.
-// Applying this script also will apply black-level subtraction, rescaling, clipping, tonemapping,
-// and color space transforms along with the Bayer demosaic.  See RawConverter.java
-// for more information.
-
-// Input globals
-
-rs_allocation inputRawBuffer; // RAW16 buffer of dimensions (raw image stride) * (raw image height)
-rs_allocation gainMap; // Gainmap to apply to linearized raw sensor data.
-uint cfaPattern; // The Color Filter Arrangement pattern used
-uint gainMapWidth;  // The width of the gain map
-uint gainMapHeight;  // The height of the gain map
-bool hasGainMap; // Does gainmap exist?
-bool isMonochrome;  // Is monochrome camera?
-rs_matrix3x3 sensorToIntermediate; // Color transform from sensor to a wide-gamut colorspace
-rs_matrix3x3 intermediateToSRGB; // Color transform from wide-gamut colorspace to sRGB
-ushort4 blackLevelPattern; // Blacklevel to subtract for each channel, given in CFA order
-int whiteLevel;  // Whitelevel of sensor
-uint offsetX; // X offset into inputRawBuffer
-uint offsetY; // Y offset into inputRawBuffer
-uint rawWidth; // Width of raw buffer
-uint rawHeight; // Height of raw buffer
-float3 neutralPoint; // The camera neutral
-float4 toneMapCoeffs; // Coefficients for a polynomial tonemapping curve
-
-// Interpolate gain map to find per-channel gains at a given pixel
-static float4 getGain(uint x, uint y) {
-    float interpX = (((float) x) / rawWidth) * gainMapWidth;
-    float interpY = (((float) y) / rawHeight) * gainMapHeight;
-    uint gX = (uint) interpX;
-    uint gY = (uint) interpY;
-    uint gXNext = (gX + 1 < gainMapWidth) ? gX + 1 : gX;
-    uint gYNext = (gY + 1 < gainMapHeight) ? gY + 1 : gY;
-
-    float4 tl = *((float4 *) rsGetElementAt(gainMap, gX, gY));
-    float4 tr = *((float4 *) rsGetElementAt(gainMap, gXNext, gY));
-    float4 bl = *((float4 *) rsGetElementAt(gainMap, gX, gYNext));
-    float4 br = *((float4 *) rsGetElementAt(gainMap, gXNext, gYNext));
-
-    float fracX = interpX - (float) gX;
-    float fracY = interpY - (float) gY;
-    float invFracX = 1.f - fracX;
-    float invFracY = 1.f - fracY;
-
-    return tl * invFracX * invFracY + tr * fracX * invFracY +
-            bl * invFracX * fracY + br * fracX * fracY;
-}
-
-// Apply gamma correction using sRGB gamma curve
-static float gammaEncode(float x) {
-    return (x <= 0.0031308f) ? x * 12.92f : 1.055f * pow(x, 0.4166667f) - 0.055f;
-}
-
-// Apply gamma correction to each color channel in RGB pixel
-static float3 gammaCorrectPixel(float3 rgb) {
-    float3 ret;
-    ret.x = gammaEncode(rgb.x);
-    ret.y = gammaEncode(rgb.y);
-    ret.z = gammaEncode(rgb.z);
-    return ret;
-}
-
-// Apply polynomial tonemapping curve to each color channel in RGB pixel.
-// This attempts to apply tonemapping without changing the hue of each pixel,
-// i.e.:
-//
-// For some RGB values:
-// M = max(R, G, B)
-// m = min(R, G, B)
-// m' = mid(R, G, B)
-// chroma = M - m
-// H = m' - m / chroma
-//
-// The relationship H=H' should be preserved, where H and H' are calculated from
-// the RGB and RGB' value at this pixel before and after this tonemapping
-// operation has been applied, respectively.
-static float3 tonemap(float3 rgb) {
-    float3 sorted = clamp(rgb, 0.f, 1.f);
-    float tmp;
-    int permutation = 0;
-
-    // Sort the RGB channels by value
-    if (sorted.z < sorted.y) {
-        tmp = sorted.z;
-        sorted.z = sorted.y;
-        sorted.y = tmp;
-        permutation |= 1;
-    }
-    if (sorted.y < sorted.x) {
-        tmp = sorted.y;
-        sorted.y = sorted.x;
-        sorted.x = tmp;
-        permutation |= 2;
-    }
-    if (sorted.z < sorted.y) {
-        tmp = sorted.z;
-        sorted.z = sorted.y;
-        sorted.y = tmp;
-        permutation |= 4;
-    }
-
-    float2 minmax;
-    minmax.x = sorted.x;
-    minmax.y = sorted.z;
-
-    // Apply tonemapping curve to min, max RGB channel values
-    minmax = native_powr(minmax, 3.f) * toneMapCoeffs.x +
-            native_powr(minmax, 2.f) * toneMapCoeffs.y +
-            minmax * toneMapCoeffs.z + toneMapCoeffs.w;
-
-    // Rescale middle value
-    float newMid;
-    if (sorted.z == sorted.x) {
-        newMid = minmax.y;
-    } else {
-        newMid = minmax.x + ((minmax.y - minmax.x) * (sorted.y - sorted.x) /
-                (sorted.z - sorted.x));
-    }
-
-    float3 finalRGB;
-    switch (permutation) {
-        case 0: // b >= g >= r
-            finalRGB.x = minmax.x;
-            finalRGB.y = newMid;
-            finalRGB.z = minmax.y;
-            break;
-        case 1: // g >= b >= r
-            finalRGB.x = minmax.x;
-            finalRGB.z = newMid;
-            finalRGB.y = minmax.y;
-            break;
-        case 2: // b >= r >= g
-            finalRGB.y = minmax.x;
-            finalRGB.x = newMid;
-            finalRGB.z = minmax.y;
-            break;
-        case 3: // g >= r >= b
-            finalRGB.z = minmax.x;
-            finalRGB.x = newMid;
-            finalRGB.y = minmax.y;
-            break;
-        case 6: // r >= b >= g
-            finalRGB.y = minmax.x;
-            finalRGB.z = newMid;
-            finalRGB.x = minmax.y;
-            break;
-        case 7: // r >= g >= b
-            finalRGB.z = minmax.x;
-            finalRGB.y = newMid;
-            finalRGB.x = minmax.y;
-            break;
-        case 4: // impossible
-        case 5: // impossible
-        default:
-            finalRGB.x = 0.f;
-            finalRGB.y = 0.f;
-            finalRGB.z = 0.f;
-            LOGD("raw_converter.rs: Logic error in tonemap.", 0);
-            break;
-    }
-    return clamp(finalRGB, 0.f, 1.f);
-}
-
-// Apply a colorspace transform to the intermediate colorspace, apply
-// a tonemapping curve, apply a colorspace transform to a final colorspace,
-// and apply a gamma correction curve.
-static float3 applyColorspace(float3 pRGB) {
-    pRGB.x = clamp(pRGB.x, 0.f, neutralPoint.x);
-    pRGB.y = clamp(pRGB.y, 0.f, neutralPoint.y);
-    pRGB.z = clamp(pRGB.z, 0.f, neutralPoint.z);
-
-    float3 intermediate = rsMatrixMultiply(&sensorToIntermediate, pRGB);
-    intermediate = tonemap(intermediate);
-    return gammaCorrectPixel(clamp(rsMatrixMultiply(&intermediateToSRGB, intermediate), 0.f, 1.f));
-}
-
-// Load a 3x3 patch of pixels into the output.
-static void load3x3(uint x, uint y, rs_allocation buf, /*out*/float* outputArray) {
-    outputArray[0] = *((ushort *) rsGetElementAt(buf, x - 1, y - 1));
-    outputArray[1] = *((ushort *) rsGetElementAt(buf, x, y - 1));
-    outputArray[2] = *((ushort *) rsGetElementAt(buf, x + 1, y - 1));
-    outputArray[3] = *((ushort *) rsGetElementAt(buf, x - 1, y));
-    outputArray[4] = *((ushort *) rsGetElementAt(buf, x, y));
-    outputArray[5] = *((ushort *) rsGetElementAt(buf, x + 1, y));
-    outputArray[6] = *((ushort *) rsGetElementAt(buf, x - 1, y + 1));
-    outputArray[7] = *((ushort *) rsGetElementAt(buf, x, y + 1));
-    outputArray[8] = *((ushort *) rsGetElementAt(buf, x + 1, y + 1));
-}
-
-// Blacklevel subtract, and normalize each pixel in the outputArray, and apply the
-// gain map.
-static void linearizeAndGainmap(uint x, uint y, ushort4 blackLevel, int whiteLevel,
-        uint cfa, /*inout*/float* outputArray) {
-    uint kk = 0;
-    for (uint j = y - 1; j <= y + 1; j++) {
-        for (uint i = x - 1; i <= x + 1; i++) {
-            uint index = (i & 1) | ((j & 1) << 1);  // bits [0,1] are blacklevel offset
-            index |= (cfa << 2);  // bits [2,3] are cfa
-            float bl = 0.f;
-            float g = 1.f;
-            float4 gains = 1.f;
-            if (hasGainMap) {
-                gains = getGain(i, j);
-            }
-            switch (index) {
-                // RGGB
-                case 0:
-                    bl = blackLevel.x;
-                    g = gains.x;
-                    break;
-                case 1:
-                    bl = blackLevel.y;
-                    g = gains.y;
-                    break;
-                case 2:
-                    bl = blackLevel.z;
-                    g = gains.z;
-                    break;
-                case 3:
-                    bl = blackLevel.w;
-                    g = gains.w;
-                    break;
-                // GRBG
-                case 4:
-                    bl = blackLevel.x;
-                    g = gains.y;
-                    break;
-                case 5:
-                    bl = blackLevel.y;
-                    g = gains.x;
-                    break;
-                case 6:
-                    bl = blackLevel.z;
-                    g = gains.w;
-                    break;
-                case 7:
-                    bl = blackLevel.w;
-                    g = gains.z;
-                    break;
-                // GBRG
-                case 8:
-                    bl = blackLevel.x;
-                    g = gains.y;
-                    break;
-                case 9:
-                    bl = blackLevel.y;
-                    g = gains.w;
-                    break;
-                case 10:
-                    bl = blackLevel.z;
-                    g = gains.x;
-                    break;
-                case 11:
-                    bl = blackLevel.w;
-                    g = gains.z;
-                    break;
-                // BGGR
-                case 12:
-                    bl = blackLevel.x;
-                    g = gains.w;
-                    break;
-                case 13:
-                    bl = blackLevel.y;
-                    g = gains.y;
-                    break;
-                case 14:
-                    bl = blackLevel.z;
-                    g = gains.z;
-                    break;
-                case 15:
-                    bl = blackLevel.w;
-                    g = gains.x;
-                    break;
-            }
-            outputArray[kk] = clamp(g * (outputArray[kk] - bl) / (whiteLevel - bl), 0.f, 1.f);
-            kk++;
-        }
-    }
-}
-
-// Apply bilinear-interpolation to demosaic
-static float3 demosaic(uint x, uint y, uint cfa, float* inputArray) {
-    uint index = (x & 1) | ((y & 1) << 1);
-    index |= (cfa << 2);
-    float3 pRGB;
-    switch (index) {
-        case 0:
-        case 5:
-        case 10:
-        case 15:  // Red centered
-                  // B G B
-                  // G R G
-                  // B G B
-            pRGB.x = inputArray[4];
-            pRGB.y = (inputArray[1] + inputArray[3] + inputArray[5] + inputArray[7]) / 4;
-            pRGB.z = (inputArray[0] + inputArray[2] + inputArray[6] + inputArray[8]) / 4;
-            break;
-        case 1:
-        case 4:
-        case 11:
-        case 14: // Green centered w/ horizontally adjacent Red
-                 // G B G
-                 // R G R
-                 // G B G
-            pRGB.x = (inputArray[3] + inputArray[5]) / 2;
-            pRGB.y = inputArray[4];
-            pRGB.z = (inputArray[1] + inputArray[7]) / 2;
-            break;
-        case 2:
-        case 7:
-        case 8:
-        case 13: // Green centered w/ horizontally adjacent Blue
-                 // G R G
-                 // B G B
-                 // G R G
-            pRGB.x = (inputArray[1] + inputArray[7]) / 2;
-            pRGB.y = inputArray[4];
-            pRGB.z = (inputArray[3] + inputArray[5]) / 2;
-            break;
-        case 3:
-        case 6:
-        case 9:
-        case 12: // Blue centered
-                 // R G R
-                 // G B G
-                 // R G R
-            pRGB.x = (inputArray[0] + inputArray[2] + inputArray[6] + inputArray[8]) / 4;
-            pRGB.y = (inputArray[1] + inputArray[3] + inputArray[5] + inputArray[7]) / 4;
-            pRGB.z = inputArray[4];
-            break;
-    }
-
-    return pRGB;
-}
-
-// Full RAW->ARGB bitmap conversion kernel
-uchar4 RS_KERNEL convert_RAW_To_ARGB(uint x, uint y) {
-    float3 pRGB;
-    uint xP = x + offsetX;
-    uint yP = y + offsetY;
-    if (xP == 0) xP = 1;
-    if (yP == 0) yP = 1;
-    if (xP == rawWidth - 1) xP = rawWidth - 2;
-    if (yP == rawHeight - 1) yP = rawHeight  - 2;
-
-    if (isMonochrome) {
-        float pixel = *((ushort *) rsGetElementAt(inputRawBuffer, x, y));
-
-        // Apply linearization and gain map
-        float4 gains = 1.f;
-        if (hasGainMap) {
-            gains = getGain(xP, yP);
-        }
-        float bl = blackLevelPattern.x;
-        float g = gains.x;
-        pixel = clamp(g * (pixel - bl) / (whiteLevel - bl), 0.f, 1.f);
-
-        // Use same Y value for R, G, and B.
-        pRGB.x = pRGB.y = pRGB.z = pixel;
-
-        // apply tonemap and gamma correction
-        pRGB = tonemap(pRGB);
-        pRGB = gammaCorrectPixel(pRGB);
-    } else {
-        float patch[9];
-        // TODO: Once ScriptGroup and RS kernels have been updated to allow for iteration over 3x3 pixel
-        // patches, this can be optimized to avoid re-applying the pre-demosaic steps for each pixel,
-        // potentially achieving a 9x speedup here.
-        load3x3(xP, yP, inputRawBuffer, /*out*/ patch);
-        linearizeAndGainmap(xP, yP, blackLevelPattern, whiteLevel, cfaPattern, /*inout*/patch);
-        pRGB = demosaic(xP, yP, cfaPattern, patch);
-        pRGB = applyColorspace(pRGB);
-    }
-
-    return rsPackColorTo8888(pRGB);
-}
diff --git a/tests/camera/src/android/hardware/camera2/cts/rs/raw_converter.rscript b/tests/camera/src/android/hardware/camera2/cts/rs/raw_converter.rscript
new file mode 100644
index 0000000..6b2ad0c
--- /dev/null
+++ b/tests/camera/src/android/hardware/camera2/cts/rs/raw_converter.rscript
@@ -0,0 +1,394 @@
+/*
+ * Copyright 2015 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 "../common.rscript"
+
+// This file includes a conversion kernel for RGGB, GRBG, GBRG, and BGGR Bayer patterns.
+// Applying this script also will apply black-level subtraction, rescaling, clipping, tonemapping,
+// and color space transforms along with the Bayer demosaic.  See RawConverter.java
+// for more information.
+
+// Input globals
+
+rs_allocation inputRawBuffer; // RAW16 buffer of dimensions (raw image stride) * (raw image height)
+rs_allocation gainMap; // Gainmap to apply to linearized raw sensor data.
+uint cfaPattern; // The Color Filter Arrangement pattern used
+uint gainMapWidth;  // The width of the gain map
+uint gainMapHeight;  // The height of the gain map
+bool hasGainMap; // Does gainmap exist?
+bool isMonochrome;  // Is monochrome camera?
+rs_matrix3x3 sensorToIntermediate; // Color transform from sensor to a wide-gamut colorspace
+rs_matrix3x3 intermediateToSRGB; // Color transform from wide-gamut colorspace to sRGB
+ushort4 blackLevelPattern; // Blacklevel to subtract for each channel, given in CFA order
+int whiteLevel;  // Whitelevel of sensor
+uint offsetX; // X offset into inputRawBuffer
+uint offsetY; // Y offset into inputRawBuffer
+uint rawWidth; // Width of raw buffer
+uint rawHeight; // Height of raw buffer
+float3 neutralPoint; // The camera neutral
+float4 toneMapCoeffs; // Coefficients for a polynomial tonemapping curve
+
+// Interpolate gain map to find per-channel gains at a given pixel
+static float4 getGain(uint x, uint y) {
+    float interpX = (((float) x) / rawWidth) * gainMapWidth;
+    float interpY = (((float) y) / rawHeight) * gainMapHeight;
+    uint gX = (uint) interpX;
+    uint gY = (uint) interpY;
+    uint gXNext = (gX + 1 < gainMapWidth) ? gX + 1 : gX;
+    uint gYNext = (gY + 1 < gainMapHeight) ? gY + 1 : gY;
+
+    float4 tl = *((float4 *) rsGetElementAt(gainMap, gX, gY));
+    float4 tr = *((float4 *) rsGetElementAt(gainMap, gXNext, gY));
+    float4 bl = *((float4 *) rsGetElementAt(gainMap, gX, gYNext));
+    float4 br = *((float4 *) rsGetElementAt(gainMap, gXNext, gYNext));
+
+    float fracX = interpX - (float) gX;
+    float fracY = interpY - (float) gY;
+    float invFracX = 1.f - fracX;
+    float invFracY = 1.f - fracY;
+
+    return tl * invFracX * invFracY + tr * fracX * invFracY +
+            bl * invFracX * fracY + br * fracX * fracY;
+}
+
+// Apply gamma correction using sRGB gamma curve
+static float gammaEncode(float x) {
+    return (x <= 0.0031308f) ? x * 12.92f : 1.055f * pow(x, 0.4166667f) - 0.055f;
+}
+
+// Apply gamma correction to each color channel in RGB pixel
+static float3 gammaCorrectPixel(float3 rgb) {
+    float3 ret;
+    ret.x = gammaEncode(rgb.x);
+    ret.y = gammaEncode(rgb.y);
+    ret.z = gammaEncode(rgb.z);
+    return ret;
+}
+
+// Apply polynomial tonemapping curve to each color channel in RGB pixel.
+// This attempts to apply tonemapping without changing the hue of each pixel,
+// i.e.:
+//
+// For some RGB values:
+// M = max(R, G, B)
+// m = min(R, G, B)
+// m' = mid(R, G, B)
+// chroma = M - m
+// H = m' - m / chroma
+//
+// The relationship H=H' should be preserved, where H and H' are calculated from
+// the RGB and RGB' value at this pixel before and after this tonemapping
+// operation has been applied, respectively.
+static float3 tonemap(float3 rgb) {
+    float3 sorted = clamp(rgb, 0.f, 1.f);
+    float tmp;
+    int permutation = 0;
+
+    // Sort the RGB channels by value
+    if (sorted.z < sorted.y) {
+        tmp = sorted.z;
+        sorted.z = sorted.y;
+        sorted.y = tmp;
+        permutation |= 1;
+    }
+    if (sorted.y < sorted.x) {
+        tmp = sorted.y;
+        sorted.y = sorted.x;
+        sorted.x = tmp;
+        permutation |= 2;
+    }
+    if (sorted.z < sorted.y) {
+        tmp = sorted.z;
+        sorted.z = sorted.y;
+        sorted.y = tmp;
+        permutation |= 4;
+    }
+
+    float2 minmax;
+    minmax.x = sorted.x;
+    minmax.y = sorted.z;
+
+    // Apply tonemapping curve to min, max RGB channel values
+    minmax = native_powr(minmax, 3.f) * toneMapCoeffs.x +
+            native_powr(minmax, 2.f) * toneMapCoeffs.y +
+            minmax * toneMapCoeffs.z + toneMapCoeffs.w;
+
+    // Rescale middle value
+    float newMid;
+    if (sorted.z == sorted.x) {
+        newMid = minmax.y;
+    } else {
+        newMid = minmax.x + ((minmax.y - minmax.x) * (sorted.y - sorted.x) /
+                (sorted.z - sorted.x));
+    }
+
+    float3 finalRGB;
+    switch (permutation) {
+        case 0: // b >= g >= r
+            finalRGB.x = minmax.x;
+            finalRGB.y = newMid;
+            finalRGB.z = minmax.y;
+            break;
+        case 1: // g >= b >= r
+            finalRGB.x = minmax.x;
+            finalRGB.z = newMid;
+            finalRGB.y = minmax.y;
+            break;
+        case 2: // b >= r >= g
+            finalRGB.y = minmax.x;
+            finalRGB.x = newMid;
+            finalRGB.z = minmax.y;
+            break;
+        case 3: // g >= r >= b
+            finalRGB.z = minmax.x;
+            finalRGB.x = newMid;
+            finalRGB.y = minmax.y;
+            break;
+        case 6: // r >= b >= g
+            finalRGB.y = minmax.x;
+            finalRGB.z = newMid;
+            finalRGB.x = minmax.y;
+            break;
+        case 7: // r >= g >= b
+            finalRGB.z = minmax.x;
+            finalRGB.y = newMid;
+            finalRGB.x = minmax.y;
+            break;
+        case 4: // impossible
+        case 5: // impossible
+        default:
+            finalRGB.x = 0.f;
+            finalRGB.y = 0.f;
+            finalRGB.z = 0.f;
+            LOGD("raw_converter.rscript: Logic error in tonemap.", 0);
+            break;
+    }
+    return clamp(finalRGB, 0.f, 1.f);
+}
+
+// Apply a colorspace transform to the intermediate colorspace, apply
+// a tonemapping curve, apply a colorspace transform to a final colorspace,
+// and apply a gamma correction curve.
+static float3 applyColorspace(float3 pRGB) {
+    pRGB.x = clamp(pRGB.x, 0.f, neutralPoint.x);
+    pRGB.y = clamp(pRGB.y, 0.f, neutralPoint.y);
+    pRGB.z = clamp(pRGB.z, 0.f, neutralPoint.z);
+
+    float3 intermediate = rsMatrixMultiply(&sensorToIntermediate, pRGB);
+    intermediate = tonemap(intermediate);
+    return gammaCorrectPixel(clamp(rsMatrixMultiply(&intermediateToSRGB, intermediate), 0.f, 1.f));
+}
+
+// Load a 3x3 patch of pixels into the output.
+static void load3x3(uint x, uint y, rs_allocation buf, /*out*/float* outputArray) {
+    outputArray[0] = *((ushort *) rsGetElementAt(buf, x - 1, y - 1));
+    outputArray[1] = *((ushort *) rsGetElementAt(buf, x, y - 1));
+    outputArray[2] = *((ushort *) rsGetElementAt(buf, x + 1, y - 1));
+    outputArray[3] = *((ushort *) rsGetElementAt(buf, x - 1, y));
+    outputArray[4] = *((ushort *) rsGetElementAt(buf, x, y));
+    outputArray[5] = *((ushort *) rsGetElementAt(buf, x + 1, y));
+    outputArray[6] = *((ushort *) rsGetElementAt(buf, x - 1, y + 1));
+    outputArray[7] = *((ushort *) rsGetElementAt(buf, x, y + 1));
+    outputArray[8] = *((ushort *) rsGetElementAt(buf, x + 1, y + 1));
+}
+
+// Blacklevel subtract, and normalize each pixel in the outputArray, and apply the
+// gain map.
+static void linearizeAndGainmap(uint x, uint y, ushort4 blackLevel, int whiteLevel,
+        uint cfa, /*inout*/float* outputArray) {
+    uint kk = 0;
+    for (uint j = y - 1; j <= y + 1; j++) {
+        for (uint i = x - 1; i <= x + 1; i++) {
+            uint index = (i & 1) | ((j & 1) << 1);  // bits [0,1] are blacklevel offset
+            index |= (cfa << 2);  // bits [2,3] are cfa
+            float bl = 0.f;
+            float g = 1.f;
+            float4 gains = 1.f;
+            if (hasGainMap) {
+                gains = getGain(i, j);
+            }
+            switch (index) {
+                // RGGB
+                case 0:
+                    bl = blackLevel.x;
+                    g = gains.x;
+                    break;
+                case 1:
+                    bl = blackLevel.y;
+                    g = gains.y;
+                    break;
+                case 2:
+                    bl = blackLevel.z;
+                    g = gains.z;
+                    break;
+                case 3:
+                    bl = blackLevel.w;
+                    g = gains.w;
+                    break;
+                // GRBG
+                case 4:
+                    bl = blackLevel.x;
+                    g = gains.y;
+                    break;
+                case 5:
+                    bl = blackLevel.y;
+                    g = gains.x;
+                    break;
+                case 6:
+                    bl = blackLevel.z;
+                    g = gains.w;
+                    break;
+                case 7:
+                    bl = blackLevel.w;
+                    g = gains.z;
+                    break;
+                // GBRG
+                case 8:
+                    bl = blackLevel.x;
+                    g = gains.y;
+                    break;
+                case 9:
+                    bl = blackLevel.y;
+                    g = gains.w;
+                    break;
+                case 10:
+                    bl = blackLevel.z;
+                    g = gains.x;
+                    break;
+                case 11:
+                    bl = blackLevel.w;
+                    g = gains.z;
+                    break;
+                // BGGR
+                case 12:
+                    bl = blackLevel.x;
+                    g = gains.w;
+                    break;
+                case 13:
+                    bl = blackLevel.y;
+                    g = gains.y;
+                    break;
+                case 14:
+                    bl = blackLevel.z;
+                    g = gains.z;
+                    break;
+                case 15:
+                    bl = blackLevel.w;
+                    g = gains.x;
+                    break;
+            }
+            outputArray[kk] = clamp(g * (outputArray[kk] - bl) / (whiteLevel - bl), 0.f, 1.f);
+            kk++;
+        }
+    }
+}
+
+// Apply bilinear-interpolation to demosaic
+static float3 demosaic(uint x, uint y, uint cfa, float* inputArray) {
+    uint index = (x & 1) | ((y & 1) << 1);
+    index |= (cfa << 2);
+    float3 pRGB;
+    switch (index) {
+        case 0:
+        case 5:
+        case 10:
+        case 15:  // Red centered
+                  // B G B
+                  // G R G
+                  // B G B
+            pRGB.x = inputArray[4];
+            pRGB.y = (inputArray[1] + inputArray[3] + inputArray[5] + inputArray[7]) / 4;
+            pRGB.z = (inputArray[0] + inputArray[2] + inputArray[6] + inputArray[8]) / 4;
+            break;
+        case 1:
+        case 4:
+        case 11:
+        case 14: // Green centered w/ horizontally adjacent Red
+                 // G B G
+                 // R G R
+                 // G B G
+            pRGB.x = (inputArray[3] + inputArray[5]) / 2;
+            pRGB.y = inputArray[4];
+            pRGB.z = (inputArray[1] + inputArray[7]) / 2;
+            break;
+        case 2:
+        case 7:
+        case 8:
+        case 13: // Green centered w/ horizontally adjacent Blue
+                 // G R G
+                 // B G B
+                 // G R G
+            pRGB.x = (inputArray[1] + inputArray[7]) / 2;
+            pRGB.y = inputArray[4];
+            pRGB.z = (inputArray[3] + inputArray[5]) / 2;
+            break;
+        case 3:
+        case 6:
+        case 9:
+        case 12: // Blue centered
+                 // R G R
+                 // G B G
+                 // R G R
+            pRGB.x = (inputArray[0] + inputArray[2] + inputArray[6] + inputArray[8]) / 4;
+            pRGB.y = (inputArray[1] + inputArray[3] + inputArray[5] + inputArray[7]) / 4;
+            pRGB.z = inputArray[4];
+            break;
+    }
+
+    return pRGB;
+}
+
+// Full RAW->ARGB bitmap conversion kernel
+uchar4 RS_KERNEL convert_RAW_To_ARGB(uint x, uint y) {
+    float3 pRGB;
+    uint xP = x + offsetX;
+    uint yP = y + offsetY;
+    if (xP == 0) xP = 1;
+    if (yP == 0) yP = 1;
+    if (xP == rawWidth - 1) xP = rawWidth - 2;
+    if (yP == rawHeight - 1) yP = rawHeight  - 2;
+
+    if (isMonochrome) {
+        float pixel = *((ushort *) rsGetElementAt(inputRawBuffer, x, y));
+
+        // Apply linearization and gain map
+        float4 gains = 1.f;
+        if (hasGainMap) {
+            gains = getGain(xP, yP);
+        }
+        float bl = blackLevelPattern.x;
+        float g = gains.x;
+        pixel = clamp(g * (pixel - bl) / (whiteLevel - bl), 0.f, 1.f);
+
+        // Use same Y value for R, G, and B.
+        pRGB.x = pRGB.y = pRGB.z = pixel;
+
+        // apply tonemap and gamma correction
+        pRGB = tonemap(pRGB);
+        pRGB = gammaCorrectPixel(pRGB);
+    } else {
+        float patch[9];
+        // TODO: Once ScriptGroup and RS kernels have been updated to allow for iteration over 3x3 pixel
+        // patches, this can be optimized to avoid re-applying the pre-demosaic steps for each pixel,
+        // potentially achieving a 9x speedup here.
+        load3x3(xP, yP, inputRawBuffer, /*out*/ patch);
+        linearizeAndGainmap(xP, yP, blackLevelPattern, whiteLevel, cfaPattern, /*inout*/patch);
+        pRGB = demosaic(xP, yP, cfaPattern, patch);
+        pRGB = applyColorspace(pRGB);
+    }
+
+    return rsPackColorTo8888(pRGB);
+}
diff --git a/tests/core/runner-axt/src/com/android/cts/core/runner/ExpectationBasedFilter.java b/tests/core/runner-axt/src/com/android/cts/core/runner/ExpectationBasedFilter.java
index f409dbd..4419b4b 100644
--- a/tests/core/runner-axt/src/com/android/cts/core/runner/ExpectationBasedFilter.java
+++ b/tests/core/runner-axt/src/com/android/cts/core/runner/ExpectationBasedFilter.java
@@ -27,10 +27,10 @@
 import org.junit.runner.manipulation.Filter;
 import org.junit.runners.ParentRunner;
 import org.junit.runners.Suite;
-import vogar.Expectation;
-import vogar.ExpectationStore;
-import vogar.ModeId;
-import vogar.Result;
+import vogar.expect.Expectation;
+import vogar.expect.ExpectationStore;
+import vogar.expect.ModeId;
+import vogar.expect.Result;
 
 /**
  * Filter out tests/classes that are not requested or which are expected to fail.
diff --git a/tests/core/runner/src/com/android/cts/core/runner/ExpectationBasedFilter.java b/tests/core/runner/src/com/android/cts/core/runner/ExpectationBasedFilter.java
index f409dbd..4419b4b 100644
--- a/tests/core/runner/src/com/android/cts/core/runner/ExpectationBasedFilter.java
+++ b/tests/core/runner/src/com/android/cts/core/runner/ExpectationBasedFilter.java
@@ -27,10 +27,10 @@
 import org.junit.runner.manipulation.Filter;
 import org.junit.runners.ParentRunner;
 import org.junit.runners.Suite;
-import vogar.Expectation;
-import vogar.ExpectationStore;
-import vogar.ModeId;
-import vogar.Result;
+import vogar.expect.Expectation;
+import vogar.expect.ExpectationStore;
+import vogar.expect.ModeId;
+import vogar.expect.Result;
 
 /**
  * Filter out tests/classes that are not requested or which are expected to fail.
diff --git a/tests/inputmethod/Android.bp b/tests/inputmethod/Android.bp
new file mode 100644
index 0000000..1309bcb
--- /dev/null
+++ b/tests/inputmethod/Android.bp
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsInputMethodTestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    compile_multilib: "both",
+    libs: ["android.test.runner.stubs"],
+    static_libs: [
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "CtsMockInputMethodLib",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "src/**/I*.aidl",
+    ],
+    aidl: {
+        local_include_dirs: ["src"],
+    },
+    sdk_version: "test_current",
+}
diff --git a/tests/inputmethod/Android.mk b/tests/inputmethod/Android.mk
deleted file mode 100644
index c9c5953..0000000
--- a/tests/inputmethod/Android.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_MULTILIB := both
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    CtsMockInputMethodLib
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-    $(call all-Iaidl-files-under, src)
-
-LOCAL_AIDL_INCLUDES += $(LOCAL_PATH)/src
-
-LOCAL_PACKAGE_NAME := CtsInputMethodTestCases
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/inputmethod/mockime/Android.bp b/tests/inputmethod/mockime/Android.bp
new file mode 100644
index 0000000..8a9e49c
--- /dev/null
+++ b/tests/inputmethod/mockime/Android.bp
@@ -0,0 +1,50 @@
+// Copyright (C) 2017 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.
+
+java_test_helper_library {
+    name: "CtsMockInputMethodLib",
+    sdk_version: "test_current",
+
+    // TODO: ideally we should split MockIme source files into three categories
+    //       1) common, 2) common + IME-only, and 3) common + client-only.
+    //       Currently, both MockIme APK and test APKs that use MockIme contain
+    //       all the Java classes, which is inefficient.
+    srcs: ["src/**/*.java"],
+    libs: ["junit"],
+    static_libs: [
+        "androidx.annotation_annotation",
+        "compatibility-device-util-axt",
+    ],
+}
+
+android_test_helper_app {
+    name: "CtsMockInputMethod",
+    defaults: ["cts_defaults"],
+    optimize: {
+        enabled: false,
+    },
+    sdk_version: "test_current",
+    min_sdk_version: "19",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    static_libs: [
+        "androidx.annotation_annotation",
+        "CtsMockInputMethodLib",
+    ],
+}
diff --git a/tests/inputmethod/mockime/Android.mk b/tests/inputmethod/mockime/Android.mk
deleted file mode 100644
index 346e316..0000000
--- a/tests/inputmethod/mockime/Android.mk
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE := CtsMockInputMethodLib
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SDK_VERSION := test_current
-
-# TODO: ideally we should split MockIme source files into three categories
-#       1) common, 2) common + IME-only, and 3) common + client-only.
-#       Currently, both MockIme APK and test APKs that use MockIme contain
-#       all the Java classes, which is inefficient.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_LIBRARIES := junit
-LOCAL_STATIC_JAVA_LIBRARIES := \
-   androidx.annotation_annotation \
-   compatibility-device-util-axt
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
-
-# -----------
-include $(CLEAR_VARS)
-
-# Don't include this package in any target
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_PACKAGE_NAME := CtsMockInputMethod
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SDK_VERSION := test_current
-LOCAL_MIN_SDK_VERSION := 19
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-   androidx.annotation_annotation \
-   CtsMockInputMethodLib
-
-include $(BUILD_PACKAGE)
diff --git a/tests/jdwp/Android.bp b/tests/jdwp/Android.bp
index c51958a..d7d748c 100644
--- a/tests/jdwp/Android.bp
+++ b/tests/jdwp/Android.bp
@@ -31,4 +31,5 @@
     optimize: {
         enabled: false,
     },
+    data: [":cts-dalvik-device-test-runner"],
 }
diff --git a/tests/jdwp/OWNERS b/tests/jdwp/OWNERS
new file mode 100644
index 0000000..6e06299
--- /dev/null
+++ b/tests/jdwp/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 86431
+include /hostsidetests/jvmti/run-tests/OWNERS
diff --git a/tests/jdwp/runner/device-side/Android.bp b/tests/jdwp/runner/device-side/Android.bp
index b3f370c..98edcf8 100644
--- a/tests/jdwp/runner/device-side/Android.bp
+++ b/tests/jdwp/runner/device-side/Android.bp
@@ -27,11 +27,4 @@
     },
 
     static_libs: ["junit"],
-
-    // Tag this module as a cts test artifact
-    test_suites: [
-        "cts",
-        "vts",
-        "general-tests",
-    ],
 }
diff --git a/tests/jdwp/runner/host-side/src/com/android/compatibility/testtype/DalvikTest.java b/tests/jdwp/runner/host-side/src/com/android/compatibility/testtype/DalvikTest.java
index 61e1988..4546535 100644
--- a/tests/jdwp/runner/host-side/src/com/android/compatibility/testtype/DalvikTest.java
+++ b/tests/jdwp/runner/host-side/src/com/android/compatibility/testtype/DalvikTest.java
@@ -61,8 +61,8 @@
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
-import vogar.ExpectationStore;
-import vogar.ModeId;
+import vogar.expect.ExpectationStore;
+import vogar.expect.ModeId;
 
 /**
  * A wrapper to run tests against Dalvik.
diff --git a/tests/jdwp/runner/host-side/src/com/android/compatibility/testtype/LibcoreTest.java b/tests/jdwp/runner/host-side/src/com/android/compatibility/testtype/LibcoreTest.java
index f4021b2..980315a 100644
--- a/tests/jdwp/runner/host-side/src/com/android/compatibility/testtype/LibcoreTest.java
+++ b/tests/jdwp/runner/host-side/src/com/android/compatibility/testtype/LibcoreTest.java
@@ -16,6 +16,8 @@
 
 package com.android.compatibility.testtype;
 
+import static java.util.stream.Collectors.toList;
+
 import com.android.tradefed.config.Option;
 import com.android.tradefed.device.DeviceNotAvailableException;
 import com.android.tradefed.log.LogUtil.CLog;
@@ -25,6 +27,8 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
 
 /**
  * A specialized test type for Libcore tests that provides the ability to specify a set of
@@ -41,13 +45,20 @@
             + "expectation file")
     private List<String> mCoreExpectations = new ArrayList<>();
 
+    @Option(name = "virtual-device-core-expectation", description = "Provides failure expectations "
+            + "on virtual devices only for libcore tests via the specified file; the path must be "
+            + "absolute and will be resolved to matching bundled resource files; this parameter "
+            + "should be repeated for each expectation file")
+    private List<String> mVirtualDeviceCoreExpectations = new ArrayList<>();
+
     /**
      * {@inheritDoc}
      */
     @Override
     public void run(ITestInvocationListener listener) throws DeviceNotAvailableException {
-        if (!mCoreExpectations.isEmpty()) {
-            addInstrumentationArg(INSTRUMENTATION_ARG_NAME, ArrayUtil.join(",", mCoreExpectations));
+        List<String> coreExpectations = getCoreExpectations();
+        if (!coreExpectations.isEmpty()) {
+            addInstrumentationArg(INSTRUMENTATION_ARG_NAME, ArrayUtil.join(",", coreExpectations));
         }
 
         if (getTestPackageName() != null && getClassName() != null) {
@@ -61,4 +72,18 @@
         }
         super.run(listener);
     }
+
+    private List<String> getCoreExpectations() throws DeviceNotAvailableException {
+        if (isVirtualDevice()) {
+                return Stream.concat(
+                        mCoreExpectations.stream(), mVirtualDeviceCoreExpectations.stream())
+                    .collect(toList());
+        } else {
+            return mCoreExpectations;
+        }
+    }
+
+    private boolean isVirtualDevice() throws DeviceNotAvailableException {
+        return Objects.equals(getDevice().getProperty("ro.hardware.virtual_device"), "1");
+    }
 }
diff --git a/tests/libcore/Android.mk b/tests/libcore/Android.mk
deleted file mode 100644
index 00d1223..0000000
--- a/tests/libcore/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2016 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.
-
-# Build the test APK using its own makefile, and any other CTS-related packages
-include $(call all-subdir-makefiles)
diff --git a/tests/libcore/jsr166/Android.bp b/tests/libcore/jsr166/Android.bp
new file mode 100644
index 0000000..83e0331
--- /dev/null
+++ b/tests/libcore/jsr166/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2016 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.
+
+android_test {
+    name: "CtsLibcoreJsr166TestCases",
+    defaults: ["cts_support_defaults"],
+    platform_apis: true,
+    static_libs: [
+        "cts-core-test-runner-axt",
+        "jsr166-tests",
+    ],
+    dex_preopt: {
+        enabled: false,
+    },
+    optimize: {
+        enabled: false,
+    },
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    java_resources: [":libcore-expectations-knownfailures"],
+}
diff --git a/tests/libcore/jsr166/Android.mk b/tests/libcore/jsr166/Android.mk
deleted file mode 100644
index 3cb2bfa..0000000
--- a/tests/libcore/jsr166/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_PACKAGE_NAME := CtsLibcoreJsr166TestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    cts-core-test-runner-axt \
-    jsr166-tests
-
-# Don't include this package in any target
-LOCAL_MODULE_TAGS := tests
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-LOCAL_JACK_FLAGS := --multi-dex native
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_JAVA_RESOURCE_FILES := libcore/expectations/knownfailures.txt
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/libcore/jsr166/OWNERS b/tests/libcore/jsr166/OWNERS
deleted file mode 100644
index 7b5c0ad..0000000
--- a/tests/libcore/jsr166/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-# NOTE: Each source root in CTS should have an OWNERS file as a reminder to
-# add owners to it. It's okay for this file to be empty because the parent
-# directory's owners get inherited by default.
diff --git a/tests/libcore/luni/Android.bp b/tests/libcore/luni/Android.bp
new file mode 100644
index 0000000..b0fa8b6
--- /dev/null
+++ b/tests/libcore/luni/Android.bp
@@ -0,0 +1,62 @@
+// Copyright (C) 2015 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.
+
+android_test {
+    name: "CtsLibcoreTestCases",
+    defaults: ["cts_support_defaults"],
+    platform_apis: true,
+    static_libs: [
+        "apache-harmony-tests",
+        "conscrypt-tests",
+        "core-tests",
+        "cts-core-test-runner-axt",
+        "mockito-target-minus-junit4",
+        "time_zone_distro-tests",
+        "time_zone_distro_installer-tests",
+    ],
+    dex_preopt: {
+        enabled: false,
+    },
+    dxflags: ["--multi-dex"],
+    // Exclude apache harmony tests from coverage instrumentation, since it breaks
+    // the tests of reflection APIs by adding fields and methods to the test classes.
+    jacoco: {
+        exclude_filter: ["org.apache.harmony.tests.**"],
+    },
+    optimize: {
+        enabled: false,
+    },
+    jni_libs: [
+        "libjavacoretests",
+        "libsqlite_jni",
+        "libnativehelper_compat_libc++",
+        "libc++",
+    ],
+    // Include both the 32 and 64 bit versions of libjavacoretests,
+    // where applicable.
+    compile_multilib: "both",
+    // This test requires cts-dalvik-host-test-runner to be built to run via Atest.
+    host_required: ["cts-dalvik-host-test-runner"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "mts",
+        "vts",
+        "general-tests",
+    ],
+    java_resources: [
+        ":libcore-expectations-knownfailures",
+        ":libcore-expectations-virtualdeviceknownfailures",
+    ],
+}
diff --git a/tests/libcore/luni/Android.mk b/tests/libcore/luni/Android.mk
deleted file mode 100644
index 210ba0f..0000000
--- a/tests/libcore/luni/Android.mk
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_PACKAGE_NAME := CtsLibcoreTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    apache-harmony-tests \
-    conscrypt-tests \
-    core-tests \
-    cts-core-test-runner-axt \
-    mockito-target-minus-junit4 \
-    time_zone_distro-tests \
-    time_zone_distro_installer-tests
-
-# Don't include this package in any target
-LOCAL_MODULE_TAGS := tests
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-LOCAL_JACK_FLAGS := --multi-dex native
-LOCAL_DX_FLAGS := --multi-dex
-
-# Exclude apache harmony tests from coverage instrumentation, since it breaks
-# the tests of reflection APIs by adding fields and methods to the test classes.
-LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := org.apache.harmony.tests.*
-
-LOCAL_PROGUARD_ENABLED := disabled
-# Keep META-INF/ resources from LOCAL_STATIC_JAVA_LIBRARIES. http://b/62341677
-LOCAL_DONT_DELETE_JAR_META_INF := true
-LOCAL_JNI_SHARED_LIBRARIES := libjavacoretests libsqlite_jni libnativehelper_compat_libc++ libc++
-
-# Include both the 32 and 64 bit versions of libjavacoretests,
-# where applicable.
-LOCAL_MULTILIB := both
-
-# This test requires cts-dalvik-host-test-runner to be built to run via Atest.
-LOCAL_HOST_REQUIRED_MODULES := cts-dalvik-host-test-runner
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests mts
-
-# NOTE: virtualdeviceknownfailures.txt is only used for simulated/cloud-based
-# continuous build configurations, so it's not referenced in AndroidTest.xml
-LOCAL_JAVA_RESOURCE_FILES := \
-    libcore/expectations/knownfailures.txt \
-    libcore/expectations/virtualdeviceknownfailures.txt
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/libcore/luni/AndroidTest.xml b/tests/libcore/luni/AndroidTest.xml
index 85728a8..7fef84d 100644
--- a/tests/libcore/luni/AndroidTest.xml
+++ b/tests/libcore/luni/AndroidTest.xml
@@ -33,6 +33,7 @@
         <option name="instrumentation-arg" key="filter"
                 value="com.android.cts.core.runner.ExpectationBasedFilter" />
         <option name="core-expectation" value="/knownfailures.txt" />
+        <option name="virtual-device-core-expectation" value="/virtualdeviceknownfailures.txt" />
         <option name="runtime-hint" value="45m"/>
         <!-- 20x default timeout of 600sec -->
         <option name="shell-timeout" value="12000000"/>
diff --git a/tests/libcore/luni/OWNERS b/tests/libcore/luni/OWNERS
deleted file mode 100644
index 7b5c0ad..0000000
--- a/tests/libcore/luni/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-# NOTE: Each source root in CTS should have an OWNERS file as a reminder to
-# add owners to it. It's okay for this file to be empty because the parent
-# directory's owners get inherited by default.
diff --git a/tests/libcore/ojluni/Android.bp b/tests/libcore/ojluni/Android.bp
new file mode 100644
index 0000000..6232e47
--- /dev/null
+++ b/tests/libcore/ojluni/Android.bp
@@ -0,0 +1,39 @@
+// Copyright (C) 2016 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.
+
+android_test {
+    name: "CtsLibcoreOjTestCases",
+    defaults: ["cts_support_defaults"],
+    platform_apis: true,
+    static_libs: ["core-ojtests-public"],
+    libs: ["testng"],
+    dxflags: ["--core-library"],
+    dex_preopt: {
+        enabled: false,
+    },
+    optimize: {
+        enabled: false,
+    },
+    // Include both the 32 and 64 bit versions of libjavacoretests,
+    // where applicable.
+    compile_multilib: "both",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+	"mts",
+    ],
+    java_resources: [":libcore-expectations-knownfailures"],
+}
diff --git a/tests/libcore/ojluni/Android.mk b/tests/libcore/ojluni/Android.mk
deleted file mode 100644
index 437488e..0000000
--- a/tests/libcore/ojluni/Android.mk
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_PACKAGE_NAME := CtsLibcoreOjTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    core-ojtests-public
-
-LOCAL_JAVA_LIBRARIES := testng
-
-LOCAL_DX_FLAGS := --core-library
-
-# Don't include this package in any target
-LOCAL_MODULE_TAGS := tests
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-LOCAL_JACK_FLAGS := --multi-dex native
-
-# Keep META-INF/ resources from LOCAL_STATIC_JAVA_LIBRARIES. http://b/62231394
-LOCAL_DONT_DELETE_JAR_META_INF := true
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-# Include both the 32 and 64 bit versions of libjavacoretests,
-# where applicable.
-LOCAL_MULTILIB := both
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests mts
-
-LOCAL_JAVA_RESOURCE_FILES := libcore/expectations/knownfailures.txt
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/libcore/ojluni/OWNERS b/tests/libcore/ojluni/OWNERS
deleted file mode 100644
index 7b5c0ad..0000000
--- a/tests/libcore/ojluni/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-# NOTE: Each source root in CTS should have an OWNERS file as a reminder to
-# add owners to it. It's okay for this file to be empty because the parent
-# directory's owners get inherited by default.
diff --git a/tests/libcore/okhttp/Android.bp b/tests/libcore/okhttp/Android.bp
new file mode 100644
index 0000000..511e28a
--- /dev/null
+++ b/tests/libcore/okhttp/Android.bp
@@ -0,0 +1,42 @@
+// Copyright (C) 2016 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.
+
+android_test {
+    name: "CtsLibcoreOkHttpTestCases",
+    defaults: ["cts_support_defaults"],
+    platform_apis: true,
+    static_libs: [
+        "bouncycastle-unbundled",
+        "cts-core-test-runner-axt",
+        "okhttp-nojarjar",
+        "okhttp-tests-nojarjar",
+    ],
+    dex_preopt: {
+        enabled: false,
+    },
+    optimize: {
+        enabled: false,
+    },
+    // Include both the 32 and 64 bit versions of libjavacoretests,
+    // where applicable.
+    compile_multilib: "both",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "general-tests",
+        "mts",
+        "vts",
+    ],
+    java_resources: [":libcore-expectations-knownfailures"],
+}
diff --git a/tests/libcore/okhttp/Android.mk b/tests/libcore/okhttp/Android.mk
deleted file mode 100644
index 2088f74..0000000
--- a/tests/libcore/okhttp/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_PACKAGE_NAME := CtsLibcoreOkHttpTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    bouncycastle-unbundled \
-    cts-core-test-runner-axt \
-    okhttp-nojarjar \
-    okhttp-tests-nojarjar
-
-# Don't include this package in any target
-LOCAL_MODULE_TAGS := tests
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-LOCAL_JACK_FLAGS := --multi-dex native
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-# Include both the 32 and 64 bit versions of libjavacoretests,
-# where applicable.
-LOCAL_MULTILIB := both
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests mts
-
-LOCAL_JAVA_RESOURCE_FILES := libcore/expectations/knownfailures.txt
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/libcore/okhttp/OWNERS b/tests/libcore/okhttp/OWNERS
deleted file mode 100644
index 7b5c0ad..0000000
--- a/tests/libcore/okhttp/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-# NOTE: Each source root in CTS should have an OWNERS file as a reminder to
-# add owners to it. It's okay for this file to be empty because the parent
-# directory's owners get inherited by default.
diff --git a/tests/libcore/runner/Android.bp b/tests/libcore/runner/Android.bp
new file mode 100644
index 0000000..3edbe3f
--- /dev/null
+++ b/tests/libcore/runner/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsLibcoreTestRunner",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "test_current",
+    static_libs: ["cts-core-test-runner-axt"],
+    dex_preopt: {
+        enabled: false,
+    },
+    optimize: {
+        enabled: false,
+    },
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+	"mts",
+    ],
+}
diff --git a/tests/libcore/runner/Android.mk b/tests/libcore/runner/Android.mk
deleted file mode 100644
index c260de7..0000000
--- a/tests/libcore/runner/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_PACKAGE_NAME := CtsLibcoreTestRunner
-LOCAL_SDK_VERSION := current
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    cts-core-test-runner-axt
-
-# Don't include this package in any target
-LOCAL_MODULE_TAGS := tests
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-LOCAL_JACK_FLAGS := --multi-dex native
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests mts
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/libcore/runner/OWNERS b/tests/libcore/runner/OWNERS
deleted file mode 100644
index 7b5c0ad..0000000
--- a/tests/libcore/runner/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-# NOTE: Each source root in CTS should have an OWNERS file as a reminder to
-# add owners to it. It's okay for this file to be empty because the parent
-# directory's owners get inherited by default.
diff --git a/tests/libcore/wycheproof-bc/Android.bp b/tests/libcore/wycheproof-bc/Android.bp
new file mode 100644
index 0000000..f719b1a
--- /dev/null
+++ b/tests/libcore/wycheproof-bc/Android.bp
@@ -0,0 +1,39 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsLibcoreWycheproofBCTestCases",
+    defaults: ["cts_support_defaults"],
+    platform_apis: true,
+    static_libs: [
+        "cts-core-test-runner-axt",
+        "wycheproof",
+    ],
+    srcs: ["src/**/*.java"],
+    dex_preopt: {
+        enabled: false,
+    },
+    optimize: {
+        enabled: false,
+    },
+    // Include both the 32 and 64 bit versions of libjavacoretests,
+    // where applicable.
+    compile_multilib: "both",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+    ],
+    java_resources: [":libcore-expectations-knownfailures"],
+}
diff --git a/tests/libcore/wycheproof-bc/Android.mk b/tests/libcore/wycheproof-bc/Android.mk
deleted file mode 100644
index 832a155..0000000
--- a/tests/libcore/wycheproof-bc/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsLibcoreWycheproofBCTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    cts-core-test-runner-axt \
-    wycheproof
-
-# Don't include this package in any target
-LOCAL_MODULE_TAGS := tests
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under,src)
-
-LOCAL_DEX_PREOPT := false
-LOCAL_JACK_FLAGS := --multi-dex native
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-# Include both the 32 and 64 bit versions of libjavacoretests,
-# where applicable.
-LOCAL_MULTILIB := both
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-
-LOCAL_JAVA_RESOURCE_FILES := libcore/expectations/knownfailures.txt
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/libcore/wycheproof-bc/OWNERS b/tests/libcore/wycheproof-bc/OWNERS
deleted file mode 100644
index 7b5c0ad..0000000
--- a/tests/libcore/wycheproof-bc/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-# NOTE: Each source root in CTS should have an OWNERS file as a reminder to
-# add owners to it. It's okay for this file to be empty because the parent
-# directory's owners get inherited by default.
diff --git a/tests/libcore/wycheproof/Android.bp b/tests/libcore/wycheproof/Android.bp
new file mode 100644
index 0000000..3a9eb28
--- /dev/null
+++ b/tests/libcore/wycheproof/Android.bp
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsLibcoreWycheproofConscryptTestCases",
+    defaults: ["cts_support_defaults"],
+    platform_apis: true,
+    static_libs: [
+        "cts-core-test-runner-axt",
+        "wycheproof",
+    ],
+    srcs: ["src/**/*.java"],
+    dex_preopt: {
+        enabled: false,
+    },
+    optimize: {
+        enabled: false,
+    },
+    // Include both the 32 and 64 bit versions of libjavacoretests,
+    // where applicable.
+    compile_multilib: "both",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    java_resources: [":libcore-expectations-knownfailures"],
+}
diff --git a/tests/libcore/wycheproof/Android.mk b/tests/libcore/wycheproof/Android.mk
deleted file mode 100644
index 0f8fdbf..0000000
--- a/tests/libcore/wycheproof/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsLibcoreWycheproofConscryptTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    cts-core-test-runner-axt \
-    wycheproof
-
-# Don't include this package in any target
-LOCAL_MODULE_TAGS := tests
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under,src)
-
-LOCAL_DEX_PREOPT := false
-LOCAL_JACK_FLAGS := --multi-dex native
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-# Include both the 32 and 64 bit versions of libjavacoretests,
-# where applicable.
-LOCAL_MULTILIB := both
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_JAVA_RESOURCE_FILES := libcore/expectations/knownfailures.txt
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/libcore/wycheproof/OWNERS b/tests/libcore/wycheproof/OWNERS
deleted file mode 100644
index 7b5c0ad..0000000
--- a/tests/libcore/wycheproof/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-# NOTE: Each source root in CTS should have an OWNERS file as a reminder to
-# add owners to it. It's okay for this file to be empty because the parent
-# directory's owners get inherited by default.
diff --git a/tests/mocking/Android.mk b/tests/mocking/Android.mk
deleted file mode 100644
index cfd03be..0000000
--- a/tests/mocking/Android.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/mocking/extended/Android.bp b/tests/mocking/extended/Android.bp
new file mode 100644
index 0000000..c60f0a3
--- /dev/null
+++ b/tests/mocking/extended/Android.bp
@@ -0,0 +1,43 @@
+// Copyright (C) 2017 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.
+
+// NOTE: when converting this file to Android.bp, verify that
+// 'atest CtsExtendedMockingTestCases' succeeds.
+
+android_test_helper_app {
+    name: "CtsExtendedMockingTestCases",
+    defaults: ["cts_defaults"],
+    libs: ["android.test.runner.stubs"],
+    static_libs: [
+        "mockito-target-extended",
+        "androidx.test.rules",
+        "ctstestrunner-axt",
+        "dexmaker-mockmaker-tests",
+        "dexmaker-inline-mockmaker-tests",
+        "dexmaker-extended-mockmaker-tests",
+        "android-support-v4",
+    ],
+    compile_multilib: "both",
+    jni_libs: [
+        "libdexmakerjvmtiagent",
+        "libmultiplejvmtiagentsinterferenceagent",
+        "libstaticjvmtiagent",
+    ],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/tests/mocking/extended/Android.mk b/tests/mocking/extended/Android.mk
deleted file mode 100644
index 39c4dd2..0000000
--- a/tests/mocking/extended/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2017 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.
-
-# NOTE: when converting this file to Android.bp, verify that
-# 'atest CtsExtendedMockingTestCases' succeeds.
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := \
-    tests
-LOCAL_JAVA_LIBRARIES := \
-    android.test.runner.stubs
-LOCAL_STATIC_JAVA_LIBRARIES = \
-    mockito-target-extended \
-    androidx.test.rules \
-    ctstestrunner-axt \
-    dexmaker-mockmaker-tests \
-    dexmaker-inline-mockmaker-tests \
-    dexmaker-extended-mockmaker-tests \
-    android-support-v4
-LOCAL_MULTILIB := \
-    both
-LOCAL_JNI_SHARED_LIBRARIES := \
-    libdexmakerjvmtiagent \
-    libmultiplejvmtiagentsinterferenceagent \
-    libstaticjvmtiagent
-LOCAL_COMPATIBILITY_SUITE := \
-    cts vts general-tests
-LOCAL_PACKAGE_NAME := \
-    CtsExtendedMockingTestCases
-LOCAL_SDK_VERSION := \
-    current
-include $(BUILD_CTS_PACKAGE)
-
diff --git a/tests/netsecpolicy/Android.bp b/tests/netsecpolicy/Android.bp
new file mode 100644
index 0000000..1dbfe9f
--- /dev/null
+++ b/tests/netsecpolicy/Android.bp
@@ -0,0 +1,54 @@
+// Copyright (C) 2015 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.
+android_test {
+    name: "CtsNetSecPolicyUsesCleartextTrafficFalse",
+    defaults: ["cts_support_defaults"],
+    srcs: ["usescleartexttraffic-shared/src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+    manifest: "usescleartexttraffic-false/AndroidManifest.xml",
+}
+
+android_test {
+    name: "CtsNetSecPolicyUsesCleartextTrafficTrue",
+    defaults: ["cts_support_defaults"],
+    srcs: ["usescleartexttraffic-shared/src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+    manifest: "usescleartexttraffic-true/AndroidManifest.xml",
+}
+
+android_test {
+    name: "CtsNetSecPolicyUsesCleartextTrafficUnspecified",
+    defaults: ["cts_support_defaults"],
+    srcs: ["usescleartexttraffic-shared/src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+    manifest: "usescleartexttraffic-unspecified/AndroidManifest.xml",
+}
diff --git a/tests/netsecpolicy/Android.mk b/tests/netsecpolicy/Android.mk
deleted file mode 100644
index 137672e..0000000
--- a/tests/netsecpolicy/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2015 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 $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/netsecpolicy/usescleartexttraffic-false/Android.mk b/tests/netsecpolicy/usescleartexttraffic-false/Android.mk
deleted file mode 100644
index 34422f8..0000000
--- a/tests/netsecpolicy/usescleartexttraffic-false/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, \
-    ../usescleartexttraffic-shared/src)
-
-LOCAL_PACKAGE_NAME := CtsNetSecPolicyUsesCleartextTrafficFalse
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/netsecpolicy/usescleartexttraffic-true/Android.mk b/tests/netsecpolicy/usescleartexttraffic-true/Android.mk
deleted file mode 100644
index efabeb2..0000000
--- a/tests/netsecpolicy/usescleartexttraffic-true/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, \
-    ../usescleartexttraffic-shared/src)
-
-LOCAL_PACKAGE_NAME := CtsNetSecPolicyUsesCleartextTrafficTrue
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.mk b/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.mk
deleted file mode 100644
index 9960bca..0000000
--- a/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, \
-    ../usescleartexttraffic-shared/src)
-
-LOCAL_PACKAGE_NAME := CtsNetSecPolicyUsesCleartextTrafficUnspecified
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/security/src/android/keystore/cts/Attestation.java b/tests/security/src/android/keystore/cts/Attestation.java
index aeaf4ab..bdfe00a 100644
--- a/tests/security/src/android/keystore/cts/Attestation.java
+++ b/tests/security/src/android/keystore/cts/Attestation.java
@@ -132,7 +132,7 @@
 
         s.append("\nChallenge");
         String stringChallenge = new String(attestationChallenge);
-        if (CharMatcher.ASCII.matchesAllOf(stringChallenge)) {
+        if (CharMatcher.ascii().matchesAllOf(stringChallenge)) {
             s.append(": [" + stringChallenge + "]");
         } else {
             s.append(" (base64): [" + BaseEncoding.base64().encode(attestationChallenge) + "]");
diff --git a/tests/signature/Android.bp b/tests/signature/Android.bp
index 21344ea..5cadd88 100644
--- a/tests/signature/Android.bp
+++ b/tests/signature/Android.bp
@@ -14,6 +14,9 @@
 
 // Compat.
 java_library_host {
-  name: "signature-hostside",
-  static_libs: ["signature-common-javalib"],
+    name: "signature-hostside",
+    visibility: [
+        "//cts/tests/signature/tests",
+    ],
+    static_libs: ["signature-common-javalib"],
 }
diff --git a/tests/signature/TEST_MAPPING b/tests/signature/TEST_MAPPING
index 58ce1b0..dc92081 100644
--- a/tests/signature/TEST_MAPPING
+++ b/tests/signature/TEST_MAPPING
@@ -25,28 +25,22 @@
       "name": "CtsApacheHttpLegacyUsesLibraryApiSignatureTestCases"
     },
     {
-      "name": "CtsHiddenApiBlacklistApi27TestCases"
+      "name": "CtsIntentSignatureTestCases"
     },
     {
-      "name": "CtsHiddenApiBlacklistCurrentApiTestCases"
+        "name": "CtsHiddenApiKillswitchDebugClassTestCases"
     },
     {
-      "name": "CtsHiddenApiBlacklistDebugClassTestCases"
+        "name": "CtsHiddenApiKillswitchWhitelistTestCases"
     },
     {
-      "name": "CtsHiddenApiKillswitchDebugClassTestCases"
+        "name": "CtsHiddenApiKillswitchWildcardTestCases"
     },
     {
-      "name": "CtsHiddenApiKillswitchWhitelistTestCases"
+        "name": "CtsSystemApiAnnotationTestCases"
     },
     {
-      "name": "CtsHiddenApiKillswitchWildcardTestCases"
-    },
-    {
-      "name": "CtsSystemApiAnnotationTestCases"
-    },
-    {
-      "name": "CtsHiddenApiBlacklistApi28TestCases"
+        "name": "CtsSystemApiSignatureTestCases"
     },
     {
       "name": "CtsSharedLibsApiSignatureTestCases"
@@ -55,6 +49,20 @@
       "name": "signature-host-tests",
       "host" : true
     }
+  ],
+  "postsubmit": [
+    {
+      "name": "CtsHiddenApiBlacklistApi27TestCases"
+    },
+    {
+        "name": "CtsHiddenApiBlacklistApi28TestCases"
+    },
+    {
+      "name": "CtsHiddenApiBlacklistCurrentApiTestCases"
+    },
+    {
+      "name": "CtsHiddenApiBlacklistDebugClassTestCases"
+    }
   ]
 }
 
diff --git a/tests/signature/api-check/Android.bp b/tests/signature/api-check/Android.bp
index e66d8fe..ceb82a4 100644
--- a/tests/signature/api-check/Android.bp
+++ b/tests/signature/api-check/Android.bp
@@ -31,3 +31,56 @@
         "repackaged.android.test.runner",
     ],
 }
+
+// Defaults for signature api checks.
+java_defaults {
+    name: "signature-api-check-defaults",
+    defaults: ["cts_defaults"],
+    srcs: [
+        "src/**/*.java",
+    ],
+    static_libs: [
+        "cts-api-signature-test",
+    ],
+    jni_libs: [
+        "libclassdescriptors",
+    ],
+    sdk_version: "test_current",
+    compile_multilib: "both",
+}
+
+// Defaults for hiddenapi killswitch checks.
+java_defaults {
+    name: "hiddenapi-killswitch-check-defaults",
+    defaults: ["cts_defaults"],
+
+    compile_multilib: "both",
+    jni_libs: [
+        "libcts_dexchecker",
+        "libclassdescriptors",
+    ],
+    stl: "c++_static",
+
+    // Tag this module as a cts test artifact
+    sdk_version: "test_current",
+    static_libs: ["cts-api-signature-test"],
+}
+
+// Access the hiddenapi-flags.csv file produced by the build.
+hiddenapi_flags {
+    name: "cts-hiddenapi-flags-csv",
+    filename: "hiddenapi-flags.csv",
+}
+
+// Defaults for hiddenapi blacklist checks.
+java_defaults {
+    name: "hiddenapi-blacklist-check-defaults",
+    defaults: ["signature-api-check-defaults"],
+    java_resources: [
+        ":cts-hiddenapi-flags-csv",
+    ],
+    jni_libs: [
+        "libcts_dexchecker",
+    ],
+}
+
diff --git a/tests/signature/api-check/Android.mk b/tests/signature/api-check/Android.mk
index d5b0be2..337f5b9 100644
--- a/tests/signature/api-check/Android.mk
+++ b/tests/signature/api-check/Android.mk
@@ -12,18 +12,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-LOCAL_PATH := $(call my-dir)
-
-# hidden API lists
-# ===================================
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := cts-hiddenapi_flags-csv
-LOCAL_MODULE_STEM := hiddenapi_flags.csv
-LOCAL_MODULE_CLASS := ETC
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-include $(BUILD_SYSTEM)/base_rules.mk
-$(eval $(call copy-one-file,$(INTERNAL_PLATFORM_HIDDENAPI_FLAGS),$(LOCAL_BUILT_MODULE)))
-
-
+LOCAL_PATH:= $(call my-dir)
 include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/signature/api-check/android-test-base-28-api/Android.bp b/tests/signature/api-check/android-test-base-28-api/Android.bp
new file mode 100644
index 0000000..565aad3
--- /dev/null
+++ b/tests/signature/api-check/android-test-base-28-api/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsAndroidTestBase28ApiSignatureTestCases",
+    defaults: [
+        "signature-api-check-defaults",
+    ],
+    java_resources: [
+        ":cts-android-test-base-current-txt",
+    ],
+    min_sdk_version: "27",
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/android-test-base-28-api/Android.mk b/tests/signature/api-check/android-test-base-28-api/Android.mk
deleted file mode 100644
index 02f3a50..0000000
--- a/tests/signature/api-check/android-test-base-28-api/Android.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsAndroidTestBase28ApiSignatureTestCases
-
-LOCAL_SIGNATURE_API_FILES := \
-    android-test-base-current.api \
-
-LOCAL_MIN_SDK_VERSION := 25
-LOCAL_SDK_VERSION := 28
-
-include $(LOCAL_PATH)/../build_signature_apk.mk
diff --git a/tests/signature/api-check/android-test-base-28-api/AndroidManifest.xml b/tests/signature/api-check/android-test-base-28-api/AndroidManifest.xml
index e5f1269..dd67533 100644
--- a/tests/signature/api-check/android-test-base-28-api/AndroidManifest.xml
+++ b/tests/signature/api-check/android-test-base-28-api/AndroidManifest.xml
@@ -16,11 +16,12 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.android_test_base_28">
+          package="android.signature.cts.api.android_test_base_28"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
-    <uses-sdk android:minSdkVersion="25" android:targetSdkVersion="28"/>
+    <uses-sdk android:minSdkVersion="27" android:targetSdkVersion="28"/>
 
     <application android:debuggable="true"
                  android:extractNativeLibs="true"
diff --git a/tests/signature/api-check/android-test-base-28-api/AndroidTest.xml b/tests/signature/api-check/android-test-base-28-api/AndroidTest.xml
index cb418e7..4024e9d 100644
--- a/tests/signature/api-check/android-test-base-28-api/AndroidTest.xml
+++ b/tests/signature/api-check/android-test-base-28-api/AndroidTest.xml
@@ -16,15 +16,8 @@
 <configuration description="Config for CTS Android Test Base 28 API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="android-test-base-current.api->/data/local/tmp/signature-test/android-test-base-current.api" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsAndroidTestBase28ApiSignatureTestCases.apk" />
@@ -33,7 +26,7 @@
         <option name="package" value="android.signature.cts.api.android_test_base_28" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.api28.test.SignatureTest" />
-        <option name="instrumentation-arg" key="expected-api-files" value="android-test-base-current.api" />
+        <option name="instrumentation-arg" key="expected-api-files" value="android-test-base-current.txt" />
         <option name="runtime-hint" value="5s" />
     </test>
 </configuration>
diff --git a/tests/signature/api-check/android-test-base-28-api/OWNERS b/tests/signature/api-check/android-test-base-28-api/OWNERS
new file mode 100644
index 0000000..aaadab7
--- /dev/null
+++ b/tests/signature/api-check/android-test-base-28-api/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 24949
+include ../android-test-base-current-api/OWNERS
diff --git a/tests/signature/api-check/android-test-base-current-api/Android.bp b/tests/signature/api-check/android-test-base-current-api/Android.bp
new file mode 100644
index 0000000..8ddb74f
--- /dev/null
+++ b/tests/signature/api-check/android-test-base-current-api/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsAndroidTestBaseCurrentApiSignatureTestCases",
+    defaults: [
+        "signature-api-check-defaults",
+    ],
+    java_resources: [
+        ":cts-android-test-base-current-txt",
+    ],
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/android-test-base-current-api/Android.mk b/tests/signature/api-check/android-test-base-current-api/Android.mk
deleted file mode 100644
index 240f087..0000000
--- a/tests/signature/api-check/android-test-base-current-api/Android.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsAndroidTestBaseCurrentApiSignatureTestCases
-
-LOCAL_SIGNATURE_API_FILES := \
-    android-test-base-current.api \
-
-include $(LOCAL_PATH)/../build_signature_apk.mk
diff --git a/tests/signature/api-check/android-test-base-current-api/AndroidManifest.xml b/tests/signature/api-check/android-test-base-current-api/AndroidManifest.xml
index 44e6018..1467a63 100644
--- a/tests/signature/api-check/android-test-base-current-api/AndroidManifest.xml
+++ b/tests/signature/api-check/android-test-base-current-api/AndroidManifest.xml
@@ -16,7 +16,8 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.android_test_base_current">
+          package="android.signature.cts.api.android_test_base_current"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
diff --git a/tests/signature/api-check/android-test-base-current-api/AndroidTest.xml b/tests/signature/api-check/android-test-base-current-api/AndroidTest.xml
index 49ac0a7..d0756b9 100644
--- a/tests/signature/api-check/android-test-base-current-api/AndroidTest.xml
+++ b/tests/signature/api-check/android-test-base-current-api/AndroidTest.xml
@@ -16,15 +16,8 @@
 <configuration description="Config for CTS Android Test Base Current API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="android-test-base-current.api->/data/local/tmp/signature-test/android-test-base-current.api" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsAndroidTestBaseCurrentApiSignatureTestCases.apk" />
@@ -33,7 +26,7 @@
         <option name="package" value="android.signature.cts.api.android_test_base_current" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.current.test.SignatureTest" />
-        <option name="instrumentation-arg" key="expected-api-files" value="android-test-base-current.api" />
+        <option name="instrumentation-arg" key="expected-api-files" value="android-test-base-current.txt" />
         <option name="runtime-hint" value="5s" />
     </test>
 </configuration>
diff --git a/tests/signature/api-check/android-test-base-current-api/OWNERS b/tests/signature/api-check/android-test-base-current-api/OWNERS
index 7841a94..682d0b0 100644
--- a/tests/signature/api-check/android-test-base-current-api/OWNERS
+++ b/tests/signature/api-check/android-test-base-current-api/OWNERS
@@ -1,2 +1,4 @@
 # Bug component: 24949
-paulduffin@google.com
\ No newline at end of file
+paulduffin@google.com
+jiyong@google.com
+tnorbye@google.com
diff --git a/tests/signature/api-check/android-test-mock-current-api/Android.bp b/tests/signature/api-check/android-test-mock-current-api/Android.bp
new file mode 100644
index 0000000..e836409
--- /dev/null
+++ b/tests/signature/api-check/android-test-mock-current-api/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsAndroidTestMockCurrentApiSignatureTestCases",
+    defaults: [
+        "signature-api-check-defaults",
+    ],
+    java_resources: [
+        ":cts-android-test-mock-current-txt",
+    ],
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/android-test-mock-current-api/Android.mk b/tests/signature/api-check/android-test-mock-current-api/Android.mk
deleted file mode 100644
index b60f6a3..0000000
--- a/tests/signature/api-check/android-test-mock-current-api/Android.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsAndroidTestMockCurrentApiSignatureTestCases
-
-LOCAL_SIGNATURE_API_FILES := \
-    android-test-mock-current.api \
-
-include $(LOCAL_PATH)/../build_signature_apk.mk
diff --git a/tests/signature/api-check/android-test-mock-current-api/AndroidManifest.xml b/tests/signature/api-check/android-test-mock-current-api/AndroidManifest.xml
index 4269669..8a4dcdc 100644
--- a/tests/signature/api-check/android-test-mock-current-api/AndroidManifest.xml
+++ b/tests/signature/api-check/android-test-mock-current-api/AndroidManifest.xml
@@ -16,7 +16,8 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.android_test_mock_current">
+          package="android.signature.cts.api.android_test_mock_current"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
diff --git a/tests/signature/api-check/android-test-mock-current-api/AndroidTest.xml b/tests/signature/api-check/android-test-mock-current-api/AndroidTest.xml
index e90984d..fccf9c7 100644
--- a/tests/signature/api-check/android-test-mock-current-api/AndroidTest.xml
+++ b/tests/signature/api-check/android-test-mock-current-api/AndroidTest.xml
@@ -16,15 +16,8 @@
 <configuration description="Config for CTS Android Test Mock Current API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="android-test-mock-current.api->/data/local/tmp/signature-test/android-test-mock-current.api" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsAndroidTestMockCurrentApiSignatureTestCases.apk" />
@@ -33,7 +26,7 @@
         <option name="package" value="android.signature.cts.api.android_test_mock_current" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.current.mock.SignatureTest" />
-        <option name="instrumentation-arg" key="expected-api-files" value="android-test-mock-current.api" />
+        <option name="instrumentation-arg" key="expected-api-files" value="android-test-mock-current.txt" />
         <option name="runtime-hint" value="5s" />
     </test>
 </configuration>
diff --git a/tests/signature/api-check/android-test-runner-current-api/Android.bp b/tests/signature/api-check/android-test-runner-current-api/Android.bp
new file mode 100644
index 0000000..2a6dd7d
--- /dev/null
+++ b/tests/signature/api-check/android-test-runner-current-api/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsAndroidTestRunnerCurrentApiSignatureTestCases",
+    defaults: [
+        "signature-api-check-defaults",
+    ],
+    java_resources: [
+        ":cts-android-test-base-current-txt",
+        ":cts-android-test-mock-current-txt",
+        ":cts-android-test-runner-current-txt",
+    ],
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/android-test-runner-current-api/Android.mk b/tests/signature/api-check/android-test-runner-current-api/Android.mk
deleted file mode 100644
index 9f0aad4..0000000
--- a/tests/signature/api-check/android-test-runner-current-api/Android.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsAndroidTestRunnerCurrentApiSignatureTestCases
-
-LOCAL_SIGNATURE_API_FILES := \
-    android-test-base-current.api \
-    android-test-mock-current.api \
-    android-test-runner-current.api \
-
-include $(LOCAL_PATH)/../build_signature_apk.mk
diff --git a/tests/signature/api-check/android-test-runner-current-api/AndroidManifest.xml b/tests/signature/api-check/android-test-runner-current-api/AndroidManifest.xml
index 8bbf07e..fd030be 100644
--- a/tests/signature/api-check/android-test-runner-current-api/AndroidManifest.xml
+++ b/tests/signature/api-check/android-test-runner-current-api/AndroidManifest.xml
@@ -16,7 +16,8 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.android_test_runner_current">
+          package="android.signature.cts.api.android_test_runner_current"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
diff --git a/tests/signature/api-check/android-test-runner-current-api/AndroidTest.xml b/tests/signature/api-check/android-test-runner-current-api/AndroidTest.xml
index e2cb9e0..77809ba 100644
--- a/tests/signature/api-check/android-test-runner-current-api/AndroidTest.xml
+++ b/tests/signature/api-check/android-test-runner-current-api/AndroidTest.xml
@@ -16,21 +16,8 @@
 <configuration description="Config for CTS Android Test Runner Current API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="android-test-base-current.api->/data/local/tmp/signature-test/android-test-base-current.api" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="android-test-mock-current.api->/data/local/tmp/signature-test/android-test-mock-current.api" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="android-test-runner-current.api->/data/local/tmp/signature-test/android-test-runner-current.api" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsAndroidTestRunnerCurrentApiSignatureTestCases.apk" />
@@ -39,7 +26,7 @@
         <option name="package" value="android.signature.cts.api.android_test_runner_current" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.current.runner.SignatureTest" />
-        <option name="instrumentation-arg" key="expected-api-files" value="android-test-base-current.api,android-test-mock-current.api,android-test-runner-current.api" />
+        <option name="instrumentation-arg" key="expected-api-files" value="android-test-base-current.txt,android-test-mock-current.txt,android-test-runner-current.txt" />
         <option name="runtime-hint" value="5s" />
     </test>
 </configuration>
diff --git a/tests/signature/api-check/android-test-runner-current-api/OWNERS b/tests/signature/api-check/android-test-runner-current-api/OWNERS
new file mode 100644
index 0000000..aaadab7
--- /dev/null
+++ b/tests/signature/api-check/android-test-runner-current-api/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 24949
+include ../android-test-base-current-api/OWNERS
diff --git a/tests/signature/api-check/apache-http-legacy-27-api/Android.bp b/tests/signature/api-check/apache-http-legacy-27-api/Android.bp
new file mode 100644
index 0000000..0c53a34
--- /dev/null
+++ b/tests/signature/api-check/apache-http-legacy-27-api/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsApacheHttpLegacy27ApiSignatureTestCases",
+    defaults: [
+        "signature-api-check-defaults",
+    ],
+    java_resources: [
+        ":cts-current-txt",
+        ":cts-apache-http-legacy-current-txt",
+    ],
+    min_sdk_version: "27",
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/apache-http-legacy-27-api/Android.mk b/tests/signature/api-check/apache-http-legacy-27-api/Android.mk
deleted file mode 100644
index 906dda8..0000000
--- a/tests/signature/api-check/apache-http-legacy-27-api/Android.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsApacheHttpLegacy27ApiSignatureTestCases
-
-LOCAL_SIGNATURE_API_FILES := \
-    current.api \
-    apache-http-legacy-current.api \
-
-LOCAL_MIN_SDK_VERSION := 22
-
-include $(LOCAL_PATH)/../build_signature_apk.mk
diff --git a/tests/signature/api-check/apache-http-legacy-27-api/AndroidManifest.xml b/tests/signature/api-check/apache-http-legacy-27-api/AndroidManifest.xml
index 8044d4b..4f32045 100644
--- a/tests/signature/api-check/apache-http-legacy-27-api/AndroidManifest.xml
+++ b/tests/signature/api-check/apache-http-legacy-27-api/AndroidManifest.xml
@@ -16,11 +16,12 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.apache_http_legacy_27">
+          package="android.signature.cts.api.apache_http_legacy_27"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
-    <uses-sdk android:minSdkVersion="22" android:targetSdkVersion="27"/>
+    <uses-sdk android:minSdkVersion="27" android:targetSdkVersion="27"/>
 
     <application android:extractNativeLibs="true" android:largeHeap="true"/>
 
diff --git a/tests/signature/api-check/apache-http-legacy-27-api/AndroidTest.xml b/tests/signature/api-check/apache-http-legacy-27-api/AndroidTest.xml
index 7c0a7fc..828926f 100644
--- a/tests/signature/api-check/apache-http-legacy-27-api/AndroidTest.xml
+++ b/tests/signature/api-check/apache-http-legacy-27-api/AndroidTest.xml
@@ -16,18 +16,8 @@
 <configuration description="Config for CTS Apache Http Legacy 27 API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="current.api->/data/local/tmp/signature-test/current.api" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="apache-http-legacy-current.api->/data/local/tmp/signature-test/apache-http-legacy-current.api" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsApacheHttpLegacy27ApiSignatureTestCases.apk" />
@@ -36,8 +26,8 @@
         <option name="package" value="android.signature.cts.api.apache_http_legacy_27" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.api27.http.SignatureTest" />
-        <option name="instrumentation-arg" key="base-api-files" value="current.api" />
-        <option name="instrumentation-arg" key="expected-api-files" value="apache-http-legacy-current.api" />
+        <option name="instrumentation-arg" key="base-api-files" value="current.txt" />
+        <option name="instrumentation-arg" key="expected-api-files" value="apache-http-legacy-current.txt" />
         <option name="runtime-hint" value="5s" />
     </test>
 </configuration>
diff --git a/tests/signature/api-check/apache-http-legacy-current-api/Android.bp b/tests/signature/api-check/apache-http-legacy-current-api/Android.bp
new file mode 100644
index 0000000..e589ab3
--- /dev/null
+++ b/tests/signature/api-check/apache-http-legacy-current-api/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsApacheHttpLegacyCurrentApiSignatureTestCases",
+    defaults: [
+        "signature-api-check-defaults",
+    ],
+    java_resources: [
+        ":cts-apache-http-legacy-current-txt",
+    ],
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/apache-http-legacy-current-api/Android.mk b/tests/signature/api-check/apache-http-legacy-current-api/Android.mk
deleted file mode 100644
index df69004..0000000
--- a/tests/signature/api-check/apache-http-legacy-current-api/Android.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsApacheHttpLegacyCurrentApiSignatureTestCases
-
-LOCAL_SIGNATURE_API_FILES := \
-    apache-http-legacy-current.api \
-
-include $(LOCAL_PATH)/../build_signature_apk.mk
diff --git a/tests/signature/api-check/apache-http-legacy-current-api/AndroidManifest.xml b/tests/signature/api-check/apache-http-legacy-current-api/AndroidManifest.xml
index b50d47e..7e75171 100644
--- a/tests/signature/api-check/apache-http-legacy-current-api/AndroidManifest.xml
+++ b/tests/signature/api-check/apache-http-legacy-current-api/AndroidManifest.xml
@@ -16,7 +16,8 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.apache_http_legacy_current">
+          package="android.signature.cts.api.apache_http_legacy_current"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
diff --git a/tests/signature/api-check/apache-http-legacy-current-api/AndroidTest.xml b/tests/signature/api-check/apache-http-legacy-current-api/AndroidTest.xml
index 0e1559e..4b0df13 100644
--- a/tests/signature/api-check/apache-http-legacy-current-api/AndroidTest.xml
+++ b/tests/signature/api-check/apache-http-legacy-current-api/AndroidTest.xml
@@ -16,15 +16,8 @@
 <configuration description="Config for CTS Apache Http Legacy Current API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="apache-http-legacy-current.api->/data/local/tmp/signature-test/apache-http-legacy-current.api" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsApacheHttpLegacyCurrentApiSignatureTestCases.apk" />
@@ -33,7 +26,7 @@
         <option name="package" value="android.signature.cts.api.apache_http_legacy_current" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.current.http.SignatureTest" />
-        <option name="instrumentation-arg" key="unexpected-api-files" value="apache-http-legacy-current.api" />
+        <option name="instrumentation-arg" key="unexpected-api-files" value="apache-http-legacy-current.txt" />
         <option name="runtime-hint" value="5s" />
     </test>
 </configuration>
diff --git a/tests/signature/api-check/apache-http-legacy-current-api/OWNERS b/tests/signature/api-check/apache-http-legacy-current-api/OWNERS
new file mode 100644
index 0000000..aaadab7
--- /dev/null
+++ b/tests/signature/api-check/apache-http-legacy-current-api/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 24949
+include ../android-test-base-current-api/OWNERS
diff --git a/tests/signature/api-check/apache-http-legacy-uses-library-api/Android.bp b/tests/signature/api-check/apache-http-legacy-uses-library-api/Android.bp
new file mode 100644
index 0000000..794a952
--- /dev/null
+++ b/tests/signature/api-check/apache-http-legacy-uses-library-api/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsApacheHttpLegacyUsesLibraryApiSignatureTestCases",
+    defaults: [
+        "signature-api-check-defaults",
+    ],
+    java_resources: [
+        ":cts-current-txt",
+        ":cts-apache-http-legacy-current-txt",
+    ],
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/apache-http-legacy-uses-library-api/Android.mk b/tests/signature/api-check/apache-http-legacy-uses-library-api/Android.mk
deleted file mode 100644
index 563f80e..0000000
--- a/tests/signature/api-check/apache-http-legacy-uses-library-api/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsApacheHttpLegacyUsesLibraryApiSignatureTestCases
-
-LOCAL_SIGNATURE_API_FILES := \
-    current.api \
-    apache-http-legacy-current.api \
-
-include $(LOCAL_PATH)/../build_signature_apk.mk
diff --git a/tests/signature/api-check/apache-http-legacy-uses-library-api/AndroidManifest.xml b/tests/signature/api-check/apache-http-legacy-uses-library-api/AndroidManifest.xml
index 6cf150a..cfd69f3 100644
--- a/tests/signature/api-check/apache-http-legacy-uses-library-api/AndroidManifest.xml
+++ b/tests/signature/api-check/apache-http-legacy-uses-library-api/AndroidManifest.xml
@@ -16,7 +16,8 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.apache_http_legacy_uses_library">
+          package="android.signature.cts.api.apache_http_legacy_uses_library"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
diff --git a/tests/signature/api-check/apache-http-legacy-uses-library-api/AndroidTest.xml b/tests/signature/api-check/apache-http-legacy-uses-library-api/AndroidTest.xml
index 8674d5b..f45d52c 100644
--- a/tests/signature/api-check/apache-http-legacy-uses-library-api/AndroidTest.xml
+++ b/tests/signature/api-check/apache-http-legacy-uses-library-api/AndroidTest.xml
@@ -16,18 +16,8 @@
 <configuration description="Config for CTS Apache Http Legacy UsesLibrary API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="current.api->/data/local/tmp/signature-test/current.api" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="apache-http-legacy-current.api->/data/local/tmp/signature-test/apache-http-legacy-current.api" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsApacheHttpLegacyUsesLibraryApiSignatureTestCases.apk" />
@@ -36,8 +26,8 @@
         <option name="package" value="android.signature.cts.api.apache_http_legacy_uses_library" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.http_uses_library.SignatureTest" />
-        <option name="instrumentation-arg" key="base-api-files" value="current.api" />
-        <option name="instrumentation-arg" key="expected-api-files" value="apache-http-legacy-current.api" />
+        <option name="instrumentation-arg" key="base-api-files" value="current.txt" />
+        <option name="instrumentation-arg" key="expected-api-files" value="apache-http-legacy-current.txt" />
         <option name="runtime-hint" value="5s" />
     </test>
 </configuration>
diff --git a/tests/signature/api-check/apache-http-legacy-uses-library-api/OWNERS b/tests/signature/api-check/apache-http-legacy-uses-library-api/OWNERS
new file mode 100644
index 0000000..aaadab7
--- /dev/null
+++ b/tests/signature/api-check/apache-http-legacy-uses-library-api/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 24949
+include ../android-test-base-current-api/OWNERS
diff --git a/tests/signature/api-check/build_signature_apk.mk b/tests/signature/api-check/build_signature_apk.mk
index 8696c4d..98ff55f 100644
--- a/tests/signature/api-check/build_signature_apk.mk
+++ b/tests/signature/api-check/build_signature_apk.mk
@@ -33,35 +33,26 @@
 LOCAL_JNI_SHARED_LIBRARIES += libclassdescriptors
 LOCAL_MULTILIB := both
 
-LOCAL_ADDITIONAL_DEPENDENCIES += \
-    $(addprefix $(COMPATIBILITY_TESTCASES_OUT_cts)/,$(LOCAL_SIGNATURE_API_FILES))
-
 # Add dependencies needed to build/run the test with atest.
 #
-# This is a temporary workaround as described in b/123393637. It adds the dependencies that
-# atest requires for each of the modules specified in the LOCAL_SIGNATURE_API_FILES. The
-# mapping from module name to the dependency is slightly complicated due to inconsistencies
-# in the mapping for the different file types, i.e. .api, .csv and .zip. Those
-# inconsistencies will be resolved by build improvement work mentioned in b/123393637.
-#
 # Converts:
-#     current.api -> $(TARGET_OUT_TESTCASES)/cts-current-api/current.api
-#     hiddenapi_flags.csv -> $(TARGET_OUT_TESTCASES)/cts-hiddenapi_flags-csv/hiddenapi_flags.csv
-#     system-all.api.zip -> $(TARGET_OUT_TESTCASES)/cts-system-all.api/system-all.api.zip
+#     current.api -> $(SOONG_OUT_DIR)/.intermediates/cts/tests/signature/api/cts-current-txt/gen/current.txt
 
-# Construct module name directory from file name, matches behavior in the
-# build_xml_api_file function in ../api/Android.mk plus some extra rules for handling slight
-# inconsistencies with that behavior for the ..all.zip files used by some signature tests.
+# Construct module name directory from file name, matches location of output of genrules
+# in ../api/Android.bp.
 #   Replace . with -
 #   Prefix every entry with cts-
-#   Replace -all-api-zip with -all.api to handle ...all.zip files
 #
 cts_signature_module_deps := $(LOCAL_SIGNATURE_API_FILES)
 cts_signature_module_deps := $(subst .,-,$(cts_signature_module_deps))
 cts_signature_module_deps := $(addprefix cts-,$(cts_signature_module_deps))
-cts_signature_module_deps := $(subst -all-api-zip,-all.api,$(cts_signature_module_deps))
 
-LOCAL_REQUIRED_MODULES := $(cts_signature_module_deps)
+# Construct path to the generated files and add them as java resources.
+cts_signature_module_resources := $(addprefix $(SOONG_OUT_DIR)/.intermediates/cts/tests/signature/api/,$(cts_signature_module_deps))
+cts_signature_module_resources := $(addsuffix /gen/,$(cts_signature_module_resources))
+cts_signature_module_resources := $(join $(cts_signature_module_resources),$(LOCAL_SIGNATURE_API_FILES))
+
+LOCAL_JAVA_RESOURCE_FILES += $(cts_signature_module_resources)
 
 LOCAL_DEX_PREOPT := false
 LOCAL_PROGUARD_ENABLED := disabled
@@ -75,4 +66,5 @@
 include $(BUILD_CTS_PACKAGE)
 
 LOCAL_SIGNATURE_API_FILES :=
+cts_signature_module_resources :=
 cts_signature_module_deps :=
diff --git a/tests/signature/api-check/current-api/Android.bp b/tests/signature/api-check/current-api/Android.bp
new file mode 100644
index 0000000..1ca5d11
--- /dev/null
+++ b/tests/signature/api-check/current-api/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsCurrentApiSignatureTestCases",
+    defaults: [
+        "signature-api-check-defaults",
+    ],
+    java_resources: [
+        ":cts-current-txt",
+        ":cts-android-test-base-current-txt",
+        ":cts-android-test-mock-current-txt",
+        ":cts-android-test-runner-current-txt",
+    ],
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/current-api/Android.mk b/tests/signature/api-check/current-api/Android.mk
deleted file mode 100644
index 31b1229..0000000
--- a/tests/signature/api-check/current-api/Android.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsCurrentApiSignatureTestCases
-
-LOCAL_SIGNATURE_API_FILES := \
-    current.api \
-    android-test-base-current.api \
-    android-test-mock-current.api \
-    android-test-runner-current.api \
-
-include $(LOCAL_PATH)/../build_signature_apk.mk
diff --git a/tests/signature/api-check/current-api/AndroidManifest.xml b/tests/signature/api-check/current-api/AndroidManifest.xml
index ab8b1f6..aa6e6c5 100644
--- a/tests/signature/api-check/current-api/AndroidManifest.xml
+++ b/tests/signature/api-check/current-api/AndroidManifest.xml
@@ -16,7 +16,8 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.current">
+          package="android.signature.cts.api.current"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
diff --git a/tests/signature/api-check/current-api/AndroidTest.xml b/tests/signature/api-check/current-api/AndroidTest.xml
index dc6ded5..d605847 100644
--- a/tests/signature/api-check/current-api/AndroidTest.xml
+++ b/tests/signature/api-check/current-api/AndroidTest.xml
@@ -16,25 +16,9 @@
 <configuration description="Config for CTS Current API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
     <option name="not-shardable" value="true" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="current.api->/data/local/tmp/signature-test/current.api" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="android-test-base-current.api->/data/local/tmp/signature-test/android-test-base-current.api" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="android-test-mock-current.api->/data/local/tmp/signature-test/android-test-mock-current.api" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="android-test-runner-current.api->/data/local/tmp/signature-test/android-test-runner-current.api" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsCurrentApiSignatureTestCases.apk" />
@@ -43,8 +27,8 @@
         <option name="package" value="android.signature.cts.api.current" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.current.SignatureTest" />
-        <option name="instrumentation-arg" key="expected-api-files" value="current.api,android-test-base-current.api" />
-        <option name="instrumentation-arg" key="unexpected-api-files" value="android-test-mock-current.api,android-test-runner-current.api" />
+        <option name="instrumentation-arg" key="expected-api-files" value="current.txt" />
+        <option name="instrumentation-arg" key="unexpected-api-files" value="android-test-base-current.txt,android-test-mock-current.txt,android-test-runner-current.txt" />
         <option name="runtime-hint" value="30s" />
     </test>
 </configuration>
diff --git a/tests/signature/api-check/hidden-api-blacklist-27-api/Android.bp b/tests/signature/api-check/hidden-api-blacklist-27-api/Android.bp
new file mode 100644
index 0000000..7750b14
--- /dev/null
+++ b/tests/signature/api-check/hidden-api-blacklist-27-api/Android.bp
@@ -0,0 +1,28 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsHiddenApiBlacklistApi27TestCases",
+    defaults: [
+        "hiddenapi-blacklist-check-defaults",
+    ],
+    min_sdk_version: "27",
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/hidden-api-blacklist-27-api/Android.mk b/tests/signature/api-check/hidden-api-blacklist-27-api/Android.mk
deleted file mode 100644
index 59f7d6f2..0000000
--- a/tests/signature/api-check/hidden-api-blacklist-27-api/Android.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright (C) 2018 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)
-LOCAL_PACKAGE_NAME := CtsHiddenApiBlacklistApi27TestCases
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_SIGNATURE_API_FILES := hiddenapi_flags.csv
-LOCAL_JNI_SHARED_LIBRARIES := libcts_dexchecker
-include $(LOCAL_PATH)/../build_signature_apk.mk
diff --git a/tests/signature/api-check/hidden-api-blacklist-27-api/AndroidManifest.xml b/tests/signature/api-check/hidden-api-blacklist-27-api/AndroidManifest.xml
index c714e97..144d631 100644
--- a/tests/signature/api-check/hidden-api-blacklist-27-api/AndroidManifest.xml
+++ b/tests/signature/api-check/hidden-api-blacklist-27-api/AndroidManifest.xml
@@ -16,10 +16,11 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.hiddenapi_blacklist_api_27">
+          package="android.signature.cts.api.hiddenapi_blacklist_api_27"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
-    <uses-sdk android:targetSdkVersion="27" />
+    <uses-sdk android:minSdkVersion="27" android:targetSdkVersion="27" />
 
     <application android:extractNativeLibs="true" android:largeHeap="true"/>
 
diff --git a/tests/signature/api-check/hidden-api-blacklist-27-api/AndroidTest.xml b/tests/signature/api-check/hidden-api-blacklist-27-api/AndroidTest.xml
index e19f874..d168b2d 100644
--- a/tests/signature/api-check/hidden-api-blacklist-27-api/AndroidTest.xml
+++ b/tests/signature/api-check/hidden-api-blacklist-27-api/AndroidTest.xml
@@ -16,15 +16,8 @@
 <configuration description="Config for CTS Hidden API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="hiddenapi_flags.csv->/data/local/tmp/signature-test/hiddenapi_flags.csv" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsHiddenApiBlacklistApi27TestCases.apk" />
@@ -33,7 +26,7 @@
         <option name="package" value="android.signature.cts.api.hiddenapi_blacklist_api_27" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.api27.HiddenApiTest" />
-        <option name="instrumentation-arg" key="hiddenapi-files" value="hiddenapi_flags.csv" />
+        <option name="instrumentation-arg" key="hiddenapi-files" value="hiddenapi-flags.csv" />
         <option name="instrumentation-arg" key="hiddenapi-test-flags" value="blacklist" />
         <option name="runtime-hint" value="30s" />
     </test>
diff --git a/tests/signature/api-check/hidden-api-blacklist-28-api/Android.bp b/tests/signature/api-check/hidden-api-blacklist-28-api/Android.bp
new file mode 100644
index 0000000..44ec9ba
--- /dev/null
+++ b/tests/signature/api-check/hidden-api-blacklist-28-api/Android.bp
@@ -0,0 +1,28 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsHiddenApiBlacklistApi28TestCases",
+    defaults: [
+        "hiddenapi-blacklist-check-defaults",
+    ],
+    min_sdk_version: "27",
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/hidden-api-blacklist-28-api/Android.mk b/tests/signature/api-check/hidden-api-blacklist-28-api/Android.mk
deleted file mode 100644
index f1cd2f3..0000000
--- a/tests/signature/api-check/hidden-api-blacklist-28-api/Android.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright (C) 2018 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)
-LOCAL_PACKAGE_NAME := CtsHiddenApiBlacklistApi28TestCases
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_SIGNATURE_API_FILES := hiddenapi_flags.csv
-LOCAL_JNI_SHARED_LIBRARIES := libcts_dexchecker
-include $(LOCAL_PATH)/../build_signature_apk.mk
diff --git a/tests/signature/api-check/hidden-api-blacklist-28-api/AndroidManifest.xml b/tests/signature/api-check/hidden-api-blacklist-28-api/AndroidManifest.xml
index d011b88..919cd00 100644
--- a/tests/signature/api-check/hidden-api-blacklist-28-api/AndroidManifest.xml
+++ b/tests/signature/api-check/hidden-api-blacklist-28-api/AndroidManifest.xml
@@ -16,10 +16,11 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.hiddenapi_blacklist_api_28">
+          package="android.signature.cts.api.hiddenapi_blacklist_api_28"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
-    <uses-sdk android:targetSdkVersion="28" />
+    <uses-sdk android:minSdkVersion="27" android:targetSdkVersion="28" />
 
     <application android:extractNativeLibs="true" android:largeHeap="true"/>
 
diff --git a/tests/signature/api-check/hidden-api-blacklist-28-api/AndroidTest.xml b/tests/signature/api-check/hidden-api-blacklist-28-api/AndroidTest.xml
index 3c407b3..6285971 100644
--- a/tests/signature/api-check/hidden-api-blacklist-28-api/AndroidTest.xml
+++ b/tests/signature/api-check/hidden-api-blacklist-28-api/AndroidTest.xml
@@ -16,15 +16,8 @@
 <configuration description="Config for CTS Hidden API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="hiddenapi_flags.csv->/data/local/tmp/signature-test/hiddenapi_flags.csv" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsHiddenApiBlacklistApi28TestCases.apk" />
@@ -33,7 +26,7 @@
         <option name="package" value="android.signature.cts.api.hiddenapi_blacklist_api_28" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.api28.HiddenApiTest" />
-        <option name="instrumentation-arg" key="hiddenapi-files" value="hiddenapi_flags.csv" />
+        <option name="instrumentation-arg" key="hiddenapi-files" value="hiddenapi-flags.csv" />
         <option name="instrumentation-arg" key="hiddenapi-test-flags" value="blacklist,greylist-max-o" />
         <option name="runtime-hint" value="30s" />
     </test>
diff --git a/tests/signature/api-check/hidden-api-blacklist-current-api/Android.bp b/tests/signature/api-check/hidden-api-blacklist-current-api/Android.bp
new file mode 100644
index 0000000..ea419f2
--- /dev/null
+++ b/tests/signature/api-check/hidden-api-blacklist-current-api/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsHiddenApiBlacklistCurrentApiTestCases",
+    defaults: [
+        "hiddenapi-blacklist-check-defaults",
+    ],
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/hidden-api-blacklist-current-api/Android.mk b/tests/signature/api-check/hidden-api-blacklist-current-api/Android.mk
deleted file mode 100644
index bfd890b..0000000
--- a/tests/signature/api-check/hidden-api-blacklist-current-api/Android.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright (C) 2018 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)
-LOCAL_PACKAGE_NAME := CtsHiddenApiBlacklistCurrentApiTestCases
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_SIGNATURE_API_FILES := hiddenapi_flags.csv
-LOCAL_JNI_SHARED_LIBRARIES := libcts_dexchecker
-include $(LOCAL_PATH)/../build_signature_apk.mk
diff --git a/tests/signature/api-check/hidden-api-blacklist-current-api/AndroidManifest.xml b/tests/signature/api-check/hidden-api-blacklist-current-api/AndroidManifest.xml
index 4c1528b..a17daac 100644
--- a/tests/signature/api-check/hidden-api-blacklist-current-api/AndroidManifest.xml
+++ b/tests/signature/api-check/hidden-api-blacklist-current-api/AndroidManifest.xml
@@ -16,7 +16,8 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.hiddenapi_blacklist_current">
+          package="android.signature.cts.api.hiddenapi_blacklist_current"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
diff --git a/tests/signature/api-check/hidden-api-blacklist-current-api/AndroidTest.xml b/tests/signature/api-check/hidden-api-blacklist-current-api/AndroidTest.xml
index 904f2f1..3fb352d 100644
--- a/tests/signature/api-check/hidden-api-blacklist-current-api/AndroidTest.xml
+++ b/tests/signature/api-check/hidden-api-blacklist-current-api/AndroidTest.xml
@@ -16,15 +16,8 @@
 <configuration description="Config for CTS Hidden API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="hiddenapi_flags.csv->/data/local/tmp/signature-test/hiddenapi_flags.csv" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsHiddenApiBlacklistCurrentApiTestCases.apk" />
@@ -33,7 +26,7 @@
         <option name="package" value="android.signature.cts.api.hiddenapi_blacklist_current" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.current.HiddenApiTest" />
-        <option name="instrumentation-arg" key="hiddenapi-files" value="hiddenapi_flags.csv" />
+        <option name="instrumentation-arg" key="hiddenapi-files" value="hiddenapi-flags.csv" />
         <option name="instrumentation-arg" key="hiddenapi-test-flags" value="blacklist,greylist-max-o,greylist-max-p" />
         <option name="runtime-hint" value="30s" />
     </test>
diff --git a/tests/signature/api-check/hidden-api-blacklist-debug-class/Android.bp b/tests/signature/api-check/hidden-api-blacklist-debug-class/Android.bp
new file mode 100644
index 0000000..150ba8c
--- /dev/null
+++ b/tests/signature/api-check/hidden-api-blacklist-debug-class/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsHiddenApiBlacklistDebugClassTestCases",
+    defaults: [
+        "hiddenapi-blacklist-check-defaults",
+    ],
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/hidden-api-blacklist-debug-class/Android.mk b/tests/signature/api-check/hidden-api-blacklist-debug-class/Android.mk
deleted file mode 100644
index 9048d8e..0000000
--- a/tests/signature/api-check/hidden-api-blacklist-debug-class/Android.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright (C) 2018 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)
-LOCAL_PACKAGE_NAME := CtsHiddenApiBlacklistDebugClassTestCases
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_SIGNATURE_API_FILES := hiddenapi_flags.csv
-LOCAL_JNI_SHARED_LIBRARIES := libcts_dexchecker
-include $(LOCAL_PATH)/../build_signature_apk.mk
diff --git a/tests/signature/api-check/hidden-api-blacklist-debug-class/AndroidManifest.xml b/tests/signature/api-check/hidden-api-blacklist-debug-class/AndroidManifest.xml
index e0e9a3e..8646c80 100644
--- a/tests/signature/api-check/hidden-api-blacklist-debug-class/AndroidManifest.xml
+++ b/tests/signature/api-check/hidden-api-blacklist-debug-class/AndroidManifest.xml
@@ -16,7 +16,8 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.hiddenapi_blacklist_debug_class">
+          package="android.signature.cts.api.hiddenapi_blacklist_debug_class"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
diff --git a/tests/signature/api-check/hidden-api-blacklist-debug-class/AndroidTest.xml b/tests/signature/api-check/hidden-api-blacklist-debug-class/AndroidTest.xml
index 9209d59..9c49d41 100644
--- a/tests/signature/api-check/hidden-api-blacklist-debug-class/AndroidTest.xml
+++ b/tests/signature/api-check/hidden-api-blacklist-debug-class/AndroidTest.xml
@@ -16,15 +16,8 @@
 <configuration description="Config for CTS Hidden API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="hiddenapi_flags.csv->/data/local/tmp/signature-test/hiddenapi_flags.csv" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsHiddenApiBlacklistDebugClassTestCases.apk" />
@@ -33,7 +26,7 @@
         <option name="package" value="android.signature.cts.api.hiddenapi_blacklist_debug_class" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.DebugClassHiddenApiTest" />
-        <option name="instrumentation-arg" key="hiddenapi-files" value="hiddenapi_flags.csv" />
+        <option name="instrumentation-arg" key="hiddenapi-files" value="hiddenapi-flags.csv" />
         <option name="instrumentation-arg" key="hiddenapi-test-flags" value="blacklist,greylist-max-o,greylist-max-p" />
         <option name="runtime-hint" value="30s" />
     </test>
diff --git a/tests/signature/api-check/hidden-api-killswitch-debug-class/Android.bp b/tests/signature/api-check/hidden-api-killswitch-debug-class/Android.bp
new file mode 100644
index 0000000..cb86794
--- /dev/null
+++ b/tests/signature/api-check/hidden-api-killswitch-debug-class/Android.bp
@@ -0,0 +1,25 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsHiddenApiKillswitchDebugClassTestCases",
+    defaults: ["hiddenapi-killswitch-check-defaults"],
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/hidden-api-killswitch-debug-class/Android.mk b/tests/signature/api-check/hidden-api-killswitch-debug-class/Android.mk
deleted file mode 100644
index 003eb7f..0000000
--- a/tests/signature/api-check/hidden-api-killswitch-debug-class/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2018 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)
-LOCAL_PACKAGE_NAME := CtsHiddenApiKillswitchDebugClassTestCases
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_MULTILIB := both
-LOCAL_JNI_SHARED_LIBRARIES := libcts_dexchecker libclassdescriptors
-LOCAL_NDK_STL_VARIANT := c++_static
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := cts-api-signature-test
-
-LOCAL_USE_EMBEDDED_NATIVE_LIBS := false
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/signature/api-check/hidden-api-killswitch-debug-class/AndroidManifest.xml b/tests/signature/api-check/hidden-api-killswitch-debug-class/AndroidManifest.xml
index 5435b61..b502561 100644
--- a/tests/signature/api-check/hidden-api-killswitch-debug-class/AndroidManifest.xml
+++ b/tests/signature/api-check/hidden-api-killswitch-debug-class/AndroidManifest.xml
@@ -16,7 +16,8 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.killswitch_debug_class">
+          package="android.signature.cts.api.killswitch_debug_class"
+          android:targetSandboxVersion="2">
 
     <application android:debuggable="true"
                  android:extractNativeLibs="true"
diff --git a/tests/signature/api-check/hidden-api-killswitch-debug-class/AndroidTest.xml b/tests/signature/api-check/hidden-api-killswitch-debug-class/AndroidTest.xml
index 7f144c0..68c3e5c 100644
--- a/tests/signature/api-check/hidden-api-killswitch-debug-class/AndroidTest.xml
+++ b/tests/signature/api-check/hidden-api-killswitch-debug-class/AndroidTest.xml
@@ -16,7 +16,7 @@
 <configuration description="Config for CTS Hidden API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
diff --git a/tests/signature/api-check/hidden-api-killswitch-whitelist/Android.bp b/tests/signature/api-check/hidden-api-killswitch-whitelist/Android.bp
new file mode 100644
index 0000000..2c1e8f4
--- /dev/null
+++ b/tests/signature/api-check/hidden-api-killswitch-whitelist/Android.bp
@@ -0,0 +1,25 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsHiddenApiKillswitchWhitelistTestCases",
+    defaults: ["hiddenapi-killswitch-check-defaults"],
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/hidden-api-killswitch-whitelist/Android.mk b/tests/signature/api-check/hidden-api-killswitch-whitelist/Android.mk
deleted file mode 100644
index 5dca9c1..0000000
--- a/tests/signature/api-check/hidden-api-killswitch-whitelist/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2018 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)
-LOCAL_PACKAGE_NAME := CtsHiddenApiKillswitchWhitelistTestCases
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_MULTILIB := both
-LOCAL_JNI_SHARED_LIBRARIES := libcts_dexchecker libclassdescriptors
-LOCAL_NDK_STL_VARIANT := c++_static
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := cts-api-signature-test
-
-LOCAL_USE_EMBEDDED_NATIVE_LIBS := false
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/signature/api-check/hidden-api-killswitch-whitelist/AndroidManifest.xml b/tests/signature/api-check/hidden-api-killswitch-whitelist/AndroidManifest.xml
index 35b3e0c..54f61f9 100644
--- a/tests/signature/api-check/hidden-api-killswitch-whitelist/AndroidManifest.xml
+++ b/tests/signature/api-check/hidden-api-killswitch-whitelist/AndroidManifest.xml
@@ -16,7 +16,8 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.killswitch_whitelist">
+          package="android.signature.cts.api.killswitch_whitelist"
+          android:targetSandboxVersion="2">
 
     <application android:debuggable="true"
                  android:extractNativeLibs="true"
diff --git a/tests/signature/api-check/hidden-api-killswitch-whitelist/AndroidTest.xml b/tests/signature/api-check/hidden-api-killswitch-whitelist/AndroidTest.xml
index b34d6ba..e25bb65 100644
--- a/tests/signature/api-check/hidden-api-killswitch-whitelist/AndroidTest.xml
+++ b/tests/signature/api-check/hidden-api-killswitch-whitelist/AndroidTest.xml
@@ -16,7 +16,7 @@
 <configuration description="Config for CTS Hidden API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
     <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
         <!-- Whitelist all APIs before running the test, then reset this afterwards. The test
diff --git a/tests/signature/api-check/hidden-api-killswitch-wildcard/Android.bp b/tests/signature/api-check/hidden-api-killswitch-wildcard/Android.bp
new file mode 100644
index 0000000..785199e
--- /dev/null
+++ b/tests/signature/api-check/hidden-api-killswitch-wildcard/Android.bp
@@ -0,0 +1,25 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsHiddenApiKillswitchWildcardTestCases",
+    defaults: ["hiddenapi-killswitch-check-defaults"],
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/hidden-api-killswitch-wildcard/Android.mk b/tests/signature/api-check/hidden-api-killswitch-wildcard/Android.mk
deleted file mode 100644
index ab0eef9..0000000
--- a/tests/signature/api-check/hidden-api-killswitch-wildcard/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2018 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)
-LOCAL_PACKAGE_NAME := CtsHiddenApiKillswitchWildcardTestCases
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_MULTILIB := both
-LOCAL_JNI_SHARED_LIBRARIES := libcts_dexchecker libclassdescriptors
-LOCAL_NDK_STL_VARIANT := c++_static
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := cts-api-signature-test
-
-LOCAL_USE_EMBEDDED_NATIVE_LIBS := false
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/signature/api-check/hidden-api-killswitch-wildcard/AndroidManifest.xml b/tests/signature/api-check/hidden-api-killswitch-wildcard/AndroidManifest.xml
index c13d4bb..3747831 100644
--- a/tests/signature/api-check/hidden-api-killswitch-wildcard/AndroidManifest.xml
+++ b/tests/signature/api-check/hidden-api-killswitch-wildcard/AndroidManifest.xml
@@ -16,7 +16,8 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.killswitch_wildcard">
+          package="android.signature.cts.api.killswitch_wildcard"
+          android:targetSandboxVersion="2">
 
     <application android:debuggable="true"
                  android:extractNativeLibs="true"
diff --git a/tests/signature/api-check/hidden-api-killswitch-wildcard/AndroidTest.xml b/tests/signature/api-check/hidden-api-killswitch-wildcard/AndroidTest.xml
index ef41dcc..0363684 100644
--- a/tests/signature/api-check/hidden-api-killswitch-wildcard/AndroidTest.xml
+++ b/tests/signature/api-check/hidden-api-killswitch-wildcard/AndroidTest.xml
@@ -16,7 +16,7 @@
 <configuration description="Config for CTS Hidden API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
     <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
         <!-- Enable the killswitch before running the test, then disable it afterwards. The test
diff --git a/tests/signature/api-check/shared-libs-api/Android.mk b/tests/signature/api-check/shared-libs-api/Android.mk
index f71835e..d921e6b 100644
--- a/tests/signature/api-check/shared-libs-api/Android.mk
+++ b/tests/signature/api-check/shared-libs-api/Android.mk
@@ -16,24 +16,31 @@
 
 include $(CLEAR_VARS)
 
+all_shared_libs_modules :=
+
 $(foreach ver,$(call int_range_list,28,$(PLATFORM_SDK_VERSION)),\
   $(foreach api_level,public system,\
     $(foreach lib,$(filter-out android,$(filter-out %removed,$(filter-out incompatibilities,\
       $(basename $(notdir $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/$(ver)/$(api_level)/api/*.txt)))))),\
-        $(eval all_shared_libs_files += $(lib)-$(ver)-$(api_level).api))))
+        $(eval all_shared_libs_modules += $(lib)-$(ver)-$(api_level).txt))))
+
+all_shared_libs_files := $(addprefix $(COMPATIBILITY_TESTCASES_OUT_cts)/,$(all_shared_libs_modules))
 
 include $(CLEAR_VARS)
-LOCAL_MODULE := cts-shared-libs-all.api
-LOCAL_MODULE_STEM := shared-libs-all.api.zip
+LOCAL_MODULE := cts-shared-libs-all.txt
+LOCAL_MODULE_STEM := shared-libs-all.txt.zip
 LOCAL_MODULE_CLASS := ETC
 LOCAL_MODULE_PATH = $(TARGET_OUT_DATA_ETC)
-LOCAL_COMPATIBILITY_SUITE := arcts cts vts general-tests
 include $(BUILD_SYSTEM)/base_rules.mk
-$(LOCAL_BUILT_MODULE): $(addprefix $(COMPATIBILITY_TESTCASES_OUT_cts)/,$(all_shared_libs_files))
+$(LOCAL_BUILT_MODULE): $(SOONG_ZIP)
+$(LOCAL_BUILT_MODULE): PRIVATE_SHARED_LIBS_FILES := $(all_shared_libs_files)
+$(LOCAL_BUILT_MODULE): $(all_shared_libs_files)
 	@echo "Zip API files $^ -> $@"
 	@mkdir -p $(dir $@)
 	$(hide) rm -f $@
-	$(hide) zip -q $@ $^
+	$(hide) $(SOONG_ZIP) -o $@ -P out -C $(OUT_DIR) $(addprefix -f ,$(PRIVATE_SHARED_LIBS_FILES))
+
+all_shared_libs_zip_file := $(LOCAL_BUILT_MODULE)
 
 include $(CLEAR_VARS)
 
@@ -56,9 +63,7 @@
 
 LOCAL_PACKAGE_NAME := CtsSharedLibsApiSignatureTestCases
 
-LOCAL_SIGNATURE_API_FILES := \
-    shared-libs-all.api.zip \
-    $(all_shared_libs_files)
+LOCAL_JAVA_RESOURCE_FILES := $(all_shared_libs_zip_file)
 
 LOCAL_STATIC_JAVA_LIBRARIES := cts-api-signature-multilib-test
 
@@ -66,4 +71,5 @@
 
 LOCAL_JAVA_SDK_LIBRARIES :=
 all_shared_libs_files :=
-
+all_shared_libs_modules :=
+all_shared_libs_zip_file :=
diff --git a/tests/signature/api-check/shared-libs-api/AndroidManifest.xml b/tests/signature/api-check/shared-libs-api/AndroidManifest.xml
index 5bdec66..00ddd9a 100644
--- a/tests/signature/api-check/shared-libs-api/AndroidManifest.xml
+++ b/tests/signature/api-check/shared-libs-api/AndroidManifest.xml
@@ -16,7 +16,8 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.shared_libs">
+          package="android.signature.cts.api.shared_libs"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
diff --git a/tests/signature/api-check/shared-libs-api/AndroidTest.xml b/tests/signature/api-check/shared-libs-api/AndroidTest.xml
index 29262ca..09a9168 100644
--- a/tests/signature/api-check/shared-libs-api/AndroidTest.xml
+++ b/tests/signature/api-check/shared-libs-api/AndroidTest.xml
@@ -16,15 +16,8 @@
 <configuration description="Config for CTS Shared Libraries API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="shared-libs-all.api.zip->/data/local/tmp/signature-test/shared-libs-all.api.zip" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsSharedLibsApiSignatureTestCases.apk" />
@@ -33,7 +26,7 @@
         <option name="package" value="android.signature.cts.api.shared_libs" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.SignatureMultiLibsTest" />
-        <option name="instrumentation-arg" key="expected-api-files" value="shared-libs-all.api.zip" />
+        <option name="instrumentation-arg" key="expected-api-files" value="shared-libs-all.txt.zip" />
         <option name="runtime-hint" value="30s" />
     </test>
 </configuration>
diff --git a/tests/signature/api-check/shared-libs-api/src/android/signature/cts/api/SignatureMultiLibsTest.java b/tests/signature/api-check/shared-libs-api/src/android/signature/cts/api/SignatureMultiLibsTest.java
index c04f7ccb..5499119 100644
--- a/tests/signature/api-check/shared-libs-api/src/android/signature/cts/api/SignatureMultiLibsTest.java
+++ b/tests/signature/api-check/shared-libs-api/src/android/signature/cts/api/SignatureMultiLibsTest.java
@@ -18,13 +18,11 @@
 
 import android.signature.cts.ApiComplianceChecker;
 import android.signature.cts.ApiDocumentParser;
-import java.io.File;
-import java.io.FileInputStream;
+import android.signature.cts.VirtualPath;
+import android.signature.cts.VirtualPath.LocalFilePath;
 import java.io.IOException;
-import java.io.InputStream;
 import java.util.Arrays;
 import java.util.stream.Stream;
-import java.util.zip.ZipFile;
 
 import static com.android.compatibility.common.util.SystemUtil.runShellCommand;
 
@@ -48,7 +46,7 @@
 
             ApiDocumentParser apiDocumentParser = new ApiDocumentParser(TAG);
 
-            parseApiFilesAsStream(apiDocumentParser, expectedApiFiles)
+            parseApiResourcesAsStream(apiDocumentParser, expectedApiFiles)
                     .forEach(complianceChecker::checkSignatureCompliance);
 
             // After done parsing all expected API files, perform any deferred checks.
@@ -70,21 +68,9 @@
         return getLibraries().anyMatch(libraryName::equals);
     }
 
-    protected Stream<InputStream> readFile(File file) {
-        try {
-            if (file.getName().endsWith(".zip")) {
-                ZipFile zip = new ZipFile(file);
-                return zip.stream().filter(entry -> checkLibrary(entry.getName())).map(entry -> {
-                    try {
-                        return zip.getInputStream(entry);
-                    } catch (IOException e) {
-                        throw new RuntimeException(e);
-                    }});
-            } else {
-                return Stream.of(new FileInputStream(file));
-            }
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
+    @Override
+    protected Stream<VirtualPath> getZipEntryFiles(LocalFilePath path) throws IOException {
+        // Only return entries corresponding to shared libraries.
+        return super.getZipEntryFiles(path).filter(p -> checkLibrary(p.toString()));
     }
 }
diff --git a/tests/signature/api-check/src/java/android/signature/cts/api/AbstractApiTest.java b/tests/signature/api-check/src/java/android/signature/cts/api/AbstractApiTest.java
index 4167c9c..7e8c6d6 100644
--- a/tests/signature/api-check/src/java/android/signature/cts/api/AbstractApiTest.java
+++ b/tests/signature/api-check/src/java/android/signature/cts/api/AbstractApiTest.java
@@ -21,8 +21,11 @@
 import android.signature.cts.ExcludingClassProvider;
 import android.signature.cts.FailureType;
 import android.signature.cts.JDiffClassDescription;
+import android.signature.cts.VirtualPath;
+import android.signature.cts.VirtualPath.LocalFilePath;
+import android.signature.cts.VirtualPath.ResourcePath;
+import android.util.Log;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintWriter;
@@ -30,22 +33,20 @@
 import java.nio.ByteBuffer;
 import java.nio.channels.FileChannel;
 import java.nio.file.Files;
+import java.nio.file.Path;
 import java.nio.file.StandardOpenOption;
 import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.Set;
 import java.util.stream.Stream;
 import java.util.zip.ZipFile;
-import org.xmlpull.v1.XmlPullParserException;
 import repackaged.android.test.InstrumentationTestCase;
 import repackaged.android.test.InstrumentationTestRunner;
 
-import static android.signature.cts.CurrentApi.API_FILE_DIRECTORY;
-
 /**
  */
 public class AbstractApiTest extends InstrumentationTestCase {
 
+    private static final String TAG = "SignatureTest";
+
     private TestResultObserver mResultObserver;
 
     ClassProvider classProvider;
@@ -109,63 +110,63 @@
         return argument.split(",");
     }
 
-    Stream<Object> readFileOptimized(File file) {
+    private Stream<VirtualPath> readResource(String resourceName) {
         try {
-            if (file.getName().endsWith(".zip")) {
-                @SuppressWarnings("resource")
-                ZipFile zip = new ZipFile(file);
-                return zip.stream().map(entry -> {
-                    try {
-                        return zip.getInputStream(entry);
-                    } catch (IOException e) {
-                        throw new RuntimeException(e);
-                    }
-                });
+            ResourcePath resourcePath =
+                    VirtualPath.get(getClass().getClassLoader(), resourceName);
+            if (resourceName.endsWith(".zip")) {
+                // Extract to a temporary file and read from there.
+                Path file = extractResourceToFile(resourceName, resourcePath.newInputStream());
+                return flattenPaths(VirtualPath.get(file.toString()));
             } else {
-                try (FileChannel fileChannel = (FileChannel) Files.newByteChannel(file.toPath(),
-                        EnumSet.of(StandardOpenOption.READ))) {
-                    ByteBuffer mappedByteBuffer = fileChannel.map(FileChannel.MapMode.READ_ONLY, 0,
-                            fileChannel.size());
-                    if (mappedByteBuffer == null) {
-                        throw new IllegalStateException("Could not map " + file);
-                    }
-                    return Stream.of(mappedByteBuffer);
-                }
-            }
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-    }
-    Stream<InputStream> readFile(File file) {
-        try {
-            if (file.getName().endsWith(".zip")) {
-                @SuppressWarnings("resource")
-                ZipFile zip = new ZipFile(file);
-                return zip.stream().map(entry -> {
-                    try {
-                        return zip.getInputStream(entry);
-                    } catch (IOException e) {
-                        throw new RuntimeException(e);
-                    }});
-            } else {
-                return Stream.of(new FileInputStream(file));
+                return Stream.of(resourcePath);
             }
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
     }
 
-    Stream<JDiffClassDescription> parseApiFilesAsStream(
-            ApiDocumentParser apiDocumentParser, String[] apiFiles) {
-        return Stream.of(apiFiles)
-                .map(name -> new File(API_FILE_DIRECTORY + "/" + name))
-                .flatMap(this::readFile)
-                .flatMap(stream -> {
-                    try {
-                        return apiDocumentParser.parseAsStream(stream);
-                    } catch (IOException | XmlPullParserException e) {
-                        throw new RuntimeException(e);
-                    }
-                });
+    Path extractResourceToFile(String resourceName, InputStream is) throws IOException {
+        Path tempDirectory = Files.createTempDirectory("signature");
+        Path file = tempDirectory.resolve(resourceName);
+        Log.i(TAG, "extractResourceToFile: extracting " + resourceName + " to " + file);
+        Files.copy(is, file);
+        is.close();
+        return file;
+    }
+
+    /**
+     * Given a path in the local file system (possibly of a zip file) flatten it into a stream of
+     * virtual paths.
+     */
+    private Stream<VirtualPath> flattenPaths(LocalFilePath path) {
+        try {
+            if (path.toString().endsWith(".zip")) {
+                return getZipEntryFiles(path);
+            } else {
+                return Stream.of(path);
+            }
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    Stream<JDiffClassDescription> parseApiResourcesAsStream(
+            ApiDocumentParser apiDocumentParser, String[] apiResources) {
+        return Stream.of(apiResources)
+                .flatMap(this::readResource)
+                .flatMap(apiDocumentParser::parseAsStream);
+    }
+
+    /**
+     * Get the zip entries that are files.
+     *
+     * @param path the path to the zip file.
+     * @return paths to zip entries
+     */
+    protected Stream<VirtualPath> getZipEntryFiles(LocalFilePath path) throws IOException {
+        @SuppressWarnings("resource")
+        ZipFile zip = new ZipFile(path.toFile());
+        return zip.stream().map(entry -> VirtualPath.get(zip, entry));
     }
 }
diff --git a/tests/signature/api-check/src/java/android/signature/cts/api/HiddenApiTest.java b/tests/signature/api-check/src/java/android/signature/cts/api/HiddenApiTest.java
index b185c50..2102aaa 100644
--- a/tests/signature/api-check/src/java/android/signature/cts/api/HiddenApiTest.java
+++ b/tests/signature/api-check/src/java/android/signature/cts/api/HiddenApiTest.java
@@ -16,8 +16,6 @@
 
 package android.signature.cts.api;
 
-import static android.signature.cts.CurrentApi.API_FILE_DIRECTORY;
-
 import android.os.Bundle;
 import android.signature.cts.DexApiDocumentParser;
 import android.signature.cts.DexField;
@@ -25,15 +23,11 @@
 import android.signature.cts.DexMemberChecker;
 import android.signature.cts.DexMethod;
 import android.signature.cts.FailureType;
+import android.signature.cts.VirtualPath;
 
 import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.text.ParseException;
+import java.io.InputStreamReader;
 import java.util.function.Predicate;
-import java.util.stream.Stream;
 
 /**
  * Checks that it is not possible to access hidden APIs.
@@ -44,7 +38,7 @@
     private String[] hiddenapiTestFlags;
 
     @Override
-    protected void initializeFromArgs(Bundle instrumentationArgs) throws Exception {
+    protected void initializeFromArgs(Bundle instrumentationArgs) {
         hiddenapiFiles = getCommaSeparatedList(instrumentationArgs, "hiddenapi-files");
         hiddenapiTestFlags = getCommaSeparatedList(instrumentationArgs, "hiddenapi-test-flags");
     }
@@ -141,9 +135,12 @@
                     }
                 }
             };
+
             for (String apiFile : hiddenapiFiles) {
+                VirtualPath.ResourcePath resourcePath =
+                        VirtualPath.get(getClass().getClassLoader(), apiFile);
                 BufferedReader reader = new BufferedReader(
-                        new FileReader(API_FILE_DIRECTORY + "/" + apiFile));
+                        new InputStreamReader(resourcePath.newInputStream()));
                 int lineIndex = 1;
                 String line = reader.readLine();
                 while (line != null) {
@@ -155,6 +152,7 @@
                     line = reader.readLine();
                     lineIndex++;
                 }
+
             }
         });
     }
diff --git a/tests/signature/api-check/src/java/android/signature/cts/api/SignatureTest.java b/tests/signature/api-check/src/java/android/signature/cts/api/SignatureTest.java
index 7861df7..937d074 100644
--- a/tests/signature/api-check/src/java/android/signature/cts/api/SignatureTest.java
+++ b/tests/signature/api-check/src/java/android/signature/cts/api/SignatureTest.java
@@ -23,13 +23,11 @@
 import android.signature.cts.FailureType;
 import android.signature.cts.JDiffClassDescription;
 import android.signature.cts.ReflectionHelper;
-import java.io.IOException;
 import java.util.Comparator;
 import java.util.Set;
 import java.util.TreeSet;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
-import org.xmlpull.v1.XmlPullParserException;
 
 /**
  * Performs the signature check via a JUnit test.
@@ -43,7 +41,7 @@
     private String[] unexpectedApiFiles;
 
     @Override
-    protected void initializeFromArgs(Bundle instrumentationArgs) throws Exception {
+    protected void initializeFromArgs(Bundle instrumentationArgs) {
         expectedApiFiles = getCommaSeparatedList(instrumentationArgs, "expected-api-files");
         baseApiFiles = getCommaSeparatedList(instrumentationArgs, "base-api-files");
         unexpectedApiFiles = getCommaSeparatedList(instrumentationArgs, "unexpected-api-files");
@@ -75,7 +73,7 @@
 
             ApiDocumentParser apiDocumentParser = new ApiDocumentParser(TAG);
 
-            parseApiFilesAsStream(apiDocumentParser, expectedApiFiles)
+            parseApiResourcesAsStream(apiDocumentParser, expectedApiFiles)
                     .filter(not(unexpectedClasses::contains))
                     .forEach(complianceChecker::checkSignatureCompliance);
 
@@ -97,11 +95,9 @@
         }
     }
 
-    private Set<JDiffClassDescription> loadUnexpectedClasses()
-            throws IOException, XmlPullParserException {
-
+    private Set<JDiffClassDescription> loadUnexpectedClasses() {
         ApiDocumentParser apiDocumentParser = new ApiDocumentParser(TAG);
-        return parseApiFilesAsStream(apiDocumentParser, unexpectedApiFiles)
+        return parseApiResourcesAsStream(apiDocumentParser, unexpectedApiFiles)
                 .collect(Collectors.toCollection(SignatureTest::newSetOfClassDescriptions));
     }
 
@@ -109,12 +105,9 @@
         return new TreeSet<>(Comparator.comparing(JDiffClassDescription::getAbsoluteClassName));
     }
 
-    private void loadBaseClasses(ApiComplianceChecker complianceChecker)
-            throws IOException, XmlPullParserException {
-
-        ApiDocumentParser apiDocumentParser =
-                new ApiDocumentParser(TAG);
-        parseApiFilesAsStream(apiDocumentParser, baseApiFiles)
+    private void loadBaseClasses(ApiComplianceChecker complianceChecker) {
+        ApiDocumentParser apiDocumentParser = new ApiDocumentParser(TAG);
+        parseApiResourcesAsStream(apiDocumentParser, baseApiFiles)
                 .forEach(complianceChecker::addBaseClass);
     }
 }
diff --git a/tests/signature/api-check/system-annotation/Android.bp b/tests/signature/api-check/system-annotation/Android.bp
new file mode 100644
index 0000000..b423593
--- /dev/null
+++ b/tests/signature/api-check/system-annotation/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsSystemApiAnnotationTestCases",
+    defaults: [
+        "signature-api-check-defaults",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+    ],
+    java_resources: [
+        ":cts-system-current-txt",
+        ":cts-system-removed-txt",
+        ":cts-car-system-current-txt",
+        ":cts-car-system-removed-txt",
+    ],
+    min_sdk_version: "27",
+
+    use_embedded_native_libs: false,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/signature/api-check/system-annotation/Android.mk b/tests/signature/api-check/system-annotation/Android.mk
deleted file mode 100644
index 680e422..0000000
--- a/tests/signature/api-check/system-annotation/Android.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsSystemApiAnnotationTestCases
-LOCAL_SRC_FILES := $(call all-java-files-under,src)
-LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util-axt
-LOCAL_SIGNATURE_API_FILES := \
-    system-current.api \
-    system-removed.api \
-    car-system-current.api \
-    car-system-removed.api \
-
-include $(LOCAL_PATH)/../build_signature_apk.mk
diff --git a/tests/signature/api-check/system-annotation/AndroidManifest.xml b/tests/signature/api-check/system-annotation/AndroidManifest.xml
index 34a12c4..13258c2 100644
--- a/tests/signature/api-check/system-annotation/AndroidManifest.xml
+++ b/tests/signature/api-check/system-annotation/AndroidManifest.xml
@@ -16,11 +16,12 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.system_annotation">
+          package="android.signature.cts.api.system_annotation"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
-    <uses-sdk android:targetSdkVersion="28" />
+    <uses-sdk android:minSdkVersion="27" android:targetSdkVersion="28" />
 
     <application android:debuggable="true"
                  android:extractNativeLibs="true"
diff --git a/tests/signature/api-check/system-annotation/AndroidTest.xml b/tests/signature/api-check/system-annotation/AndroidTest.xml
index f8d1e92..70db574 100644
--- a/tests/signature/api-check/system-annotation/AndroidTest.xml
+++ b/tests/signature/api-check/system-annotation/AndroidTest.xml
@@ -16,24 +16,8 @@
 <configuration description="Config for CTS System Current API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="system-current.api->/data/local/tmp/signature-test/system-current.api" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="system-removed.api->/data/local/tmp/signature-test/system-removed.api" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="car-system-current.api->/data/local/tmp/signature-test/car-system-current.api" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="car-system-removed.api->/data/local/tmp/signature-test/car-system-removed.api" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsSystemApiAnnotationTestCases.apk" />
@@ -42,7 +26,7 @@
         <option name="package" value="android.signature.cts.api.system_annotation" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.AnnotationTest" />
-        <option name="instrumentation-arg" key="expected-api-files" value="system-current.api,system-removed.api,car-system-current.api,car-system-removed.api" />
+        <option name="instrumentation-arg" key="expected-api-files" value="system-current.txt,system-removed.txt,car-system-current.txt,car-system-removed.txt" />
         <option name="instrumentation-arg" key="annotation-for-exact-match" value="android.annotation.SystemApi" />
         <option name="runtime-hint" value="30s" />
     </test>
diff --git a/tests/signature/api-check/system-annotation/src/java/android/signature/cts/api/AnnotationTest.java b/tests/signature/api-check/system-annotation/src/java/android/signature/cts/api/AnnotationTest.java
index b94300f..78f114b 100644
--- a/tests/signature/api-check/system-annotation/src/java/android/signature/cts/api/AnnotationTest.java
+++ b/tests/signature/api-check/system-annotation/src/java/android/signature/cts/api/AnnotationTest.java
@@ -53,7 +53,7 @@
 
                 ApiDocumentParser apiDocumentParser = new ApiDocumentParser(TAG);
 
-                parseApiFilesAsStream(apiDocumentParser, expectedApiFiles)
+                parseApiResourcesAsStream(apiDocumentParser, expectedApiFiles)
                         .forEach(complianceChecker::checkSignatureCompliance);
 
                 // After done parsing all expected API files, perform any deferred checks.
diff --git a/tests/signature/api-check/system-api/Android.mk b/tests/signature/api-check/system-api/Android.mk
index e795a6d..7605f85 100644
--- a/tests/signature/api-check/system-api/Android.mk
+++ b/tests/signature/api-check/system-api/Android.mk
@@ -14,37 +14,46 @@
 
 LOCAL_PATH := $(call my-dir)
 
-all_system_api_files := system-current.api system-removed.api
+all_system_api_modules :=
 $(foreach ver,$(PLATFORM_SYSTEMSDK_VERSIONS),\
   $(if $(call math_is_number,$(ver)),\
-    $(eval all_system_api_files += system-$(ver).api)\
+    $(eval all_system_api_modules += system-$(ver).txt)\
   )\
 )
+all_system_api_files := $(addprefix $(COMPATIBILITY_TESTCASES_OUT_cts)/,$(all_system_api_modules))
 
 include $(CLEAR_VARS)
-LOCAL_MODULE := cts-system-all.api
-LOCAL_MODULE_STEM := system-all.api.zip
+LOCAL_MODULE := cts-system-all.txt
+LOCAL_MODULE_STEM := system-all.txt.zip
 LOCAL_MODULE_CLASS := ETC
 LOCAL_MODULE_PATH = $(TARGET_OUT_DATA_ETC)
 LOCAL_COMPATIBILITY_SUITE := arcts cts vts general-tests
 include $(BUILD_SYSTEM)/base_rules.mk
-$(LOCAL_BUILT_MODULE): $(addprefix $(COMPATIBILITY_TESTCASES_OUT_cts)/,$(all_system_api_files))
+$(LOCAL_BUILT_MODULE): $(SOONG_ZIP)
+$(LOCAL_BUILT_MODULE): PRIVATE_SYSTEM_API_FILES := $(all_system_api_files)
+$(LOCAL_BUILT_MODULE): $(all_system_api_files)
 	@echo "Zip API files $^ -> $@"
 	@mkdir -p $(dir $@)
 	$(hide) rm -f $@
-	$(hide) zip -q $@ $^
+	$(hide) $(SOONG_ZIP) -o $@ -P out -C $(OUT_DIR) $(addprefix -f ,$(PRIVATE_SYSTEM_API_FILES))
+
+all_system_api_zip_file := $(LOCAL_BUILT_MODULE)
 
 include $(CLEAR_VARS)
 
 LOCAL_PACKAGE_NAME := CtsSystemApiSignatureTestCases
 
+LOCAL_JAVA_RESOURCE_FILES := $(all_system_api_zip_file)
+
 LOCAL_SIGNATURE_API_FILES := \
-    current.api \
-    android-test-mock-current.api \
-    android-test-runner-current.api \
-    $(all_sytem_api_files) \
-    system-all.api.zip
+    current.txt \
+    android-test-mock-current.txt \
+    android-test-runner-current.txt \
+    system-current.txt \
+    system-removed.txt \
 
 include $(LOCAL_PATH)/../build_signature_apk.mk
 
 all_system_api_files :=
+all_system_api_modules :=
+all_system_api_zip_file :=
diff --git a/tests/signature/api-check/system-api/AndroidManifest.xml b/tests/signature/api-check/system-api/AndroidManifest.xml
index c32a63a..7906164 100644
--- a/tests/signature/api-check/system-api/AndroidManifest.xml
+++ b/tests/signature/api-check/system-api/AndroidManifest.xml
@@ -16,7 +16,8 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.signature.cts.api.system">
+          package="android.signature.cts.api.system"
+          android:targetSandboxVersion="2">
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
diff --git a/tests/signature/api-check/system-api/AndroidTest.xml b/tests/signature/api-check/system-api/AndroidTest.xml
index 397e72b..3368b77 100644
--- a/tests/signature/api-check/system-api/AndroidTest.xml
+++ b/tests/signature/api-check/system-api/AndroidTest.xml
@@ -16,19 +16,8 @@
 <configuration description="Config for CTS System API Signature test cases">
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="systems" />
-    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
-    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
-        <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="current.api->/data/local/tmp/signature-test/current.api" />
-        <option name="push" value="android-test-mock-current.api->/data/local/tmp/signature-test/android-test-mock-current.api" />
-        <option name="push" value="android-test-runner-current.api->/data/local/tmp/signature-test/android-test-runner-current.api" />
-        <!-- This zip file contains all versions of system APIs that the platform is supposed to implement -->
-        <option name="push" value="system-all.api.zip->/data/local/tmp/signature-test/system-all.api.zip" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsSystemApiSignatureTestCases.apk" />
@@ -37,9 +26,9 @@
         <option name="package" value="android.signature.cts.api.system" />
         <option name="runner" value="repackaged.android.test.InstrumentationTestRunner" />
         <option name="class" value="android.signature.cts.api.system.SignatureTest" />
-        <option name="instrumentation-arg" key="base-api-files" value="current.api" />
-        <option name="instrumentation-arg" key="expected-api-files" value="system-all.api.zip" />
-        <option name="instrumentation-arg" key="unexpected-api-files" value="android-test-mock-current.api,android-test-runner-current.api" />
+        <option name="instrumentation-arg" key="base-api-files" value="current.txt" />
+        <option name="instrumentation-arg" key="expected-api-files" value="system-current.txt,system-removed.txt,system-all.txt.zip" />
+        <option name="instrumentation-arg" key="unexpected-api-files" value="android-test-mock-current.txt,android-test-runner-current.txt" />
         <option name="runtime-hint" value="30s" />
     </test>
 </configuration>
diff --git a/tests/signature/api/Android.bp b/tests/signature/api/Android.bp
new file mode 100644
index 0000000..8c3e12a
--- /dev/null
+++ b/tests/signature/api/Android.bp
@@ -0,0 +1,126 @@
+// Copyright (C) 2019 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.
+
+default_visibility = [
+    "//cts/tests/signature/api-check:__subpackages__",
+    "//cts/tests/signature/intent-check",
+]
+
+genrule {
+    name: "cts-current-txt",
+    visibility: default_visibility,
+    srcs: [
+        ":frameworks-base-api-current.txt",
+    ],
+    out: [
+        "current.txt",
+    ],
+    cmd: "cp $(in) $(out)",
+}
+
+genrule {
+    name: "cts-system-current-txt",
+    visibility: default_visibility,
+    srcs: [
+        ":frameworks-base-api-system-current.txt",
+    ],
+    out: [
+        "system-current.txt",
+    ],
+    cmd: "cp $(in) $(out)",
+}
+
+genrule {
+    name: "cts-system-removed-txt",
+    visibility: default_visibility,
+    srcs: [
+        ":frameworks-base-api-system-removed.txt",
+    ],
+    out: [
+        "system-removed.txt",
+    ],
+    cmd: "cp $(in) $(out)",
+}
+
+genrule {
+    name: "cts-android-test-base-current-txt",
+    visibility: default_visibility,
+    srcs: [
+        ":android-test-base-current.txt",
+    ],
+    out: [
+        "android-test-base-current.txt",
+    ],
+    cmd: "cp $(in) $(out)",
+}
+
+genrule {
+    name: "cts-android-test-mock-current-txt",
+    visibility: default_visibility,
+    srcs: [
+        ":android-test-mock-current.txt",
+    ],
+    out: [
+        "android-test-mock-current.txt",
+    ],
+    cmd: "cp $(in) $(out)",
+}
+
+genrule {
+    name: "cts-android-test-runner-current-txt",
+    visibility: default_visibility,
+    srcs: [
+        ":android-test-runner-current.txt",
+    ],
+    out: [
+        "android-test-runner-current.txt",
+    ],
+    cmd: "cp $(in) $(out)",
+}
+
+genrule {
+    name: "cts-apache-http-legacy-current-txt",
+    visibility: default_visibility,
+    srcs: [
+        ":apache-http-legacy-current.txt",
+    ],
+    out: [
+        "apache-http-legacy-current.txt",
+    ],
+    cmd: "cp $(in) $(out)",
+}
+
+genrule {
+    name: "cts-car-system-current-txt",
+    visibility: default_visibility,
+    srcs: [
+        ":car-api-system-current.txt",
+    ],
+    out: [
+        "car-system-current.txt",
+    ],
+    cmd: "cp $(in) $(out)",
+}
+
+genrule {
+    name: "cts-car-system-removed-txt",
+    visibility: default_visibility,
+    srcs: [
+        ":car-api-system-removed.txt",
+    ],
+    out: [
+        "car-system-removed.txt",
+    ],
+    cmd: "cp $(in) $(out)",
+}
diff --git a/tests/signature/api/Android.mk b/tests/signature/api/Android.mk
index 6cd2ee6..6e7f13c 100644
--- a/tests/signature/api/Android.mk
+++ b/tests/signature/api/Android.mk
@@ -16,9 +16,9 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# $(1) name of the xml file to be created
+# $(1) name of the txt file to be created
 # $(2) path to the api text file
-define build_xml_api_file
+define copy_api_txt_file
 include $(CLEAR_VARS)
 LOCAL_MODULE := cts-$(subst .,-,$(1))
 LOCAL_MODULE_STEM := $(1)
@@ -26,27 +26,13 @@
 LOCAL_COMPATIBILITY_SUITE := arcts cts vts general-tests
 include $(BUILD_SYSTEM)/base_rules.mk
 $$(LOCAL_BUILT_MODULE): $(2) | $(APICHECK)
-	@echo "Convert API file $$< -> $$@"
-	@mkdir -p $$(dir $$@)
-	$(hide) $(APICHECK_COMMAND) -convert2xmlnostrip $$< $$@
+	@echo "Copying API file $$< -> $$@"
+	$$(copy-file-to-target)
 endef
 
-# NOTE: the output XML file is also used
-# in //cts/hostsidetests/devicepolicy/AndroidTest.xml
-# by com.android.cts.managedprofile.CurrentApiHelper
-# ============================================================
-$(eval $(call build_xml_api_file,current.api,frameworks/base/api/current.txt))
-$(eval $(call build_xml_api_file,system-current.api,frameworks/base/api/system-current.txt))
-$(eval $(call build_xml_api_file,system-removed.api,frameworks/base/api/system-removed.txt))
-$(eval $(call build_xml_api_file,apache-http-legacy-current.api,external/apache-http/api/current.txt))
-$(eval $(call build_xml_api_file,android-test-base-current.api,frameworks/base/test-base/api/current.txt))
-$(eval $(call build_xml_api_file,android-test-mock-current.api,frameworks/base/test-mock/api/current.txt))
-$(eval $(call build_xml_api_file,android-test-runner-current.api,frameworks/base/test-runner/api/current.txt))
-$(eval $(call build_xml_api_file,car-system-current.api,packages/services/Car/car-lib/api/system-current.txt))
-$(eval $(call build_xml_api_file,car-system-removed.api,packages/services/Car/car-lib/api/system-removed.txt))
 $(foreach ver,$(PLATFORM_SYSTEMSDK_VERSIONS),\
   $(if $(call math_is_number,$(ver)),\
-    $(eval $(call build_xml_api_file,system-$(ver).api,prebuilts/sdk/$(ver)/system/api/android.txt))\
+    $(eval $(call copy_api_txt_file,system-$(ver).txt,prebuilts/sdk/$(ver)/system/api/android.txt))\
   )\
 )
 
@@ -54,4 +40,4 @@
   $(foreach api_level,public system,\
     $(foreach lib,$(filter-out android,$(filter-out %removed,$(filter-out incompatibilities,\
       $(basename $(notdir $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/$(ver)/$(api_level)/api/*.txt)))))),\
-        $(eval $(call build_xml_api_file,$(lib)-$(ver)-$(api_level).api,prebuilts/sdk/$(ver)/$(api_level)/api/$(lib).txt)))))
+        $(eval $(call copy_api_txt_file,$(lib)-$(ver)-$(api_level).txt,prebuilts/sdk/$(ver)/$(api_level)/api/$(lib).txt)))))
diff --git a/tests/signature/intent-check/Android.bp b/tests/signature/intent-check/Android.bp
new file mode 100644
index 0000000..299e2b7
--- /dev/null
+++ b/tests/signature/intent-check/Android.bp
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsIntentSignatureTestCases",
+    defaults: ["cts_defaults"],
+
+    srcs: ["src/**/*.java"],
+    java_resources: [
+        ":cts-current-txt",
+        ":cts-system-current-txt",
+        ":cts-system-removed-txt",
+    ],
+
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+
+    sdk_version: "test_current",
+
+    static_libs: [
+        "compatibility-device-util-axt",
+        "androidx.test.rules",
+        "cts-signature-common",
+    ],
+
+    host_required: ["cts-dynamic-config"],
+}
diff --git a/tests/signature/intent-check/Android.mk b/tests/signature/intent-check/Android.mk
deleted file mode 100644
index b015d21..0000000
--- a/tests/signature/intent-check/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 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_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsIntentSignatureTestCases
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    androidx.test.rules \
-    cts-signature-common \
-
-LOCAL_HOST_REQUIRED_MODULES := cts-dynamic-config
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/signature/intent-check/AndroidTest.xml b/tests/signature/intent-check/AndroidTest.xml
index e76cd79..40968ec 100644
--- a/tests/signature/intent-check/AndroidTest.xml
+++ b/tests/signature/intent-check/AndroidTest.xml
@@ -34,21 +34,13 @@
         <option name="run-command" value="mkdir -p /data/local/tmp/signature-test" />
         <option name="teardown-command" value="rm -rf /data/local/tmp/signature-test" />
     </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="current.api->/data/local/tmp/signature-test/current.api" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="system-current.api->/data/local/tmp/signature-test/system-current.api" />
-    </target_preparer>
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="push" value="system-removed.api->/data/local/tmp/signature-test/system-removed.api" />
-    </target_preparer>
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
         <option name="test-file-name" value="CtsIntentSignatureTestCases.apk" />
     </target_preparer>
     <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
         <option name="package" value="android.signature.cts.intent" />
+        <option name="class" value="android.signature.cts.intent.IntentTest" />
         <option name="runtime-hint" value="10s" />
         <!-- disable isolated storage so tests can access dynamic config stored in /sdcard. -->
         <option name="isolated-storage" value="false" />
diff --git a/tests/signature/intent-check/src/android/signature/cts/intent/IntentTest.java b/tests/signature/intent-check/src/android/signature/cts/intent/IntentTest.java
index af5c4b9..0195dc4 100644
--- a/tests/signature/intent-check/src/android/signature/cts/intent/IntentTest.java
+++ b/tests/signature/intent-check/src/android/signature/cts/intent/IntentTest.java
@@ -15,14 +15,11 @@
  */
 package android.signature.cts.intent;
 
-import static android.signature.cts.CurrentApi.CURRENT_API_FILE;
-import static android.signature.cts.CurrentApi.SYSTEM_CURRENT_API_FILE;
-import static android.signature.cts.CurrentApi.SYSTEM_REMOVED_API_FILE;
-
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
 import android.signature.cts.ApiDocumentParser;
 import android.signature.cts.JDiffClassDescription.JDiffField;
+import android.signature.cts.VirtualPath;
 import android.util.Log;
 
 import androidx.test.InstrumentationRegistry;
@@ -30,16 +27,15 @@
 
 import com.android.compatibility.common.util.DynamicConfigDeviceSide;
 
+import java.io.IOException;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.xmlpull.v1.XmlPullParserException;
 
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.IOException;
 import java.io.InputStreamReader;
 import java.util.HashSet;
 import java.util.List;
@@ -51,9 +47,16 @@
  */
 @RunWith(AndroidJUnit4.class)
 public class IntentTest {
+
+    private static final String CURRENT_API_RESOURCE = "current.txt";
+
+    private static final String SYSTEM_CURRENT_API_RESOURCE = "system-current.txt";
+
+    private static final String SYSTEM_REMOVED_API_RESOURCE = "system-removed.txt";
+
     private static final String TAG = IntentTest.class.getSimpleName();
 
-    private static final File SIGNATURE_TEST_PACKGES =
+    private static final File SIGNATURE_TEST_PACKAGES =
             new File("/data/local/tmp/signature-test-packages");
     private static final String ANDROID_INTENT_PREFIX = "android.intent.action";
     private static final String ACTION_LINE_PREFIX = "          Action: ";
@@ -110,26 +113,23 @@
         Assert.assertTrue(errors.toString(), errors.isEmpty());
     }
 
-    private Set<String> lookupPlatformIntents() {
-        try {
-            Set<String> intents = new HashSet<>();
-            intents.addAll(parse(CURRENT_API_FILE));
-            intents.addAll(parse(SYSTEM_CURRENT_API_FILE));
-            intents.addAll(parse(SYSTEM_REMOVED_API_FILE));
-            return intents;
-        } catch (XmlPullParserException | IOException e) {
-            throw new RuntimeException("failed to parse", e);
-        }
+    private Set<String> lookupPlatformIntents() throws IOException {
+        Set<String> intents = new HashSet<>();
+        intents.addAll(parse(CURRENT_API_RESOURCE));
+        intents.addAll(parse(SYSTEM_CURRENT_API_RESOURCE));
+        intents.addAll(parse(SYSTEM_REMOVED_API_RESOURCE));
+        return intents;
     }
 
-    private static Set<String> parse(String apiFileName)
-            throws XmlPullParserException, IOException {
+    private static Set<String> parse(String apiResourceName) throws IOException {
 
         Set<String> androidIntents = new HashSet<>();
 
         ApiDocumentParser apiDocumentParser = new ApiDocumentParser(TAG);
 
-        apiDocumentParser.parseAsStream(new FileInputStream(new File(apiFileName))).forEach(
+        VirtualPath.ResourcePath virtualPath =
+                VirtualPath.get(IntentTest.class.getClassLoader(), apiResourceName);
+        apiDocumentParser.parseAsStream(virtualPath).forEach(
                 classDescription -> {
                     for (JDiffField diffField : classDescription.getFieldList()) {
                         String fieldValue = diffField.getValueString();
@@ -155,7 +155,7 @@
 
     private static Set<String> lookupActiveIntents(String packageName) {
         HashSet<String> activeIntents = new HashSet<>();
-        File dumpsysPackage = new File(SIGNATURE_TEST_PACKGES, packageName + ".txt");
+        File dumpsysPackage = new File(SIGNATURE_TEST_PACKAGES, packageName + ".txt");
         if (!dumpsysPackage.exists() || dumpsysPackage.length() == 0) {
           throw new RuntimeException("Missing package info: " + dumpsysPackage.getAbsolutePath());
         }
diff --git a/tests/signature/lib/android/Android.bp b/tests/signature/lib/android/Android.bp
index 55066ad..7b0e679 100644
--- a/tests/signature/lib/android/Android.bp
+++ b/tests/signature/lib/android/Android.bp
@@ -12,11 +12,19 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-java_library_static {
-  name: "cts-signature-common",
-  host_supported: false,
-  installable: false,
-  srcs: ["src/**/*.java"],
-  static_libs: ["signature-common-javalib"],
-  sdk_version: "current",
+java_library {
+    name: "cts-signature-common",
+    visibility: [
+        "//cts/tests/signature:__subpackages__",
+    ],
+    installable: false,
+    srcs: [
+        "src/**/*.java",
+        "src/**/*.kt",
+    ],
+    static_libs: [
+        "signature-common-javalib",
+        "metalava",
+    ],
+    sdk_version: "current",
 }
diff --git a/tests/signature/lib/android/src/android/signature/cts/ApiDocumentParser.java b/tests/signature/lib/android/src/android/signature/cts/ApiDocumentParser.java
index 18afa98..78027d4 100644
--- a/tests/signature/lib/android/src/android/signature/cts/ApiDocumentParser.java
+++ b/tests/signature/lib/android/src/android/signature/cts/ApiDocumentParser.java
@@ -15,32 +15,8 @@
  */
 package android.signature.cts;
 
-import static android.signature.cts.CurrentApi.ATTRIBUTE_NAME;
-import static android.signature.cts.CurrentApi.ATTRIBUTE_TYPE;
-import static android.signature.cts.CurrentApi.TAG_CLASS;
-import static android.signature.cts.CurrentApi.TAG_CONSTRUCTOR;
-import static android.signature.cts.CurrentApi.TAG_EXCEPTION;
-import static android.signature.cts.CurrentApi.TAG_FIELD;
-import static android.signature.cts.CurrentApi.TAG_IMPLEMENTS;
-import static android.signature.cts.CurrentApi.TAG_INTERFACE;
-import static android.signature.cts.CurrentApi.TAG_METHOD;
-import static android.signature.cts.CurrentApi.TAG_PACKAGE;
-import static android.signature.cts.CurrentApi.TAG_PARAM;
-import static android.signature.cts.CurrentApi.TAG_ROOT;
-
-import android.util.Log;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Spliterator;
-import java.util.function.Consumer;
 import java.util.stream.Stream;
-import java.util.stream.StreamSupport;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlPullParserFactory;
+
 
 /**
  * Parses an XML api definition file and constructs and populates an {@link JDiffClassDescription}
@@ -50,177 +26,25 @@
  */
 public class ApiDocumentParser {
 
-    private static final Set<String> KEY_TAG_SET;
-    static {
-        KEY_TAG_SET = new HashSet<>();
-        Collections.addAll(KEY_TAG_SET,
-                TAG_PACKAGE,
-                TAG_CLASS,
-                TAG_INTERFACE,
-                TAG_IMPLEMENTS,
-                TAG_CONSTRUCTOR,
-                TAG_METHOD,
-                TAG_PARAM,
-                TAG_EXCEPTION,
-                TAG_FIELD);
-    }
-
     private final String tag;
 
-    private final XmlPullParserFactory factory;
-
-    public ApiDocumentParser(String tag) throws XmlPullParserException {
+    public ApiDocumentParser(String tag) {
         this.tag = tag;
-        factory = XmlPullParserFactory.newInstance();
     }
 
-    public Stream<JDiffClassDescription> parseAsStream(InputStream inputStream)
-            throws XmlPullParserException, IOException {
-        XmlPullParser parser = factory.newPullParser();
-        parser.setInput(inputStream, null);
-        return StreamSupport.stream(new ClassDescriptionSpliterator(parser), false);
-    }
-
-    private class ClassDescriptionSpliterator implements Spliterator<JDiffClassDescription> {
-
-        private final XmlPullParser parser;
-
-        JDiffClassDescription currentClass = null;
-        String currentPackage = "";
-        JDiffClassDescription.JDiffMethod currentMethod = null;
-
-        ClassDescriptionSpliterator(XmlPullParser parser) throws IOException, XmlPullParserException {
-            this.parser = parser;
-            logd(String.format("Name: %s", parser.getName()));
-            logd(String.format("Text: %s", parser.getText()));
-            logd(String.format("Namespace: %s", parser.getNamespace()));
-            logd(String.format("Line Number: %s", parser.getLineNumber()));
-            logd(String.format("Column Number: %s", parser.getColumnNumber()));
-            logd(String.format("Position Description: %s", parser.getPositionDescription()));
-            beginDocument(parser, TAG_ROOT);
-        }
-
-        @Override
-        public boolean tryAdvance(Consumer<? super JDiffClassDescription> action) {
-            JDiffClassDescription classDescription;
-            try {
-                classDescription = next();
-            } catch (IOException|XmlPullParserException e) {
-                throw new RuntimeException(e);
-            }
-
-            if (classDescription == null) {
-                return false;
-            }
-            action.accept(classDescription);
-            return true;
-        }
-
-        @Override
-        public Spliterator<JDiffClassDescription> trySplit() {
-            return null;
-        }
-
-        @Override
-        public long estimateSize() {
-            return Long.MAX_VALUE;
-        }
-
-        @Override
-        public int characteristics() {
-            return ORDERED | DISTINCT | NONNULL | IMMUTABLE;
-        }
-
-        private void beginDocument(XmlPullParser parser, String firstElementName)
-                throws XmlPullParserException, IOException {
-            int type;
-            do {
-                type = parser.next();
-            } while (type != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT);
-
-            if (type != XmlPullParser.START_TAG) {
-                throw new XmlPullParserException("No start tag found");
-            }
-
-            if (!parser.getName().equals(firstElementName)) {
-                throw new XmlPullParserException("Unexpected start tag: found " + parser.getName() +
-                        ", expected " + firstElementName);
-            }
-        }
-
-        private JDiffClassDescription next() throws IOException, XmlPullParserException {
-            int type;
-            while (true) {
-                do {
-                    type = parser.next();
-                } while (type != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT
-                        && type != XmlPullParser.END_TAG);
-
-                if (type == XmlPullParser.END_DOCUMENT) {
-                    logd("Reached end of document");
-                    break;
-                }
-
-                String tagname = parser.getName();
-                if (type == XmlPullParser.END_TAG) {
-                    if (TAG_CLASS.equals(tagname) || TAG_INTERFACE.equals(tagname)) {
-                        logd("Reached end of class: " + currentClass);
-                        return currentClass;
-                    } else if (TAG_PACKAGE.equals(tagname)) {
-                        currentPackage = "";
-                    }
-                    continue;
-                }
-
-                if (!KEY_TAG_SET.contains(tagname)) {
-                    continue;
-                }
-
-                if (tagname.equals(TAG_PACKAGE)) {
-                    currentPackage = parser.getAttributeValue(null, ATTRIBUTE_NAME);
-                } else if (tagname.equals(TAG_CLASS)) {
-                    currentClass = CurrentApi.loadClassInfo(
-                            parser, false, currentPackage);
-                } else if (tagname.equals(TAG_INTERFACE)) {
-                    currentClass = CurrentApi.loadClassInfo(
-                            parser, true, currentPackage);
-                } else if (tagname.equals(TAG_IMPLEMENTS)) {
-                    currentClass.addImplInterface(parser.getAttributeValue(null, ATTRIBUTE_NAME));
-                } else if (tagname.equals(TAG_CONSTRUCTOR)) {
-                    JDiffClassDescription.JDiffConstructor constructor =
-                            CurrentApi.loadConstructorInfo(parser, currentClass);
-                    currentClass.addConstructor(constructor);
-                    currentMethod = constructor;
-                } else if (tagname.equals(TAG_METHOD)) {
-                    currentMethod = CurrentApi.loadMethodInfo(currentClass.getClassName(), parser);
-                    currentClass.addMethod(currentMethod);
-                } else if (tagname.equals(TAG_PARAM)) {
-                    currentMethod.addParam(parser.getAttributeValue(null, ATTRIBUTE_TYPE));
-                } else if (tagname.equals(TAG_EXCEPTION)) {
-                    currentMethod.addException(parser.getAttributeValue(null, ATTRIBUTE_TYPE));
-                } else if (tagname.equals(TAG_FIELD)) {
-                    JDiffClassDescription.JDiffField field = CurrentApi.loadFieldInfo(currentClass.getClassName(), parser);
-                    currentClass.addField(field);
-                } else {
-                    throw new RuntimeException(
-                            "unknown tag exception:" + tagname);
-                }
-                if (currentPackage != null) {
-                    logd(String.format("currentPackage: %s", currentPackage));
-                }
-                if (currentClass != null) {
-                    logd(String.format("currentClass: %s", currentClass.toSignatureString()));
-                }
-                if (currentMethod != null) {
-                    logd(String.format("currentMethod: %s", currentMethod.toSignatureString()));
-                }
-            }
-
-            return null;
+    private ApiParser getApiParser(VirtualPath path) {
+        if (path.toString().endsWith(".txt")) {
+            return new TextApiParser();
+        } else if (path.toString().endsWith(".api")) {
+            return new XmlApiParser(tag);
+        } else {
+            throw new IllegalStateException("Unrecognized file type: " + path);
         }
     }
 
-    private void logd(String msg) {
-        Log.d(tag, msg);
+    public Stream<JDiffClassDescription> parseAsStream(VirtualPath path) {
+        ApiParser parser = getApiParser(path);
+
+        return parser.parseAsStream(path);
     }
 }
diff --git a/tests/signature/lib/android/src/android/signature/cts/ApiParser.java b/tests/signature/lib/android/src/android/signature/cts/ApiParser.java
new file mode 100644
index 0000000..15444cc
--- /dev/null
+++ b/tests/signature/lib/android/src/android/signature/cts/ApiParser.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+package android.signature.cts;
+
+import java.util.stream.Stream;
+
+/**
+ * Base class for parsers of API specification.
+ */
+abstract class ApiParser {
+
+    /**
+     * Parse the contents of the path and generate a stream of {@link JDiffClassDescription}
+     * instances.
+     *
+     * @param path the path to the API specification.
+     * @return the stream of {@link JDiffClassDescription} instances.
+     */
+    abstract Stream<JDiffClassDescription> parseAsStream(VirtualPath path);
+}
diff --git a/tests/signature/lib/android/src/android/signature/cts/CurrentApi.java b/tests/signature/lib/android/src/android/signature/cts/CurrentApi.java
index 611bcb5..c5e0d16 100644
--- a/tests/signature/lib/android/src/android/signature/cts/CurrentApi.java
+++ b/tests/signature/lib/android/src/android/signature/cts/CurrentApi.java
@@ -15,14 +15,6 @@
  */
 package android.signature.cts;
 
-import android.signature.cts.JDiffClassDescription.JDiffConstructor;
-import android.signature.cts.JDiffClassDescription.JDiffField;
-import android.signature.cts.JDiffClassDescription.JDiffMethod;
-
-import java.lang.reflect.Modifier;
-
-import org.xmlpull.v1.XmlPullParser;
-
 /**
  * Helper methods and constants used for parsing the current api file.
  */
@@ -32,159 +24,4 @@
 
     public static final String API_FILE_DIRECTORY = "/data/local/tmp/signature-test";
 
-    public static final String CURRENT_API_FILE =
-            API_FILE_DIRECTORY + "/current.api";
-    public static final String SYSTEM_CURRENT_API_FILE =
-            API_FILE_DIRECTORY + "/system-current.api";
-    public static final String SYSTEM_REMOVED_API_FILE =
-            API_FILE_DIRECTORY + "/system-removed.api";
-
-    static final String TAG_ROOT = "api";
-    static final String TAG_PACKAGE = "package";
-    static final String TAG_CLASS = "class";
-    static final String TAG_INTERFACE = "interface";
-    static final String TAG_IMPLEMENTS = "implements";
-    static final String TAG_CONSTRUCTOR = "constructor";
-    static final String TAG_METHOD = "method";
-    static final String TAG_PARAM = "parameter";
-    static final String TAG_EXCEPTION = "exception";
-    static final String TAG_FIELD = "field";
-
-    private static final String MODIFIER_ABSTRACT = "abstract";
-    private static final String MODIFIER_FINAL = "final";
-    private static final String MODIFIER_NATIVE = "native";
-    private static final String MODIFIER_PRIVATE = "private";
-    private static final String MODIFIER_PROTECTED = "protected";
-    private static final String MODIFIER_PUBLIC = "public";
-    private static final String MODIFIER_STATIC = "static";
-    private static final String MODIFIER_SYNCHRONIZED = "synchronized";
-    private static final String MODIFIER_TRANSIENT = "transient";
-    private static final String MODIFIER_VOLATILE = "volatile";
-    private static final String MODIFIER_VISIBILITY = "visibility";
-
-    static final String ATTRIBUTE_NAME = "name";
-    private static final String ATTRIBUTE_VALUE = "value";
-    private static final String ATTRIBUTE_EXTENDS = "extends";
-    static final String ATTRIBUTE_TYPE = "type";
-    private static final String ATTRIBUTE_RETURN = "return";
-
-    /**
-     * Load field information from xml to memory.
-     *
-     * @param className of the class being examined which will be shown in error messages
-     * @param parser The XmlPullParser which carries the xml information.
-     * @return the new field
-     */
-    static JDiffField loadFieldInfo(String className, XmlPullParser parser) {
-        String fieldName = parser.getAttributeValue(null, ATTRIBUTE_NAME);
-        String fieldType = parser.getAttributeValue(null, ATTRIBUTE_TYPE);
-        int modifier = jdiffModifierToReflectionFormat(className, parser);
-        String value = parser.getAttributeValue(null, ATTRIBUTE_VALUE);
-        return new JDiffField(fieldName, fieldType, modifier, value);
-    }
-
-    /**
-     * Load method information from xml to memory.
-     *
-     * @param className of the class being examined which will be shown in error messages
-     * @param parser The XmlPullParser which carries the xml information.
-     * @return the newly loaded method.
-     */
-    static JDiffMethod loadMethodInfo(String className, XmlPullParser parser) {
-        String methodName = parser.getAttributeValue(null, ATTRIBUTE_NAME);
-        String returnType = parser.getAttributeValue(null, ATTRIBUTE_RETURN);
-        int modifier = jdiffModifierToReflectionFormat(className, parser);
-        return new JDiffMethod(methodName, modifier, returnType);
-    }
-
-    /**
-     * Load constructor information from xml to memory.
-     *
-     * @param parser The XmlPullParser which carries the xml information.
-     * @param currentClass the current class being loaded.
-     * @return the new constructor
-     */
-    static JDiffConstructor loadConstructorInfo(
-            XmlPullParser parser, JDiffClassDescription currentClass) {
-        String name = currentClass.getClassName();
-        int modifier = jdiffModifierToReflectionFormat(name, parser);
-        return new JDiffConstructor(name, modifier);
-    }
-
-    /**
-     * Load class or interface information to memory.
-     *
-     * @param parser The XmlPullParser which carries the xml information.
-     * @param isInterface true if the current class is an interface, otherwise is false.
-     * @param pkg the name of the java package this class can be found in.
-     * @return the new class description.
-     */
-    static JDiffClassDescription loadClassInfo(
-            XmlPullParser parser, boolean isInterface, String pkg) {
-        String className = parser.getAttributeValue(null, ATTRIBUTE_NAME);
-        JDiffClassDescription currentClass = new JDiffClassDescription(pkg, className);
-
-        currentClass.setModifier(jdiffModifierToReflectionFormat(className, parser));
-        currentClass.setType(isInterface ? JDiffClassDescription.JDiffType.INTERFACE :
-                             JDiffClassDescription.JDiffType.CLASS);
-        currentClass.setExtendsClass(parser.getAttributeValue(null, ATTRIBUTE_EXTENDS));
-        return currentClass;
-    }
-
-    /**
-     * Convert string modifier to int modifier.
-     *
-     * @param name of the class/method/field being examined which will be shown in error messages
-     * @param key modifier name
-     * @param value modifier value
-     * @return converted modifier value
-     */
-    private static int modifierDescriptionToReflectedType(String name, String key, String value) {
-        if (key.equals(MODIFIER_ABSTRACT)) {
-            return value.equals("true") ? Modifier.ABSTRACT : 0;
-        } else if (key.equals(MODIFIER_FINAL)) {
-            return value.equals("true") ? Modifier.FINAL : 0;
-        } else if (key.equals(MODIFIER_NATIVE)) {
-            return value.equals("true") ? Modifier.NATIVE : 0;
-        } else if (key.equals(MODIFIER_STATIC)) {
-            return value.equals("true") ? Modifier.STATIC : 0;
-        } else if (key.equals(MODIFIER_SYNCHRONIZED)) {
-            return value.equals("true") ? Modifier.SYNCHRONIZED : 0;
-        } else if (key.equals(MODIFIER_TRANSIENT)) {
-            return value.equals("true") ? Modifier.TRANSIENT : 0;
-        } else if (key.equals(MODIFIER_VOLATILE)) {
-            return value.equals("true") ? Modifier.VOLATILE : 0;
-        } else if (key.equals(MODIFIER_VISIBILITY)) {
-            if (value.equals(MODIFIER_PRIVATE)) {
-                throw new RuntimeException("Private visibility found in API spec: " + name);
-            } else if (value.equals(MODIFIER_PROTECTED)) {
-                return Modifier.PROTECTED;
-            } else if (value.equals(MODIFIER_PUBLIC)) {
-                return Modifier.PUBLIC;
-            } else if ("".equals(value)) {
-                // If the visibility is "", it means it has no modifier.
-                // which is package private. We should return 0 for this modifier.
-                return 0;
-            } else {
-                throw new RuntimeException("Unknown modifier found in API spec: " + value);
-            }
-        }
-        return 0;
-    }
-
-    /**
-     * Transfer string modifier to int one.
-     *
-     * @param name of the class/method/field being examined which will be shown in error messages
-     * @param parser XML resource parser
-     * @return converted modifier
-     */
-    private static int jdiffModifierToReflectionFormat(String name, XmlPullParser parser){
-        int modifier = 0;
-        for (int i = 0;i < parser.getAttributeCount();i++) {
-            modifier |= modifierDescriptionToReflectedType(name, parser.getAttributeName(i),
-                    parser.getAttributeValue(i));
-        }
-        return modifier;
-    }
 }
diff --git a/tests/signature/lib/android/src/android/signature/cts/KtHelper.kt b/tests/signature/lib/android/src/android/signature/cts/KtHelper.kt
new file mode 100644
index 0000000..4d2fade
--- /dev/null
+++ b/tests/signature/lib/android/src/android/signature/cts/KtHelper.kt
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+@file:JvmName("KtHelper")
+package android.signature.cts
+
+import com.android.tools.metalava.model.TypeItem
+
+/**
+ * Allows Java to call the TypeItem.toTypeString() without having to explicitly specify each named
+ * parameter to its default. This allows additional parameters to be added to the method without
+ * breaking the Java code.
+ */
+fun toDefaultTypeString(item: TypeItem): String {
+    // Normalize the strings to contain , without a following space. This is needed because
+    // different versions of the txt specification used different separators in generic types, some
+    // used "," and some used ", " and metalava does not normalize them. e.g. some files will format
+    // a Map from String to Integer as "java.util.Map<java.lang.String,java.lang.Integer>" and some
+    // will format it as "java.util.Map<java.lang.String, java.lang.Integer>".
+    //
+    // Must match separator used in android.signature.cts.ReflectionHelper.typeToString.
+    return item.toTypeString().replace(", ", ",")
+}
diff --git a/tests/signature/lib/android/src/android/signature/cts/TextApiParser.java b/tests/signature/lib/android/src/android/signature/cts/TextApiParser.java
new file mode 100644
index 0000000..26ac862
--- /dev/null
+++ b/tests/signature/lib/android/src/android/signature/cts/TextApiParser.java
@@ -0,0 +1,191 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+package android.signature.cts;
+
+import android.signature.cts.JDiffClassDescription.JDiffConstructor;
+import android.signature.cts.JDiffClassDescription.JDiffField;
+import android.signature.cts.JDiffClassDescription.JDiffMethod;
+import com.android.tools.metalava.doclava1.ApiFile;
+import com.android.tools.metalava.doclava1.ApiParseException;
+import com.android.tools.metalava.doclava1.TextCodebase;
+import com.android.tools.metalava.model.ClassItem;
+import com.android.tools.metalava.model.ConstructorItem;
+import com.android.tools.metalava.model.FieldItem;
+import com.android.tools.metalava.model.Item;
+import com.android.tools.metalava.model.MethodItem;
+import com.android.tools.metalava.model.ModifierList;
+import com.android.tools.metalava.model.PackageItem;
+import com.android.tools.metalava.model.ParameterItem;
+import com.android.tools.metalava.model.TypeItem;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.lang.reflect.Modifier;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import kotlin.streams.jdk8.StreamsKt;
+
+/**
+ * Parser for the text representation of an API specification.
+ */
+public class TextApiParser extends ApiParser {
+
+    @Override
+    public Stream<JDiffClassDescription> parseAsStream(VirtualPath path) {
+        try {
+            String content = new BufferedReader(new InputStreamReader(path.newInputStream()))
+                    .lines()
+                    .parallel()
+                    .collect(Collectors.joining("\n"));
+            TextCodebase codebase = ApiFile.parseApi(path.toString(), content, false);
+            List<PackageItem> packages = codebase.getPackages().getPackages();
+            return packages.stream()
+                    // Map each package to the Sequence of ClassItems that it contains
+                    .map(PackageItem::allClasses)
+                    // Flatten the Sequences of ClassItems into one stream.
+                    .flatMap(StreamsKt::asStream)
+                    // Filter out TextClassItems that are used from but not defined in the source.
+                    .filter(ClassItem::isDefined)
+                    .map(TextApiParser::convertClass);
+        } catch (IOException | ApiParseException e) {
+            throw new RuntimeException("Could not parse " + path, e);
+        }
+    }
+
+    private static JDiffClassDescription convertClass(ClassItem item) {
+        String pkg = item.containingPackage().qualifiedName();
+
+        JDiffClassDescription currentClass = new JDiffClassDescription(pkg, item.fullName());
+
+        int modifiers = getModifiers(item);
+
+        currentClass.setModifier(modifiers);
+        currentClass.setType(item.isInterface() ? JDiffClassDescription.JDiffType.INTERFACE :
+                JDiffClassDescription.JDiffType.CLASS);
+
+        // Map the super class.
+        ClassItem superClass = item.superClass();
+        if (superClass != null) {
+            String extendsClass = superClass.qualifiedName();
+            if (item.isInterface()) {
+                // TextCodebase treats an interface as if it extends java.lang.Object.
+                if (!superClass.isJavaLangObject()) {
+                    currentClass.addImplInterface(extendsClass);
+                }
+            } else {
+                currentClass.setExtendsClass(extendsClass);
+            }
+        }
+
+        // Map the interfaces.
+        item.interfaceTypes().stream()
+                .map(TypeItem::asClass)
+                .filter(Objects::nonNull)
+                .map(ClassItem::qualifiedName)
+                .forEach(currentClass::addImplInterface);
+
+        item.fields().stream().map(TextApiParser::convertField).forEach(currentClass::addField);
+
+        item.constructors().stream()
+                .map(TextApiParser::convertConstructor)
+                .forEach(currentClass::addConstructor);
+
+        item.methods().stream()
+                .map(TextApiParser::convertMethod)
+                .forEach(currentClass::addMethod);
+
+        return currentClass;
+    }
+
+    private static int getModifiers(Item item) {
+        ModifierList modifierList = item.getModifiers();
+        int modifiers = 0;
+        if (modifierList.isAbstract()) {
+            modifiers |= Modifier.ABSTRACT;
+        }
+        if (modifierList.isFinal()) {
+            modifiers |= Modifier.FINAL;
+        }
+        if (modifierList.isNative()) {
+            modifiers |= Modifier.NATIVE;
+        }
+        if (modifierList.isStatic()) {
+            modifiers |= Modifier.STATIC;
+        }
+        if (modifierList.isSynchronized()) {
+            modifiers |= Modifier.SYNCHRONIZED;
+        }
+        if (modifierList.isTransient()) {
+            modifiers |= Modifier.TRANSIENT;
+        }
+        if (modifierList.isVolatile()) {
+            modifiers |= Modifier.VOLATILE;
+        }
+        if (modifierList.isPrivate()) {
+            modifiers |= Modifier.PRIVATE;
+        } else if (modifierList.isProtected()) {
+            modifiers |= Modifier.PROTECTED;
+        } else if (modifierList.isPublic()) {
+            modifiers |= Modifier.PUBLIC;
+        }
+        return modifiers;
+    }
+
+    private static JDiffField convertField(FieldItem item) {
+        int modifiers = getModifiers(item);
+        Object value = item.initialValue(true);
+
+        if (item.isEnumConstant()) {
+            // Set the enum bit on the enum constant to match the modifiers returned by reflection.
+            modifiers |= 0x00004000;
+        }
+
+        return new JDiffField(item.name(),
+                KtHelper.toDefaultTypeString(item.type()), modifiers,
+                value == null ? null : value.toString());
+    }
+
+    private static JDiffConstructor convertConstructor(ConstructorItem item) {
+        JDiffConstructor constructor = new JDiffConstructor(item.name(), getModifiers(item));
+
+        convertParameters(item, constructor);
+
+        return constructor;
+    }
+
+    private static void convertParameters(MethodItem item, JDiffMethod method) {
+        item.parameters().stream()
+                .map(TextApiParser::convertParameter)
+                .forEach(method::addParam);
+    }
+
+    private static JDiffMethod convertMethod(MethodItem item) {
+        TypeItem returnType = item.returnType();
+        String returnTypeAsString = returnType == null ? null
+                : KtHelper.toDefaultTypeString(returnType);
+        JDiffMethod method = new JDiffMethod(item.name(), getModifiers(item), returnTypeAsString);
+
+        convertParameters(item, method);
+
+        return method;
+    }
+
+    private static String convertParameter(ParameterItem item) {
+        return KtHelper.toDefaultTypeString(item.type());
+    }
+}
diff --git a/tests/signature/lib/android/src/android/signature/cts/VirtualPath.java b/tests/signature/lib/android/src/android/signature/cts/VirtualPath.java
new file mode 100644
index 0000000..140dd6d
--- /dev/null
+++ b/tests/signature/lib/android/src/android/signature/cts/VirtualPath.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+package android.signature.cts;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+/**
+ * Workaround for the lack of a zip file system provider on Android.
+ */
+public abstract class VirtualPath {
+
+    /**
+     * Get a path to the local file system.
+     */
+    public static LocalFilePath get(String path) {
+        return new LocalFilePath(path);
+    }
+
+    /**
+     * Get a path to an entry in a zip file, i.e. a zip file system.
+     */
+    public static ZipEntryPath get(ZipFile zip, ZipEntry entry) {
+        return new ZipEntryPath(zip, entry);
+    }
+
+    /**
+     * Get a path to a resource in a ClassLoader.
+     *
+     * @param classLoader the ClassLoader containing the resource.
+     * @param resourceName the name of the resource, must not start with a /.
+     */
+    public static ResourcePath get(ClassLoader classLoader, String resourceName)
+            throws IOException {
+        return new ResourcePath(classLoader, resourceName);
+    }
+
+    public abstract InputStream newInputStream() throws IOException;
+
+    public static class LocalFilePath extends VirtualPath {
+        private final String path;
+
+        LocalFilePath(String path) {
+            this.path = path;
+        }
+
+        public File toFile() {
+            return new File(path);
+        }
+
+        public LocalFilePath resolve(String relative) {
+            return new LocalFilePath(path + "/" + relative);
+        }
+
+        @Override
+        public InputStream newInputStream() throws IOException {
+            return new FileInputStream(path);
+        }
+
+        @Override
+        public String toString() {
+            return path;
+        }
+    }
+
+    private static class ZipEntryPath extends VirtualPath {
+
+        private final ZipFile zip;
+
+        private final ZipEntry entry;
+
+        private ZipEntryPath(ZipFile zip, ZipEntry entry) {
+            this.zip = zip;
+            this.entry = entry;
+        }
+
+        @Override
+        public InputStream newInputStream() throws IOException {
+            return zip.getInputStream(entry);
+        }
+
+        @Override
+        public String toString() {
+            return "zip:file:" + zip.getName() + "!/" + entry.getName();
+        }
+    }
+
+    public static class ResourcePath extends VirtualPath {
+        private final URL url;
+
+        ResourcePath(ClassLoader classLoader, String path) throws IOException {
+            this.url = classLoader.getResource(path);
+            if (url == null) {
+                throw new IOException("Could not find resource '" + path + "' in " + classLoader);
+            }
+        }
+
+        @Override
+        public InputStream newInputStream() throws IOException {
+            return url.openStream();
+        }
+
+        @Override
+        public String toString() {
+            return url.toExternalForm();
+        }
+    }
+}
diff --git a/tests/signature/lib/android/src/android/signature/cts/XmlApiParser.java b/tests/signature/lib/android/src/android/signature/cts/XmlApiParser.java
new file mode 100644
index 0000000..8e5d0bb
--- /dev/null
+++ b/tests/signature/lib/android/src/android/signature/cts/XmlApiParser.java
@@ -0,0 +1,617 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+package android.signature.cts;
+
+import android.signature.cts.JDiffClassDescription.JDiffConstructor;
+import android.signature.cts.JDiffClassDescription.JDiffField;
+import android.signature.cts.JDiffClassDescription.JDiffMethod;
+import android.util.Log;
+import java.io.IOException;
+import java.lang.reflect.Modifier;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Spliterator;
+import java.util.function.Consumer;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
+
+/**
+ * Parser for the XML representation of an API specification.
+ */
+class XmlApiParser extends ApiParser {
+
+    private static final String TAG_ROOT = "api";
+
+    private static final String TAG_PACKAGE = "package";
+
+    private static final String TAG_CLASS = "class";
+
+    private static final String TAG_INTERFACE = "interface";
+
+    private static final String TAG_IMPLEMENTS = "implements";
+
+    private static final String TAG_CONSTRUCTOR = "constructor";
+
+    private static final String TAG_METHOD = "method";
+
+    private static final String TAG_PARAM = "parameter";
+
+    private static final String TAG_EXCEPTION = "exception";
+
+    private static final String TAG_FIELD = "field";
+
+    private static final String ATTRIBUTE_NAME = "name";
+
+    private static final String ATTRIBUTE_TYPE = "type";
+
+    private static final String ATTRIBUTE_VALUE = "value";
+
+    private static final String ATTRIBUTE_EXTENDS = "extends";
+
+    private static final String ATTRIBUTE_RETURN = "return";
+
+    private static final String MODIFIER_ABSTRACT = "abstract";
+
+    private static final String MODIFIER_FINAL = "final";
+
+    private static final String MODIFIER_NATIVE = "native";
+
+    private static final String MODIFIER_PRIVATE = "private";
+
+    private static final String MODIFIER_PROTECTED = "protected";
+
+    private static final String MODIFIER_PUBLIC = "public";
+
+    private static final String MODIFIER_STATIC = "static";
+
+    private static final String MODIFIER_SYNCHRONIZED = "synchronized";
+
+    private static final String MODIFIER_TRANSIENT = "transient";
+
+    private static final String MODIFIER_VOLATILE = "volatile";
+
+    private static final String MODIFIER_VISIBILITY = "visibility";
+
+    private static final Set<String> KEY_TAG_SET;
+
+    static {
+        KEY_TAG_SET = new HashSet<>();
+        Collections.addAll(KEY_TAG_SET,
+                TAG_PACKAGE,
+                TAG_CLASS,
+                TAG_INTERFACE,
+                TAG_IMPLEMENTS,
+                TAG_CONSTRUCTOR,
+                TAG_METHOD,
+                TAG_PARAM,
+                TAG_EXCEPTION,
+                TAG_FIELD);
+    }
+
+    private final String tag;
+
+    private final XmlPullParserFactory factory;
+
+    XmlApiParser(String tag) {
+        this.tag = tag;
+        try {
+            factory = XmlPullParserFactory.newInstance();
+        } catch (XmlPullParserException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * Load field information from xml to memory.
+     *
+     * @param className
+     *         of the class being examined which will be shown in error messages
+     * @param parser
+     *         The XmlPullParser which carries the xml information.
+     * @return the new field
+     */
+    private static JDiffField loadFieldInfo(String className, XmlPullParser parser) {
+        String fieldName = parser.getAttributeValue(null, ATTRIBUTE_NAME);
+        String fieldType = canonicalizeType(parser.getAttributeValue(null, ATTRIBUTE_TYPE));
+        int modifier = jdiffModifierToReflectionFormat(className, parser);
+        String value = parser.getAttributeValue(null, ATTRIBUTE_VALUE);
+
+        // Canonicalize the expected value to ensure that it is consistent with the values obtained
+        // using reflection by ApiComplianceChecker.getFieldValueAsString(...).
+        if (value != null) {
+
+            // An unquoted null String value actually means null. It cannot be confused with a
+            // String containing the word null as that would be surrounded with double quotes.
+            if (value.equals("null")) {
+                value = null;
+            } else {
+                switch (fieldType) {
+                    case "java.lang.String":
+                        value = unescapeFieldStringValue(value);
+                        break;
+
+                    case "char":
+                        // A character is encoded in XML as its numeric value. Convert it to a
+                        // string containing the single character.
+                        char c = (char) Integer.parseInt(value);
+                        value = String.valueOf(c);
+                        break;
+
+                    case "double":
+                        switch (value) {
+                            case "(-1.0/0.0)":
+                                value = "-Infinity";
+                                break;
+                            case "(0.0/0.0)":
+                                value = "NaN";
+                                break;
+                            case "(1.0/0.0)":
+                                value = "Infinity";
+                                break;
+                        }
+                        break;
+
+                    case "float":
+                        switch (value) {
+                            case "(-1.0f/0.0f)":
+                                value = "-Infinity";
+                                break;
+                            case "(0.0f/0.0f)":
+                                value = "NaN";
+                                break;
+                            case "(1.0f/0.0f)":
+                                value = "Infinity";
+                                break;
+                            default:
+                                // Remove the trailing f.
+                                if (value.endsWith("f")) {
+                                    value = value.substring(0, value.length() - 1);
+                                }
+                        }
+                        break;
+
+                    case "long":
+                        // Remove the trailing L.
+                        if (value.endsWith("L")) {
+                            value = value.substring(0, value.length() - 1);
+                        }
+                        break;
+                }
+            }
+        }
+
+        return new JDiffField(fieldName, fieldType, modifier, value);
+    }
+
+    /**
+     * Load method information from xml to memory.
+     *
+     * @param className
+     *         of the class being examined which will be shown in error messages
+     * @param parser
+     *         The XmlPullParser which carries the xml information.
+     * @return the newly loaded method.
+     */
+    private static JDiffMethod loadMethodInfo(String className, XmlPullParser parser) {
+        String methodName = parser.getAttributeValue(null, ATTRIBUTE_NAME);
+        String returnType = parser.getAttributeValue(null, ATTRIBUTE_RETURN);
+        int modifier = jdiffModifierToReflectionFormat(className, parser);
+        return new JDiffMethod(methodName, modifier, canonicalizeType(returnType));
+    }
+
+    /**
+     * Load constructor information from xml to memory.
+     *
+     * @param parser
+     *         The XmlPullParser which carries the xml information.
+     * @param currentClass
+     *         the current class being loaded.
+     * @return the new constructor
+     */
+    private static JDiffConstructor loadConstructorInfo(
+            XmlPullParser parser, JDiffClassDescription currentClass) {
+        String name = currentClass.getClassName();
+        int modifier = jdiffModifierToReflectionFormat(name, parser);
+        return new JDiffConstructor(name, modifier);
+    }
+
+    /**
+     * Load class or interface information to memory.
+     *
+     * @param parser
+     *         The XmlPullParser which carries the xml information.
+     * @param isInterface
+     *         true if the current class is an interface, otherwise is false.
+     * @param pkg
+     *         the name of the java package this class can be found in.
+     * @return the new class description.
+     */
+    private static JDiffClassDescription loadClassInfo(
+            XmlPullParser parser, boolean isInterface, String pkg) {
+        String className = parser.getAttributeValue(null, ATTRIBUTE_NAME);
+        JDiffClassDescription currentClass = new JDiffClassDescription(pkg, className);
+
+        currentClass.setModifier(jdiffModifierToReflectionFormat(className, parser));
+        currentClass.setType(isInterface ? JDiffClassDescription.JDiffType.INTERFACE :
+                JDiffClassDescription.JDiffType.CLASS);
+        currentClass.setExtendsClass(parser.getAttributeValue(null, ATTRIBUTE_EXTENDS));
+        return currentClass;
+    }
+
+    /**
+     * Transfer string modifier to int one.
+     *
+     * @param name
+     *         of the class/method/field being examined which will be shown in error messages
+     * @param parser
+     *         XML resource parser
+     * @return converted modifier
+     */
+    private static int jdiffModifierToReflectionFormat(String name, XmlPullParser parser) {
+        int modifier = 0;
+        for (int i = 0; i < parser.getAttributeCount(); i++) {
+            modifier |= modifierDescriptionToReflectedType(name, parser.getAttributeName(i),
+                    parser.getAttributeValue(i));
+        }
+        return modifier;
+    }
+
+    /**
+     * Convert string modifier to int modifier.
+     *
+     * @param name
+     *         of the class/method/field being examined which will be shown in error messages
+     * @param key
+     *         modifier name
+     * @param value
+     *         modifier value
+     * @return converted modifier value
+     */
+    private static int modifierDescriptionToReflectedType(String name, String key, String value) {
+        switch (key) {
+            case MODIFIER_ABSTRACT:
+                return value.equals("true") ? Modifier.ABSTRACT : 0;
+            case MODIFIER_FINAL:
+                return value.equals("true") ? Modifier.FINAL : 0;
+            case MODIFIER_NATIVE:
+                return value.equals("true") ? Modifier.NATIVE : 0;
+            case MODIFIER_STATIC:
+                return value.equals("true") ? Modifier.STATIC : 0;
+            case MODIFIER_SYNCHRONIZED:
+                return value.equals("true") ? Modifier.SYNCHRONIZED : 0;
+            case MODIFIER_TRANSIENT:
+                return value.equals("true") ? Modifier.TRANSIENT : 0;
+            case MODIFIER_VOLATILE:
+                return value.equals("true") ? Modifier.VOLATILE : 0;
+            case MODIFIER_VISIBILITY:
+                switch (value) {
+                    case MODIFIER_PRIVATE:
+                        throw new RuntimeException("Private visibility found in API spec: " + name);
+                    case MODIFIER_PROTECTED:
+                        return Modifier.PROTECTED;
+                    case MODIFIER_PUBLIC:
+                        return Modifier.PUBLIC;
+                    case "":
+                        // If the visibility is "", it means it has no modifier.
+                        // which is package private. We should return 0 for this modifier.
+                        return 0;
+                    default:
+                        throw new RuntimeException("Unknown modifier found in API spec: " + value);
+                }
+        }
+        return 0;
+    }
+
+    @Override
+    public Stream<JDiffClassDescription> parseAsStream(VirtualPath path) {
+        XmlPullParser parser;
+        try {
+            parser = factory.newPullParser();
+            parser.setInput(path.newInputStream(), null);
+            return StreamSupport
+                    .stream(new ClassDescriptionSpliterator(parser), false);
+        } catch (XmlPullParserException | IOException e) {
+            throw new RuntimeException("Could not parse " + path, e);
+        }
+    }
+
+    private class ClassDescriptionSpliterator implements Spliterator<JDiffClassDescription> {
+
+        private final XmlPullParser parser;
+
+        JDiffClassDescription currentClass = null;
+
+        String currentPackage = "";
+
+        JDiffMethod currentMethod = null;
+
+        ClassDescriptionSpliterator(XmlPullParser parser)
+                throws IOException, XmlPullParserException {
+            this.parser = parser;
+            logd(String.format("Name: %s", parser.getName()));
+            logd(String.format("Text: %s", parser.getText()));
+            logd(String.format("Namespace: %s", parser.getNamespace()));
+            logd(String.format("Line Number: %s", parser.getLineNumber()));
+            logd(String.format("Column Number: %s", parser.getColumnNumber()));
+            logd(String.format("Position Description: %s", parser.getPositionDescription()));
+            beginDocument(parser);
+        }
+
+        @Override
+        public boolean tryAdvance(Consumer<? super JDiffClassDescription> action) {
+            JDiffClassDescription classDescription;
+            try {
+                classDescription = next();
+            } catch (IOException | XmlPullParserException e) {
+                throw new RuntimeException(e);
+            }
+
+            if (classDescription == null) {
+                return false;
+            }
+            action.accept(classDescription);
+            return true;
+        }
+
+        @Override
+        public Spliterator<JDiffClassDescription> trySplit() {
+            return null;
+        }
+
+        @Override
+        public long estimateSize() {
+            return Long.MAX_VALUE;
+        }
+
+        @Override
+        public int characteristics() {
+            return ORDERED | DISTINCT | NONNULL | IMMUTABLE;
+        }
+
+        private void beginDocument(XmlPullParser parser)
+                throws XmlPullParserException, IOException {
+            int type;
+            do {
+                type = parser.next();
+            } while (type != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT);
+
+            if (type != XmlPullParser.START_TAG) {
+                throw new XmlPullParserException("No start tag found");
+            }
+
+            if (!parser.getName().equals(TAG_ROOT)) {
+                throw new XmlPullParserException("Unexpected start tag: found " + parser.getName() +
+                        ", expected " + TAG_ROOT);
+            }
+        }
+
+        private JDiffClassDescription next() throws IOException, XmlPullParserException {
+            int type;
+            while (true) {
+                do {
+                    type = parser.next();
+                } while (type != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT
+                        && type != XmlPullParser.END_TAG);
+
+                if (type == XmlPullParser.END_DOCUMENT) {
+                    logd("Reached end of document");
+                    break;
+                }
+
+                String tagname = parser.getName();
+                if (type == XmlPullParser.END_TAG) {
+                    if (TAG_CLASS.equals(tagname) || TAG_INTERFACE.equals(tagname)) {
+                        logd("Reached end of class: " + currentClass);
+                        return currentClass;
+                    } else if (TAG_PACKAGE.equals(tagname)) {
+                        currentPackage = "";
+                    }
+                    continue;
+                }
+
+                if (!KEY_TAG_SET.contains(tagname)) {
+                    continue;
+                }
+
+                switch (tagname) {
+                    case TAG_PACKAGE:
+                        currentPackage = parser.getAttributeValue(null, ATTRIBUTE_NAME);
+                        break;
+
+                    case TAG_CLASS:
+                        currentClass = loadClassInfo(parser, false, currentPackage);
+                        break;
+
+                    case TAG_INTERFACE:
+                        currentClass = loadClassInfo(parser, true, currentPackage);
+                        break;
+
+                    case TAG_IMPLEMENTS:
+                        currentClass
+                                .addImplInterface(parser.getAttributeValue(null, ATTRIBUTE_NAME));
+                        break;
+
+                    case TAG_CONSTRUCTOR:
+                        JDiffConstructor constructor =
+                                loadConstructorInfo(parser, currentClass);
+                        currentClass.addConstructor(constructor);
+                        currentMethod = constructor;
+                        break;
+
+                    case TAG_METHOD:
+                        currentMethod = loadMethodInfo(currentClass.getClassName(), parser);
+                        currentClass.addMethod(currentMethod);
+                        break;
+
+                    case TAG_PARAM:
+                        String paramType = parser.getAttributeValue(null, ATTRIBUTE_TYPE);
+                        currentMethod.addParam(canonicalizeType(paramType));
+                        break;
+
+                    case TAG_EXCEPTION:
+                        currentMethod.addException(parser.getAttributeValue(null, ATTRIBUTE_TYPE));
+                        break;
+
+                    case TAG_FIELD:
+                        JDiffField field = loadFieldInfo(currentClass.getClassName(), parser);
+                        currentClass.addField(field);
+                        break;
+
+                    default:
+                        throw new RuntimeException("unknown tag exception:" + tagname);
+                }
+
+                if (currentPackage != null) {
+                    logd(String.format("currentPackage: %s", currentPackage));
+                }
+                if (currentClass != null) {
+                    logd(String.format("currentClass: %s", currentClass.toSignatureString()));
+                }
+                if (currentMethod != null) {
+                    logd(String.format("currentMethod: %s", currentMethod.toSignatureString()));
+                }
+            }
+
+            return null;
+        }
+    }
+
+    private void logd(String msg) {
+        Log.d(tag, msg);
+    }
+
+    // This unescapes the string format used by doclava and so needs to be kept in sync with any
+    // changes made to that format.
+    private static String unescapeFieldStringValue(String str) {
+        // Skip over leading and trailing ".
+        int start = 0;
+        if (str.charAt(start) == '"') {
+            ++start;
+        }
+        int end = str.length();
+        if (str.charAt(end - 1) == '"') {
+            --end;
+        }
+
+        // If there's no special encoding strings in the string then just return it without the
+        // leading and trailing "s.
+        if (str.indexOf('\\') == -1) {
+            return str.substring(start, end);
+        }
+
+        final StringBuilder buf = new StringBuilder(str.length());
+        char escaped = 0;
+        final int START = 0;
+        final int CHAR1 = 1;
+        final int CHAR2 = 2;
+        final int CHAR3 = 3;
+        final int CHAR4 = 4;
+        final int ESCAPE = 5;
+        int state = START;
+
+        for (int i = start; i < end; i++) {
+            final char c = str.charAt(i);
+            switch (state) {
+                case START:
+                    if (c == '\\') {
+                        state = ESCAPE;
+                    } else {
+                        buf.append(c);
+                    }
+                    break;
+                case ESCAPE:
+                    switch (c) {
+                        case '\\':
+                            buf.append('\\');
+                            state = START;
+                            break;
+                        case 't':
+                            buf.append('\t');
+                            state = START;
+                            break;
+                        case 'b':
+                            buf.append('\b');
+                            state = START;
+                            break;
+                        case 'r':
+                            buf.append('\r');
+                            state = START;
+                            break;
+                        case 'n':
+                            buf.append('\n');
+                            state = START;
+                            break;
+                        case 'f':
+                            buf.append('\f');
+                            state = START;
+                            break;
+                        case '\'':
+                            buf.append('\'');
+                            state = START;
+                            break;
+                        case '\"':
+                            buf.append('\"');
+                            state = START;
+                            break;
+                        case 'u':
+                            state = CHAR1;
+                            escaped = 0;
+                            break;
+                    }
+                    break;
+                case CHAR1:
+                case CHAR2:
+                case CHAR3:
+                case CHAR4:
+                    escaped <<= 4;
+                    if (c >= '0' && c <= '9') {
+                        escaped |= c - '0';
+                    } else if (c >= 'a' && c <= 'f') {
+                        escaped |= 10 + (c - 'a');
+                    } else if (c >= 'A' && c <= 'F') {
+                        escaped |= 10 + (c - 'A');
+                    } else {
+                        throw new RuntimeException(
+                                "bad escape sequence: '" + c + "' at pos " + i + " in: \""
+                                        + str + "\"");
+                    }
+                    if (state == CHAR4) {
+                        buf.append(escaped);
+                        state = START;
+                    } else {
+                        state++;
+                    }
+                    break;
+            }
+        }
+        if (state != START) {
+            throw new RuntimeException("unfinished escape sequence: " + str);
+        }
+        return buf.toString();
+    }
+
+    /**
+     * Canonicalize a possibly generic type.
+     */
+    private static String canonicalizeType(String type) {
+        // Remove trailing spaces after commas.
+        return type.replace(", ", ",");
+    }
+}
diff --git a/tests/signature/lib/common/Android.bp b/tests/signature/lib/common/Android.bp
index 31fb149..81a9f8c 100644
--- a/tests/signature/lib/common/Android.bp
+++ b/tests/signature/lib/common/Android.bp
@@ -14,6 +14,9 @@
 
 java_library_static {
   name: "signature-common-javalib",
+  visibility: [
+      "//cts/tests/signature:__subpackages__",
+  ],
   host_supported: true,
   installable: false,
   srcs: ["src/**/*.java"],
diff --git a/tests/signature/lib/common/src/android/signature/cts/AbstractApiChecker.java b/tests/signature/lib/common/src/android/signature/cts/AbstractApiChecker.java
index 75632ac..03c4a85 100644
--- a/tests/signature/lib/common/src/android/signature/cts/AbstractApiChecker.java
+++ b/tests/signature/lib/common/src/android/signature/cts/AbstractApiChecker.java
@@ -19,7 +19,9 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * Base class for those that process a set of API definition files and perform some checking on
@@ -187,14 +189,22 @@
      */
     private void checkConstructorCompliance(JDiffClassDescription classDescription,
             Class<?> runtimeClass) {
+        Map<Constructor, String> mismatchReasons = new LinkedHashMap<>();
         for (JDiffClassDescription.JDiffConstructor con : classDescription.getConstructors()) {
             try {
-                Constructor<?> c = ReflectionHelper.findMatchingConstructor(runtimeClass, con);
+                Constructor<?> c = ReflectionHelper.findMatchingConstructor(runtimeClass, con,
+                        mismatchReasons);
                 if (c == null) {
                     resultObserver.notifyFailure(FailureType.MISSING_CONSTRUCTOR,
                             con.toReadableString(classDescription.getAbsoluteClassName()),
-                            "No constructor with correct signature found:" +
-                                    con.toSignatureString());
+                            String.format(
+                                    "No constructor with correct signature found. The following"
+                                            + " constructors were rejected:\n%s",
+                                    mismatchReasons.entrySet()
+                                            .stream()
+                                            .map(e -> String.format("\t\t%s - %s\n",
+                                                    e.getKey(), e.getValue()))
+                                            .collect(Collectors.joining())));
                 } else {
                     checkConstructor(classDescription, runtimeClass, con, c);
                 }
@@ -220,18 +230,27 @@
      */
     private void checkMethodCompliance(JDiffClassDescription classDescription,
             Class<?> runtimeClass) {
+        Map<Method, String> mismatchReasons = new LinkedHashMap<>();
         for (JDiffClassDescription.JDiffMethod method : classDescription.getMethods()) {
             try {
-
-                Method m = ReflectionHelper.findMatchingMethod(runtimeClass, method);
+                Method m = ReflectionHelper.findMatchingMethod(
+                        runtimeClass, method, mismatchReasons);
                 if (m == null) {
                     resultObserver.notifyFailure(FailureType.MISSING_METHOD,
                             method.toReadableString(classDescription.getAbsoluteClassName()),
-                            "No method with correct signature found, looking for:" +
-                                    method.toSignatureString());
+                            String.format(
+                                    "No method with correct signature found. The following methods"
+                                            + " with the same name were rejected:\n%s",
+                                    mismatchReasons.entrySet()
+                                            .stream()
+                                            .map(e -> String.format("\t\t%s - %s\n",
+                                                    e.getKey(), e.getValue()))
+                                            .collect(Collectors.joining())));
                 } else {
                     checkMethod(classDescription, runtimeClass, method, m);
                 }
+                // Clear the list.
+                mismatchReasons.clear();
             } catch (Exception e) {
                 LogHelper.loge("Got exception when checking method compliance", e);
                 resultObserver.notifyFailure(FailureType.CAUGHT_EXCEPTION,
diff --git a/tests/signature/lib/common/src/android/signature/cts/ApiComplianceChecker.java b/tests/signature/lib/common/src/android/signature/cts/ApiComplianceChecker.java
index b346648..df7c18b 100644
--- a/tests/signature/lib/common/src/android/signature/cts/ApiComplianceChecker.java
+++ b/tests/signature/lib/common/src/android/signature/cts/ApiComplianceChecker.java
@@ -15,11 +15,13 @@
  */
 package android.signature.cts;
 
+import android.signature.cts.JDiffClassDescription.JDiffField;
+import android.signature.cts.ReflectionHelper.DefaultTypeComparator;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
+import java.util.Formatter;
 import java.util.HashSet;
 import java.util.Objects;
 import java.util.Set;
@@ -99,14 +101,16 @@
             // check father class
             if (!checkClassExtendsCompliance(classDescription, runtimeClass)) {
                 resultObserver.notifyFailure(FailureType.mismatch(classDescription),
-                        classDescription.getAbsoluteClassName(), "Extends mismatch");
+                        classDescription.getAbsoluteClassName(),
+                        "Extends mismatch, expected " + classDescription.getExtendedClass());
                 return false;
             }
 
             // check implements interface
             if (!checkClassImplementsCompliance(classDescription, runtimeClass)) {
                 resultObserver.notifyFailure(FailureType.mismatch(classDescription),
-                        classDescription.getAbsoluteClassName(), "Implements mismatch");
+                        classDescription.getAbsoluteClassName(),
+                        "Implements mismatch, expected " + classDescription.getImplInterfaces());
                 return false;
             }
         }
@@ -162,7 +166,7 @@
             return null;
         } else {
             return String.format("modifier mismatch - description (%s), class (%s)",
-                    Modifier.toString(apiModifiers), Modifier.toString(reflectionModifiers));
+                    getModifierString(apiModifiers), getModifierString(reflectionModifiers));
         }
     }
 
@@ -254,33 +258,72 @@
 
     @Override
     protected void checkField(JDiffClassDescription classDescription, Class<?> runtimeClass,
-            JDiffClassDescription.JDiffField fieldDescription, Field field) {
-        if (field.getModifiers() != fieldDescription.mModifier) {
+            JDiffField fieldDescription, Field field) {
+        int expectedModifiers = fieldDescription.mModifier;
+        int actualModifiers = field.getModifiers();
+        if (actualModifiers != expectedModifiers) {
             resultObserver.notifyFailure(FailureType.MISMATCH_FIELD,
                     fieldDescription.toReadableString(classDescription.getAbsoluteClassName()),
-                    "Non-compatible field modifiers found when looking for " +
-                            fieldDescription.toSignatureString());
-        } else if (!checkFieldValueCompliance(fieldDescription, field)) {
-            resultObserver.notifyFailure(FailureType.MISMATCH_FIELD,
-                    fieldDescription.toReadableString(classDescription.getAbsoluteClassName()),
-                    "Incorrect field value found when looking for " +
-                            fieldDescription.toSignatureString());
-        } else if (!field.getType().getCanonicalName().equals(fieldDescription.mFieldType)) {
-            // type name does not match, but this might be a generic
-            String genericTypeName = null;
-            Type type = field.getGenericType();
-            if (type != null) {
-                genericTypeName = type instanceof Class ? ((Class<?>) type).getName() :
-                        type.toString().replace('$', '.');
-            }
-            if (genericTypeName == null || !genericTypeName.equals(fieldDescription.mFieldType)) {
-                resultObserver.notifyFailure(
-                        FailureType.MISMATCH_FIELD,
-                        fieldDescription.toReadableString(classDescription.getAbsoluteClassName()),
-                        "Non-compatible field type found when looking for " +
-                                fieldDescription.toSignatureString());
-            }
+                    String.format(
+                            "Incompatible field modifiers, expected %s, found %s",
+                            getModifierString(expectedModifiers),
+                            getModifierString(actualModifiers)));
         }
+
+        String expectedFieldType = fieldDescription.mFieldType;
+        String actualFieldType = ReflectionHelper.typeToString(field.getGenericType());
+        if (!DefaultTypeComparator.INSTANCE.compare(expectedFieldType, actualFieldType)) {
+            resultObserver.notifyFailure(
+                    FailureType.MISMATCH_FIELD,
+                    fieldDescription.toReadableString(classDescription.getAbsoluteClassName()),
+                    String.format("Incompatible field type found, expected %s, found %s",
+                            expectedFieldType, actualFieldType));
+        }
+
+        String message = checkFieldValueCompliance(fieldDescription, field);
+        if (message != null) {
+            resultObserver.notifyFailure(FailureType.MISMATCH_FIELD,
+                    fieldDescription.toReadableString(classDescription.getAbsoluteClassName()),
+                    message);
+        }
+    }
+
+    private static final int BRIDGE    = 0x00000040;
+    private static final int VARARGS   = 0x00000080;
+    private static final int SYNTHETIC = 0x00001000;
+    private static final int ANNOTATION  = 0x00002000;
+    private static final int ENUM      = 0x00004000;
+    private static final int MANDATED  = 0x00008000;
+
+    private static String getModifierString(int modifiers) {
+        Formatter formatter = new Formatter();
+        String m = Modifier.toString(modifiers);
+        formatter.format("<%s", m);
+        String sep = m.isEmpty() ? "" : " ";
+        if ((modifiers & BRIDGE) != 0) {
+            formatter.format("%senum", sep);
+            sep = " ";
+        }
+        if ((modifiers & VARARGS) != 0) {
+            formatter.format("%svarargs", sep);
+            sep = " ";
+        }
+        if ((modifiers & SYNTHETIC) != 0) {
+            formatter.format("%ssynthetic", sep);
+            sep = " ";
+        }
+        if ((modifiers & ANNOTATION) != 0) {
+            formatter.format("%sannotation", sep);
+            sep = " ";
+        }
+        if ((modifiers & ENUM) != 0) {
+            formatter.format("%senum", sep);
+            sep = " ";
+        }
+        if ((modifiers & MANDATED) != 0) {
+            formatter.format("%smandated", sep);
+        }
+        return formatter.format("> (0x%x)", modifiers).toString();
     }
 
     /**
@@ -289,76 +332,86 @@
      * @param apiField The field as defined by the platform API.
      * @param deviceField The field as defined by the device under test.
      */
-    private static boolean checkFieldValueCompliance(JDiffClassDescription.JDiffField apiField, Field deviceField) {
+    private static String checkFieldValueCompliance(JDiffField apiField, Field deviceField) {
         if ((apiField.mModifier & Modifier.FINAL) == 0 ||
                 (apiField.mModifier & Modifier.STATIC) == 0) {
             // Only final static fields can have fixed values.
-            return true;
+            return null;
         }
-        if (apiField.getValueString() == null) {
+        String apiFieldValue = apiField.getValueString();
+        if (apiFieldValue == null) {
             // If we don't define a constant value for it, then it can be anything.
-            return true;
+            return null;
         }
+
+        // Convert char into a number to match the value returned from device field. The device
+        // field does not
+        if (deviceField.getType() == char.class) {
+            apiFieldValue = convertCharToCanonicalValue(apiFieldValue.charAt(0));
+        }
+
+        String deviceFieldValue = getFieldValueAsString(deviceField);
+        if (!Objects.equals(apiFieldValue, deviceFieldValue)) {
+            return String.format("Incorrect field value, expected <%s>, found <%s>",
+                    apiFieldValue, deviceFieldValue);
+
+        }
+
+        return null;
+    }
+
+    private static String getFieldValueAsString(Field deviceField) {
         // Some fields may be protected or package-private
         deviceField.setAccessible(true);
         try {
-            switch (apiField.mFieldType) {
-                case "byte":
-                    return Objects.equals(apiField.getValueString(),
-                            Byte.toString(deviceField.getByte(null)));
-                case "char":
-                    return Objects.equals(apiField.getValueString(),
-                            Integer.toString(deviceField.getChar(null)));
-                case "short":
-                    return Objects.equals(apiField.getValueString(),
-                            Short.toString(deviceField.getShort(null)));
-                case "int":
-                    return Objects.equals(apiField.getValueString(),
-                            Integer.toString(deviceField.getInt(null)));
-                case "long":
-                    return Objects.equals(apiField.getValueString(),
-                            Long.toString(deviceField.getLong(null)) + "L");
-                case "float":
-                    return Objects.equals(apiField.getValueString(),
-                            canonicalizeFloatingPoint(
-                                    Float.toString(deviceField.getFloat(null)), "f"));
-                case "double":
-                    return Objects.equals(apiField.getValueString(),
-                            canonicalizeFloatingPoint(
-                                    Double.toString(deviceField.getDouble(null)), ""));
-                case "boolean":
-                    return Objects.equals(apiField.getValueString(),
-                            Boolean.toString(deviceField.getBoolean(null)));
-                case "java.lang.String":
-                    String value = apiField.getValueString();
-                    // Remove the quotes the value string is wrapped in
-                    value = unescapeFieldStringValue(value.substring(1, value.length() - 1));
-                    return Objects.equals(value, deviceField.get(null));
-                default:
-                    return true;
+            Class<?> fieldType = deviceField.getType();
+            if (fieldType == byte.class) {
+                return Byte.toString(deviceField.getByte(null));
+            } else if (fieldType == char.class) {
+                return convertCharToCanonicalValue(deviceField.getChar(null));
+            } else if (fieldType == short.class) {
+                return  Short.toString(deviceField.getShort(null));
+            } else if (fieldType == int.class) {
+                return  Integer.toString(deviceField.getInt(null));
+            } else if (fieldType == long.class) {
+                return Long.toString(deviceField.getLong(null));
+            } else if (fieldType == float.class) {
+                return  canonicalizeFloatingPoint(
+                                Float.toString(deviceField.getFloat(null)));
+            } else if (fieldType == double.class) {
+                return  canonicalizeFloatingPoint(
+                                Double.toString(deviceField.getDouble(null)));
+            } else if (fieldType == boolean.class) {
+                return  Boolean.toString(deviceField.getBoolean(null));
+            } else if (fieldType == java.lang.String.class) {
+                return (String) deviceField.get(null);
+            } else {
+                return null;
             }
         } catch (IllegalAccessException e) {
             throw new RuntimeException(e);
         }
     }
 
+    private static String convertCharToCanonicalValue(char c) {
+        return String.format("'%c' (0x%x)", c, (int) c);
+    }
+
     /**
      * Canonicalize the string representation of floating point numbers.
      *
      * This needs to be kept in sync with the doclava canonicalization.
      */
-    private static String canonicalizeFloatingPoint(String val, String suffix) {
+    private static String canonicalizeFloatingPoint(String val) {
         switch (val) {
             case "Infinity":
-                return "(1.0" + suffix + "/0.0" + suffix + ")";
             case "-Infinity":
-                return "(-1.0" + suffix + "/0.0" + suffix + ")";
             case "NaN":
-                return "(0.0" + suffix + "/0.0" + suffix + ")";
+                return val;
         }
 
         if (val.indexOf('E') != -1) {
-            return val + suffix;
+            return val;
         }
 
         // 1.0 is the only case where a trailing "0" is allowed.
@@ -368,108 +421,7 @@
         while (i >= d + 2 && val.charAt(i) == '0') {
             val = val.substring(0, i--);
         }
-        return val + suffix;
-    }
-
-    // This unescapes the string format used by doclava and so needs to be kept in sync with any
-    // changes made to that format.
-    private static String unescapeFieldStringValue(String str) {
-        final int N = str.length();
-
-        // If there's no special encoding strings in the string then just return it.
-        if (str.indexOf('\\') == -1) {
-            return str;
-        }
-
-        final StringBuilder buf = new StringBuilder(str.length());
-        char escaped = 0;
-        final int START = 0;
-        final int CHAR1 = 1;
-        final int CHAR2 = 2;
-        final int CHAR3 = 3;
-        final int CHAR4 = 4;
-        final int ESCAPE = 5;
-        int state = START;
-
-        for (int i = 0; i < N; i++) {
-            final char c = str.charAt(i);
-            switch (state) {
-                case START:
-                    if (c == '\\') {
-                        state = ESCAPE;
-                    } else {
-                        buf.append(c);
-                    }
-                    break;
-                case ESCAPE:
-                    switch (c) {
-                        case '\\':
-                            buf.append('\\');
-                            state = START;
-                            break;
-                        case 't':
-                            buf.append('\t');
-                            state = START;
-                            break;
-                        case 'b':
-                            buf.append('\b');
-                            state = START;
-                            break;
-                        case 'r':
-                            buf.append('\r');
-                            state = START;
-                            break;
-                        case 'n':
-                            buf.append('\n');
-                            state = START;
-                            break;
-                        case 'f':
-                            buf.append('\f');
-                            state = START;
-                            break;
-                        case '\'':
-                            buf.append('\'');
-                            state = START;
-                            break;
-                        case '\"':
-                            buf.append('\"');
-                            state = START;
-                            break;
-                        case 'u':
-                            state = CHAR1;
-                            escaped = 0;
-                            break;
-                    }
-                    break;
-                case CHAR1:
-                case CHAR2:
-                case CHAR3:
-                case CHAR4:
-                    escaped <<= 4;
-                    if (c >= '0' && c <= '9') {
-                        escaped |= c - '0';
-                    } else if (c >= 'a' && c <= 'f') {
-                        escaped |= 10 + (c - 'a');
-                    } else if (c >= 'A' && c <= 'F') {
-                        escaped |= 10 + (c - 'A');
-                    } else {
-                        throw new RuntimeException(
-                                "bad escape sequence: '" + c + "' at pos " + i + " in: \""
-                                        + str + "\"");
-                    }
-                    if (state == CHAR4) {
-                        buf.append(escaped);
-                        state = START;
-                    } else {
-                        state++;
-                    }
-                    break;
-            }
-        }
-        if (state != START) {
-            throw new RuntimeException("unfinished escape sequence: " + str);
-        }
-        return buf.toString();
+        return val;
     }
 
     @Override
@@ -553,7 +505,7 @@
             return null;
         } else {
             return String.format("modifier mismatch - description (%s), method (%s), for %s",
-                Modifier.toString(apiModifiers), Modifier.toString(reflectionModifiers), genericString);
+                    getModifierString(apiModifiers), getModifierString(reflectionModifiers), genericString);
         }
     }
 
diff --git a/tests/signature/lib/common/src/android/signature/cts/InterfaceChecker.java b/tests/signature/lib/common/src/android/signature/cts/InterfaceChecker.java
index 6be5f96..66492ff 100644
--- a/tests/signature/lib/common/src/android/signature/cts/InterfaceChecker.java
+++ b/tests/signature/lib/common/src/android/signature/cts/InterfaceChecker.java
@@ -20,6 +20,7 @@
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.HashSet;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -112,8 +113,9 @@
     }
 
     private boolean findMethod(JDiffClassDescription classDescription, Method method) {
+        Map<Method, String> matchNameNotSignature = new LinkedHashMap<>();
         for (JDiffClassDescription.JDiffMethod jdiffMethod : classDescription.getMethods()) {
-            if (ReflectionHelper.matches(jdiffMethod, method)) {
+            if (ReflectionHelper.matchesSignature(jdiffMethod, method, matchNameNotSignature)) {
                 return true;
             }
         }
diff --git a/tests/signature/lib/common/src/android/signature/cts/JDiffClassDescription.java b/tests/signature/lib/common/src/android/signature/cts/JDiffClassDescription.java
index 30584c9..97f11d0 100644
--- a/tests/signature/lib/common/src/android/signature/cts/JDiffClassDescription.java
+++ b/tests/signature/lib/common/src/android/signature/cts/JDiffClassDescription.java
@@ -325,9 +325,9 @@
             StringBuilder sb = new StringBuilder();
 
             // access level
-            String accesLevel = convertModifiersToAccessLevel(mModifier);
-            if (!"".equals(accesLevel)) {
-                sb.append(accesLevel).append(" ");
+            String accessLevel = convertModifiersToAccessLevel(mModifier);
+            if (!"".equals(accessLevel)) {
+                sb.append(accessLevel).append(" ");
             }
 
             String modifierString = convertModifersToModifierString(mModifier);
diff --git a/tests/signature/lib/common/src/android/signature/cts/ReflectionHelper.java b/tests/signature/lib/common/src/android/signature/cts/ReflectionHelper.java
index 992b3fa..6b6140a 100644
--- a/tests/signature/lib/common/src/android/signature/cts/ReflectionHelper.java
+++ b/tests/signature/lib/common/src/android/signature/cts/ReflectionHelper.java
@@ -15,6 +15,8 @@
  */
 package android.signature.cts;
 
+import android.signature.cts.JDiffClassDescription.JDiffConstructor;
+import android.signature.cts.JDiffClassDescription.JDiffMethod;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
@@ -29,6 +31,7 @@
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -123,10 +126,12 @@
      *
      * @param runtimeClass the class in which to search.
      * @param jdiffDes constructor description to find.
+     * @param mismatchReasons a map from rejected constructor to the reason it was rejected.
      * @return reflected constructor, or null if not found.
      */
     static Constructor<?> findMatchingConstructor(Class<?> runtimeClass,
-            JDiffClassDescription.JDiffConstructor jdiffDes) {
+            JDiffConstructor jdiffDes, Map<Constructor, String> mismatchReasons) {
+
         for (Constructor<?> c : runtimeClass.getDeclaredConstructors()) {
             Type[] params = c.getGenericParameterTypes();
             boolean isStaticClass = ((runtimeClass.getModifiers() & Modifier.STATIC) != 0);
@@ -148,8 +153,15 @@
                 int i = 0;
                 int j = startParamOffset;
                 while (i < jdiffParamList.size()) {
-                    if (!compareParam(jdiffParamList.get(i), params[j],
+                    String expectedParameter = jdiffParamList.get(i);
+                    Type actualParameter = params[j];
+                    if (!compareParam(expectedParameter, actualParameter,
                             DefaultTypeComparator.INSTANCE)) {
+                        mismatchReasons.put(c,
+                                String.format("parameter %d mismatch: expected (%s), found (%s)",
+                                        i,
+                                        expectedParameter,
+                                        actualParameter));
                         isFound = false;
                         break;
                     }
@@ -159,6 +171,11 @@
                 if (isFound) {
                     return c;
                 }
+            } else {
+                mismatchReasons.put(c,
+                        String.format("parameter list length mismatch: expected %d, found %d",
+                                jdiffParamList.size(),
+                                params.length));
             }
         }
         return null;
@@ -204,25 +221,33 @@
      *
      * @param runtimeClass the class in which to search.
      * @param method description of the method to find
+     * @param mismatchReasons a map from rejected method to the reason it was rejected, only
+     *     contains methods with the same name.
      * @return the reflected method, or null if not found.
      */
-    static Method findMatchingMethod(Class<?> runtimeClass,
-            JDiffClassDescription.JDiffMethod method) {
+    static Method findMatchingMethod(
+            Class<?> runtimeClass, JDiffMethod method, Map<Method, String> mismatchReasons) {
 
         // Search through the class to find the methods just in case the method was actually
         // declared in a superclass which is not part of the API and so was made to appear as if
         // it was declared in each of the hidden class' subclasses. Cannot use getMethods() as that
         // will only return public methods and the API includes protected methods.
-        while (runtimeClass != null) {
-            Method[] methods = runtimeClass.getDeclaredMethods();
+        Class<?> currentClass = runtimeClass;
+        while (currentClass != null) {
+            Method[] reflectedMethods = currentClass.getDeclaredMethods();
 
-            for (Method m : methods) {
-                if (matches(method, m)) {
-                    return m;
+            for (Method reflectedMethod : reflectedMethods) {
+                // If the method names aren't equal, the methods can't match.
+                if (!method.mName.equals(reflectedMethod.getName())) {
+                    continue;
+                }
+
+                if (matchesSignature(method, reflectedMethod, mismatchReasons)) {
+                    return reflectedMethod;
                 }
             }
 
-            runtimeClass = runtimeClass.getSuperclass();
+            currentClass = currentClass.getSuperclass();
         }
 
         return null;
@@ -233,15 +258,12 @@
      *
      * @param jDiffMethod the jDiffMethod to compare
      * @param reflectedMethod the reflected method to compare
+     * @param mismatchReasons map from method to reason it did not match, used when reporting
+     *     missing methods.
      * @return true, if both methods are the same
      */
-    static boolean matches(JDiffClassDescription.JDiffMethod jDiffMethod,
-            Method reflectedMethod) {
-        // If the method names aren't equal, the methods can't match.
-        if (!jDiffMethod.mName.equals(reflectedMethod.getName())) {
-            return false;
-        }
-
+    static boolean matchesSignature(JDiffMethod jDiffMethod, Method reflectedMethod,
+            Map<Method, String> mismatchReasons) {
         // If the method is a bridge then use a special comparator for comparing types as
         // bridge methods created for generic methods may not have generic signatures.
         // See b/123558763 for more information.
@@ -250,19 +272,26 @@
 
         String jdiffReturnType = jDiffMethod.mReturnType;
         String reflectionReturnType = typeToString(reflectedMethod.getGenericReturnType());
-        List<String> jdiffParamList = jDiffMethod.mParamList;
 
         // Next, compare the return types of the two methods.  If
         // they aren't equal, the methods can't match.
         if (!typeComparator.compare(jdiffReturnType, reflectionReturnType)) {
+            mismatchReasons.put(reflectedMethod,
+                    String.format("return type mismatch: expected %s, found %s", jdiffReturnType,
+                            reflectionReturnType));
             return false;
         }
 
+        List<String> jdiffParamList = jDiffMethod.mParamList;
         Type[] params = reflectedMethod.getGenericParameterTypes();
 
         // Next, check the method parameters.  If they have different
         // parameter lengths, the two methods can't match.
         if (jdiffParamList.size() != params.length) {
+            mismatchReasons.put(reflectedMethod,
+                    String.format("parameter list length mismatch: expected %s, found %s",
+                            jdiffParamList.size(),
+                            params.length));
             return false;
         }
 
@@ -290,15 +319,25 @@
         StringBuilder reflectedMethodParams = new StringBuilder("");
         StringBuilder jdiffMethodParams = new StringBuilder("");
 
+        String sep = "";
         for (int i = 0; i < jdiffParamList.size(); i++) {
-            jdiffMethodParams.append(jdiffParamList.get(i));
-            reflectedMethodParams.append(params[i]);
+            jdiffMethodParams.append(sep).append(jdiffParamList.get(i));
+            reflectedMethodParams.append(sep).append(params[i].getTypeName());
+            sep = ", ";
         }
 
         String jDiffFName = jdiffMethodParams.toString();
         String refName = reflectedMethodParams.toString();
 
-        return jDiffFName.equals(refName);
+        boolean signatureMatches = jDiffFName.equals(refName);
+        if (!signatureMatches) {
+            mismatchReasons.put(reflectedMethod,
+                    String.format("parameter signature mismatch: expected (%s), found (%s)",
+                            jDiffFName,
+                            refName));
+        }
+
+        return signatureMatches;
     }
 
     /**
@@ -328,7 +367,7 @@
      * @param type the type to convert.
      * @return the jdiff formatted string.
      */
-    private static String typeToString(Type type) {
+    public static String typeToString(Type type) {
         if (type instanceof ParameterizedType) {
             ParameterizedType pt = (ParameterizedType) type;
 
@@ -341,7 +380,9 @@
             for (Type t : types) {
                 sb.append(typeToString(t));
                 if (++elementNum < types.length) {
-                    sb.append(", ");
+                    // Must match separator used in
+                    // android.signature.cts.KtHelper.toDefaultTypeString.
+                    sb.append(",");
                 }
             }
 
diff --git a/tests/signature/tests/src/android/signature/cts/tests/ApiComplianceCheckerTest.java b/tests/signature/tests/src/android/signature/cts/tests/ApiComplianceCheckerTest.java
index dc3e446..0a4558e 100644
--- a/tests/signature/tests/src/android/signature/cts/tests/ApiComplianceCheckerTest.java
+++ b/tests/signature/tests/src/android/signature/cts/tests/ApiComplianceCheckerTest.java
@@ -259,7 +259,7 @@
         JDiffClassDescription clz = createClass(NormalClass.class.getSimpleName());
         JDiffClassDescription.JDiffField field = new JDiffClassDescription.JDiffField(
                 "VALUE_FIELD", "java.lang.String",
-                Modifier.PUBLIC | Modifier.FINAL | Modifier.STATIC, "\"\\u2708\"");
+                Modifier.PUBLIC | Modifier.FINAL | Modifier.STATIC, "\u2708");
         clz.addField(field);
         checkSignatureCompliance(clz);
         assertEquals(field.toSignatureString(), "public static final java.lang.String VALUE_FIELD");
diff --git a/tests/tests/accounts/Android.bp b/tests/tests/accounts/Android.bp
new file mode 100644
index 0000000..94f7c79
--- /dev/null
+++ b/tests/tests/accounts/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2009 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.
+
+android_test {
+    name: "CtsAccountManagerTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "CtsAccountTestsCommon",
+        "ctstestrunner-axt",
+        "platform-test-annotations",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    certificate: ":cts-testkey1",
+    min_sdk_version: "1",
+    sdk_version: "current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/tests/tests/accounts/Android.mk b/tests/tests/accounts/Android.mk
deleted file mode 100644
index c559252..0000000
--- a/tests/tests/accounts/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2009 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    CtsAccountTestsCommon ctstestrunner-axt platform-test-annotations
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/cts-testkey1
-
-LOCAL_PACKAGE_NAME := CtsAccountManagerTestCases
-
-LOCAL_MIN_SDK_VERSION  := 1
-
-LOCAL_SDK_VERSION := current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_PACKAGE)
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/accounts/CtsUnaffiliatedAccountAuthenticators/Android.bp b/tests/tests/accounts/CtsUnaffiliatedAccountAuthenticators/Android.bp
new file mode 100644
index 0000000..a9bc0e8
--- /dev/null
+++ b/tests/tests/accounts/CtsUnaffiliatedAccountAuthenticators/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2015 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.
+
+android_test_helper_app {
+    name: "CtsUnaffiliatedAccountAuthenticators",
+    defaults: ["cts_support_defaults"],
+    min_sdk_version: "1",
+    sdk_version: "current",
+    static_libs: [
+        "ctstestrunner-axt",
+        "CtsAccountTestsCommon",
+    ],
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["res"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    certificate: ":cts-testkey2",
+}
diff --git a/tests/tests/accounts/CtsUnaffiliatedAccountAuthenticators/Android.mk b/tests/tests/accounts/CtsUnaffiliatedAccountAuthenticators/Android.mk
deleted file mode 100644
index 03479db..0000000
--- a/tests/tests/accounts/CtsUnaffiliatedAccountAuthenticators/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2015 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_TAGS := tests
-
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_MIN_SDK_VERSION  := 1
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-	ctstestrunner-axt \
-	CtsAccountTestsCommon
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/res
-
-LOCAL_PACKAGE_NAME := CtsUnaffiliatedAccountAuthenticators
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/cts-testkey2
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/tests/accounts/common/Android.bp b/tests/tests/accounts/common/Android.bp
new file mode 100644
index 0000000..35d01fb
--- /dev/null
+++ b/tests/tests/accounts/common/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2015 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.
+
+java_library {
+    name: "CtsAccountTestsCommon",
+    // Includes all the java files, and explicitly declares any aidl files
+    srcs: [
+        "src/**/*.java",
+        "src/**/I*.aidl",
+    ],
+    aidl: {
+        local_include_dirs: ["src"],
+    },
+    min_sdk_version: "1",
+    sdk_version: "current",
+}
diff --git a/tests/tests/accounts/common/Android.mk b/tests/tests/accounts/common/Android.mk
deleted file mode 100644
index 0b208dd..0000000
--- a/tests/tests/accounts/common/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2015 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Includes all the java files, and explicitly declares any aidl files
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-    $(call all-Iaidl-files-under, src)
-
-LOCAL_AIDL_INCLUDES += $(LOCAL_PATH)/src
-
-LOCAL_MODULE:= CtsAccountTestsCommon
-
-LOCAL_MIN_SDK_VERSION  := 1
-
-LOCAL_SDK_VERSION := current
-
-# Build the actual static library
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/tests/tests/app.usage/Android.bp b/tests/tests/app.usage/Android.bp
new file mode 100644
index 0000000..d249a76
--- /dev/null
+++ b/tests/tests/app.usage/Android.bp
@@ -0,0 +1,39 @@
+// Copyright (C) 2014 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.
+
+android_test {
+    name: "CtsUsageStatsTestCases",
+    defaults: ["cts_defaults"],
+    platform_apis: true,
+    static_libs: [
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "cts-wm-util",
+        "junit",
+        "ub-uiautomator",
+    ],
+    libs: [
+        "android.test.base.stubs",
+        "android.test.runner.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/tests/tests/app.usage/Android.mk b/tests/tests/app.usage/Android.mk
deleted file mode 100644
index 0a6d005..0000000
--- a/tests/tests/app.usage/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2014 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)
-
-LOCAL_PACKAGE_NAME := CtsUsageStatsTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    cts-wm-util \
-    junit \
-    ub-uiautomator
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs android.test.runner.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_PACKAGE)
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/app.usage/TestApp1/Android.bp b/tests/tests/app.usage/TestApp1/Android.bp
new file mode 100644
index 0000000..fc09db7
--- /dev/null
+++ b/tests/tests/app.usage/TestApp1/Android.bp
@@ -0,0 +1,39 @@
+// Copyright (C) 2019 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.
+
+android_test_helper_app {
+    name: "CtsUsageStatsTestApp1",
+    defaults: ["cts_defaults"],
+    platform_apis: true,
+    static_libs: [
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "cts-wm-util",
+        "junit",
+        "ub-uiautomator",
+    ],
+    libs: [
+        "android.test.base.stubs",
+        "android.test.runner.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/tests/tests/app.usage/TestApp1/Android.mk b/tests/tests/app.usage/TestApp1/Android.mk
deleted file mode 100644
index 3d3927c..0000000
--- a/tests/tests/app.usage/TestApp1/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2019 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)
-
-LOCAL_PACKAGE_NAME := CtsUsageStatsTestApp1
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    cts-wm-util \
-    junit \
-    ub-uiautomator
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs android.test.runner.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/app/Android.bp b/tests/tests/app/Android.bp
new file mode 100644
index 0000000..122dc6b
--- /dev/null
+++ b/tests/tests/app/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2016 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.
+
+android_test {
+    name: "CtsAndroidAppTestCases",
+    defaults: ["cts_defaults"],
+    platform_apis: true,
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "junit",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/app/Android.mk b/tests/tests/app/Android.mk
deleted file mode 100644
index ea5d9e6..0000000
--- a/tests/tests/app/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_PACKAGE_NAME := CtsAndroidAppTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    junit
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/appcomponentfactory/Android.bp b/tests/tests/appcomponentfactory/Android.bp
new file mode 100644
index 0000000..b746d68
--- /dev/null
+++ b/tests/tests/appcomponentfactory/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsAppComponentFactoryTestCases",
+    defaults: ["cts_defaults"],
+    sdk_version: "current",
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "junit",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/appcomponentfactory/Android.mk b/tests/tests/appcomponentfactory/Android.mk
deleted file mode 100644
index c6434f5..0000000
--- a/tests/tests/appcomponentfactory/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsAppComponentFactoryTestCases
-LOCAL_SDK_VERSION := current
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    junit
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/appop/src/android/app/appops/cts/AppOpsTest.kt b/tests/tests/appop/src/android/app/appops/cts/AppOpsTest.kt
index e5fe926..c358913 100644
--- a/tests/tests/appop/src/android/app/appops/cts/AppOpsTest.kt
+++ b/tests/tests/appop/src/android/app/appops/cts/AppOpsTest.kt
@@ -313,11 +313,11 @@
     @Test
     fun testPermissionMapping() {
         for (entry in permissionToOpStr) {
-            testPermissionMapping(entry.key, permissionToOpStr[entry.key])
+            testPermissionMapping(entry.key, entry.value)
         }
     }
 
-    private fun testPermissionMapping(permission: String, opStr: String?) {
+    private fun testPermissionMapping(permission: String, opStr: String) {
         // Do the public value => internal op code lookups.
         val mappedOpStr = AppOpsManager.permissionToOp(permission)
         assertEquals(mappedOpStr, opStr)
diff --git a/tests/tests/appop/src/android/app/appops/cts/HistoricalAppopsTest.kt b/tests/tests/appop/src/android/app/appops/cts/HistoricalAppopsTest.kt
index a18cba0..73a4516 100644
--- a/tests/tests/appop/src/android/app/appops/cts/HistoricalAppopsTest.kt
+++ b/tests/tests/appop/src/android/app/appops/cts/HistoricalAppopsTest.kt
@@ -247,7 +247,7 @@
             // Note ops such that we have data at all levels
             for (d in depth downTo 0) {
                 for (i in 0 until noteCount) {
-                    appOpsManager!!.noteOp(AppOpsManager.OPSTR_START_FOREGROUND, uid, packageName)
+                    appOpsManager!!.noteOp(AppOpsManager.OPSTR_START_FOREGROUND, uid, packageName!!)
                 }
 
                 if (d > 0) {
@@ -348,17 +348,17 @@
         val chunk = HistoricalOps(SNAPSHOT_INTERVAL_MILLIS / 4,
                 SNAPSHOT_INTERVAL_MILLIS / 2)
         chunk.increaseAccessCount(AppOpsManager.OP_START_FOREGROUND, uid,
-                packageName, AppOpsManager.UID_STATE_TOP, AppOpsManager.OP_FLAG_SELF, 10)
+                packageName!!, AppOpsManager.UID_STATE_TOP, AppOpsManager.OP_FLAG_SELF, 10)
         chunk.increaseAccessCount(AppOpsManager.OP_START_FOREGROUND, uid,
-                packageName, AppOpsManager.UID_STATE_BACKGROUND, AppOpsManager.OP_FLAG_SELF, 10)
+                packageName!!, AppOpsManager.UID_STATE_BACKGROUND, AppOpsManager.OP_FLAG_SELF, 10)
         chunk.increaseRejectCount(AppOpsManager.OP_START_FOREGROUND, uid,
-                packageName, AppOpsManager.UID_STATE_TOP, AppOpsManager.OP_FLAG_SELF, 10)
+                packageName!!, AppOpsManager.UID_STATE_TOP, AppOpsManager.OP_FLAG_SELF, 10)
         chunk.increaseRejectCount(AppOpsManager.OP_START_FOREGROUND, uid,
-                packageName, AppOpsManager.UID_STATE_BACKGROUND, AppOpsManager.OP_FLAG_SELF, 10)
+                packageName!!, AppOpsManager.UID_STATE_BACKGROUND, AppOpsManager.OP_FLAG_SELF, 10)
         chunk.increaseAccessDuration(AppOpsManager.OP_START_FOREGROUND, uid,
-                packageName, AppOpsManager.UID_STATE_TOP, AppOpsManager.OP_FLAG_SELF, 10)
+                packageName!!, AppOpsManager.UID_STATE_TOP, AppOpsManager.OP_FLAG_SELF, 10)
         chunk.increaseAccessDuration(AppOpsManager.OP_START_FOREGROUND, uid,
-                packageName, AppOpsManager.UID_STATE_BACKGROUND, AppOpsManager.OP_FLAG_SELF, 10)
+                packageName!!, AppOpsManager.UID_STATE_BACKGROUND, AppOpsManager.OP_FLAG_SELF, 10)
         return chunk
     }
 
diff --git a/tests/tests/assist/Android.bp b/tests/tests/assist/Android.bp
new file mode 100644
index 0000000..632c19e
--- /dev/null
+++ b/tests/tests/assist/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2015 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.
+
+android_test {
+    name: "CtsAssistTestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    static_libs: [
+        "CtsAssistCommon",
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/assist/Android.mk b/tests/tests/assist/Android.mk
deleted file mode 100644
index 3357334..0000000
--- a/tests/tests/assist/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2015 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_STATIC_JAVA_LIBRARIES := CtsAssistCommon ctstestrunner-axt compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsAssistTestCases
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/assist/service/Android.bp b/tests/tests/assist/service/Android.bp
new file mode 100644
index 0000000..d3bb2b6
--- /dev/null
+++ b/tests/tests/assist/service/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2015 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.
+
+android_test_helper_app {
+    name: "CtsAssistService",
+    defaults: ["cts_support_defaults"],
+    static_libs: [
+        "CtsAssistCommon",
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/assist/service/Android.mk b/tests/tests/assist/service/Android.mk
deleted file mode 100644
index 822c422..0000000
--- a/tests/tests/assist/service/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2015 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := CtsAssistCommon ctstestrunner-axt compatibility-device-util-axt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsAssistService
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/tests/assist/testapp/Android.bp b/tests/tests/assist/testapp/Android.bp
new file mode 100644
index 0000000..b87a7f1
--- /dev/null
+++ b/tests/tests/assist/testapp/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2015 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.
+
+android_test_helper_app {
+    name: "CtsAssistApp",
+    defaults: ["cts_support_defaults"],
+    static_libs: ["CtsAssistCommon"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/assist/testapp/Android.mk b/tests/tests/assist/testapp/Android.mk
deleted file mode 100644
index 9482510..0000000
--- a/tests/tests/assist/testapp/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2015 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := CtsAssistCommon
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsAssistApp
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/tests/background/Android.bp b/tests/tests/background/Android.bp
new file mode 100644
index 0000000..485914b
--- /dev/null
+++ b/tests/tests/background/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsBackgroundRestrictionsTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "androidx.legacy_legacy-support-v4",
+        "mockito-target-minus-junit4",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ub-uiautomator",
+    ],
+    libs: ["android.test.runner.stubs"],
+    srcs: ["src/**/*.java"],
+    test_suites: [
+        "cts",
+        "vts",
+        "cts_instant",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/background/Android.mk b/tests/tests/background/Android.mk
deleted file mode 100755
index b2512ce..0000000
--- a/tests/tests/background/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsBackgroundRestrictionsTestCases
-
-LOCAL_COMPATIBILITY_SUITE := cts vts cts_instant
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/batterysaving/Android.bp b/tests/tests/batterysaving/Android.bp
new file mode 100644
index 0000000..032d2bf
--- /dev/null
+++ b/tests/tests/batterysaving/Android.bp
@@ -0,0 +1,39 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsBatterySavingTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "BatterySavingCtsCommon",
+        "androidx.test.rules",
+        "androidx.legacy_legacy-support-v4",
+        "mockito-target-minus-junit4",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "truth-prebuilt",
+        "ub-uiautomator",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/batterysaving/Android.mk b/tests/tests/batterysaving/Android.mk
deleted file mode 100755
index 05cd50c..0000000
--- a/tests/tests/batterysaving/Android.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    BatterySavingCtsCommon \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    truth-prebuilt \
-    ub-uiautomator
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsBatterySavingTestCases
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/batterysaving/apps/Android.mk b/tests/tests/batterysaving/apps/Android.mk
deleted file mode 100644
index 9aaa6ac..0000000
--- a/tests/tests/batterysaving/apps/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2018 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 $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/batterysaving/apps/app_target_api_25/Android.bp b/tests/tests/batterysaving/apps/app_target_api_25/Android.bp
new file mode 100644
index 0000000..de78337
--- /dev/null
+++ b/tests/tests/batterysaving/apps/app_target_api_25/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsBatterySavingAppTargetApi25",
+    defaults: ["cts_defaults"],
+    static_libs: ["CtsBatterSavingAppTargetLib"],
+    sdk_version: "test_current",
+    min_sdk_version: "23",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/batterysaving/apps/app_target_api_25/Android.mk b/tests/tests/batterysaving/apps/app_target_api_25/Android.mk
deleted file mode 100644
index c704a29..0000000
--- a/tests/tests/batterysaving/apps/app_target_api_25/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsBatterySavingAppTargetApi25
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../app_target_api_current/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    BatterySavingCtsCommon \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ub-uiautomator
-
-LOCAL_SDK_VERSION := test_current
-LOCAL_MIN_SDK_VERSION := 23
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/batterysaving/apps/app_target_api_current/Android.bp b/tests/tests/batterysaving/apps/app_target_api_current/Android.bp
new file mode 100644
index 0000000..8d385c6
--- /dev/null
+++ b/tests/tests/batterysaving/apps/app_target_api_current/Android.bp
@@ -0,0 +1,41 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsBatterySavingAppTargetApiCurrent",
+    defaults: ["cts_defaults"],
+    static_libs: ["CtsBatterSavingAppTargetLib"],
+    sdk_version: "test_current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
+
+java_library {
+    name: "CtsBatterSavingAppTargetLib",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "BatterySavingCtsCommon",
+        "androidx.test.rules",
+        "androidx.legacy_legacy-support-v4",
+        "mockito-target-minus-junit4",
+        "compatibility-device-util-axt",
+        "ub-uiautomator",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/batterysaving/apps/app_target_api_current/Android.mk b/tests/tests/batterysaving/apps/app_target_api_current/Android.mk
deleted file mode 100644
index 717ce3b..0000000
--- a/tests/tests/batterysaving/apps/app_target_api_current/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsBatterySavingAppTargetApiCurrent
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    BatterySavingCtsCommon \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ub-uiautomator
-
-LOCAL_SDK_VERSION := test_current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/batterysaving/common/Android.bp b/tests/tests/batterysaving/common/Android.bp
new file mode 100644
index 0000000..6f99fda
--- /dev/null
+++ b/tests/tests/batterysaving/common/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2016 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.
+
+java_library {
+    name: "BatterySavingCtsCommon",
+    srcs: [
+        "src/**/*.java",
+        "proto/**/*.proto",
+    ],
+    libs: [
+        "androidx.test.rules",
+        "androidx.legacy_legacy-support-v4",
+        "mockito-target",
+        "compatibility-device-util-axt",
+        "android.test.runner.stubs",
+    ],
+    sdk_version: "test_current",
+    proto: {
+        type: "lite",
+    },
+}
diff --git a/tests/tests/batterysaving/common/Android.mk b/tests/tests/batterysaving/common/Android.mk
deleted file mode 100644
index 1328461..0000000
--- a/tests/tests/batterysaving/common/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-    $(call all-proto-files-under, proto)
-
-LOCAL_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target \
-    compatibility-device-util-axt \
-    android.test.runner.stubs
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE := BatterySavingCtsCommon
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/tests/tests/binder_ndk/Android.bp b/tests/tests/binder_ndk/Android.bp
new file mode 100644
index 0000000..fe5bf2a
--- /dev/null
+++ b/tests/tests/binder_ndk/Android.bp
@@ -0,0 +1,39 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsNdkBinderTestCases",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "libbinder_ndk_test_interface-java",
+        "nativetesthelper",
+    ],
+    jni_libs: [
+        "libbinder_ndk_test",
+        "libbinder_ndk_test_utilities",
+        "libbinder_ndk_test_interface-ndk",
+        "libbinder_ndk_test_interface_old",
+        "libbinder_ndk_test_interface_new",
+    ],
+    stl: "c++_shared",
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+}
diff --git a/tests/tests/binder_ndk/Android.mk b/tests/tests/binder_ndk/Android.mk
deleted file mode 100644
index 4851346..0000000
--- a/tests/tests/binder_ndk/Android.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsNdkBinderTestCases
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# Include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    libbinder_ndk_test_interface-java \
-    nativetesthelper
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-    libbinder_ndk_test \
-    libbinder_ndk_test_utilities \
-    libbinder_ndk_test_interface-ndk \
-    libbinder_ndk_test_interface_old \
-    libbinder_ndk_test_interface_new \
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-LOCAL_NDK_STL_VARIANT := c++_shared
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/binder_ndk/OWNERS b/tests/tests/binder_ndk/OWNERS
new file mode 100644
index 0000000..531df84
--- /dev/null
+++ b/tests/tests/binder_ndk/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 1344
+smoreland@google.com
diff --git a/tests/tests/binder_ndk/libbinder_ndk_test/Android.bp b/tests/tests/binder_ndk/libbinder_ndk_test/Android.bp
index a6502bf..3fd9cb0 100644
--- a/tests/tests/binder_ndk/libbinder_ndk_test/Android.bp
+++ b/tests/tests/binder_ndk/libbinder_ndk_test/Android.bp
@@ -34,62 +34,56 @@
 
 cc_defaults {
     name: "libbinder_ndk_test_defaults",
-
     cflags: [
         "-Wall",
         "-Werror",
     ],
-
     shared_libs: [
         "liblog",
         "libbinder_ndk",
     ],
     whole_static_libs: ["libnativetesthelper_jni"],
-
     sdk_version: "current",
-    stl: "c++_static",
+    stl: "c++_shared",
+    gtest: false,
 }
 
-cc_library_shared {
+cc_test_library {
     name: "libbinder_ndk_test_utilities",
     defaults: ["libbinder_ndk_test_defaults"],
     srcs: ["utilities.cpp"],
 }
 
-cc_library_shared {
+cc_test_library {
     name: "libbinder_ndk_test_interface_new",
     defaults: ["libbinder_ndk_test_defaults"],
     srcs: [
         "android_binder_cts_NativeService.cpp",
     ],
-
     // Using the up-to-date version of the interface
-
     shared_libs: [
         "libbinder_ndk_test_interface-ndk",
         "libbinder_ndk_test_utilities",
     ],
 }
 
-cc_library_shared {
+cc_test_library {
     name: "libbinder_ndk_test_interface_old",
     defaults: ["libbinder_ndk_test_defaults"],
     srcs: [
         "android_binder_cts_NativeService.cpp",
     ],
     cflags: ["-DUSING_VERSION_1"],
-
     // Using the frozen version 1 of the interface
     static_libs: [
         "libbinder_ndk_test_interface-V1-ndk",
     ],
-
     shared_libs: [
         "libbinder_ndk_test_utilities",
     ],
 }
 
-cc_library_shared {
+cc_test_library {
     name: "libbinder_ndk_test",
     defaults: ["libbinder_ndk_test_defaults"],
     srcs: [
@@ -99,7 +93,6 @@
         "test_parcel.cpp",
         "test_status.cpp",
     ],
-
     shared_libs: [
         "libbinder_ndk_test_interface-ndk",
         "libbinder_ndk_test_utilities",
diff --git a/tests/tests/binder_ndk/libbinder_ndk_test/android_binder_cts_NativeService.cpp b/tests/tests/binder_ndk/libbinder_ndk_test/android_binder_cts_NativeService.cpp
index ecc04c3..1656b46 100644
--- a/tests/tests/binder_ndk/libbinder_ndk_test/android_binder_cts_NativeService.cpp
+++ b/tests/tests/binder_ndk/libbinder_ndk_test/android_binder_cts_NativeService.cpp
@@ -28,6 +28,15 @@
   // The ref owns the MyTest, and the binder owns the ref.
   SpAIBinder binder = SharedRefBase::make<MyTest>()->asBinder();
 
+  // adding an arbitrary class as the extension
+  std::shared_ptr<MyTest> ext = SharedRefBase::make<MyTest>();
+  SpAIBinder extBinder = ext->asBinder();
+
+  binder_status_t ret = AIBinder_setExtension(binder.get(), extBinder.get());
+  if (ret != STATUS_OK) {
+    std::cout << "Could not set local extension" << std::endl;
+  }
+
   // And the Java object owns the binder
   return AIBinder_toJavaBinder(env, binder.get());
 }
diff --git a/tests/tests/binder_ndk/libbinder_ndk_test/test_ibinder.cpp b/tests/tests/binder_ndk/libbinder_ndk_test/test_ibinder.cpp
index 793795f..c8526ec 100644
--- a/tests/tests/binder_ndk/libbinder_ndk_test/test_ibinder.cpp
+++ b/tests/tests/binder_ndk/libbinder_ndk_test/test_ibinder.cpp
@@ -142,6 +142,45 @@
   AIBinder_decStrong(binder);
 }
 
+TEST_F(NdkBinderTest_AIBinder, GetExtensionImmediatelyReturnsNull) {
+  AIBinder* binder = SampleData::newBinder();
+  AIBinder* ext;
+  EXPECT_OK(AIBinder_getExtension(binder, &ext));
+  EXPECT_EQ(ext, nullptr);
+  AIBinder_decStrong(binder);
+}
+
+TEST_F(NdkBinderTest_AIBinder, GetSetExtensionLocally) {
+  AIBinder* binder = SampleData::newBinder();
+  AIBinder* ext = SampleData::newBinder();
+  EXPECT_OK(AIBinder_setExtension(binder, ext));
+
+  AIBinder* getExt;
+  EXPECT_OK(AIBinder_getExtension(binder, &getExt));
+  ASSERT_EQ(ext, getExt);
+
+  AIBinder_decStrong(ext);
+  AIBinder_decStrong(getExt);
+  AIBinder_decStrong(binder);
+}
+
+TEST_F(NdkBinderTest_AIBinder, GetSetExtensionRepeatedly) {
+  AIBinder* binder = SampleData::newBinder();
+  AIBinder* ext1 = SampleData::newBinder();
+  AIBinder* ext2 = SampleData::newBinder();
+  EXPECT_OK(AIBinder_setExtension(binder, ext1));
+  EXPECT_OK(AIBinder_setExtension(binder, ext2));
+
+  AIBinder* getExt;
+  EXPECT_OK(AIBinder_getExtension(binder, &getExt));
+  ASSERT_EQ(ext2, getExt);
+
+  AIBinder_decStrong(ext1);
+  AIBinder_decStrong(ext2);
+  AIBinder_decStrong(getExt);
+  AIBinder_decStrong(binder);
+}
+
 TEST_F(NdkBinderTest_AIBinder, TransactionHappens) {
   AIBinder* binder = SampleData::newBinder(TransactionsReturn(STATUS_OK),
                                            ExpectLifetimeTransactions(1));
@@ -299,4 +338,7 @@
 
   AIBinder_DeathRecipient_delete(recipient);
   AIBinder_decStrong(binder);
+
+  EXPECT_EQ(STATUS_UNEXPECTED_NULL, AIBinder_getExtension(nullptr, nullptr));
+  EXPECT_EQ(STATUS_UNEXPECTED_NULL, AIBinder_setExtension(nullptr, nullptr));
 }
diff --git a/tests/tests/binder_ndk/libbinder_ndk_test/test_native_aidl_client.cpp b/tests/tests/binder_ndk/libbinder_ndk_test/test_native_aidl_client.cpp
index 1069f09..b860a81 100644
--- a/tests/tests/binder_ndk/libbinder_ndk_test/test_native_aidl_client.cpp
+++ b/tests/tests/binder_ndk/libbinder_ndk_test/test_native_aidl_client.cpp
@@ -83,6 +83,18 @@
   ASSERT_EQ(STATUS_OK, AIBinder_ping(iface->asBinder().get()));
 }
 
+TEST_P(NdkBinderTest_Aidl, GetExtension) {
+  SpAIBinder ext;
+  ASSERT_EQ(STATUS_OK, AIBinder_getExtension(iface->asBinder().get(), ext.getR()));
+
+  // TODO(b/139325468): add support in Java as well
+  if (GetParam().expectedName == "CPP") {
+    EXPECT_EQ(STATUS_OK, AIBinder_ping(ext.get()));
+  } else {
+    ASSERT_EQ(nullptr, ext.get());
+  }
+}
+
 bool ReadFdToString(int fd, std::string* content) {
   char buf[64];
   ssize_t n;
@@ -614,12 +626,23 @@
 }
 
 std::shared_ptr<ITest> getProxyLocalService() {
+  std::shared_ptr<MyTest> test = SharedRefBase::make<MyTest>();
+  SpAIBinder binder = test->asBinder();
+
+  // adding an arbitrary class as the extension
+  std::shared_ptr<MyTest> ext = SharedRefBase::make<MyTest>();
+  SpAIBinder extBinder = ext->asBinder();
+
+  binder_status_t ret = AIBinder_setExtension(binder.get(), extBinder.get());
+  if (ret != STATUS_OK) {
+    std::cout << "Could not set local extension" << std::endl;
+  }
+
   // BpTest -> AIBinder -> test
   //
   // Warning: for testing purposes only. This parcels things within the same process for testing
   // purposes. In normal usage, this should just return SharedRefBase::make<MyTest> directly.
-  std::shared_ptr<MyTest> test = SharedRefBase::make<MyTest>();
-  return (new BpTest(test->asBinder()))->ref<ITest>();
+  return (new BpTest(binder))->ref<ITest>();
 }
 
 std::shared_ptr<ITest> getNdkBinderTestJavaService(const std::string& method) {
diff --git a/tests/tests/binder_ndk/src/android/binder/cts/TestImpl.java b/tests/tests/binder_ndk/src/android/binder/cts/TestImpl.java
index c498098..6ee8dc3 100644
--- a/tests/tests/binder_ndk/src/android/binder/cts/TestImpl.java
+++ b/tests/tests/binder_ndk/src/android/binder/cts/TestImpl.java
@@ -80,9 +80,9 @@
 
   @Override
   public void CacheCallingInfoFromOneway() {
-    mCachedLatch.countDown();
     mCachedPid = Binder.getCallingPid();
     mCachedUid = Binder.getCallingUid();
+    mCachedLatch.countDown();
   }
 
   @Override
diff --git a/tests/tests/bluetooth/Android.bp b/tests/tests/bluetooth/Android.bp
new file mode 100644
index 0000000..1d24127
--- /dev/null
+++ b/tests/tests/bluetooth/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2009 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.
+
+android_test {
+    name: "CtsBluetoothTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: ["ctstestrunner-axt"],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/bluetooth/Android.mk b/tests/tests/bluetooth/Android.mk
deleted file mode 100644
index ab06e93..0000000
--- a/tests/tests/bluetooth/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2009 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)
-
-LOCAL_PACKAGE_NAME := CtsBluetoothTestCases
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt
-LOCAL_JAVA_LIBRARIES += android.test.runner.stubs
-LOCAL_JAVA_LIBRARIES += android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/calendarcommon/Android.bp b/tests/tests/calendarcommon/Android.bp
new file mode 100644
index 0000000..5b2504d
--- /dev/null
+++ b/tests/tests/calendarcommon/Android.bp
@@ -0,0 +1,29 @@
+// 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.
+
+android_test {
+    name: "CtsCalendarcommon2TestCases",
+    defaults: ["cts_defaults"],
+    static_libs: ["ctstestrunner-axt"],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    min_sdk_version: "15",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/calendarcommon/Android.mk b/tests/tests/calendarcommon/Android.mk
deleted file mode 100644
index d3a8e87..0000000
--- a/tests/tests/calendarcommon/Android.mk
+++ /dev/null
@@ -1,40 +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)
-
-# Replace "Example" with your name.
-LOCAL_PACKAGE_NAME := CtsCalendarcommon2TestCases
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 15
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/car/Android.bp b/tests/tests/car/Android.bp
new file mode 100644
index 0000000..4db0f0a
--- /dev/null
+++ b/tests/tests/car/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2016 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.
+
+android_test {
+    name: "CtsCarTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "truth-prebuilt",
+        "ctstestrunner-axt",
+        "android.car",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    //TODO(b/72620511) Apps should not use platform APIs directly
+    //sdk_version: "current"
+    platform_apis: true,
+}
diff --git a/tests/tests/car/Android.mk b/tests/tests/car/Android.mk
deleted file mode 100644
index 6fc7139..0000000
--- a/tests/tests/car/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_PACKAGE_NAME := CtsCarTestCases
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-	androidx.test.rules \
-	compatibility-device-util-axt \
-	truth-prebuilt\
-	ctstestrunner-axt
-
-LOCAL_JAVA_LIBRARIES := android.car android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-#TODO(b/72620511) Apps should not use platform APIs directly
-#LOCAL_SDK_VERSION := current
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/carrierapi/Android.bp b/tests/tests/carrierapi/Android.bp
new file mode 100644
index 0000000..be6215e
--- /dev/null
+++ b/tests/tests/carrierapi/Android.bp
@@ -0,0 +1,40 @@
+// Copyright (C) 2016 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.
+
+android_test {
+    name: "CtsCarrierApiTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+        "junit",
+    ],
+    srcs: ["src/**/*.java"],
+    sdk_version: "test_current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    // This  APK must be signed to match the test SIM's cert whitelist.
+    // While "testkey" is the default, there are different per-device testkeys, so
+    // hard-code the AOSP default key to ensure it is used regardless of build
+    // environment.
+    certificate: ":aosp-testkey",
+}
diff --git a/tests/tests/carrierapi/Android.mk b/tests/tests/carrierapi/Android.mk
deleted file mode 100644
index a9c5d8b..0000000
--- a/tests/tests/carrierapi/Android.mk
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (C) 2016 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-    junit
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsCarrierApiTestCases
-LOCAL_SDK_VERSION := test_current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_JAVA_LIBRARIES += android.test.runner.stubs android.test.base.stubs
-
-# This APK must be signed to match the test SIM's cert whitelist.
-# While "testkey" is the default, there are different per-device testkeys, so
-# hard-code the AOSP default key to ensure it is used regardless of build
-# environment.
-LOCAL_CERTIFICATE := build/make/target/product/security/testkey
-
-# This APK must be signed to match the test SIM's cert whitelist.
-# While "testkey" is the default, there are different per-device testkeys, so
-# hard-code the AOSP default key to ensure it is used regardless of build
-# environment.
-LOCAL_CERTIFICATE := build/make/target/product/security/testkey
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/colormode/Android.bp b/tests/tests/colormode/Android.bp
new file mode 100644
index 0000000..02268ed
--- /dev/null
+++ b/tests/tests/colormode/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2011 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.
+
+android_test {
+    name: "CtsColorModeTestCases",
+    defaults: ["cts_defaults"],
+    dex_preopt: {
+        enabled: false,
+    },
+    optimize: {
+        enabled: false,
+    },
+    static_libs: ["ctstestrunner-axt"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    sdk_version: "current",
+}
diff --git a/tests/tests/colormode/Android.mk b/tests/tests/colormode/Android.mk
deleted file mode 100644
index 1bce247..0000000
--- a/tests/tests/colormode/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2011 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsColorModeTestCases
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/contactsproviderwipe/Android.bp b/tests/tests/contactsproviderwipe/Android.bp
new file mode 100644
index 0000000..e694239
--- /dev/null
+++ b/tests/tests/contactsproviderwipe/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsContactsProviderWipe",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "androidx.legacy_legacy-support-v4",
+        "mockito-target-minus-junit4",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ub-uiautomator",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/contactsproviderwipe/Android.mk b/tests/tests/contactsproviderwipe/Android.mk
deleted file mode 100644
index e046fad..0000000
--- a/tests/tests/contactsproviderwipe/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsContactsProviderWipe
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/content/BinderPermissionTestService/Android.bp b/tests/tests/content/BinderPermissionTestService/Android.bp
new file mode 100644
index 0000000..2b5d4d8
--- /dev/null
+++ b/tests/tests/content/BinderPermissionTestService/Android.bp
@@ -0,0 +1,36 @@
+//
+// Copyright (C) 2018 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.
+//
+
+android_test_helper_app {
+    name: "CtsBinderPermissionTestService",
+    defaults: ["cts_support_defaults"],
+    sdk_version: "current",
+    srcs: [
+        "src/**/*.java",
+        "aidl/**/I*.aidl",
+    ],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    optimize: {
+        enabled: false,
+    },
+    dex_preopt: {
+        enabled: false,
+    },
+}
diff --git a/tests/tests/content/BinderPermissionTestService/Android.mk b/tests/tests/content/BinderPermissionTestService/Android.mk
deleted file mode 100644
index 697d8f6..0000000
--- a/tests/tests/content/BinderPermissionTestService/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Copyright (C) 2018 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)
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-Iaidl-files-under, aidl)
-
-LOCAL_PACKAGE_NAME := CtsBinderPermissionTestService
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/tests/content/CtsSyncAccountAccessOtherCertTests/Android.bp b/tests/tests/content/CtsSyncAccountAccessOtherCertTests/Android.bp
new file mode 100644
index 0000000..c6453bc
--- /dev/null
+++ b/tests/tests/content/CtsSyncAccountAccessOtherCertTests/Android.bp
@@ -0,0 +1,39 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test {
+    name: "CtsSyncAccountAccessOtherCertTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "ctstestrunner-axt",
+        "accountaccesslib",
+    ],
+    srcs: ["src/**/*.java"],
+    platform_apis: true,
+    certificate: ":cts-testkey2",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    optimize: {
+        enabled: false,
+    },
+    dex_preopt: {
+        enabled: false,
+    },
+}
diff --git a/tests/tests/content/CtsSyncAccountAccessOtherCertTests/Android.mk b/tests/tests/content/CtsSyncAccountAccessOtherCertTests/Android.mk
deleted file mode 100644
index 959fab5..0000000
--- a/tests/tests/content/CtsSyncAccountAccessOtherCertTests/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    ctstestrunner-axt \
-    accountaccesslib
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsSyncAccountAccessOtherCertTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/cts-testkey2
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/content/SyncAccountAccessStubs/Android.bp b/tests/tests/content/SyncAccountAccessStubs/Android.bp
new file mode 100644
index 0000000..5ef6d43
--- /dev/null
+++ b/tests/tests/content/SyncAccountAccessStubs/Android.bp
@@ -0,0 +1,34 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test_helper_app {
+    name: "CtsSyncAccountAccessStubs",
+    defaults: ["cts_support_defaults"],
+    static_libs: ["android-support-annotations"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    optimize: {
+        enabled: false,
+    },
+    dex_preopt: {
+        enabled: false,
+    },
+}
diff --git a/tests/tests/content/SyncAccountAccessStubs/Android.mk b/tests/tests/content/SyncAccountAccessStubs/Android.mk
deleted file mode 100644
index d176ce7..0000000
--- a/tests/tests/content/SyncAccountAccessStubs/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsSyncAccountAccessStubs
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/tests/content/emptytestapp/Android.bp b/tests/tests/content/emptytestapp/Android.bp
new file mode 100644
index 0000000..e3a7872
--- /dev/null
+++ b/tests/tests/content/emptytestapp/Android.bp
@@ -0,0 +1,25 @@
+// Copyright (C) 2017 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.
+
+android_test_helper_app {
+    name: "CtsContentEmptyTestApp",
+    defaults: ["cts_defaults"],
+    sdk_version: "current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/content/emptytestapp/Android.mk b/tests/tests/content/emptytestapp/Android.mk
deleted file mode 100644
index ea4d35a..0000000
--- a/tests/tests/content/emptytestapp/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsContentEmptyTestApp
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SDK_VERSION := current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/content/jni/Android.bp b/tests/tests/content/jni/Android.bp
new file mode 100644
index 0000000..2328276
--- /dev/null
+++ b/tests/tests/content/jni/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 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.
+
+cc_test_library {
+    name: "libnativecursorwindow_jni",
+    srcs: ["NativeCursorWindow.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-pointer-arith",
+        "-Wno-unused-parameter",
+        "-Wno-unused-variable",
+    ],
+    shared_libs: [
+        "libnativehelper_compat_libc++",
+        "liblog",
+    ],
+    stl: "libc++_static",
+}
diff --git a/tests/tests/content/jni/Android.mk b/tests/tests/content/jni/Android.mk
deleted file mode 100644
index bc934d5..0000000
--- a/tests/tests/content/jni/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE := libnativecursorwindow_jni
-
-# Don't include this package in any configuration by default.
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := NativeCursorWindow.cpp
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-LOCAL_CFLAGS := -Wall -Werror -Wno-pointer-arith -Wno-unused-parameter -Wno-unused-variable
-
-LOCAL_SHARED_LIBRARIES := libnativehelper_compat_libc++ liblog
-LOCAL_CXX_STL := libc++_static
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/content/lib/Android.mk b/tests/tests/content/lib/Android.mk
deleted file mode 100644
index 9aaa6ac..0000000
--- a/tests/tests/content/lib/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2018 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 $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/content/lib/accountaccess/Android.bp b/tests/tests/content/lib/accountaccess/Android.bp
new file mode 100644
index 0000000..0773b86
--- /dev/null
+++ b/tests/tests/content/lib/accountaccess/Android.bp
@@ -0,0 +1,23 @@
+// Copyright (C) 2018 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.
+
+java_library {
+    name: "accountaccesslib",
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "mockito-target",
+        "ub-uiautomator",
+        "compatibility-device-util-axt",
+    ],
+}
diff --git a/tests/tests/content/lib/accountaccess/Android.mk b/tests/tests/content/lib/accountaccess/Android.mk
deleted file mode 100644
index 134eb40..0000000
--- a/tests/tests/content/lib/accountaccess/Android.mk
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := accountaccesslib
-
-LOCAL_STATIC_JAVA_LIBRARIES := mockito-target \
-                               ub-uiautomator \
-                               compatibility-device-util-axt
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
\ No newline at end of file
diff --git a/tests/tests/database/Android.bp b/tests/tests/database/Android.bp
new file mode 100644
index 0000000..aad02e9
--- /dev/null
+++ b/tests/tests/database/Android.bp
@@ -0,0 +1,40 @@
+// Copyright (C) 2008 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.
+
+android_test {
+    name: "CtsDatabaseTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "android-common",
+        "ctstestrunner-axt",
+        "ctstestrunner-axt",
+        "ub-uiautomator",
+        "junit",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    // Enforce public / test api only
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/database/Android.mk b/tests/tests/database/Android.mk
deleted file mode 100644
index 1a0a9b6..0000000
--- a/tests/tests/database/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2008 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    android-common \
-    ctstestrunner-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    junit
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsDatabaseTestCases
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-# Enforce public / test api only
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java b/tests/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java
index 9e1519b..667f27e 100644
--- a/tests/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java
+++ b/tests/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java
@@ -49,7 +49,7 @@
 public class SQLiteDatabaseTest extends AndroidTestCase {
 
     private static final String TAG = "SQLiteDatabaseTest";
-    private static final String EXPECTED_MAJOR_MINOR_VERSION = "3.22";
+    private static final String EXPECTED_MAJOR_MINOR_VERSION = "3.28";
     private static final int EXPECTED_MIN_PATCH_LEVEL = 0;
 
     private SQLiteDatabase mDatabase;
diff --git a/tests/tests/display/Android.bp b/tests/tests/display/Android.bp
new file mode 100644
index 0000000..ac6c955
--- /dev/null
+++ b/tests/tests/display/Android.bp
@@ -0,0 +1,35 @@
+// 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.
+
+android_test {
+    name: "CtsDisplayTestCases",
+    defaults: ["cts_defaults"],
+    dex_preopt: {
+        enabled: false,
+    },
+    optimize: {
+        enabled: false,
+    },
+    srcs: ["src/**/*.java"],
+    static_libs: ["androidx.test.rules"],
+    libs: ["android.test.base.stubs"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/display/Android.mk b/tests/tests/display/Android.mk
deleted file mode 100644
index 99efc20..0000000
--- a/tests/tests/display/Android.mk
+++ /dev/null
@@ -1,41 +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 := tests
-# When built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsDisplayTestCases
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/dpi/Android.bp b/tests/tests/dpi/Android.bp
new file mode 100644
index 0000000..88706bb
--- /dev/null
+++ b/tests/tests/dpi/Android.bp
@@ -0,0 +1,49 @@
+//
+// Copyright (C) 2009 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.
+//
+
+android_test {
+    name: "CtsDpiTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "junit",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    sdk_version: "test_current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
+
+// ============================================================
+
+// DefaultManifestAttributesTest can be used as a base class for other
+// CTS tests, so drop it into a library that other tests can use.
+java_library {
+    name: "android.cts.dpi",
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/android/dpi/cts/DefaultManifestAttributesTest.java"],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/dpi/Android.mk b/tests/tests/dpi/Android.mk
deleted file mode 100644
index a4c3315..0000000
--- a/tests/tests/dpi/Android.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# Copyright (C) 2009 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)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt junit compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsDpiTestCases
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SDK_VERSION := current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_PACKAGE)
-
-# ============================================================
-
-# DefaultManifestAttributesTest can be used as a base class for other
-# CTS tests, so drop it into a library that other tests can use.
-include $(CLEAR_VARS)
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := src/android/dpi/cts/DefaultManifestAttributesTest.java
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE := android.cts.dpi
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/tests/tests/dpi2/Android.bp b/tests/tests/dpi2/Android.bp
new file mode 100644
index 0000000..9af9055
--- /dev/null
+++ b/tests/tests/dpi2/Android.bp
@@ -0,0 +1,36 @@
+//
+// Copyright (C) 2009 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.
+//
+
+android_test {
+    name: "CtsDpiTestCases2",
+    defaults: ["cts_defaults"],
+    // We use the DefaultManifestAttributesTest from the android.cts.dpi package.
+    static_libs: [
+        "android.cts.dpi",
+        "ctstestrunner-axt",
+        "junit",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "test_current",
+    min_sdk_version: "3",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/dpi2/Android.mk b/tests/tests/dpi2/Android.mk
deleted file mode 100644
index 641b217..0000000
--- a/tests/tests/dpi2/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# Copyright (C) 2009 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)
-
-# We use the DefaultManifestAttributesTest from the android.cts.dpi package.
-LOCAL_STATIC_JAVA_LIBRARIES := android.cts.dpi ctstestrunner-axt junit
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsDpiTestCases2
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 3
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/dreams/Android.bp b/tests/tests/dreams/Android.bp
new file mode 100644
index 0000000..d1ba152
--- /dev/null
+++ b/tests/tests/dreams/Android.bp
@@ -0,0 +1,35 @@
+// 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.
+
+android_test {
+    name: "CtsDreamsTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "junit",
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Need access to ServiceManager - see b/13307221
+    // sdk_version: "current",
+    platform_apis: true,
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+}
diff --git a/tests/tests/dreams/Android.mk b/tests/tests/dreams/Android.mk
deleted file mode 100644
index b27b989..0000000
--- a/tests/tests/dreams/Android.mk
+++ /dev/null
@@ -1,40 +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)
-
-LOCAL_PACKAGE_NAME := CtsDreamsTestCases
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt junit
-
-LOCAL_JAVA_LIBRARIES :=  android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Need access to ServiceManager - see b/13307221
-#LOCAL_SDK_VERSION := current
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/drm/Android.bp b/tests/tests/drm/Android.bp
new file mode 100644
index 0000000..57b9332
--- /dev/null
+++ b/tests/tests/drm/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2011 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.
+
+android_test {
+    name: "CtsDrmTestCases",
+    defaults: ["cts_defaults"],
+    // Include both the 32 and 64 bit versions of libs
+    compile_multilib: "both",
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    jni_libs: [
+        "libctsdrm_jni",
+        "libdrmtestplugin",
+    ],
+    platform_apis: true,
+}
diff --git a/tests/tests/drm/Android.mk b/tests/tests/drm/Android.mk
deleted file mode 100644
index 0b47c85..0000000
--- a/tests/tests/drm/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2011 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)
-
-# Include both the 32 and 64 bit versions of libs
-LOCAL_MULTILIB := both
-
-LOCAL_MODULE_TAGS := tests
-
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsDrmTestCases
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-	libctsdrm_jni \
-	libdrmtestplugin
-
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/drm/jni/Android.bp b/tests/tests/drm/jni/Android.bp
new file mode 100644
index 0000000..ce14d1e
--- /dev/null
+++ b/tests/tests/drm/jni/Android.bp
@@ -0,0 +1,32 @@
+// 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.
+
+cc_test_library {
+    name: "libctsdrm_jni",
+    srcs: [
+        "CtsDrmJniOnLoad.cpp",
+        "android_drm_cts_NativeCodeTest.cpp",
+    ],
+    gtest: false,
+    shared_libs: [
+        "liblog",
+        "libdl",
+    ],
+    sdk_version: "23",
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+    ],
+}
diff --git a/tests/tests/drm/jni/Android.mk b/tests/tests/drm/jni/Android.mk
deleted file mode 100644
index 113bef8..0000000
--- a/tests/tests/drm/jni/Android.mk
+++ /dev/null
@@ -1,35 +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)
-
-LOCAL_MODULE := libctsdrm_jni
-
-# Don't include this package in any configuration by default.
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
-		CtsDrmJniOnLoad.cpp \
-		android_drm_cts_NativeCodeTest.cpp
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-LOCAL_SHARED_LIBRARIES := liblog libdl
-LOCAL_SDK_VERSION := 23
-
-LOCAL_CFLAGS := -Wall -Werror -Wno-unused-parameter
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/drm/lib/Android.bp b/tests/tests/drm/lib/Android.bp
new file mode 100644
index 0000000..2724d2b
--- /dev/null
+++ b/tests/tests/drm/lib/Android.bp
@@ -0,0 +1,31 @@
+// 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.
+
+cc_test_library {
+    name: "libdrmtestplugin",
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Wunused",
+        "-Werror",
+        "-Wno-unused-parameter",
+    ],
+    gtest: false,
+    srcs: ["TestPlugin.cpp"],
+    shared_libs: [
+        "liblog",
+        "libutils",
+    ],
+    static_libs: ["libdrmframeworkcommon"],
+}
diff --git a/tests/tests/drm/lib/Android.mk b/tests/tests/drm/lib/Android.mk
deleted file mode 100644
index 73d2fe5..0000000
--- a/tests/tests/drm/lib/Android.mk
+++ /dev/null
@@ -1,40 +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)
-
-LOCAL_CFLAGS := -Wall -Wextra -Wunused -Werror \
-	-Wno-unused-parameter
-
-LOCAL_MODULE := libdrmtestplugin
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := \
-		TestPlugin.cpp
-
-LOCAL_C_INCLUDES := \
-	$(JNI_H_INCLUDE) \
-	$(TOP)/frameworks/av/drm/libdrmframework/plugins/common/include
-
-LOCAL_SHARED_LIBRARIES := \
-	liblog \
-	libutils
-
-LOCAL_STATIC_LIBRARIES := \
-	libdrmframeworkcommon
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/dynamic_linker/Android.bp b/tests/tests/dynamic_linker/Android.bp
new file mode 100644
index 0000000..76b6603
--- /dev/null
+++ b/tests/tests/dynamic_linker/Android.bp
@@ -0,0 +1,58 @@
+// Copyright (C) 2017 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.
+
+cc_test_library {
+    name: "libdynamiclinker_native_lib_a",
+    srcs: ["native_lib_a.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    strip: {
+        none: true,
+    },
+    stl: "libc++_static",
+}
+
+cc_test_library {
+    name: "libdynamiclinker_native_lib_b",
+    srcs: ["native_lib_b.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    strip: {
+        none: true,
+    },
+    stl: "libc++_static",
+}
+
+android_test {
+    name: "CtsDynamicLinkerTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: ["ctstestrunner-axt"],
+    srcs: ["**/*.java"],
+    compile_multilib: "both",
+    jni_libs: [
+        "libdynamiclinker_native_lib_a",
+        "libdynamiclinker_native_lib_b",
+    ],
+    manifest: "AndroidManifest.xml",
+    sdk_version: "current",
+    test_suites: [
+        "cts",
+        "vts",
+    ],
+    use_embedded_native_libs: true,
+}
diff --git a/tests/tests/dynamic_linker/Android.mk b/tests/tests/dynamic_linker/Android.mk
deleted file mode 100644
index 7d1d574..0000000
--- a/tests/tests/dynamic_linker/Android.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (C) 2017 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)
-LOCAL_MODULE := libdynamiclinker_native_lib_a
-LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := native_lib_a.cpp
-LOCAL_CFLAGS := -Wall -Werror
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-LOCAL_SDK_VERSION := 25
-LOCAL_NDK_STL_VARIANT := c++_static
-LOCAL_STRIP_MODULE := false
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libdynamiclinker_native_lib_b
-LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := native_lib_b.cpp
-LOCAL_CFLAGS := -Wall -Werror
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-LOCAL_SDK_VERSION := 25
-LOCAL_NDK_STL_VARIANT := c++_static
-LOCAL_STRIP_MODULE := false
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt
-LOCAL_SRC_FILES := $(call all-java-files-under, .)
-LOCAL_MULTILIB := both
-LOCAL_JNI_SHARED_LIBRARIES := libdynamiclinker_native_lib_a libdynamiclinker_native_lib_b
-LOCAL_MANIFEST_FILE := AndroidManifest.xml
-LOCAL_PACKAGE_NAME := CtsDynamicLinkerTestCases
-LOCAL_SDK_VERSION := current
-LOCAL_COMPATIBILITY_SUITE := cts vts
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/effect/Android.bp b/tests/tests/effect/Android.bp
new file mode 100644
index 0000000..5b62692
--- /dev/null
+++ b/tests/tests/effect/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2011 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.
+
+android_test {
+    name: "CtsEffectTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: ["ctstestrunner-axt"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/tests/tests/effect/Android.mk b/tests/tests/effect/Android.mk
deleted file mode 100644
index f2fcc94..0000000
--- a/tests/tests/effect/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2011 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)
-
-LOCAL_PACKAGE_NAME := CtsEffectTestCases
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/externalservice/Android.bp b/tests/tests/externalservice/Android.bp
new file mode 100644
index 0000000..11a1d35
--- /dev/null
+++ b/tests/tests/externalservice/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2016 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.
+
+android_test {
+    name: "CtsExternalServiceTestCases",
+    defaults: ["cts_defaults"],
+    dex_preopt: {
+        enabled: false,
+    },
+    optimize: {
+        enabled: false,
+    },
+    static_libs: [
+        "CtsExternalServiceCommon",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/externalservice/Android.mk b/tests/tests/externalservice/Android.mk
deleted file mode 100644
index d5513e3..0000000
--- a/tests/tests/externalservice/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 2016 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := CtsExternalServiceCommon compatibility-device-util-axt ctstestrunner-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsExternalServiceTestCases
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/externalservice/common/Android.bp b/tests/tests/externalservice/common/Android.bp
new file mode 100644
index 0000000..4348ace
--- /dev/null
+++ b/tests/tests/externalservice/common/Android.bp
@@ -0,0 +1,19 @@
+// Copyright (C) 2016 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.
+
+java_library {
+    name: "CtsExternalServiceCommon",
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+}
diff --git a/tests/tests/externalservice/common/Android.mk b/tests/tests/externalservice/common/Android.mk
deleted file mode 100644
index 1ebf149..0000000
--- a/tests/tests/externalservice/common/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2016 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := CtsExternalServiceCommon
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/tests/tests/externalservice/service/Android.bp b/tests/tests/externalservice/service/Android.bp
new file mode 100644
index 0000000..29b48d1
--- /dev/null
+++ b/tests/tests/externalservice/service/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsExternalServiceService",
+    defaults: ["cts_support_defaults"],
+    static_libs: [
+        "CtsExternalServiceCommon",
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/externalservice/service/Android.mk b/tests/tests/externalservice/service/Android.mk
deleted file mode 100644
index 400891e..0000000
--- a/tests/tests/externalservice/service/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2016 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    CtsExternalServiceCommon \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsExternalServiceService
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/tests/gesture/Android.bp b/tests/tests/gesture/Android.bp
new file mode 100644
index 0000000..9344bb6
--- /dev/null
+++ b/tests/tests/gesture/Android.bp
@@ -0,0 +1,28 @@
+// Copyright (C) 2008 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.
+
+android_test {
+    name: "CtsGestureTestCases",
+    defaults: ["cts_defaults"],
+    srcs: ["src/**/*.java"],
+    static_libs: ["androidx.test.runner"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    sdk_version: "current",
+}
diff --git a/tests/tests/gesture/Android.mk b/tests/tests/gesture/Android.mk
deleted file mode 100755
index 56e3b10..0000000
--- a/tests/tests/gesture/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2008 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 := tests
-# When built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.runner
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsGestureTestCases
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/graphics/Android.bp b/tests/tests/graphics/Android.bp
new file mode 100644
index 0000000..beed115
--- /dev/null
+++ b/tests/tests/graphics/Android.bp
@@ -0,0 +1,44 @@
+// Copyright (C) 2008 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.
+
+android_test {
+    name: "CtsGraphicsTestCases",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "androidx.test.rules",
+        "mockito-target-minus-junit4",
+        "compatibility-device-util-axt",
+        "ctsdeviceutillegacy-axt",
+        "ctstestrunner-axt",
+        "androidx.annotation_annotation",
+        "junit",
+        "testng",
+        "androidx.core_core",
+    ],
+    jni_libs: ["libctsgraphics_jni"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    // Enforce public / test api only
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/graphics/Android.mk b/tests/tests/graphics/Android.mk
deleted file mode 100644
index 74cecda..0000000
--- a/tests/tests/graphics/Android.mk
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (C) 2008 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_MULTILIB := both
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES += \
-    androidx.test.rules \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctsdeviceutillegacy-axt \
-    ctstestrunner-axt \
-    androidx.annotation_annotation \
-    junit \
-    testng
-
-LOCAL_STATIC_ANDROID_LIBRARIES += \
-    androidx.core_core
-
-LOCAL_JNI_SHARED_LIBRARIES := libctsgraphics_jni
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsGraphicsTestCases
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-# Enforce public / test api only
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/graphics/jni/Android.bp b/tests/tests/graphics/jni/Android.bp
new file mode 100644
index 0000000..305ced3
--- /dev/null
+++ b/tests/tests/graphics/jni/Android.bp
@@ -0,0 +1,61 @@
+// Copyright 2016 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.
+
+cc_test_library {
+    name: "libctsgraphics_jni",
+    gtest: false,
+    srcs: [
+        "CtsGraphicsJniOnLoad.cpp",
+        "android_graphics_cts_ANativeWindowTest.cpp",
+        "android_graphics_cts_ASurfaceTextureTest.cpp",
+        "android_graphics_cts_BasicVulkanGpuTest.cpp",
+        "android_graphics_cts_BitmapTest.cpp",
+        "android_graphics_cts_SyncTest.cpp",
+        "android_graphics_cts_CameraGpuCtsActivity.cpp",
+        "android_graphics_cts_CameraVulkanGpuTest.cpp",
+        "android_graphics_cts_MediaVulkanGpuTest.cpp",
+        "android_graphics_cts_VulkanFeaturesTest.cpp",
+        "android_graphics_cts_VulkanPreTransformCtsActivity.cpp",
+        "android_graphics_cts_VulkanSurfaceSupportTest.cpp",
+        "android_graphics_fonts_cts_SystemFonts.cpp",
+        "CameraTestHelpers.cpp",
+        "ImageReaderTestHelpers.cpp",
+        "MediaTestHelpers.cpp",
+        "NativeTestHelpers.cpp",
+        "VulkanPreTransformTestHelpers.cpp",
+        "VulkanTestHelpers.cpp",
+    ],
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-DGL_GLEXT_PROTOTYPES",
+        "-DEGL_EGLEXT_PROTOTYPES",
+    ],
+    static_libs: ["libvkjson_ndk"],
+    shared_libs: [
+        "libandroid",
+        "libvulkan",
+        "libnativewindow",
+        "libsync",
+        "liblog",
+        "libdl",
+        "libjnigraphics",
+        "libcamera2ndk",
+        "libmediandk",
+        "libEGL",
+        "libGLESv2",
+    ],
+    stl: "c++_static",
+    sdk_version: "current",
+}
diff --git a/tests/tests/graphics/jni/Android.mk b/tests/tests/graphics/jni/Android.mk
deleted file mode 100644
index af76936..0000000
--- a/tests/tests/graphics/jni/Android.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright 2016 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)
-
-LOCAL_MODULE := libctsgraphics_jni
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := \
-	CtsGraphicsJniOnLoad.cpp \
-	android_graphics_cts_ANativeWindowTest.cpp \
-	android_graphics_cts_ASurfaceTextureTest.cpp \
-	android_graphics_cts_BasicVulkanGpuTest.cpp \
-	android_graphics_cts_BitmapTest.cpp \
-	android_graphics_cts_SyncTest.cpp \
-	android_graphics_cts_CameraGpuCtsActivity.cpp \
-	android_graphics_cts_CameraVulkanGpuTest.cpp \
-	android_graphics_cts_MediaVulkanGpuTest.cpp \
-	android_graphics_cts_VulkanFeaturesTest.cpp \
-	android_graphics_cts_VulkanPreTransformCtsActivity.cpp \
-	android_graphics_cts_VulkanSurfaceSupportTest.cpp \
-        android_graphics_fonts_cts_SystemFonts.cpp \
-	CameraTestHelpers.cpp \
-	ImageReaderTestHelpers.cpp \
-	MediaTestHelpers.cpp \
-	NativeTestHelpers.cpp \
-	VulkanPreTransformTestHelpers.cpp \
-	VulkanTestHelpers.cpp
-
-LOCAL_CFLAGS += -Wall -Werror -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-LOCAL_STATIC_LIBRARIES := libvkjson_ndk
-LOCAL_SHARED_LIBRARIES := libandroid libvulkan libnativewindow libsync liblog libdl libjnigraphics \
-                          libcamera2ndk libmediandk libEGL libGLESv2
-LOCAL_NDK_STL_VARIANT := c++_static
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/graphics/src/android/graphics/drawable/cts/AnimatedImageDrawableTest.java b/tests/tests/graphics/src/android/graphics/drawable/cts/AnimatedImageDrawableTest.java
index f8d49ef..3f5c692 100644
--- a/tests/tests/graphics/src/android/graphics/drawable/cts/AnimatedImageDrawableTest.java
+++ b/tests/tests/graphics/src/android/graphics/drawable/cts/AnimatedImageDrawableTest.java
@@ -387,6 +387,9 @@
                 drawable.start();
             });
 
+            cb.waitForStart();
+            cb.assertStarted(true);
+
             // The animation runs repeatCount + 1 total times.
             cb.waitForEnd(DURATION * repeatCount);
             cb.assertEnded(false);
diff --git a/tests/tests/hardware/Android.bp b/tests/tests/hardware/Android.bp
new file mode 100644
index 0000000..1915b00
--- /dev/null
+++ b/tests/tests/hardware/Android.bp
@@ -0,0 +1,45 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsHardwareTestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    compile_multilib: "both",
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "androidx.annotation_annotation",
+        "androidx.test.ext.junit",
+        "compatibility-device-util-axt",
+        "cts-input-lib",
+        "ctstestrunner-axt",
+        "mockito-target-minus-junit4",
+        "platform-test-annotations",
+        "ub-uiautomator",
+    ],
+    jni_libs: [
+        "libctshardware_jni",
+        "libnativehelper_compat_libc++",
+    ],
+    srcs: ["src/**/*.java"],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/hardware/Android.mk b/tests/tests/hardware/Android.mk
deleted file mode 100644
index 9bacb2c..0000000
--- a/tests/tests/hardware/Android.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (C) 2017 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 := tests
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MULTILIB := both
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.annotation_annotation \
-    androidx.test.ext.junit \
-    compatibility-device-util-axt \
-    cts-input-lib \
-    ctstestrunner-axt \
-    mockito-target-minus-junit4 \
-    platform-test-annotations \
-    ub-uiautomator
-
-LOCAL_JNI_SHARED_LIBRARIES := libctshardware_jni libnativehelper_compat_libc++
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsHardwareTestCases
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/hardware/jni/Android.bp b/tests/tests/hardware/jni/Android.bp
new file mode 100644
index 0000000..f1a04c3
--- /dev/null
+++ b/tests/tests/hardware/jni/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2017 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.
+
+cc_test_library {
+    name: "libctshardware_jni",
+    cflags: ["-Werror"],
+    gtest: false,
+    srcs: [
+        "CtsHardwareJniOnLoad.cpp",
+        "android_hardware_cts_HardwareBufferTest.cpp",
+    ],
+    shared_libs: [
+        "libandroid",
+        "libnativehelper_compat_libc++",
+        "liblog",
+    ],
+    stl: "none",
+    sdk_version: "current",
+    clang: true,
+}
diff --git a/tests/tests/hardware/jni/Android.mk b/tests/tests/hardware/jni/Android.mk
deleted file mode 100644
index 6df6667..0000000
--- a/tests/tests/hardware/jni/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE := libctshardware_jni
-
-LOCAL_CFLAGS += -Werror
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := \
-		CtsHardwareJniOnLoad.cpp \
-		android_hardware_cts_HardwareBufferTest.cpp
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-LOCAL_SHARED_LIBRARIES := libandroid libnativehelper_compat_libc++ liblog
-
-LOCAL_NDK_STL_VARIANT := none
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_CLANG := true
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/icu/Android.bp b/tests/tests/icu/Android.bp
new file mode 100644
index 0000000..178b909
--- /dev/null
+++ b/tests/tests/icu/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2015 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.
+
+android_test {
+    name: "CtsIcuTestCases",
+    defaults: ["cts_support_defaults"],
+    java_resource_dirs: ["resources"],
+    static_libs: [
+        "cts-core-test-runner-axt",
+        "android-icu4j-tests",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+	"mts",
+    ],
+    platform_apis: true,
+}
diff --git a/tests/tests/icu/Android.mk b/tests/tests/icu/Android.mk
deleted file mode 100644
index 8f4fc28..0000000
--- a/tests/tests/icu/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2015 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 := tests
-# When built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_JAVA_RESOURCE_DIRS := resources
-
-# The aim of this package is to run tests against the implementation in use by
-# the current android system.
-LOCAL_STATIC_JAVA_LIBRARIES := \
-	cts-core-test-runner-axt \
-	android-icu4j-tests
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests mts
-
-LOCAL_PACKAGE_NAME := CtsIcuTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
-
diff --git a/tests/tests/icu/OWNERS b/tests/tests/icu/OWNERS
new file mode 100644
index 0000000..2d36574
--- /dev/null
+++ b/tests/tests/icu/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 24949
+include platform/libcore:/OWNERS
diff --git a/tests/tests/jni/Android.bp b/tests/tests/jni/Android.bp
new file mode 100644
index 0000000..aff9682
--- /dev/null
+++ b/tests/tests/jni/Android.bp
@@ -0,0 +1,94 @@
+// Copyright (C) 2009 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.
+
+android_test {
+    name: "CtsJniTestCases",
+    defaults: ["cts_defaults"],
+    // Include both the 32 and 64 bit versions
+    compile_multilib: "both",
+    // When built, explicitly put it in the data partition.
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+    ],
+    jni_libs: [
+        "libjni_test_dlclose",
+        "libjninamespacea1",
+        "libjninamespacea2",
+        "libjninamespaceb",
+        "libjnicommon",
+        "libjnitest",
+        "libnativehelper_compat_libc++",
+    ],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    use_embedded_native_libs: false,
+}
+
+cc_test_library {
+    name: "libjninamespacea1",
+    srcs: ["libjninamespacea1/namespacea1.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    local_include_dirs: ["libjnicommon"],
+    host_ldlibs: ["-llog"],
+    shared_libs: [
+        "liblog",
+        "libjnicommon",
+    ],
+    sdk_version: "23",
+    gtest: false,
+}
+
+cc_test_library {
+    name: "libjninamespacea2",
+    srcs: ["libjninamespacea2/namespacea2.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    local_include_dirs: ["libjnicommon"],
+    host_ldlibs: ["-llog"],
+    shared_libs: [
+        "liblog",
+        "libjnicommon",
+    ],
+    sdk_version: "23",
+    gtest: false,
+}
+
+cc_test_library {
+    name: "libjninamespaceb",
+    srcs: ["libjninamespaceb/namespaceb.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    local_include_dirs: ["libjnicommon"],
+    host_ldlibs: ["-llog"],
+    shared_libs: [
+        "liblog",
+        "libjnicommon",
+    ],
+    sdk_version: "23",
+    gtest: false,
+}
diff --git a/tests/tests/jni/Android.mk b/tests/tests/jni/Android.mk
deleted file mode 100644
index 440758a..0000000
--- a/tests/tests/jni/Android.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright (C) 2009 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)
-
-LOCAL_PACKAGE_NAME := CtsJniTestCases
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# Include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt androidx.test.rules
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-  libjni_test_dlclose \
-  libjninamespacea1 \
-  libjninamespacea2 \
-  libjninamespaceb \
-  libjnicommon \
-  libjnitest \
-  libnativehelper_compat_libc++
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-LOCAL_NDK_STL_VARIANT := c++_shared
-
-LOCAL_USE_EMBEDDED_NATIVE_LIBS := false
-
-include $(BUILD_CTS_PACKAGE)
-
-# Include the associated library's makefile.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/jni/libjnicommon/Android.bp b/tests/tests/jni/libjnicommon/Android.bp
new file mode 100644
index 0000000..15756f6
--- /dev/null
+++ b/tests/tests/jni/libjnicommon/Android.bp
@@ -0,0 +1,28 @@
+// Copyright (C) 2016 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.
+
+//
+// This is the shared library included by the JNI test app.
+//
+
+cc_test_library {
+    name: "libjnicommon",
+    srcs: ["common.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    sdk_version: "23",
+    gtest: false,
+}
diff --git a/tests/tests/jni/libjnicommon/Android.mk b/tests/tests/jni/libjnicommon/Android.mk
deleted file mode 100644
index 14406f3..0000000
--- a/tests/tests/jni/libjnicommon/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2016 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.
-
-#
-# This is the shared library included by the JNI test app.
-#
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libjnicommon
-
-# Don't include this package in any configuration by default.
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := common.cpp
-
-LOCAL_CFLAGS := -Wall -Werror
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-LOCAL_SHARED_LIBRARIES := libdl liblog libnativehelper_compat_libc++
-
-LOCAL_SDK_VERSION := 23
-LOCAL_NDK_STL_VARIANT := c++_shared
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/jni/libjninamespacea1/Android.mk b/tests/tests/jni/libjninamespacea1/Android.mk
deleted file mode 100644
index 419db82..0000000
--- a/tests/tests/jni/libjninamespacea1/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2016 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.
-
-#
-# This is the shared library included by the JNI test app.
-#
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libjninamespacea1
-
-# Don't include this package in any configuration by default.
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := namespacea1.cpp
-
-LOCAL_CFLAGS := -Wall -Werror
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE) $(LOCAL_PATH)/../libjnicommon/
-
-LOCAL_LDLIBS += -llog
-LOCAL_SHARED_LIBRARIES := libdl liblog libnativehelper_compat_libc++ libjnicommon
-
-LOCAL_SDK_VERSION := 23
-LOCAL_NDK_STL_VARIANT := c++_shared
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/jni/libjninamespacea1/namespacea1.cpp b/tests/tests/jni/libjninamespacea1/namespacea1.cpp
index 8a79c3c..a1eddb1 100644
--- a/tests/tests/jni/libjninamespacea1/namespacea1.cpp
+++ b/tests/tests/jni/libjninamespacea1/namespacea1.cpp
@@ -18,7 +18,6 @@
 
 #include <android/log.h>
 #include <jni.h>
-#include <nativehelper/JNIHelp.h>
 
 #define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO,"namespacea1",__VA_ARGS__)
 
diff --git a/tests/tests/jni/libjninamespacea2/Android.mk b/tests/tests/jni/libjninamespacea2/Android.mk
deleted file mode 100644
index 2781a81..0000000
--- a/tests/tests/jni/libjninamespacea2/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2016 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.
-
-#
-# This is the shared library included by the JNI test app.
-#
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libjninamespacea2
-
-# Don't include this package in any configuration by default.
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := namespacea2.cpp
-
-LOCAL_CFLAGS := -Wall -Werror
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE) $(LOCAL_PATH)/../libjnicommon/
-
-LOCAL_LDLIBS += -llog
-LOCAL_SHARED_LIBRARIES := libdl liblog libnativehelper_compat_libc++ libjnicommon
-
-LOCAL_SDK_VERSION := 23
-LOCAL_NDK_STL_VARIANT := c++_shared
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/jni/libjninamespacea2/namespacea2.cpp b/tests/tests/jni/libjninamespacea2/namespacea2.cpp
index 49f055e..0ac9695 100644
--- a/tests/tests/jni/libjninamespacea2/namespacea2.cpp
+++ b/tests/tests/jni/libjninamespacea2/namespacea2.cpp
@@ -18,7 +18,6 @@
 
 #include <android/log.h>
 #include <jni.h>
-#include <nativehelper/JNIHelp.h>
 
 #define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO,"namespacea2",__VA_ARGS__)
 
diff --git a/tests/tests/jni/libjninamespaceb/Android.mk b/tests/tests/jni/libjninamespaceb/Android.mk
deleted file mode 100644
index e91ba59..0000000
--- a/tests/tests/jni/libjninamespaceb/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2016 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.
-
-#
-# This is the shared library included by the JNI test app.
-#
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libjninamespaceb
-
-# Don't include this package in any configuration by default.
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := namespaceb.cpp
-
-LOCAL_CFLAGS := -Wall -Werror
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE) $(LOCAL_PATH)/../libjnicommon/
-
-LOCAL_LDLIBS += -llog
-LOCAL_SHARED_LIBRARIES := libdl liblog libnativehelper_compat_libc++ libjnicommon
-
-LOCAL_SDK_VERSION := 23
-LOCAL_NDK_STL_VARIANT := c++_shared
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/jni/libjninamespaceb/namespaceb.cpp b/tests/tests/jni/libjninamespaceb/namespaceb.cpp
index 4c48627..e9ef300 100644
--- a/tests/tests/jni/libjninamespaceb/namespaceb.cpp
+++ b/tests/tests/jni/libjninamespaceb/namespaceb.cpp
@@ -18,7 +18,6 @@
 
 #include <android/log.h>
 #include <jni.h>
-#include <nativehelper/JNIHelp.h>
 
 #define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO,"namespaceb",__VA_ARGS__)
 
diff --git a/tests/tests/jni/libjnitest/Android.bp b/tests/tests/jni/libjnitest/Android.bp
new file mode 100644
index 0000000..d7206c4
--- /dev/null
+++ b/tests/tests/jni/libjnitest/Android.bp
@@ -0,0 +1,60 @@
+// Copyright (C) 2009 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.
+
+//
+// This is the shared library included by the JNI test app.
+//
+
+cc_test_library {
+    name: "libjnitest",
+    srcs: [
+        "android_jni_cts_BasicLoaderTest.cpp",
+        "android_jni_cts_InstanceNonce.c",
+        "android_jni_cts_JniCTest.c",
+        "android_jni_cts_JniCppTest.cpp",
+        "android_jni_cts_JniStaticTest.cpp",
+        "android_jni_cts_LinkerNamespacesTest.cpp",
+        "android_jni_cts_StaticNonce.c",
+        "helper.c",
+        "register.c",
+    ],
+    static_libs: ["libbase_ndk"],
+    shared_libs: [
+        "libdl",
+        "liblog",
+        "libnativehelper_compat_libc++",
+    ],
+    sdk_version: "current",
+    stl: "c++_static",
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+
+        "-Wno-format",
+        "-Wno-gnu-designator",
+    ],
+    gtest: false,
+}
+
+cc_test_library {
+    name: "libjni_test_dlclose",
+    srcs: ["taxicab_number.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    sdk_version: "23",
+    gtest: false,
+}
diff --git a/tests/tests/jni/libjnitest/Android.mk b/tests/tests/jni/libjnitest/Android.mk
deleted file mode 100644
index d2db74d..0000000
--- a/tests/tests/jni/libjnitest/Android.mk
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright (C) 2009 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.
-
-#
-# This is the shared library included by the JNI test app.
-#
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libjnitest
-
-# Don't include this package in any configuration by default.
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
-	android_jni_cts_BasicLoaderTest.cpp \
-	android_jni_cts_InstanceNonce.c \
-	android_jni_cts_JniCTest.c \
-	android_jni_cts_JniCppTest.cpp \
-	android_jni_cts_JniStaticTest.cpp \
-	android_jni_cts_LinkerNamespacesTest.cpp \
-	android_jni_cts_StaticNonce.c \
-	helper.c \
-	register.c
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-LOCAL_STATIC_LIBRARIES := libbase_ndk
-
-LOCAL_SHARED_LIBRARIES := libdl liblog libnativehelper_compat_libc++
-
-LOCAL_SDK_VERSION := current
-LOCAL_NDK_STL_VARIANT := c++_static
-
-LOCAL_CFLAGS := -Wall -Werror -Wno-unused-parameter
-LOCAL_CFLAGS += -Wno-format -Wno-gnu-designator
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libjni_test_dlclose
-
-LOCAL_SRC_FILES := taxicab_number.cpp
-
-LOCAL_CFLAGS += -Wall -Werror
-
-LOCAL_SDK_VERSION := 23
-
-LOCAL_NDK_STL_VARIANT := c++_static
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/jni/src/android/jni/cts/JniStaticTest.java b/tests/tests/jni/src/android/jni/cts/JniStaticTest.java
index 6f51d31..4742796 100644
--- a/tests/tests/jni/src/android/jni/cts/JniStaticTest.java
+++ b/tests/tests/jni/src/android/jni/cts/JniStaticTest.java
@@ -316,8 +316,8 @@
     /**
      * dlopen(3) any of the public lib via file name (non-absolute path) should succeed.
      */
-    public void test_dlopenPublicLibrariesInRuntimeNamespace() {
-        String error = LinkerNamespacesHelper.runDlopenPublicLibrariesInRuntimeNamespace();
+    public void test_dlopenPublicLibraries() {
+        String error = LinkerNamespacesHelper.runDlopenPublicLibraries();
         if (error != null) {
             fail(error);
         }
diff --git a/tests/tests/jni/src/android/jni/cts/LinkerNamespacesHelper.java b/tests/tests/jni/src/android/jni/cts/LinkerNamespacesHelper.java
index cbf73c1..439284d 100644
--- a/tests/tests/jni/src/android/jni/cts/LinkerNamespacesHelper.java
+++ b/tests/tests/jni/src/android/jni/cts/LinkerNamespacesHelper.java
@@ -350,14 +350,30 @@
         return null;
     }
 
-    public static String runDlopenPublicLibrariesInRuntimeNamespace() {
-        for (String lib : PUBLIC_RUNTIME_LIBRARIES) {
-            String error = LinkerNamespacesHelper.tryDlopen(lib);
-            if (error != null) {
-                return error;
+    public static String runDlopenPublicLibraries() {
+        String error;
+        try {
+            List<String> publicLibs = new ArrayList<>();
+            Collections.addAll(publicLibs, PUBLIC_SYSTEM_LIBRARIES);
+            Collections.addAll(publicLibs, PUBLIC_RUNTIME_LIBRARIES);
+            error = readExtensionConfigFiles(PUBLIC_CONFIG_DIR, publicLibs);
+            if (error != null) return error;
+            error = readExtensionConfigFiles(PRODUCT_CONFIG_DIR, publicLibs);
+            if (error != null) return error;
+            publicLibs.addAll(readPublicLibrariesFile(new File(VENDOR_CONFIG_FILE)));
+            for (String lib : publicLibs) {
+                String result = LinkerNamespacesHelper.tryDlopen(lib);
+                if (result != null) {
+                    if (error == null) {
+                        error = "";
+                    }
+                    error += result + "\n";
+                }
             }
+        } catch (IOException e) {
+            return e.toString();
         }
-        return null;
+        return error;
     }
 
     public static native String tryDlopen(String lib);
diff --git a/tests/tests/jni_vendor/Android.bp b/tests/tests/jni_vendor/Android.bp
new file mode 100644
index 0000000..544257b
--- /dev/null
+++ b/tests/tests/jni_vendor/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsVendorJniTestCases",
+    defaults: ["cts_defaults"],
+
+    compile_multilib: "both",
+    static_libs: [
+        "androidx.test.rules",
+        "ctstestrunner-axt",
+    ],
+    jni_libs: ["libvendorjnitest"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // TODO(jiyong) make this really a part of CTS
+    // This can't be done right now since VNDK runtime restriction is optional
+    // at least for O-MR1.
+    // Tag this module as a cts test artifact
+    // test_suites: ["cts", "vts", "general-tests"],
+}
diff --git a/tests/tests/jni_vendor/Android.mk b/tests/tests/jni_vendor/Android.mk
deleted file mode 100644
index 6b9bfb3..0000000
--- a/tests/tests/jni_vendor/Android.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsVendorJniTestCases
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# Include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-# When built, explicitly put it in the vendor partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules ctstestrunner-axt
-
-LOCAL_JNI_SHARED_LIBRARIES := libvendorjnitest
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-
-# TODO(jiyong) make this really a part of CTS
-# This can't be done right now since VNDK runtime restriction is optional
-# at least for O-MR1.
-# Tag this module as a cts test artifact
-#LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
-
-# Include the associated library's makefile.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/jni_vendor/libvendorjnitest/Android.bp b/tests/tests/jni_vendor/libvendorjnitest/Android.bp
new file mode 100644
index 0000000..0589010
--- /dev/null
+++ b/tests/tests/jni_vendor/libvendorjnitest/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2017 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.
+
+//
+// This is the shared library included by the JNI test app.
+//
+
+cc_test_library {
+    name: "libvendorjnitest",
+    srcs: ["android_jni_vendor_cts_VendorJniTest.cpp"],
+    shared_libs: [
+        "libdl",
+        "liblog",
+    ],
+    sdk_version: "current",
+    stl: "c++_static",
+    cflags: ["-Wno-unused-parameter"],
+    vendor: true,
+    gtest: false,
+}
diff --git a/tests/tests/jni_vendor/libvendorjnitest/Android.mk b/tests/tests/jni_vendor/libvendorjnitest/Android.mk
deleted file mode 100644
index c9e9205..0000000
--- a/tests/tests/jni_vendor/libvendorjnitest/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2017 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.
-
-#
-# This is the shared library included by the JNI test app.
-#
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libvendorjnitest
-
-# Don't include this package in any configuration by default.
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := android_jni_vendor_cts_VendorJniTest.cpp
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-LOCAL_SHARED_LIBRARIES := libdl liblog
-
-LOCAL_SDK_VERSION := current
-LOCAL_NDK_STL_VARIANT := c++_static
-
-LOCAL_CFLAGS := -Wno-unused-parameter
-
-LOCAL_VENDOR_MODULE := true
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/jvmti/Android.mk b/tests/tests/jvmti/Android.mk
deleted file mode 100644
index 8facc9f..0000000
--- a/tests/tests/jvmti/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (C) 2017 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 the associated library's makefile.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/jvmti/attaching/Android.bp b/tests/tests/jvmti/attaching/Android.bp
new file mode 100644
index 0000000..36f94a7
--- /dev/null
+++ b/tests/tests/jvmti/attaching/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsJvmtiAttachingTestCases",
+    defaults: ["cts_defaults"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+    ],
+    compile_multilib: "both",
+    jni_libs: [
+        "libjvmtiattachingtestagent1",
+        "libjvmtiattachingtestagent2",
+        "libjvmtiattachingtestagent3",
+        "libjvmtiattachingtestagent4",
+    ],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+}
diff --git a/tests/tests/jvmti/attaching/Android.mk b/tests/tests/jvmti/attaching/Android.mk
deleted file mode 100644
index fb2a765..0000000
--- a/tests/tests/jvmti/attaching/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsJvmtiAttachingTestCases
-
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt androidx.test.rules
-
-LOCAL_MULTILIB := both
-LOCAL_JNI_SHARED_LIBRARIES := libjvmtiattachingtestagent1 \
-                              libjvmtiattachingtestagent2 \
-                              libjvmtiattachingtestagent3 \
-                              libjvmtiattachingtestagent4 \
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/jvmti/attaching/OWNERS b/tests/tests/jvmti/attaching/OWNERS
new file mode 100644
index 0000000..6e06299
--- /dev/null
+++ b/tests/tests/jvmti/attaching/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 86431
+include /hostsidetests/jvmti/run-tests/OWNERS
diff --git a/tests/tests/jvmti/attaching/jni/Android.bp b/tests/tests/jvmti/attaching/jni/Android.bp
new file mode 100644
index 0000000..8e26f86
--- /dev/null
+++ b/tests/tests/jvmti/attaching/jni/Android.bp
@@ -0,0 +1,69 @@
+// Copyright (C) 2017 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.
+
+//
+// This is the shared library included by the JNI test app.
+//
+
+cc_test_library {
+    name: "libjvmtiattachingtestagent1",
+    gtest: false,
+    srcs: ["agent.c"],
+    sdk_version: "current",
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+        "-DAGENT_NR=1",
+    ],
+}
+
+cc_test_library {
+    name: "libjvmtiattachingtestagent2",
+    gtest: false,
+    srcs: ["agent.c"],
+    sdk_version: "current",
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+        "-DAGENT_NR=2",
+    ],
+}
+
+cc_test_library {
+    name: "libjvmtiattachingtestagent3",
+    gtest: false,
+    srcs: ["agent.c"],
+    sdk_version: "current",
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+        "-DAGENT_NR=3",
+    ],
+}
+
+cc_test_library {
+    name: "libjvmtiattachingtestagent4",
+    gtest: false,
+    srcs: ["agent.c"],
+    sdk_version: "current",
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+        "-DAGENT_NR=4",
+    ],
+}
diff --git a/tests/tests/jvmti/attaching/jni/Android.mk b/tests/tests/jvmti/attaching/jni/Android.mk
deleted file mode 100644
index b0d8376..0000000
--- a/tests/tests/jvmti/attaching/jni/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2017 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.
-
-#
-# This is the shared library included by the JNI test app.
-#
-
-LOCAL_PATH:= $(call my-dir)
-
-define jvmti-attaching-test-agent
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libjvmtiattachingtestagent$1
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := agent.c
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_CFLAGS := -Wall -Werror -Wno-unused-parameter
-
-LOCAL_CFLAGS += -DAGENT_NR=$1
-
-include $(BUILD_SHARED_LIBRARY)
-endef
-
-$(eval $(call jvmti-attaching-test-agent,1))
-$(eval $(call jvmti-attaching-test-agent,2))
-$(eval $(call jvmti-attaching-test-agent,3))
-$(eval $(call jvmti-attaching-test-agent,4))
diff --git a/tests/tests/keystore/Android.bp b/tests/tests/keystore/Android.bp
new file mode 100644
index 0000000..1122dab
--- /dev/null
+++ b/tests/tests/keystore/Android.bp
@@ -0,0 +1,50 @@
+// Copyright 2013 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.
+
+android_test {
+    name: "CtsKeystoreTestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    libs: [
+        "bouncycastle-unbundled",
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "androidx.test.rules",
+        "core-tests-support",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "hamcrest-library",
+        "guava",
+        "junit",
+        "cts-security-test-support-library",
+        "platformprotosnano",
+    ],
+    srcs: ["src/**/*.java"],
+    // Can't use public/test API only because some tests use hidden API
+    // (e.g. device-provided Bouncy Castle).
+    //
+    // The comment below is not particularly accurate, but it's copied from other
+    // tests that do the same thing, so anyone grepping for it will find it here.
+    //
+    // Uncomment when b/13282254 is fixed.
+    // sdk_version: "current"
+    platform_apis: true,
+}
diff --git a/tests/tests/keystore/Android.mk b/tests/tests/keystore/Android.mk
deleted file mode 100644
index 9359403..0000000
--- a/tests/tests/keystore/Android.mk
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright 2013 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_JAVA_LIBRARIES := bouncycastle-unbundled
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-        androidx.test.rules \
-        core-tests-support \
-        compatibility-device-util-axt \
-        ctstestrunner-axt \
-	hamcrest-library \
-        guava \
-        junit \
-        cts-security-test-support-library \
-        platformprotosnano
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JACK_FLAGS := --multi-dex native
-
-LOCAL_PACKAGE_NAME := CtsKeystoreTestCases
-
-# Can't use public/test API only because some tests use hidden API
-# (e.g. device-provided Bouncy Castle).
-#
-# The comment below is not particularly accurate, but it's copied from other
-# tests that do the same thing, so anyone grepping for it will find it here.
-#
-# Uncomment when b/13282254 is fixed.
-# LOCAL_SDK_VERSION := current
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_JAVA_LIBRARIES += android.test.runner.stubs
-LOCAL_JAVA_LIBRARIES += android.test.base.stubs
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/keystore/src/android/keystore/cts/KeyAttestationTest.java b/tests/tests/keystore/src/android/keystore/cts/KeyAttestationTest.java
index c0f0b69..9e45b10 100644
--- a/tests/tests/keystore/src/android/keystore/cts/KeyAttestationTest.java
+++ b/tests/tests/keystore/src/android/keystore/cts/KeyAttestationTest.java
@@ -1016,6 +1016,12 @@
                     X500Name signedCertSubject =
                             new JcaX509CertificateHolder(x509PrevCert).getSubject();
                     assertEquals(signedCertSubject, new X500Name("CN=Android Keystore Key"));
+                } else {
+                    // Only strongbox implementations should have strongbox in the subject line
+                    assertFalse(x509CurrCert.getSubjectDN()
+                                            .getName()
+                                            .toLowerCase()
+                                            .contains("strongbox"));
                 }
             } catch (InvalidKeyException | CertificateException | NoSuchAlgorithmException
                     | NoSuchProviderException | SignatureException e) {
diff --git a/tests/tests/libcoreapievolution/Android.bp b/tests/tests/libcoreapievolution/Android.bp
new file mode 100644
index 0000000..cabb0c9
--- /dev/null
+++ b/tests/tests/libcoreapievolution/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsLibcoreApiEvolutionTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "junit",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/libcoreapievolution/Android.mk b/tests/tests/libcoreapievolution/Android.mk
deleted file mode 100644
index 04e0a1b..0000000
--- a/tests/tests/libcoreapievolution/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2018 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt junit
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsLibcoreApiEvolutionTestCases
-LOCAL_SDK_VERSION := current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/libcorefileio/Android.bp b/tests/tests/libcorefileio/Android.bp
new file mode 100644
index 0000000..8a599e7
--- /dev/null
+++ b/tests/tests/libcorefileio/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2016 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.
+
+android_test {
+    name: "CtsLibcoreFileIOTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "junit",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/libcorefileio/Android.mk b/tests/tests/libcorefileio/Android.mk
deleted file mode 100644
index 9af3751..0000000
--- a/tests/tests/libcorefileio/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2016 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt junit
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsLibcoreFileIOTestCases
-LOCAL_SDK_VERSION := current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/libcorefileio/src/android/cts/FileChannelInterProcessLockTest.java b/tests/tests/libcorefileio/src/android/cts/FileChannelInterProcessLockTest.java
index b47cf2a..9f78d25 100644
--- a/tests/tests/libcorefileio/src/android/cts/FileChannelInterProcessLockTest.java
+++ b/tests/tests/libcorefileio/src/android/cts/FileChannelInterProcessLockTest.java
@@ -20,6 +20,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
+import android.os.Debug;
 import android.os.Environment;
 import android.test.AndroidTestCase;
 
diff --git a/tests/tests/libcorelegacy22/Android.bp b/tests/tests/libcorelegacy22/Android.bp
new file mode 100644
index 0000000..e28a800
--- /dev/null
+++ b/tests/tests/libcorelegacy22/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2015 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.
+
+android_test {
+    name: "CtsLibcoreLegacy22TestCases",
+    defaults: ["cts_defaults"],
+    static_libs: ["ctstestrunner-axt"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "22",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/libcorelegacy22/Android.mk b/tests/tests/libcorelegacy22/Android.mk
deleted file mode 100644
index 0295b89..0000000
--- a/tests/tests/libcorelegacy22/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2015 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsLibcoreLegacy22TestCases
-
-LOCAL_SDK_VERSION := 22
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/location/Android.bp b/tests/tests/location/Android.bp
new file mode 100644
index 0000000..9d9e6c0
--- /dev/null
+++ b/tests/tests/location/Android.bp
@@ -0,0 +1,66 @@
+// Copyright (C) 2008 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.
+
+// Reusable Location test classes and helpers
+
+java_test_helper_library {
+    name: "cts-location-tests",
+    libs: [
+        "telephony-common",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "apache-commons-math",
+        "platform-test-annotations",
+    ],
+    srcs: [
+        "src/android/location/cts/**/*.java",
+        "protos/**/*.proto",
+    ],
+    proto: {
+        type: "nano",
+    },
+}
+
+// CtsLocationTestCases package
+android_test {
+    name: "CtsLocationTestCases",
+    defaults: ["cts_defaults"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    libs: [
+        "telephony-common",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "apache-commons-math",
+    ],
+    proto: {
+        type: "nano",
+    },
+    srcs: [
+        "src/**/*.java",
+        "protos/**/*.proto",
+    ],
+    platform_apis: true,
+    dxflags: ["--multi-dex"],
+}
diff --git a/tests/tests/location/Android.mk b/tests/tests/location/Android.mk
deleted file mode 100644
index 6d88a4d..0000000
--- a/tests/tests/location/Android.mk
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright (C) 2008 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)
-
-# Reusable Location test classes and helpers
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := cts-location-tests
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := telephony-common android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt ctstestrunner-axt apache-commons-math platform-test-annotations
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src/android/location/cts) \
-   $(call all-proto-files-under, protos)
-
-LOCAL_PROTOC_OPTIMIZE_TYPE := nano
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
-
-# CtsLocationTestCases package
-
-include $(CLEAR_VARS)
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_JAVA_LIBRARIES := telephony-common android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util-axt ctstestrunner-axt  apache-commons-math
-
-LOCAL_PROTOC_OPTIMIZE_TYPE := nano
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-   $(call all-proto-files-under, protos)
-
-LOCAL_PACKAGE_NAME := CtsLocationTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_JACK_FLAGS := --multi-dex native
-LOCAL_DX_FLAGS := --multi-dex
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/location2/Android.bp b/tests/tests/location2/Android.bp
new file mode 100644
index 0000000..5cc43b1
--- /dev/null
+++ b/tests/tests/location2/Android.bp
@@ -0,0 +1,34 @@
+// 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.
+
+android_test {
+    name: "CtsLocation2TestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "junit",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    // uncomment when Location.EXTRA_NO_GPS_LOCATION is removed
+    // sdk_version: "current",
+    platform_apis: true,
+}
diff --git a/tests/tests/location2/Android.mk b/tests/tests/location2/Android.mk
deleted file mode 100644
index 3d22bb7..0000000
--- a/tests/tests/location2/Android.mk
+++ /dev/null
@@ -1,39 +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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt junit
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsLocation2TestCases
-
-# uncomment when Location.EXTRA_NO_GPS_LOCATION is removed
-#LOCAL_SDK_VERSION := current
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/media/Android.bp b/tests/tests/media/Android.bp
new file mode 100644
index 0000000..a15b1ec
--- /dev/null
+++ b/tests/tests/media/Android.bp
@@ -0,0 +1,80 @@
+// Copyright (C) 2008 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.
+
+java_library {
+    name: "ctsmediautil",
+    srcs: [
+        "src/android/media/cts/CodecImage.java",
+        "src/android/media/cts/YUVImage.java",
+        "src/android/media/cts/CodecUtils.java",
+    ],
+    sdk_version: "current",
+}
+
+android_test {
+    name: "CtsMediaTestCases",
+    defaults: ["cts_defaults"],
+    // include both the 32 and 64 bit versions
+    compile_multilib: "both",
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctsdeviceutillegacy-axt",
+        "ctsmediautil",
+        "ctstestrunner-axt",
+        "hamcrest-library",
+        "ctstestserver",
+        "junit",
+        "ndkaudio",
+        "testng",
+        "truth-prebuilt",
+        "mockito-target-minus-junit4",
+        "androidx.heifwriter_heifwriter",
+        "androidx.media2_media2",
+    ],
+    jni_libs: [
+        "libaudio_jni",
+        "libc++",
+        "libctscodecutils_jni",
+        "libctsimagereader_jni",
+        "libctsmediadrm_jni",
+        "libctsmediacodec_jni",
+        "libnativehelper_compat_libc++",
+        "libndkaudioLib",
+    ],
+    // do not compress VP9 video files
+    aaptflags: [
+        "-0 .vp9",
+        "-0 .ts",
+        "-0 .heic",
+        "-0 .trp",
+    ],
+    srcs: ["src/**/*.java"],
+    // This test uses private APIs
+    //sdk_version: "current",
+    platform_apis: true,
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+        "android.test.runner.stubs",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+        "mts",
+    ],
+    host_required: ["cts-dynamic-config"],
+}
diff --git a/tests/tests/media/Android.mk b/tests/tests/media/Android.mk
deleted file mode 100644
index ead5a7d..0000000
--- a/tests/tests/media/Android.mk
+++ /dev/null
@@ -1,98 +0,0 @@
-# Copyright (C) 2008 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)
-
-LOCAL_SRC_FILES := \
-  src/android/media/cts/CodecImage.java \
-  src/android/media/cts/YUVImage.java \
-  src/android/media/cts/CodecUtils.java
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE := ctsmediautil
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
-
-include $(CLEAR_VARS)
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-# include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    ctsdeviceutillegacy-axt \
-    ctsmediautil \
-    ctstestrunner-axt \
-    hamcrest-library \
-    ctstestserver \
-    junit \
-    ndkaudio \
-    testng \
-    truth-prebuilt \
-    mockito-target-minus-junit4 \
-    androidx.heifwriter_heifwriter \
-    androidx.media2_media2 \
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-    libaudio_jni \
-    libc++ \
-    libctscodecutils_jni \
-    libctsimagereader_jni \
-    libctsmediadrm_jni \
-    libctsmediacodec_jni \
-    libnativehelper_compat_libc++ \
-    libndkaudioLib
-
-# do not compress VP9 video files
-LOCAL_AAPT_FLAGS := -0 .vp9
-LOCAL_AAPT_FLAGS += -0 .ts
-LOCAL_AAPT_FLAGS += -0 .heic
-LOCAL_AAPT_FLAGS += -0 .trp
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsMediaTestCases
-
-# This test uses private APIs
-#LOCAL_SDK_VERSION := current
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_JAVA_LIBRARIES += \
-    org.apache.http.legacy \
-    android.test.base.stubs \
-    android.test.runner.stubs
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant mts
-
-LOCAL_HOST_REQUIRED_MODULES := cts-dynamic-config
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/media/libaudiojni/Android.bp b/tests/tests/media/libaudiojni/Android.bp
new file mode 100644
index 0000000..6e1805c
--- /dev/null
+++ b/tests/tests/media/libaudiojni/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2015 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.
+//
+
+cc_test_library {
+    name: "libaudio_jni",
+    srcs: [
+        "appendix-b-1-1-buffer-queue.cpp",
+        "appendix-b-1-2-recording.cpp",
+        "audio-record-native.cpp",
+        "audio-track-native.cpp",
+        "sl-utils.cpp",
+    ],
+    include_dirs: ["system/core/include"],
+    shared_libs: [
+        "libandroid",
+        "liblog",
+        "libnativehelper_compat_libc++",
+        "libOpenSLES",
+    ],
+    stl: "libc++_static",
+    cflags: [
+        "-Werror",
+        "-Wall",
+    ],
+    gtest: false,
+}
diff --git a/tests/tests/media/libaudiojni/Android.mk b/tests/tests/media/libaudiojni/Android.mk
deleted file mode 100644
index af9d989..0000000
--- a/tests/tests/media/libaudiojni/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_MODULE    := libaudio_jni
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
-	appendix-b-1-1-buffer-queue.cpp \
-	appendix-b-1-2-recording.cpp \
-	audio-record-native.cpp \
-	audio-track-native.cpp \
-	sl-utils.cpp
-
-LOCAL_C_INCLUDES := \
-	$(JNI_H_INCLUDE) \
-	system/core/include
-
-LOCAL_C_INCLUDES += $(call include-path-for, libaudiojni) \
-	$(call include-path-for, wilhelm)
-
-LOCAL_SHARED_LIBRARIES := libandroid liblog libnativehelper_compat_libc++ libOpenSLES
-LOCAL_CXX_STL := libc++
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/media/libimagereaderjni/Android.bp b/tests/tests/media/libimagereaderjni/Android.bp
new file mode 100644
index 0000000..9dd0988
--- /dev/null
+++ b/tests/tests/media/libimagereaderjni/Android.bp
@@ -0,0 +1,32 @@
+// Copyright 2017 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.
+
+// Build the unit tests.
+
+cc_test_library {
+    name: "libctsimagereader_jni",
+    srcs: ["AImageReaderCts.cpp"],
+    shared_libs: [
+        "libandroid",
+        "libcamera2ndk",
+        "libmediandk",
+        "libnativewindow",
+        "liblog",
+    ],
+    cflags: [
+        "-Werror",
+        "-Wall",
+    ],
+    gtest: false,
+}
diff --git a/tests/tests/media/libimagereaderjni/Android.mk b/tests/tests/media/libimagereaderjni/Android.mk
deleted file mode 100644
index 6ce591c..0000000
--- a/tests/tests/media/libimagereaderjni/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2017 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.
-
-# Build the unit tests.
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libctsimagereader_jni
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
-    AImageReaderCts.cpp
-
-LOCAL_SHARED_LIBRARIES := \
-    libandroid \
-    libcamera2ndk \
-    libmediandk \
-    libnativewindow \
-    liblog
-
-LOCAL_CXX_STL := libc++
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/media/libmediandkjni/Android.bp b/tests/tests/media/libmediandkjni/Android.bp
new file mode 100644
index 0000000..109a488
--- /dev/null
+++ b/tests/tests/media/libmediandkjni/Android.bp
@@ -0,0 +1,94 @@
+// 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.
+//
+
+//------------------------------------------------------------------------------
+// Builds libctscodecutils_jni.so
+//
+cc_test_library {
+    name: "libctscodecutils_jni",
+    srcs: [
+        "codec-utils-jni.cpp",
+        "md5_utils.cpp",
+    ],
+    include_dirs: ["system/core/include"],
+    shared_libs: [
+        "libnativehelper_compat_libc++",
+        "liblog",
+    ],
+    sdk_version: "current",
+    cflags: [
+        "-Werror",
+        "-Wall",
+        "-DEGL_EGLEXT_PROTOTYPES",
+    ],
+    gtest: false,
+}
+
+//------------------------------------------------------------------------------
+// Builds libctsmediacodec_jni.so
+//
+cc_test_library {
+    name: "libctsmediacodec_jni",
+    srcs: [
+        "native-media-jni.cpp",
+        "native_media_utils.cpp",
+        "native_media_decoder_source.cpp",
+        "native_media_encoder_jni.cpp",
+    ],
+    include_dirs: ["system/core/include"],
+    shared_libs: [
+        "libandroid",
+        "libnativehelper_compat_libc++",
+        "liblog",
+        "libmediandk",
+        "libEGL",
+    ],
+    stl: "libc++_static",
+    cflags: [
+        "-Werror",
+        "-Wall",
+        "-DEGL_EGLEXT_PROTOTYPES",
+    ],
+    gtest: false,
+}
+
+//------------------------------------------------------------------------------
+// Builds libctsmediadrm_jni.so
+//
+cc_test_library {
+    name: "libctsmediadrm_jni",
+    srcs: [
+        "CtsMediaDrmJniOnLoad.cpp",
+        "codec-utils-jni.cpp",
+        "md5_utils.cpp",
+        "native-mediadrm-jni.cpp",
+    ],
+    include_dirs: ["system/core/include"],
+    shared_libs: [
+        "libandroid",
+        "libnativehelper_compat_libc++",
+        "liblog",
+        "libmediandk",
+        "libdl",
+        "libEGL",
+    ],
+    cflags: [
+        "-Werror",
+        "-Wall",
+        "-DEGL_EGLEXT_PROTOTYPES",
+    ],
+    stl: "libc++_static",
+    gtest: false,
+}
diff --git a/tests/tests/media/libmediandkjni/Android.mk b/tests/tests/media/libmediandkjni/Android.mk
deleted file mode 100644
index 993f177..0000000
--- a/tests/tests/media/libmediandkjni/Android.mk
+++ /dev/null
@@ -1,111 +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)
-
-#------------------------------------------------------------------------------
-# Builds libctscodecutils_jni.so
-#
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libctscodecutils_jni
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
-  codec-utils-jni.cpp \
-  md5_utils.cpp
-
-LOCAL_C_INCLUDES := \
-  $(JNI_H_INCLUDE) \
-  system/core/include
-
-LOCAL_C_INCLUDES += $(call include-path-for, mediandk)
-
-LOCAL_SHARED_LIBRARIES := \
-  libnativehelper_compat_libc++ \
-  liblog
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_NDK_STL_VARIANT := system
-
-LOCAL_CFLAGS := -Werror -Wall -DEGL_EGLEXT_PROTOTYPES
-
-include $(BUILD_SHARED_LIBRARY)
-
-#------------------------------------------------------------------------------
-# Builds libctsmediacodec_jni.so
-#
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libctsmediacodec_jni
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
-  native-media-jni.cpp \
-  native_media_utils.cpp \
-  native_media_decoder_source.cpp \
-  native_media_encoder_jni.cpp
-
-LOCAL_C_INCLUDES := \
-  $(JNI_H_INCLUDE) \
-  system/core/include
-
-LOCAL_C_INCLUDES += $(call include-path-for, mediandk)
-
-LOCAL_SHARED_LIBRARIES := \
-  libandroid libnativehelper_compat_libc++ \
-  liblog libmediandk libEGL
-
-LOCAL_CXX_STL := libc++
-
-LOCAL_CFLAGS := -Werror -Wall -DEGL_EGLEXT_PROTOTYPES
-
-include $(BUILD_SHARED_LIBRARY)
-
-
-#------------------------------------------------------------------------------
-# Builds libctsmediadrm_jni.so
-#
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libctsmediadrm_jni
-
-# Don't include this package in any configuration by default.
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
-  CtsMediaDrmJniOnLoad.cpp \
-  codec-utils-jni.cpp  \
-  md5_utils.cpp \
-  native-mediadrm-jni.cpp \
-
-LOCAL_C_INCLUDES := \
-  $(JNI_H_INCLUDE) \
-  system/core/include
-
-
-LOCAL_C_INCLUDES += $(call include-path-for, mediandk)
-
-LOCAL_SHARED_LIBRARIES := \
-  libandroid libnativehelper_compat_libc++ \
-  liblog libmediandk libdl libEGL
-
-LOCAL_CFLAGS := -Werror -Wall -DEGL_EGLEXT_PROTOTYPES
-
-LOCAL_CXX_STL := libc++
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/media/libndkaudio/Android.bp b/tests/tests/media/libndkaudio/Android.bp
new file mode 100644
index 0000000..2746f0d
--- /dev/null
+++ b/tests/tests/media/libndkaudio/Android.bp
@@ -0,0 +1,54 @@
+// Copyright (C) 2016 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.
+//
+
+cc_test_library {
+    name: "libndkaudioLib",
+    include_dirs: [
+        "frameworks/wilhelm/include",
+        "frameworks/wilhelm/src/android",
+    ],
+    srcs: [
+        "OpenSLESUtils.cpp",
+        "AudioPlayer.cpp",
+        "AudioSource.cpp",
+        "PeriodicAudioSource.cpp",
+        "SystemParams.cpp",
+        "WaveTableGenerator.cpp",
+        "WaveTableOscillator.cpp",
+        "com_android_ndkaudio_AudioPlayer.cpp",
+        "AudioRecorder.cpp",
+        "com_android_ndkaudio_AudioRecorder.cpp",
+    ],
+    stl: "libc++_static",
+    shared_libs: [
+        "liblog",
+        "libOpenSLES",
+    ],
+    cflags: [
+        "-Werror",
+        "-Wall",
+    ],
+    gtest: false,
+}
+
+//
+// ndkaudio - java
+//
+java_library {
+    name: "ndkaudio",
+    srcs: ["**/*.java"],
+    sdk_version: "current",
+    min_sdk_version: "23",
+}
diff --git a/tests/tests/media/libndkaudio/Android.mk b/tests/tests/media/libndkaudio/Android.mk
deleted file mode 100644
index 9480dcd..0000000
--- a/tests/tests/media/libndkaudio/Android.mk
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE    := libndkaudioLib
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_C_INCLUDES := \
-  frameworks/wilhelm/include \
-  frameworks/wilhelm/src/android \
-  $(call include-path-for, wilhelm)
-
-LOCAL_SRC_FILES := \
-  OpenSLESUtils.cpp \
-  AudioPlayer.cpp \
-  AudioSource.cpp \
-  PeriodicAudioSource.cpp \
-  SystemParams.cpp \
-  WaveTableGenerator.cpp \
-  WaveTableOscillator.cpp \
-  com_android_ndkaudio_AudioPlayer.cpp \
-  AudioRecorder.cpp \
-  com_android_ndkaudio_AudioRecorder.cpp
-
-LOCAL_CXX_STL := libc++
-
-LOCAL_SHARED_LIBRARIES := liblog libOpenSLES
-
-LOCAL_CFLAGS := -Werror -Wall
-
-include $(BUILD_SHARED_LIBRARY)
-
-#
-# ndkaudio - java
-#
-include $(CLEAR_VARS)
-
-LOCAL_MODULE  := ndkaudio
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_CERTIFICATE := platform
-
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 23
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/tests/tests/media/src/android/media/cts/AudioRecordingConfigurationTest.java b/tests/tests/media/src/android/media/cts/AudioRecordingConfigurationTest.java
index c285be7..f5eeaf1 100644
--- a/tests/tests/media/src/android/media/cts/AudioRecordingConfigurationTest.java
+++ b/tests/tests/media/src/android/media/cts/AudioRecordingConfigurationTest.java
@@ -207,6 +207,8 @@
             mAudioRecord.startRecording();
             callback.await(TEST_TIMING_TOLERANCE_MS);
             assertFalse("Unregistered callback was called", callback.mCalled);
+            mAudioRecord.stop();
+            Thread.sleep(SLEEP_AFTER_STOP_FOR_INACTIVITY_MS);
 
             // just call the callback once directly so it's marked as tested
             final AudioManager.AudioRecordingCallback arc =
diff --git a/tests/tests/mediastress/Android.bp b/tests/tests/mediastress/Android.bp
new file mode 100644
index 0000000..e0878b6
--- /dev/null
+++ b/tests/tests/mediastress/Android.bp
@@ -0,0 +1,42 @@
+// 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.
+
+android_test {
+    name: "CtsMediaStressTestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "mts",
+    ],
+    // Include both the 32 and 64 bit versions
+    compile_multilib: "both",
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    jni_libs: [
+        "libctsmediastress_jni",
+        "libnativehelper_compat_libc++",
+    ],
+    srcs: ["src/**/*.java"],
+    host_required: ["cts-dynamic-config"],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/mediastress/Android.mk b/tests/tests/mediastress/Android.mk
deleted file mode 100644
index a972fce..0000000
--- a/tests/tests/mediastress/Android.mk
+++ /dev/null
@@ -1,48 +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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests mts
-
-# Include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_HOST_SHARED_LIBRARIES := compatibility-device-media-preconditions
-
-LOCAL_JNI_SHARED_LIBRARIES := libctsmediastress_jni libnativehelper_compat_libc++
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsMediaStressTestCases
-
-LOCAL_HOST_REQUIRED_MODULES := cts-dynamic-config
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
-
diff --git a/tests/tests/mediastress/jni/Android.bp b/tests/tests/mediastress/jni/Android.bp
new file mode 100644
index 0000000..192746e
--- /dev/null
+++ b/tests/tests/mediastress/jni/Android.bp
@@ -0,0 +1,34 @@
+// 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.
+//
+
+cc_library_shared {
+    name: "libctsmediastress_jni",
+    srcs: ["native-media-jni.cpp"],
+    include_dirs: ["frameworks/wilhelm/include"],
+    shared_libs: [
+        "libandroid",
+        "libnativehelper_compat_libc++",
+        "liblog",
+        "libOpenMAXAL",
+    ],
+    stl: "none",
+    sdk_version: "current",
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+        "-Wno-unused-variable",
+    ],
+}
diff --git a/tests/tests/mediastress/jni/Android.mk b/tests/tests/mediastress/jni/Android.mk
deleted file mode 100644
index 66ca05e..0000000
--- a/tests/tests/mediastress/jni/Android.mk
+++ /dev/null
@@ -1,35 +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)
-
-LOCAL_MODULE    := libctsmediastress_jni
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := native-media-jni.cpp
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-LOCAL_C_INCLUDES += $(call include-path-for, wilhelm)
-
-LOCAL_SHARED_LIBRARIES := libandroid libnativehelper_compat_libc++ liblog libOpenMAXAL
-LOCAL_NDK_STL_VARIANT := none
-LOCAL_SDK_VERSION := current
-
-LOCAL_CFLAGS := -Wall -Werror -Wno-unused-parameter -Wno-unused-variable
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/mimemap/Android.bp b/tests/tests/mimemap/Android.bp
new file mode 100644
index 0000000..8161eb6
--- /dev/null
+++ b/tests/tests/mimemap/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2019 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.
+
+// Verifies the default MIME mapping as exposed by @CorePlatformApi libcore.net.MimeMap.getDefault()
+android_test {
+    name: "CtsMimeMapTestCases",
+    defaults: ["cts_defaults"],
+    libs: ["android.test.base.stubs"],
+    platform_apis: true,
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "ctstestrunner-axt",
+    ],
+    test_suites: [
+        "cts",
+        "mts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/mimemap/AndroidManifest.xml b/tests/tests/mimemap/AndroidManifest.xml
new file mode 100644
index 0000000..ffb8a69
--- /dev/null
+++ b/tests/tests/mimemap/AndroidManifest.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Copyright (C) 2019 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.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="android.content.type.cts">
+    <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
+                     android:targetPackage="android.content.type.cts"
+                     android:label="CTS MimeMap test cases">
+        <meta-data android:name="listener"
+                   android:value="com.android.cts.runner.CtsTestRunListener" />
+    </instrumentation>
+</manifest>
diff --git a/tests/tests/mimemap/AndroidTest.xml b/tests/tests/mimemap/AndroidTest.xml
new file mode 100644
index 0000000..431ec11
--- /dev/null
+++ b/tests/tests/mimemap/AndroidTest.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Copyright (C) 2019 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.
+-->
+<configuration description="Config for CTS MimeMap Test cases">
+    <option name="test-suite-tag" value="cts" />
+    <option name="config-descriptor:metadata" key="component" value="framework" />
+    <option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
+    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
+        <option name="cleanup-apks" value="true" />
+        <!-- this has just the instrumentation which acts as the tests we want to run -->
+        <option name="test-file-name" value="CtsMimeMapTestCases.apk" />
+    </target_preparer>
+    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
+        <option name="package" value="android.content.type.cts" />
+        <option name="runtime-hint" value="1m" />
+        <option name="hidden-api-checks" value="false"/>
+    </test>
+</configuration>
diff --git a/tests/tests/mimemap/OWNERS b/tests/tests/mimemap/OWNERS
new file mode 100644
index 0000000..7f38126
--- /dev/null
+++ b/tests/tests/mimemap/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 24949
+include platform/libcore:/OWNERS
+jsharkey@android.com
+
diff --git a/tests/tests/mimemap/src/android/content/type/cts/MimeMapTest.java b/tests/tests/mimemap/src/android/content/type/cts/MimeMapTest.java
new file mode 100644
index 0000000..ef19040
--- /dev/null
+++ b/tests/tests/mimemap/src/android/content/type/cts/MimeMapTest.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+package android.content.type.cts;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Locale;
+import java.util.Objects;
+import libcore.net.MimeMap;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+/**
+ * Tests {@link MimeMap#getDefault()}.
+ */
+public class MimeMapTest {
+
+    private MimeMap defaultMimeMap;
+
+    @Before public void setUp() {
+        defaultMimeMap = MimeMap.getDefault();
+    }
+
+    @Test
+    public void defaultMap_15715370() {
+        assertEquals("audio/flac", defaultMimeMap.guessMimeTypeFromExtension("flac"));
+        assertEquals("flac", defaultMimeMap.guessExtensionFromMimeType("audio/flac"));
+        assertEquals("flac", defaultMimeMap.guessExtensionFromMimeType("application/x-flac"));
+    }
+
+    // https://code.google.com/p/android/issues/detail?id=78909
+    @Test public void defaultMap_78909() {
+        assertEquals("mka", defaultMimeMap.guessExtensionFromMimeType("audio/x-matroska"));
+        assertEquals("mkv", defaultMimeMap.guessExtensionFromMimeType("video/x-matroska"));
+    }
+
+    @Test public void defaultMap_16978217() {
+        assertEquals("image/x-ms-bmp", defaultMimeMap.guessMimeTypeFromExtension("bmp"));
+        assertEquals("image/x-icon", defaultMimeMap.guessMimeTypeFromExtension("ico"));
+        assertEquals("video/mp2ts", defaultMimeMap.guessMimeTypeFromExtension("ts"));
+    }
+
+    @Test public void testCommon() {
+        assertEquals("audio/mpeg", defaultMimeMap.guessMimeTypeFromExtension("mp3"));
+        assertEquals("image/png", defaultMimeMap.guessMimeTypeFromExtension("png"));
+        assertEquals("application/zip", defaultMimeMap.guessMimeTypeFromExtension("zip"));
+
+        assertEquals("mp3", defaultMimeMap.guessExtensionFromMimeType("audio/mpeg"));
+        assertEquals("png", defaultMimeMap.guessExtensionFromMimeType("image/png"));
+        assertEquals("zip", defaultMimeMap.guessExtensionFromMimeType("application/zip"));
+    }
+
+    @Test public void defaultMap_18390752() {
+        assertEquals("jpg", defaultMimeMap.guessExtensionFromMimeType("image/jpeg"));
+    }
+
+    @Test public void defaultMap_30207891() {
+        assertTrue(defaultMimeMap.hasMimeType("IMAGE/PNG"));
+        assertTrue(defaultMimeMap.hasMimeType("IMAGE/png"));
+        assertFalse(defaultMimeMap.hasMimeType(""));
+        assertEquals("png", defaultMimeMap.guessExtensionFromMimeType("IMAGE/PNG"));
+        assertEquals("png", defaultMimeMap.guessExtensionFromMimeType("IMAGE/png"));
+        assertNull(defaultMimeMap.guessMimeTypeFromExtension(""));
+        assertNull(defaultMimeMap.guessMimeTypeFromExtension("doesnotexist"));
+        assertTrue(defaultMimeMap.hasExtension("PNG"));
+        assertTrue(defaultMimeMap.hasExtension("PnG"));
+        assertFalse(defaultMimeMap.hasExtension(""));
+        assertFalse(defaultMimeMap.hasExtension(".png"));
+        assertEquals("image/png", defaultMimeMap.guessMimeTypeFromExtension("PNG"));
+        assertEquals("image/png", defaultMimeMap.guessMimeTypeFromExtension("PnG"));
+        assertNull(defaultMimeMap.guessMimeTypeFromExtension(".png"));
+        assertNull(defaultMimeMap.guessMimeTypeFromExtension(""));
+        assertNull(defaultMimeMap.guessExtensionFromMimeType("doesnotexist"));
+    }
+
+    @Test public void defaultMap_30793548() {
+        assertEquals("video/3gpp", defaultMimeMap.guessMimeTypeFromExtension("3gpp"));
+        assertEquals("video/3gpp", defaultMimeMap.guessMimeTypeFromExtension("3gp"));
+        assertEquals("video/3gpp2", defaultMimeMap.guessMimeTypeFromExtension("3gpp2"));
+        assertEquals("video/3gpp2", defaultMimeMap.guessMimeTypeFromExtension("3g2"));
+    }
+
+    @Test public void defaultMap_37167977() {
+        // https://tools.ietf.org/html/rfc5334#section-10.1
+        assertEquals("audio/ogg", defaultMimeMap.guessMimeTypeFromExtension("ogg"));
+        assertEquals("audio/ogg", defaultMimeMap.guessMimeTypeFromExtension("oga"));
+        assertEquals("audio/ogg", defaultMimeMap.guessMimeTypeFromExtension("spx"));
+        assertEquals("video/ogg", defaultMimeMap.guessMimeTypeFromExtension("ogv"));
+    }
+
+    @Test public void defaultMap_70851634_mimeTypeFromExtension() {
+        assertEquals("video/vnd.youtube.yt", defaultMimeMap.guessMimeTypeFromExtension("yt"));
+    }
+
+    @Test public void defaultMap_70851634_extensionFromMimeType() {
+        assertEquals("yt", defaultMimeMap.guessExtensionFromMimeType("video/vnd.youtube.yt"));
+        assertEquals("yt", defaultMimeMap.guessExtensionFromMimeType("application/vnd.youtube.yt"));
+    }
+
+    @Test public void defaultMap_112162449_audio() {
+        // According to https://en.wikipedia.org/wiki/M3U#Internet_media_types
+        // this is a giant mess, so we pick "audio/x-mpegurl" because a similar
+        // playlist format uses "audio/x-scpls".
+        assertMimeTypeFromExtension("audio/x-mpegurl", "m3u");
+        assertMimeTypeFromExtension("audio/x-mpegurl", "m3u8");
+        assertExtensionFromMimeType("m3u", "audio/x-mpegurl");
+
+        assertExtensionFromMimeType("m4a", "audio/mp4");
+        assertMimeTypeFromExtension("audio/mpeg", "m4a");
+
+        assertBidirectional("audio/aac", "aac");
+    }
+
+    @Test public void defaultMap_112162449_video() {
+        assertBidirectional("video/x-flv", "flv");
+        assertBidirectional("video/quicktime", "mov");
+        assertBidirectional("video/mpeg", "mpeg");
+    }
+
+    @Test public void defaultMap_112162449_image() {
+        assertBidirectional("image/heif", "heif");
+        assertBidirectional("image/heif-sequence", "heifs");
+        assertBidirectional("image/heic", "heic");
+        assertBidirectional("image/heic-sequence", "heics");
+        assertMimeTypeFromExtension("image/heif", "hif");
+
+        assertBidirectional("image/x-adobe-dng", "dng");
+        assertBidirectional("image/x-photoshop", "psd");
+
+        assertBidirectional("image/jp2", "jp2");
+        assertMimeTypeFromExtension("image/jp2", "jpg2");
+    }
+
+    @Test public void defaultMap_120135571_audio() {
+        assertMimeTypeFromExtension("audio/mpeg", "m4r");
+    }
+
+    @Test public void defaultMap_136096979_ota() {
+        assertMimeTypeFromExtension("application/vnd.android.ota", "ota");
+    }
+
+    @Test public void defaultMap_wifiConfig_xml() {
+        assertExtensionFromMimeType("xml", "application/x-wifi-config");
+        assertMimeTypeFromExtension("text/xml", "xml");
+    }
+
+    // http://b/122734564
+    @Test public void defaultMap_NonLowercaseMimeType() {
+        // A mixed-case mimeType that appears in mime.types; we expect guessMimeTypeFromExtension()
+        // to return it in lowercase because MimeMap considers lowercase to be the canonical form.
+        String mimeType = "application/vnd.ms-word.document.macroEnabled.12".toLowerCase(Locale.US);
+        assertBidirectional(mimeType, "docm");
+    }
+
+    // Check that the keys given for lookups in either direction are not case sensitive
+    @Test public void defaultMap_CaseInsensitiveKeys() {
+        String mimeType = defaultMimeMap.guessMimeTypeFromExtension("apk");
+        assertNotNull(mimeType);
+
+        assertEquals(mimeType, defaultMimeMap.guessMimeTypeFromExtension("APK"));
+        assertEquals(mimeType, defaultMimeMap.guessMimeTypeFromExtension("aPk"));
+
+        assertEquals("apk", defaultMimeMap.guessExtensionFromMimeType(mimeType));
+        assertEquals("apk", defaultMimeMap.guessExtensionFromMimeType(
+                mimeType.toUpperCase(Locale.US)));
+        assertEquals("apk", defaultMimeMap.guessExtensionFromMimeType(
+                mimeType.toLowerCase(Locale.US)));
+    }
+
+    @Test public void defaultMap_invalid_empty() {
+        checkInvalidExtension("");
+        checkInvalidMimeType("");
+    }
+
+    @Test public void defaultMap_invalid_null() {
+        checkInvalidExtension(null);
+        checkInvalidMimeType(null);
+    }
+
+    @Test public void defaultMap_invalid() {
+        checkInvalidMimeType("invalid mime type");
+        checkInvalidExtension("invalid extension");
+    }
+
+    private void checkInvalidExtension(String s) {
+        assertFalse(defaultMimeMap.hasExtension(s));
+        assertNull(defaultMimeMap.guessMimeTypeFromExtension(s));
+    }
+
+    private void checkInvalidMimeType(String s) {
+        assertFalse(defaultMimeMap.hasMimeType(s));
+        assertNull(defaultMimeMap.guessExtensionFromMimeType(s));
+    }
+
+    private void assertMimeTypeFromExtension(String mimeType, String extension) {
+        final String actual = defaultMimeMap.guessMimeTypeFromExtension(extension);
+        if (!Objects.equals(mimeType, actual)) {
+            fail("Expected " + mimeType + " but was " + actual + " for extension " + extension);
+        }
+    }
+
+    private void assertExtensionFromMimeType(String extension, String mimeType) {
+        final String actual = defaultMimeMap.guessExtensionFromMimeType(mimeType);
+        if (!Objects.equals(extension, actual)) {
+            fail("Expected " + extension + " but was " + actual + " for type " + mimeType);
+        }
+    }
+
+    private void assertBidirectional(String mimeType, String extension) {
+        assertMimeTypeFromExtension(mimeType, extension);
+        assertExtensionFromMimeType(extension, mimeType);
+    }
+
+}
diff --git a/tests/tests/multiuser/Android.bp b/tests/tests/multiuser/Android.bp
new file mode 100644
index 0000000..51d6315
--- /dev/null
+++ b/tests/tests/multiuser/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2016 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.
+
+android_test {
+    name: "CtsMultiUserTestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: ["android.test.base.stubs"],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/multiuser/Android.mk b/tests/tests/multiuser/Android.mk
deleted file mode 100644
index dfbdf1d..0000000
--- a/tests/tests/multiuser/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsMultiUserTestCases
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/ndef/Android.bp b/tests/tests/ndef/Android.bp
new file mode 100644
index 0000000..b69d7a6
--- /dev/null
+++ b/tests/tests/ndef/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2011 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.
+
+android_test {
+    name: "CtsNdefTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: ["ctstestrunner-axt"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/ndef/Android.mk b/tests/tests/ndef/Android.mk
deleted file mode 100644
index df28c7b..0000000
--- a/tests/tests/ndef/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2011 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)
-
-LOCAL_PACKAGE_NAME := CtsNdefTestCases
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SDK_VERSION := current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/net/AndroidTest.xml b/tests/tests/net/AndroidTest.xml
index 1807a6b..3ff019e 100644
--- a/tests/tests/net/AndroidTest.xml
+++ b/tests/tests/net/AndroidTest.xml
@@ -18,6 +18,7 @@
     <option name="config-descriptor:metadata" key="token" value="SIM_CARD" />
     <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
+    <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
     <option name="not-shardable" value="true" />
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
diff --git a/tests/tests/net/src/android/net/cts/SSLCertificateSocketFactoryTest.java b/tests/tests/net/src/android/net/cts/SSLCertificateSocketFactoryTest.java
index 01ac3fd..cbe54f8 100644
--- a/tests/tests/net/src/android/net/cts/SSLCertificateSocketFactoryTest.java
+++ b/tests/tests/net/src/android/net/cts/SSLCertificateSocketFactoryTest.java
@@ -16,135 +16,333 @@
 
 package android.net.cts;
 
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.Socket;
-
-import javax.net.SocketFactory;
-import javax.net.ssl.SSLPeerUnverifiedException;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import android.net.SSLCertificateSocketFactory;
 import android.platform.test.annotations.AppModeFull;
-import android.test.AndroidTestCase;
-
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.SocketAddress;
+import java.net.UnknownHostException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLPeerUnverifiedException;
+import javax.net.ssl.SSLSession;
 import libcore.javax.net.ssl.SSLConfigurationAsserts;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
-public class SSLCertificateSocketFactoryTest extends AndroidTestCase {
-    private SSLCertificateSocketFactory mFactory;
-    private int mTimeout;
+@RunWith(JUnit4.class)
+public class SSLCertificateSocketFactoryTest {
+    // TEST_HOST should point to a web server with a valid TLS certificate.
+    private static final String TEST_HOST = "www.google.com";
+    private static final int HTTPS_PORT = 443;
+    private HostnameVerifier mDefaultVerifier;
+    private SSLCertificateSocketFactory mSocketFactory;
+    private InetAddress mLocalAddress;
+    // InetAddress obtained by resolving TEST_HOST.
+    private InetAddress mTestHostAddress;
+    // SocketAddress combining mTestHostAddress and HTTPS_PORT.
+    private List<SocketAddress> mTestSocketAddresses;
 
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        mTimeout = 1000;
-        mFactory = (SSLCertificateSocketFactory) SSLCertificateSocketFactory.getDefault(mTimeout);
+    @Before
+    public void setUp() {
+        // Expected state before each test method is that
+        // HttpsURLConnection.getDefaultHostnameVerifier() will return the system default.
+        mDefaultVerifier = HttpsURLConnection.getDefaultHostnameVerifier();
+        mSocketFactory = (SSLCertificateSocketFactory)
+            SSLCertificateSocketFactory.getDefault(1000 /* handshakeTimeoutMillis */);
+        assertNotNull(mSocketFactory);
+        InetAddress[] addresses;
+        try {
+            addresses = InetAddress.getAllByName(TEST_HOST);
+            mTestHostAddress = addresses[0];
+        } catch (UnknownHostException uhe) {
+            throw new AssertionError(
+                "Unable to test SSLCertificateSocketFactory: cannot resolve " + TEST_HOST, uhe);
+        }
+
+        mTestSocketAddresses = Arrays.stream(addresses)
+            .map(addr -> new InetSocketAddress(addr, HTTPS_PORT))
+            .collect(Collectors.toList());
+
+        // Find the local IP address which will be used to connect to TEST_HOST.
+        try {
+            Socket testSocket = new Socket(TEST_HOST, HTTPS_PORT);
+            mLocalAddress = testSocket.getLocalAddress();
+            testSocket.close();
+        } catch (IOException ioe) {
+            throw new AssertionError(""
+                + "Unable to test SSLCertificateSocketFactory: cannot connect to "
+                + TEST_HOST, ioe);
+        }
     }
 
+    // Restore the system default hostname verifier after each test.
+    @After
+    public void restoreDefaultHostnameVerifier() {
+        HttpsURLConnection.setDefaultHostnameVerifier(mDefaultVerifier);
+    }
+
+    @Test
     public void testDefaultConfiguration() throws Exception {
-        SSLConfigurationAsserts.assertSSLSocketFactoryDefaultConfiguration(mFactory);
+        SSLConfigurationAsserts.assertSSLSocketFactoryDefaultConfiguration(mSocketFactory);
     }
 
-    public void testAccessProperties() throws Exception {
-        mFactory.getSupportedCipherSuites();
-        mFactory.getDefaultCipherSuites();
-        SocketFactory sf = SSLCertificateSocketFactory.getDefault(mTimeout);
-        assertNotNull(sf);
+    @Test
+    public void testAccessProperties() {
+        mSocketFactory.getSupportedCipherSuites();
+        mSocketFactory.getDefaultCipherSuites();
     }
 
-    public void testCreateSocket() throws Exception {
-        new SSLCertificateSocketFactory(100);
-        int port = 443;
-        String host = "www.google.com";
-        InetAddress inetAddress = null;
-        inetAddress = InetAddress.getLocalHost();
+    /**
+     * Tests the {@code createSocket()} cases which are expected to fail with {@code IOException}.
+     */
+    @Test
+    @AppModeFull(reason = "Socket cannot bind in instant app mode")
+    public void createSocket_io_error_expected() {
+        // Connect to the localhost HTTPS port. Should result in connection refused IOException
+        // because no service should be listening on that port.
+        InetAddress localhostAddress = InetAddress.getLoopbackAddress();
         try {
-            mFactory.createSocket(inetAddress, port);
-            fail("should throw exception!");
+            mSocketFactory.createSocket(localhostAddress, HTTPS_PORT);
+            fail();
         } catch (IOException e) {
             // expected
         }
 
+        // Same, but also binding to a local address.
         try {
-            InetAddress inetAddress1 = InetAddress.getLocalHost();
-            InetAddress inetAddress2 = InetAddress.getLocalHost();
-            mFactory.createSocket(inetAddress1, port, inetAddress2, port);
-            fail("should throw exception!");
+            mSocketFactory.createSocket(localhostAddress, HTTPS_PORT, localhostAddress, 0);
+            fail();
         } catch (IOException e) {
             // expected
         }
 
+        // Same, wrapping an existing plain socket which is in an unconnected state.
         try {
             Socket socket = new Socket();
-            mFactory.createSocket(socket, host, port, true);
-            fail("should throw exception!");
+            mSocketFactory.createSocket(socket, "localhost", HTTPS_PORT, true);
+            fail();
         } catch (IOException e) {
             // expected
         }
-        Socket socket = null;
-        socket = mFactory.createSocket(host, port);
+    }
+
+    /**
+     * Tests hostname verification for
+     * {@link SSLCertificateSocketFactory#createSocket(String, int)}.
+     *
+     * <p>This method should return a socket which is fully connected (i.e. TLS handshake complete)
+     * and whose peer TLS certificate has been verified to have the correct hostname.
+     *
+     * <p>{@link SSLCertificateSocketFactory} is documented to verify hostnames using
+     * the {@link HostnameVerifier} returned by
+     * {@link HttpsURLConnection#getDefaultHostnameVerifier}, so this test connects twice,
+     * once with the system default {@link HostnameVerifier} which is expected to succeed,
+     * and once after installing a {@link NegativeHostnameVerifier} which will cause
+     * {@link SSLCertificateSocketFactory#verifyHostname} to throw a
+     * {@link SSLPeerUnverifiedException}.
+     *
+     * <p>These tests only test the hostname verification logic in SSLCertificateSocketFactory,
+     * other TLS failure modes and the default HostnameVerifier are tested elsewhere, see
+     * {@link com.squareup.okhttp.internal.tls.HostnameVerifierTest} and
+     * https://android.googlesource.com/platform/external/boringssl/+/refs/heads/master/src/ssl/test
+     *
+     * <p>Tests the following behaviour:-
+     * <ul>
+     * <li>TEST_SERVER is available and has a valid TLS certificate
+     * <li>{@code createSocket()} verifies the remote hostname is correct using
+     *     {@link HttpsURLConnection#getDefaultHostnameVerifier}
+     * <li>{@link SSLPeerUnverifiedException} is thrown when the remote hostname is invalid
+     * </ul>
+     *
+     * <p>See also http://b/2807618.
+     */
+    @Test
+    public void createSocket_simple_with_hostname_verification() throws Exception {
+        Socket socket = mSocketFactory.createSocket(TEST_HOST, HTTPS_PORT);
+        assertConnectedSocket(socket);
+        socket.close();
+
+        HttpsURLConnection.setDefaultHostnameVerifier(new NegativeHostnameVerifier());
+        try {
+            mSocketFactory.createSocket(TEST_HOST, HTTPS_PORT);
+            fail();
+        } catch (SSLPeerUnverifiedException expected) {
+            // expected
+        }
+    }
+
+    /**
+     * Tests hostname verification for
+     * {@link SSLCertificateSocketFactory#createSocket(Socket, String, int, boolean)}.
+     *
+     * <p>This method should return a socket which is fully connected (i.e. TLS handshake complete)
+     * and whose peer TLS certificate has been verified to have the correct hostname.
+     *
+     * <p>The TLS socket returned is wrapped around the plain socket passed into
+     * {@code createSocket()}.
+     *
+     * <p>See {@link #createSocket_simple_with_hostname_verification()} for test methodology.
+     */
+    @Test
+    public void createSocket_wrapped_with_hostname_verification() throws Exception {
+        Socket underlying = new Socket(TEST_HOST, HTTPS_PORT);
+        Socket socket = mSocketFactory.createSocket(underlying, TEST_HOST, HTTPS_PORT, true);
+        assertConnectedSocket(socket);
+        socket.close();
+
+        HttpsURLConnection.setDefaultHostnameVerifier(new NegativeHostnameVerifier());
+        try {
+            underlying = new Socket(TEST_HOST, HTTPS_PORT);
+            mSocketFactory.createSocket(underlying, TEST_HOST, HTTPS_PORT, true);
+            fail();
+        } catch (SSLPeerUnverifiedException expected) {
+            // expected
+        }
+    }
+
+    /**
+     * Tests hostname verification for
+     * {@link SSLCertificateSocketFactory#createSocket(String, int, InetAddress, int)}.
+     *
+     * <p>This method should return a socket which is fully connected (i.e. TLS handshake complete)
+     * and whose peer TLS certificate has been verified to have the correct hostname.
+     *
+     * <p>The TLS socket returned is also bound to the local address determined in {@link #setUp} to
+     * be used for connections to TEST_HOST, and a wildcard port.
+     *
+     * <p>See {@link #createSocket_simple_with_hostname_verification()} for test methodology.
+     */
+    @Test
+    @AppModeFull(reason = "Socket cannot bind in instant app mode")
+    public void createSocket_bound_with_hostname_verification() throws Exception {
+        Socket socket = mSocketFactory.createSocket(TEST_HOST, HTTPS_PORT, mLocalAddress, 0);
+        assertConnectedSocket(socket);
+        socket.close();
+
+        HttpsURLConnection.setDefaultHostnameVerifier(new NegativeHostnameVerifier());
+        try {
+            mSocketFactory.createSocket(TEST_HOST, HTTPS_PORT, mLocalAddress, 0);
+            fail();
+        } catch (SSLPeerUnverifiedException expected) {
+            // expected
+        }
+    }
+
+    /**
+     * Tests hostname verification for
+     * {@link SSLCertificateSocketFactory#createSocket(InetAddress, int)}.
+     *
+     * <p>This method should return a socket which the documentation describes as "unconnected",
+     * which actually means that the socket is fully connected at the TCP layer but TLS handshaking
+     * and hostname verification have not yet taken place.
+     *
+     * <p>Behaviour is tested by installing a {@link NegativeHostnameVerifier} and by calling
+     * {@link #assertConnectedSocket} to ensure TLS handshaking but no hostname verification takes
+     * place.  Next, {@link SSLCertificateSocketFactory#verifyHostname} is called to ensure
+     * that hostname verification is using the {@link HostnameVerifier} returned by
+     * {@link HttpsURLConnection#getDefaultHostnameVerifier} as documented.
+     *
+     * <p>Tests the following behaviour:-
+     * <ul>
+     * <li>TEST_SERVER is available and has a valid TLS certificate
+     * <li>{@code createSocket()} does not verify the remote hostname
+     * <li>Calling {@link SSLCertificateSocketFactory#verifyHostname} on the returned socket
+     *     throws {@link SSLPeerUnverifiedException} if the remote hostname is invalid
+     * </ul>
+     */
+    @Test
+    public void createSocket_simple_no_hostname_verification() throws Exception{
+        HttpsURLConnection.setDefaultHostnameVerifier(new NegativeHostnameVerifier());
+        Socket socket = mSocketFactory.createSocket(mTestHostAddress, HTTPS_PORT);
+        // Need to provide the expected hostname here or the TLS handshake will
+        // be unable to supply SNI to the remote host.
+        mSocketFactory.setHostname(socket, TEST_HOST);
+        assertConnectedSocket(socket);
+        try {
+          SSLCertificateSocketFactory.verifyHostname(socket, TEST_HOST);
+          fail();
+        } catch (SSLPeerUnverifiedException expected) {
+            // expected
+        }
+        HttpsURLConnection.setDefaultHostnameVerifier(mDefaultVerifier);
+        SSLCertificateSocketFactory.verifyHostname(socket, TEST_HOST);
+        socket.close();
+    }
+
+    /**
+     * Tests hostname verification for
+     * {@link SSLCertificateSocketFactory#createSocket(InetAddress, int, InetAddress, int)}.
+     *
+     * <p>This method should return a socket which the documentation describes as "unconnected",
+     * which actually means that the socket is fully connected at the TCP layer but TLS handshaking
+     * and hostname verification have not yet taken place.
+     *
+     * <p>The TLS socket returned is also bound to the local address determined in {@link #setUp} to
+     * be used for connections to TEST_HOST, and a wildcard port.
+     *
+     * <p>See {@link #createSocket_simple_no_hostname_verification()} for test methodology.
+     */
+    @Test
+    @AppModeFull(reason = "Socket cannot bind in instant app mode")
+    public void createSocket_bound_no_hostname_verification() throws Exception{
+        HttpsURLConnection.setDefaultHostnameVerifier(new NegativeHostnameVerifier());
+        Socket socket =
+            mSocketFactory.createSocket(mTestHostAddress, HTTPS_PORT, mLocalAddress, 0);
+        // Need to provide the expected hostname here or the TLS handshake will
+        // be unable to supply SNI to the peer.
+        mSocketFactory.setHostname(socket, TEST_HOST);
+        assertConnectedSocket(socket);
+        try {
+          SSLCertificateSocketFactory.verifyHostname(socket, TEST_HOST);
+          fail();
+        } catch (SSLPeerUnverifiedException expected) {
+            // expected
+        }
+        HttpsURLConnection.setDefaultHostnameVerifier(mDefaultVerifier);
+        SSLCertificateSocketFactory.verifyHostname(socket, TEST_HOST);
+        socket.close();
+    }
+
+    /**
+     * Asserts a socket is fully connected to the expected peer.
+     *
+     * <p>For the variants of createSocket which verify the remote hostname,
+     * {@code socket} should already be fully connected.
+     *
+     * <p>For the non-verifying variants, retrieving the input stream will trigger a TLS handshake
+     * and so may throw an exception, for example if the peer's certificate is invalid.
+     *
+     * <p>Does no hostname verification.
+     */
+    private void assertConnectedSocket(Socket socket) throws Exception {
         assertNotNull(socket);
-        assertNotNull(socket.getOutputStream());
+        assertTrue(socket.isConnected());
         assertNotNull(socket.getInputStream());
-
-        // it throw exception when calling createSocket(String, int, InetAddress, int)
-        // The socket level is invalid.
-    }
-
-    // a host and port that are expected to be available but have
-    // a cert with a different CN, in this case CN=mail.google.com
-    private static String TEST_CREATE_SOCKET_HOST = "www3.l.google.com";
-    private static int TEST_CREATE_SOCKET_PORT = 443;
-
-    /**
-     * b/2807618 Make sure that hostname verifcation in cases were it
-     * is documented to be included by various
-     * SSLCertificateSocketFactory.createSocket messages.
-     *
-     * NOTE: Test will fail if external server is not available.
-     */
-    @AppModeFull(reason = "Socket cannot bind in instant app mode")
-    public void test_createSocket_simple() throws Exception {
-        try {
-            mFactory.createSocket(TEST_CREATE_SOCKET_HOST, TEST_CREATE_SOCKET_PORT);
-            fail();
-        } catch (SSLPeerUnverifiedException expected) {
-            // expected
-        }
+        assertNotNull(socket.getOutputStream());
+        assertTrue(mTestSocketAddresses.contains(socket.getRemoteSocketAddress()));
     }
 
     /**
-     * b/2807618 Make sure that hostname verifcation in cases were it
-     * is documented to be included by various
-     * SSLCertificateSocketFactory.createSocket messages.
-     *
-     * NOTE: Test will fail if external server is not available.
+     * A HostnameVerifier which always returns false to simulate a server returning a
+     * certificate which does not match the expected hostname.
      */
-    @AppModeFull(reason = "Socket cannot bind in instant app mode")
-    public void test_createSocket_wrapping() throws Exception {
-        try {
-            Socket underlying = new Socket(TEST_CREATE_SOCKET_HOST, TEST_CREATE_SOCKET_PORT);
-            mFactory.createSocket(
-                    underlying, TEST_CREATE_SOCKET_HOST, TEST_CREATE_SOCKET_PORT, true);
-            fail();
-        } catch (SSLPeerUnverifiedException expected) {
-            // expected
-        }
-    }
-
-    /**
-     * b/2807618 Make sure that hostname verifcation in cases were it
-     * is documented to be included by various
-     * SSLCertificateSocketFactory.createSocket messages.
-     *
-     * NOTE: Test will fail if external server is not available.
-     */
-    @AppModeFull(reason = "Socket cannot bind in instant app mode")
-    public void test_createSocket_bind() throws Exception {
-        try {
-            mFactory.createSocket(TEST_CREATE_SOCKET_HOST, TEST_CREATE_SOCKET_PORT, null, 0);
-            fail();
-        } catch (SSLPeerUnverifiedException expected) {
-            // expected
+    private static class NegativeHostnameVerifier implements HostnameVerifier {
+        @Override
+        public boolean verify(String hostname, SSLSession sslSession) {
+            return false;
         }
     }
 }
diff --git a/tests/tests/netpermission/OWNERS b/tests/tests/netpermission/OWNERS
new file mode 100644
index 0000000..370c20c
--- /dev/null
+++ b/tests/tests/netpermission/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 31808
+include ../net/OWNERS
diff --git a/tests/tests/netsecpolicy/Android.mk b/tests/tests/netsecpolicy/Android.mk
deleted file mode 100644
index 137672e..0000000
--- a/tests/tests/netsecpolicy/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2015 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 $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.bp b/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.bp
new file mode 100644
index 0000000..65218dd
--- /dev/null
+++ b/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2015 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.
+
+android_test {
+    name: "CtsNetSecPolicyUsesCleartextTrafficFalseTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "ctstestserver",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "common/**/*.java",
+    ],
+    instrumentation_for: "CtsNetSecPolicyUsesCleartextTrafficFalse",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.mk b/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.mk
deleted file mode 100644
index 0cb1260..0000000
--- a/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    ctstestserver
-
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src common)
-
-LOCAL_PACKAGE_NAME := CtsNetSecPolicyUsesCleartextTrafficFalseTestCases
-
-LOCAL_INSTRUMENTATION_FOR := CtsNetSecPolicyUsesCleartextTrafficFalse
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.bp b/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.bp
new file mode 100644
index 0000000..00d0af8
--- /dev/null
+++ b/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2015 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.
+
+android_test {
+    name: "CtsNetSecPolicyUsesCleartextTrafficTrueTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "ctstestserver",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "common/**/*.java",
+    ],
+    instrumentation_for: "CtsNetSecPolicyUsesCleartextTrafficTrue",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.mk b/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.mk
deleted file mode 100644
index ec4dab3..0000000
--- a/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    ctstestserver
-
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src common)
-
-LOCAL_PACKAGE_NAME := CtsNetSecPolicyUsesCleartextTrafficTrueTestCases
-
-LOCAL_INSTRUMENTATION_FOR := CtsNetSecPolicyUsesCleartextTrafficTrue
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.bp b/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.bp
new file mode 100644
index 0000000..945a2ca
--- /dev/null
+++ b/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2015 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.
+
+android_test {
+    name: "CtsNetSecPolicyUsesCleartextTrafficUnspecifiedTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "ctstestserver",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "common/**/*.java",
+    ],
+    instrumentation_for: "CtsNetSecPolicyUsesCleartextTrafficUnspecified",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "current",
+}
diff --git a/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.mk b/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.mk
deleted file mode 100644
index fba1086..0000000
--- a/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    ctstestserver
-
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src common)
-
-LOCAL_PACKAGE_NAME := CtsNetSecPolicyUsesCleartextTrafficUnspecifiedTestCases
-
-LOCAL_INSTRUMENTATION_FOR := CtsNetSecPolicyUsesCleartextTrafficUnspecified
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/networksecurityconfig/Android.bp b/tests/tests/networksecurityconfig/Android.bp
new file mode 100644
index 0000000..df15d2b
--- /dev/null
+++ b/tests/tests/networksecurityconfig/Android.bp
@@ -0,0 +1,25 @@
+// Copyright (C) 2016 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.
+//
+
+java_library {
+    name: "tests-tests-networksecurityconfig-lib",
+    srcs: ["src/**/*.java"],
+    defaults: ["cts_defaults"],
+    libs: [
+        "compatibility-device-util-axt",
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+}
diff --git a/tests/tests/networksecurityconfig/Android.mk b/tests/tests/networksecurityconfig/Android.mk
deleted file mode 100644
index 4312beb..0000000
--- a/tests/tests/networksecurityconfig/Android.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (C) 2016 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/tests/tests/networksecurityconfig/networksecurityconfig-attributes/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-attributes/Android.bp
new file mode 100644
index 0000000..021cc36
--- /dev/null
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-attributes/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2016 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.
+//
+
+android_test {
+    name: "CtsNetSecConfigAttributeTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "tests-tests-networksecurityconfig-lib",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["res/"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-attributes/Android.mk b/tests/tests/networksecurityconfig/networksecurityconfig-attributes/Android.mk
deleted file mode 100644
index 856b89a..0000000
--- a/tests/tests/networksecurityconfig/networksecurityconfig-attributes/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2016 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)
-LOCAL_PACKAGE_NAME := CtsNetSecConfigAttributeTestCases
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SRC_FILES += $(call all-java-files-under, ../src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res/
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-basic-domain/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-basic-domain/Android.bp
new file mode 100644
index 0000000..a0b4ebe
--- /dev/null
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-basic-domain/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2016 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.
+//
+
+android_test {
+    name: "CtsNetSecConfigBasicDomainConfigTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "tests-tests-networksecurityconfig-lib",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["res/"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-basic-domain/Android.mk b/tests/tests/networksecurityconfig/networksecurityconfig-basic-domain/Android.mk
deleted file mode 100644
index 8fc8c18..0000000
--- a/tests/tests/networksecurityconfig/networksecurityconfig-basic-domain/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2016 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)
-LOCAL_PACKAGE_NAME := CtsNetSecConfigBasicDomainConfigTestCases
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SRC_FILES += $(call all-java-files-under, ../src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res/
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-cleartext-pre-P/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-cleartext-pre-P/Android.bp
new file mode 100644
index 0000000..d32ea4d
--- /dev/null
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-cleartext-pre-P/Android.bp
@@ -0,0 +1,39 @@
+// Copyright (C) 2017 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.
+//
+
+android_test {
+    name: "CtsNetSecConfigPrePCleartextTrafficTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "tests-tests-networksecurityconfig-lib",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["res/"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+    min_sdk_version: "26",
+}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-cleartext-pre-P/Android.mk b/tests/tests/networksecurityconfig/networksecurityconfig-cleartext-pre-P/Android.mk
deleted file mode 100644
index 375b782..0000000
--- a/tests/tests/networksecurityconfig/networksecurityconfig-cleartext-pre-P/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2017 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)
-LOCAL_PACKAGE_NAME := CtsNetSecConfigPrePCleartextTrafficTestCases
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SRC_FILES += $(call all-java-files-under, ../src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res/
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 26
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-cleartext/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-cleartext/Android.bp
new file mode 100644
index 0000000..46978c4
--- /dev/null
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-cleartext/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2016 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.
+//
+
+android_test {
+    name: "CtsNetSecConfigCleartextTrafficTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "tests-tests-networksecurityconfig-lib",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["res/"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-cleartext/Android.mk b/tests/tests/networksecurityconfig/networksecurityconfig-cleartext/Android.mk
deleted file mode 100644
index 5e02714..0000000
--- a/tests/tests/networksecurityconfig/networksecurityconfig-cleartext/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2016 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)
-LOCAL_PACKAGE_NAME := CtsNetSecConfigCleartextTrafficTestCases
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SRC_FILES += $(call all-java-files-under, ../src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res/
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-disabled/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-disabled/Android.bp
new file mode 100644
index 0000000..e0e810f
--- /dev/null
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-disabled/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2016 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.
+//
+
+android_test {
+    name: "CtsNetSecConfigBasicDebugDisabledTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "tests-tests-networksecurityconfig-lib",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["res/"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-disabled/Android.mk b/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-disabled/Android.mk
deleted file mode 100644
index 3ff44e9..0000000
--- a/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-disabled/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2016 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)
-LOCAL_PACKAGE_NAME := CtsNetSecConfigBasicDebugDisabledTestCases
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SRC_FILES += $(call all-java-files-under, ../src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res/
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-enabled/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-enabled/Android.bp
new file mode 100644
index 0000000..68744b8
--- /dev/null
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-enabled/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2016 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.
+//
+
+android_test {
+    name: "CtsNetSecConfigBasicDebugEnabledTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "tests-tests-networksecurityconfig-lib",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["res/"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-enabled/Android.mk b/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-enabled/Android.mk
deleted file mode 100644
index dcbf3d8..0000000
--- a/tests/tests/networksecurityconfig/networksecurityconfig-debug-basic-enabled/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2016 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)
-LOCAL_PACKAGE_NAME := CtsNetSecConfigBasicDebugEnabledTestCases
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SRC_FILES += $(call all-java-files-under, ../src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res/
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.bp
new file mode 100644
index 0000000..f00e1cc
--- /dev/null
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2016 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.
+//
+
+android_test {
+    name: "CtsNetSecConfigDownloadManagerTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "tests-tests-networksecurityconfig-lib",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["res/"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.mk b/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.mk
deleted file mode 100644
index 65edbca..0000000
--- a/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2016 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)
-LOCAL_PACKAGE_NAME := CtsNetSecConfigDownloadManagerTestCases
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SRC_FILES += $(call all-java-files-under, ../src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res/
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-invalid-pin/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-invalid-pin/Android.bp
new file mode 100644
index 0000000..d920f6a
--- /dev/null
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-invalid-pin/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2016 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.
+//
+
+android_test {
+    name: "CtsNetSecConfigInvalidPinTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "tests-tests-networksecurityconfig-lib",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["res/"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-invalid-pin/Android.mk b/tests/tests/networksecurityconfig/networksecurityconfig-invalid-pin/Android.mk
deleted file mode 100644
index 4eb0c93..0000000
--- a/tests/tests/networksecurityconfig/networksecurityconfig-invalid-pin/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2016 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)
-LOCAL_PACKAGE_NAME := CtsNetSecConfigInvalidPinTestCases
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SRC_FILES += $(call all-java-files-under, ../src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res/
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-nested-domains/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-nested-domains/Android.bp
new file mode 100644
index 0000000..abfa355
--- /dev/null
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-nested-domains/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2016 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.
+//
+
+android_test {
+    name: "CtsNetSecConfigNestedDomainConfigTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "tests-tests-networksecurityconfig-lib",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["res/"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-nested-domains/Android.mk b/tests/tests/networksecurityconfig/networksecurityconfig-nested-domains/Android.mk
deleted file mode 100644
index 40350eb..0000000
--- a/tests/tests/networksecurityconfig/networksecurityconfig-nested-domains/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2016 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)
-LOCAL_PACKAGE_NAME := CtsNetSecConfigNestedDomainConfigTestCases
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SRC_FILES += $(call all-java-files-under, ../src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res/
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.bp b/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.bp
new file mode 100644
index 0000000..35b85e8
--- /dev/null
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.bp
@@ -0,0 +1,39 @@
+// Copyright (C) 2016 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.
+//
+
+android_test {
+    name: "CtsNetSecConfigResourcesSrcTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "tests-tests-networksecurityconfig-lib",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["res/"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.mk b/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.mk
deleted file mode 100644
index b8556a1..0000000
--- a/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2016 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)
-LOCAL_PACKAGE_NAME := CtsNetSecConfigResourcesSrcTestCases
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := \
-    org.apache.http.legacy \
-    android.test.runner.stubs \
-    android.test.base.stubs \
-
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SRC_FILES += $(call all-java-files-under, ../src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res/
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/neuralnetworks/Android.mk b/tests/tests/neuralnetworks/Android.mk
index 1799cec..50cb0f1 100644
--- a/tests/tests/neuralnetworks/Android.mk
+++ b/tests/tests/neuralnetworks/Android.mk
@@ -14,44 +14,6 @@
 
 nnapi_cts_dir := $(call my-dir)
 
-# Build the static library which is friendly to multi-threaded compilation.
-# The sources are located at frameworks/ml/nn/runtime/test
-LOCAL_PATH:= frameworks/ml/nn/runtime/test/
-include $(CLEAR_VARS)
-LOCAL_MODULE := CtsNNAPITests_static
-LOCAL_SRC_FILES := \
-     $(call all-cpp-files-under,generated/tests) \
-     $(call all-cpp-files-under,fuzzing/operation_signatures) \
-     fuzzing/OperationManager.cpp \
-     fuzzing/RandomGraphGenerator.cpp \
-     fuzzing/RandomGraphGeneratorUtils.cpp \
-     fuzzing/RandomVariable.cpp \
-     fuzzing/TestRandomGraph.cpp \
-     TestGenerated.cpp \
-     TestMemory.cpp \
-     TestTrivialModel.cpp \
-     TestUnknownDimensions.cpp \
-     TestValidateModel.cpp \
-     TestValidateOperations.cpp \
-     TestValidation.cpp \
-     TestWrapper.cpp \
-     TestNeuralNetworksWrapper.cpp
-
-LOCAL_C_INCLUDES := frameworks/ml/nn/runtime/include/
-LOCAL_C_INCLUDES += frameworks/ml/nn/runtime/test/
-LOCAL_C_INCLUDES += frameworks/ml/nn/runtime/
-LOCAL_C_INCLUDES += frameworks/ml/nn/common/include
-LOCAL_C_INCLUDES += frameworks/ml/nn/tools/test_generator/include
-
-LOCAL_CFLAGS := -Werror -Wall -DNNTEST_ONLY_PUBLIC_API -DNNTEST_CTS
-
-LOCAL_SHARED_LIBRARIES := libandroid liblog libneuralnetworks
-LOCAL_STATIC_LIBRARIES := libgtest_ndk_c++ libgmock_ndk
-LOCAL_SDK_VERSION := current
-LOCAL_NDK_STL_VARIANT := c++_static
-include $(BUILD_STATIC_LIBRARY)
-
-
 # Build the actual CTS module with the static lib above.
 # This is necessary for the build system to pickup the AndroidTest.xml.
 LOCAL_PATH:= $(nnapi_cts_dir)
diff --git a/tests/tests/notificationlegacy/Android.mk b/tests/tests/notificationlegacy/Android.mk
deleted file mode 100644
index 9af9f44..0000000
--- a/tests/tests/notificationlegacy/Android.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (C) 2018 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/tests/tests/notificationlegacy/notificationlegacy20/Android.bp b/tests/tests/notificationlegacy/notificationlegacy20/Android.bp
new file mode 100644
index 0000000..ca611b1
--- /dev/null
+++ b/tests/tests/notificationlegacy/notificationlegacy20/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2019 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.
+
+android_test {
+    name: "CtsLegacyNotification20TestCases",
+    defaults: ["cts_defaults"],
+    platform_apis: true,
+    static_libs: [
+        "androidx.test.rules",
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "junit",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    min_sdk_version: "20",
+}
diff --git a/tests/tests/notificationlegacy/notificationlegacy20/Android.mk b/tests/tests/notificationlegacy/notificationlegacy20/Android.mk
deleted file mode 100644
index 97e7f75..0000000
--- a/tests/tests/notificationlegacy/notificationlegacy20/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2019 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)
-
-LOCAL_PACKAGE_NAME := CtsLegacyNotification20TestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    junit
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MIN_SDK_VERSION := 20
-
-include $(BUILD_CTS_PACKAGE)
\ No newline at end of file
diff --git a/tests/tests/notificationlegacy/notificationlegacy27/Android.bp b/tests/tests/notificationlegacy/notificationlegacy27/Android.bp
new file mode 100644
index 0000000..1b1af07
--- /dev/null
+++ b/tests/tests/notificationlegacy/notificationlegacy27/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsLegacyNotification27TestCases",
+    defaults: ["cts_defaults"],
+    platform_apis: true,
+    static_libs: [
+        "androidx.test.rules",
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "junit",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    min_sdk_version: "27",
+}
diff --git a/tests/tests/notificationlegacy/notificationlegacy27/Android.mk b/tests/tests/notificationlegacy/notificationlegacy27/Android.mk
deleted file mode 100644
index e69b498..0000000
--- a/tests/tests/notificationlegacy/notificationlegacy27/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsLegacyNotification27TestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    junit
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MIN_SDK_VERSION := 27
-
-include $(BUILD_CTS_PACKAGE)
\ No newline at end of file
diff --git a/tests/tests/notificationlegacy/notificationlegacy28/Android.bp b/tests/tests/notificationlegacy/notificationlegacy28/Android.bp
new file mode 100644
index 0000000..8d4fa9c
--- /dev/null
+++ b/tests/tests/notificationlegacy/notificationlegacy28/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsLegacyNotification28TestCases",
+    defaults: ["cts_defaults"],
+    platform_apis: true,
+    static_libs: [
+        "androidx.test.rules",
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "junit",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    min_sdk_version: "28",
+}
diff --git a/tests/tests/notificationlegacy/notificationlegacy28/Android.mk b/tests/tests/notificationlegacy/notificationlegacy28/Android.mk
deleted file mode 100644
index b179d52..0000000
--- a/tests/tests/notificationlegacy/notificationlegacy28/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsLegacyNotification28TestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    junit
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MIN_SDK_VERSION := 28
-
-include $(BUILD_CTS_PACKAGE)
\ No newline at end of file
diff --git a/tests/tests/notificationlegacy/notificationlegacy29/Android.bp b/tests/tests/notificationlegacy/notificationlegacy29/Android.bp
new file mode 100644
index 0000000..be7ce31
--- /dev/null
+++ b/tests/tests/notificationlegacy/notificationlegacy29/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsLegacyNotification29TestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "junit",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    // TODO: replace with 29 once 29 finalized
+    sdk_version: "test_current",
+    min_sdk_version: "29",
+}
diff --git a/tests/tests/notificationlegacy/notificationlegacy29/Android.mk b/tests/tests/notificationlegacy/notificationlegacy29/Android.mk
deleted file mode 100644
index a0b6012..0000000
--- a/tests/tests/notificationlegacy/notificationlegacy29/Android.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsLegacyNotification29TestCases
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-
-# don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules \
-    junit
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-# TODO: replace with 29 once 29 finalized
-LOCAL_SDK_VERSION := test_current
-LOCAL_MIN_SDK_VERSION := 29
-
-include $(BUILD_CTS_PACKAGE)
\ No newline at end of file
diff --git a/tests/tests/opengl/Android.bp b/tests/tests/opengl/Android.bp
new file mode 100644
index 0000000..39148e0
--- /dev/null
+++ b/tests/tests/opengl/Android.bp
@@ -0,0 +1,37 @@
+// 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.
+
+android_test {
+    name: "CtsOpenGLTestCases",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    jni_libs: ["libopengltest_jni"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Using EGL_RECORDABLE_ANDROID requires latest
+    sdk_version: "test_current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/opengl/Android.mk b/tests/tests/opengl/Android.mk
deleted file mode 100644
index 0b75847..0000000
--- a/tests/tests/opengl/Android.mk
+++ /dev/null
@@ -1,47 +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)
-
-LOCAL_PACKAGE_NAME := CtsOpenGLTestCases
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# Include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JNI_SHARED_LIBRARIES := libopengltest_jni
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Using EGL_RECORDABLE_ANDROID requires latest
-LOCAL_SDK_VERSION := current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
-
-# Include the associated library's makefile.
-include $(LOCAL_PATH)/libopengltest/Android.mk
diff --git a/tests/tests/opengl/libopengltest/Android.bp b/tests/tests/opengl/libopengltest/Android.bp
new file mode 100644
index 0000000..bdff5f0
--- /dev/null
+++ b/tests/tests/opengl/libopengltest/Android.bp
@@ -0,0 +1,51 @@
+// 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.
+
+//
+// This is the shared library included by the JNI test app.
+//
+
+cc_test_library {
+    name: "libopengltest_jni",
+    srcs: [
+        "common.cpp",
+        "gl2_jni_libone.cpp",
+        "attach_shader_one.cpp",
+        "attach_shader_two.cpp",
+        "attach_shader_three.cpp",
+        "attach_shader_four.cpp",
+        "attach_shader_five.cpp",
+        "attach_shader_six.cpp",
+        "attach_shader_seven.cpp",
+        "attach_shader_eight.cpp",
+        "attach_shader_nine.cpp",
+        "attach_shader_ten.cpp",
+        "attach_shader_eleven.cpp",
+        "color_one.cpp",
+    ],
+    sdk_version: "current",
+    stl: "none",
+    shared_libs: [
+        "libGLESv2",
+        "liblog",
+    ],
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+        "-Wno-sign-compare",
+        "-Wno-unused-function",
+        "-Wno-unused-variable",
+    ],
+}
diff --git a/tests/tests/opengl/libopengltest/Android.mk b/tests/tests/opengl/libopengltest/Android.mk
deleted file mode 100755
index aed011a..0000000
--- a/tests/tests/opengl/libopengltest/Android.mk
+++ /dev/null
@@ -1,50 +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.
-
-#
-# This is the shared library included by the JNI test app.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-LOCAL_MODULE := libopengltest_jni
-LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := common.cpp \
-                   gl2_jni_libone.cpp \
-                   attach_shader_one.cpp \
-                   attach_shader_two.cpp \
-                   attach_shader_three.cpp \
-                   attach_shader_four.cpp \
-                   attach_shader_five.cpp \
-                   attach_shader_six.cpp \
-                   attach_shader_seven.cpp \
-                   attach_shader_eight.cpp \
-                   attach_shader_nine.cpp \
-                   attach_shader_ten.cpp \
-                   attach_shader_eleven.cpp \
-                   color_one.cpp
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-LOCAL_SDK_VERSION := current
-LOCAL_NDK_STL_VARIANT := none
-
-LOCAL_SHARED_LIBRARIES := libGLESv2 liblog
-
-LOCAL_CFLAGS := -Wall -Werror -Wno-unused-parameter
-LOCAL_CFLAGS += -Wno-sign-compare -Wno-unused-function -Wno-unused-variable
-
-include $(BUILD_SHARED_LIBRARY)
-
-
-
diff --git a/tests/tests/openglperf/Android.bp b/tests/tests/openglperf/Android.bp
new file mode 100644
index 0000000..8960491
--- /dev/null
+++ b/tests/tests/openglperf/Android.bp
@@ -0,0 +1,41 @@
+// Copyright (C) 2011 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.
+
+android_test {
+    name: "CtsOpenGlPerfTestCases",
+    defaults: ["cts_defaults"],
+    // Include both the 32 and 64 bit versions
+    compile_multilib: "both",
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    jni_libs: [
+        "libctsopenglperf_jni",
+        "libnativehelper_compat_libc++",
+    ],
+    srcs: ["src/**/*.java"],
+    instrumentation_for: "com.replica.replicaisland",
+    sdk_version: "test_current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/openglperf/Android.mk b/tests/tests/openglperf/Android.mk
deleted file mode 100644
index 03ba008..0000000
--- a/tests/tests/openglperf/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2011 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_JNI_SHARED_LIBRARIES := libctsopenglperf_jni libnativehelper_compat_libc++
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsOpenGlPerfTestCases
-
-LOCAL_INSTRUMENTATION_FOR := com.replica.replicaisland
-
-LOCAL_SDK_VERSION := current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/openglperf/jni/Android.bp b/tests/tests/openglperf/jni/Android.bp
new file mode 100644
index 0000000..6b9987d
--- /dev/null
+++ b/tests/tests/openglperf/jni/Android.bp
@@ -0,0 +1,34 @@
+// 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.
+//
+
+cc_test_library {
+    name: "libctsopenglperf_jni",
+    srcs: ["OpenGlPerfNativeJni.cpp"],
+    include_dirs: [
+        "system/core/include",
+        "frameworks/native/opengl/include",
+    ],
+    shared_libs: [
+        "libnativehelper_compat_libc++",
+        "liblog",
+        "libEGL",
+    ],
+    sdk_version: "19",
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+    ],
+}
diff --git a/tests/tests/openglperf/jni/Android.mk b/tests/tests/openglperf/jni/Android.mk
deleted file mode 100644
index fef30a1..0000000
--- a/tests/tests/openglperf/jni/Android.mk
+++ /dev/null
@@ -1,33 +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)
-
-LOCAL_MODULE    := libctsopenglperf_jni
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := OpenGlPerfNativeJni.cpp
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE) $(call include-path-for, system-core) frameworks/native/opengl/include
-
-LOCAL_SHARED_LIBRARIES := libnativehelper_compat_libc++ liblog libEGL
-
-LOCAL_SDK_VERSION := 14
-
-LOCAL_CFLAGS := -Wall -Werror -Wno-unused-parameter
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/os/Android.bp b/tests/tests/os/Android.bp
new file mode 100644
index 0000000..6c48c87
--- /dev/null
+++ b/tests/tests/os/Android.bp
@@ -0,0 +1,57 @@
+// Copyright (C) 2008 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.
+
+android_test {
+    name: "CtsOsTestCases",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    static_libs: [
+        "android.hidl.manager-V1.0-java",
+        "androidx.test.rules",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "truth-prebuilt",
+        "guava",
+        "junit",
+    ],
+    jni_libs: [
+        "libcts_jni",
+        "libctsos_jni",
+        "libnativehelper_compat_libc++",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "src/android/os/cts/IParcelFileDescriptorPeer.aidl",
+        "src/android/os/cts/IEmptyService.aidl",
+        "src/android/os/cts/ISeccompIsolatedService.aidl",
+        "src/android/os/cts/ISecondary.aidl",
+        "src/android/os/cts/ISharedMemoryService.aidl",
+        "src/android/os/cts/IParcelExceptionService.aidl",
+    ],
+    // Set its own test config to prevent sharing with cts-platform-version-check
+    test_config: "CtsOsTestCases.xml",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    platform_apis: true,
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    // Do not compress minijail policy files.
+    aaptflags: ["-0 .policy"],
+}
diff --git a/tests/tests/os/Android.mk b/tests/tests/os/Android.mk
index 8494d5e..8d3faaf 100644
--- a/tests/tests/os/Android.mk
+++ b/tests/tests/os/Android.mk
@@ -12,59 +12,6 @@
 # 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    android.hidl.manager-V1.0-java \
-    androidx.test.rules \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    truth-prebuilt \
-    guava \
-    junit
-
-LOCAL_JNI_SHARED_LIBRARIES := libcts_jni libctsos_jni libnativehelper_compat_libc++
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-    src/android/os/cts/IParcelFileDescriptorPeer.aidl \
-    src/android/os/cts/IEmptyService.aidl \
-    src/android/os/cts/ISeccompIsolatedService.aidl \
-    src/android/os/cts/ISecondary.aidl \
-    src/android/os/cts/ISharedMemoryService.aidl \
-    src/android/os/cts/IParcelExceptionService.aidl
-
-LOCAL_PACKAGE_NAME := CtsOsTestCases
-
-# Set its own test config to prevent sharing with cts-platform-version-check
-LOCAL_TEST_CONFIG := CtsOsTestCases.xml
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := test_current
-LOCAL_JAVA_LIBRARIES += android.test.runner.stubs
-LOCAL_JAVA_LIBRARIES += android.test.base.stubs
-
-# Do not compress minijail policy files.
-LOCAL_AAPT_FLAGS := -0 .policy
-
-LOCAL_USE_AAPT2 := true
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
-
 # platform version check (b/32056228)
 # ============================================================
 include $(CLEAR_VARS)
diff --git a/tests/tests/os/TEST_MAPPING b/tests/tests/os/TEST_MAPPING
index 78469e8..ad2a688 100644
--- a/tests/tests/os/TEST_MAPPING
+++ b/tests/tests/os/TEST_MAPPING
@@ -4,13 +4,13 @@
       "name": "CtsOsTestCases",
       "options": [
         {
-          "exclude-filter": "android.os.cts.UsbDebuggingTest#testUsbDebugging"
+          "exclude-filter": "android.os.cts.BuildTest#testSdkInt"
         },
         {
           "exclude-filter": "android.os.cts.StrictModeTest#testNonSdkApiUsage"
         },
         {
-          "exclude-filter": "android.os.cts.BuildTest#testSdkInt"
+          "exclude-filter": "android.os.cts.UsbDebuggingTest#testUsbDebugging"
         }
       ]
     }
diff --git a/tests/tests/os/assets/platform_versions.txt b/tests/tests/os/assets/platform_versions.txt
index f599e28..331bae0 100644
--- a/tests/tests/os/assets/platform_versions.txt
+++ b/tests/tests/os/assets/platform_versions.txt
@@ -1 +1 @@
-10
+R
diff --git a/tests/tests/os/src/android/os/cts/BuildTest.java b/tests/tests/os/src/android/os/cts/BuildTest.java
index 7ff9bcd..00cb97d 100644
--- a/tests/tests/os/src/android/os/cts/BuildTest.java
+++ b/tests/tests/os/src/android/os/cts/BuildTest.java
@@ -16,7 +16,7 @@
 
 package android.os.cts;
 
-import static android.os.Build.VERSION.CODENAME;
+import static android.os.Build.VERSION.ACTIVE_CODENAMES;
 import static android.os.Build.VERSION_CODES.CUR_DEVELOPMENT;
 
 import android.os.Build;
@@ -264,6 +264,7 @@
 
         // CUR_DEVELOPMENT must be larger than any released version.
         Field[] fields = Build.VERSION_CODES.class.getDeclaredFields();
+        List<String> codenames = Arrays.asList(ACTIVE_CODENAMES);
         for (Field field : fields) {
             if (field.getType().equals(int.class) && Modifier.isStatic(field.getModifiers())) {
                 String fieldName = field.getName();
@@ -277,7 +278,7 @@
                     // It should be okay to change the value of this constant in future, but it
                     // should at least be a conscious decision.
                     assertEquals(10000, fieldValue);
-                } else if (fieldName.equals(CODENAME) && !CODENAME.equals("REL")) {
+                } else if (codenames.contains(fieldName)) {
                     // This is the current development version. Note that fieldName can
                     // become < CUR_DEVELOPMENT before CODENAME becomes "REL", so we
                     // can't assertEquals(CUR_DEVELOPMENT, fieldValue) here.
diff --git a/tests/tests/os/src/android/os/cts/EnvironmentTest.java b/tests/tests/os/src/android/os/cts/EnvironmentTest.java
index dfbef8a..b00e1f2 100644
--- a/tests/tests/os/src/android/os/cts/EnvironmentTest.java
+++ b/tests/tests/os/src/android/os/cts/EnvironmentTest.java
@@ -110,7 +110,12 @@
         final long maxInodes = maxsize / 4096;
         // Assuming the smallest storage would be 4GB, min # of free inodes
         // in EXT4/F2FS must be larger than 128k for Android to work properly.
-        final long minInodes = 128 * 1024;
+        long minInodes = 128 * 1024;
+        final long size4GB = 4294967296l;
+        //If the storage size is smaller than 4GB, let's consider 32k for 1GB.
+        if (maxsize < size4GB) {
+            minInodes = 32 * 1024;
+        }
 
         if (stat.f_ffree >= minInodes && stat.f_ffree <= maxInodes
             && stat.f_favail <= stat.f_ffree) {
diff --git a/tests/tests/os/src/android/os/cts/ParcelTest.java b/tests/tests/os/src/android/os/cts/ParcelTest.java
index 0287b7a..68c0a46 100644
--- a/tests/tests/os/src/android/os/cts/ParcelTest.java
+++ b/tests/tests/os/src/android/os/cts/ParcelTest.java
@@ -2982,16 +2982,14 @@
         for (int pos = 0; pos <= thirdIntPos; pos++) {
             p.setDataPosition(pos);
             int value = p.readInt();
-            if (pos == firstIntPos) {
-                assertEquals(1, value);
-            } else if (pos == secondIntPos) {
-                assertEquals(2, value);
-            } else if (pos == thirdIntPos) {
-                assertEquals(3, value);
-            } else {
-                // All other read attempts cross into protected data and will return 0
-                assertEquals(0, value);
-            }
+
+            // WARNING: this is using unstable APIs: these positions aren't guaranteed
+            if (firstIntPos - 4 <= pos && pos <= firstIntPos) continue;
+            if (secondIntPos - 4 <= pos && pos <= secondIntPos) continue;
+            if (thirdIntPos - 4 <= pos && pos <= thirdIntPos) continue;
+
+            // All other read attempts cross into protected data and will return 0
+            assertEquals(0, value);
         }
 
         p.recycle();
@@ -3017,16 +3015,13 @@
         do {
             pos = p.dataPosition();
             int value = p.readInt();
-            if (pos == firstIntPos) {
-                assertEquals(1, value);
-            } else if (pos == secondIntPos) {
-                assertEquals(2, value);
-            } else if (pos == thirdIntPos) {
-                assertEquals(3, value);
-            } else {
-                // All other read attempts cross into protected data and will return 0
-                assertEquals(0, value);
-            }
+
+            // WARNING: this is using unstable APIs: these positions aren't guaranteed
+            if (firstIntPos - 4 <= pos && pos <= firstIntPos) continue;
+            if (secondIntPos - 4 <= pos && pos <= secondIntPos) continue;
+            if (thirdIntPos - 4 <= pos && pos <= thirdIntPos) continue;
+
+            assertEquals(0, value);
         } while(pos < end);
 
         p.recycle();
diff --git a/tests/tests/os/src/android/os/cts/SecurityFeaturesTest.java b/tests/tests/os/src/android/os/cts/SecurityFeaturesTest.java
index 2e7130d..64b6fd4 100644
--- a/tests/tests/os/src/android/os/cts/SecurityFeaturesTest.java
+++ b/tests/tests/os/src/android/os/cts/SecurityFeaturesTest.java
@@ -74,7 +74,7 @@
     public void testPrctlDumpable() throws Exception {
         boolean userBuild = "user".equals(Build.TYPE);
         int prctl_dumpable = Os.prctl(PR_GET_DUMPABLE, 0, 0, 0, 0);
-        int expected  = userBuild ? 0 : 1;
+        int expected = userBuild ? 0 : 1;
         assertEquals(expected, prctl_dumpable);
     }
 }
diff --git a/tests/tests/packageinstaller/nopermission/src/android.packageinstaller.nopermission.cts/NoPermissionTests.kt b/tests/tests/packageinstaller/nopermission/src/android.packageinstaller.nopermission.cts/NoPermissionTests.kt
index 10c2efa..022d598 100644
--- a/tests/tests/packageinstaller/nopermission/src/android.packageinstaller.nopermission.cts/NoPermissionTests.kt
+++ b/tests/tests/packageinstaller/nopermission/src/android.packageinstaller.nopermission.cts/NoPermissionTests.kt
@@ -72,7 +72,7 @@
 
             if (status == PackageInstaller.STATUS_PENDING_USER_ACTION) {
                 val activityIntent = intent.getParcelableExtra<Intent>(Intent.EXTRA_INTENT)
-                activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+                activityIntent!!.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                 context.startActivity(activityIntent)
             }
         }
diff --git a/tests/tests/permission/telephony/src/android/permission/cts/telephony/TelephonyManagerPermissionTest.java b/tests/tests/permission/telephony/src/android/permission/cts/telephony/TelephonyManagerPermissionTest.java
index 32e4296..3671255 100644
--- a/tests/tests/permission/telephony/src/android/permission/cts/telephony/TelephonyManagerPermissionTest.java
+++ b/tests/tests/permission/telephony/src/android/permission/cts/telephony/TelephonyManagerPermissionTest.java
@@ -287,8 +287,11 @@
             return;
         }
 
-        if (mTelephonyManager.getNetworkType() != TelephonyManager.NETWORK_TYPE_UNKNOWN) {
-            fail("getNetworkType should return UNKNOWN");
+        try {
+            mTelephonyManager.getNetworkType();
+            fail("getNetworkType did not throw a SecurityException");
+        } catch (SecurityException e) {
+            // expected
         }
 
         try {
diff --git a/tests/tests/permission2/Android.bp b/tests/tests/permission2/Android.bp
index ec9366b..f4f25b0 100644
--- a/tests/tests/permission2/Android.bp
+++ b/tests/tests/permission2/Android.bp
@@ -17,7 +17,6 @@
 android_test {
     name: "CtsPermission2TestCases",
     defaults: ["cts_defaults"],
-
     // Tag this module as a cts test artifact
     test_suites: [
         "cts",
@@ -25,11 +24,8 @@
         "general-tests",
         "cts_instant",
     ],
-
     libs: ["android.test.base.stubs"],
-
     static_libs: [
-        "androidx.test.core",
         "compatibility-device-util-axt",
         "ctstestrunner-axt",
         "guava",
@@ -37,8 +33,6 @@
         "truth-prebuilt",
         "permission-test-util-lib"
     ],
-
     srcs: ["src/**/*.java"],
-
     sdk_version: "test_current",
 }
diff --git a/tests/tests/print/Android.bp b/tests/tests/print/Android.bp
new file mode 100644
index 0000000..1e610b3
--- /dev/null
+++ b/tests/tests/print/Android.bp
@@ -0,0 +1,28 @@
+// Copyright (C) 2014 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.
+
+android_test {
+    name: "CtsPrintTestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    srcs: ["src/**/*.java"],
+    static_libs: ["print-test-util-lib"],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/print/Android.mk b/tests/tests/print/Android.mk
deleted file mode 100644
index c44943d..0000000
--- a/tests/tests/print/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2014 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsPrintTestCases
-
-LOCAL_STATIC_JAVA_LIBRARIES := print-test-util-lib
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-include $(call all-makefiles-under,$(LOCAL_PATH))
\ No newline at end of file
diff --git a/tests/tests/proto/Android.bp b/tests/tests/proto/Android.bp
new file mode 100644
index 0000000..cd57f37
--- /dev/null
+++ b/tests/tests/proto/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2008 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.
+
+android_test {
+    name: "CtsProtoTestCases",
+    defaults: ["cts_defaults"],
+    srcs: [
+        "src/**/*.java",
+        "src/**/*.proto",
+    ],
+    proto: {
+        type: "nano",
+    },
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    //sdl_version: "current",
+    platform_apis: true,
+    libs: ["android.test.runner.stubs"],
+    static_libs: ["ctstestrunner-axt"],
+}
diff --git a/tests/tests/proto/Android.mk b/tests/tests/proto/Android.mk
deleted file mode 100644
index e937e0c..0000000
--- a/tests/tests/proto/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 2008 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-    $(call all-proto-files-under, src)
-
-LOCAL_PROTOC_OPTIMIZE_TYPE := nano
-
-LOCAL_PACKAGE_NAME := CtsProtoTestCases
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-#LOCAL_SDK_VERSION := current
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_JAVA_LIBRARIES += android.test.runner.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-        ctstestrunner-axt
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/provider/Android.mk b/tests/tests/provider/Android.mk
deleted file mode 100644
index 6361f9b..0000000
--- a/tests/tests/provider/Android.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/provider/preconditions/Android.bp b/tests/tests/provider/preconditions/Android.bp
new file mode 100644
index 0000000..78b7457
--- /dev/null
+++ b/tests/tests/provider/preconditions/Android.bp
@@ -0,0 +1,17 @@
+java_test_helper_library {
+    name: "compatibility-host-provider-preconditions",
+    srcs: ["src/**/*.java"],
+    libs: [
+        "compatibility-host-util",
+        "cts-tradefed",
+        "tradefed",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    host_supported: true,
+    device_supported: false,
+}
diff --git a/tests/tests/provider/preconditions/Android.mk b/tests/tests/provider/preconditions/Android.mk
deleted file mode 100644
index f4063c4..0000000
--- a/tests/tests/provider/preconditions/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_LIBRARIES := compatibility-host-util cts-tradefed tradefed
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE := compatibility-host-provider-preconditions
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/provider/src/android/provider/cts/MediaStore_Images_ThumbnailsTest.java b/tests/tests/provider/src/android/provider/cts/MediaStore_Images_ThumbnailsTest.java
index f0308d2..2d28405 100644
--- a/tests/tests/provider/src/android/provider/cts/MediaStore_Images_ThumbnailsTest.java
+++ b/tests/tests/provider/src/android/provider/cts/MediaStore_Images_ThumbnailsTest.java
@@ -41,7 +41,6 @@
 import android.graphics.ImageDecoder;
 import android.net.Uri;
 import android.os.Environment;
-import android.os.SystemClock;
 import android.platform.test.annotations.Presubmit;
 import android.provider.MediaStore;
 import android.provider.MediaStore.Images.Media;
@@ -208,6 +207,7 @@
         String imagePath = c.getString(c.getColumnIndex(Media.DATA));
         c.close();
 
+        MediaStore.waitForIdle(mContext);
         assertExists("image file does not exist", imagePath);
         assertNotNull(Thumbnails.getThumbnail(resolver, imageId, Thumbnails.MINI_KIND, null));
         assertNotNull(Thumbnails.getThumbnail(resolver, imageId, Thumbnails.MICRO_KIND, null));
@@ -218,6 +218,7 @@
         mContentResolver.delete(stringUri, null, null);
         mRowsAdded.remove(stringUri);
 
+        MediaStore.waitForIdle(mContext);
         assertNotExists("image file should no longer exist", imagePath);
         assertNull(Thumbnails.getThumbnail(resolver, imageId, Thumbnails.MINI_KIND, null));
         assertNull(Thumbnails.getThumbnail(resolver, imageId, Thumbnails.MICRO_KIND, null));
@@ -304,16 +305,14 @@
                 "test description"));
         long imageId = ContentUris.parseId(uri);
 
-        SystemClock.sleep(1000); // TODO: Remove sleep once getThumbnail has been fixed
-
+        MediaStore.waitForIdle(mContext);
         assertNotNull(Thumbnails.getThumbnail(resolver, imageId, Thumbnails.MINI_KIND, null));
         assertNotNull(Thumbnails.getThumbnail(resolver, imageId, Thumbnails.MICRO_KIND, null));
 
         // delete the source image and check that the thumbnail is gone too
         mContentResolver.delete(uri, null /* where clause */, null /* where args */);
 
-        SystemClock.sleep(1000); // TODO: Remove sleep once getThumbnail has been fixed
-
+        MediaStore.waitForIdle(mContext);
         assertNull(Thumbnails.getThumbnail(resolver, imageId, Thumbnails.MINI_KIND, null));
         assertNull(Thumbnails.getThumbnail(resolver, imageId, Thumbnails.MICRO_KIND, null));
 
@@ -322,9 +321,8 @@
                 "test description"));
         imageId = ContentUris.parseId(uri);
 
-        SystemClock.sleep(1000); // TODO: Remove sleep once getThumbnail has been fixed
-
         // query its thumbnail again
+        MediaStore.waitForIdle(mContext);
         assertNotNull(Thumbnails.getThumbnail(resolver, imageId, Thumbnails.MINI_KIND, null));
         assertNotNull(Thumbnails.getThumbnail(resolver, imageId, Thumbnails.MICRO_KIND, null));
 
@@ -334,9 +332,8 @@
         assertEquals("unexpected number of updated rows",
                 1, mContentResolver.update(uri, values, null /* where */, null /* where args */));
 
-        SystemClock.sleep(1000);
-
         // image was marked as regular file in the database, which should have deleted its thumbnail
+        MediaStore.waitForIdle(mContext);
         assertNull(Thumbnails.getThumbnail(resolver, imageId, Thumbnails.MINI_KIND, null));
         assertNull(Thumbnails.getThumbnail(resolver, imageId, Thumbnails.MICRO_KIND, null));
 
@@ -373,7 +370,7 @@
                         Media.insertImage(mContentResolver, src, "cts" + System.nanoTime(), null));
                 mRowsAdded.add(url[i]);
                 long origId = Long.parseLong(url[i].getLastPathSegment());
-                SystemClock.sleep(1000); // TODO: Remove sleep once getThumbnail has been fixed
+                MediaStore.waitForIdle(mContext);
                 Bitmap foo = MediaStore.Images.Thumbnails.getThumbnail(mContentResolver,
                         origId, Thumbnails.MICRO_KIND, null);
                 assertNotNull(foo);
@@ -390,6 +387,7 @@
             long remainingId2 = Long.parseLong(url[2].getLastPathSegment());
 
             // check if a thumbnail is still being returned for the image that was removed
+            MediaStore.waitForIdle(mContext);
             Bitmap foo = MediaStore.Images.Thumbnails.getThumbnail(mContentResolver,
                     removedId, Thumbnails.MICRO_KIND, null);
             assertNull(foo);
@@ -400,6 +398,7 @@
                         MediaColumns._ID + order);
                 while (c.moveToNext()) {
                     long id = c.getLong(c.getColumnIndex(MediaColumns._ID));
+                    MediaStore.waitForIdle(mContext);
                     foo = MediaStore.Images.Thumbnails.getThumbnail(
                             mContentResolver, id,
                             MediaStore.Images.Thumbnails.MICRO_KIND, null);
@@ -439,6 +438,7 @@
 
         {
             // Thumbnail should be smaller
+            MediaStore.waitForIdle(mContext);
             final Bitmap thumb = mContentResolver.loadThumbnail(finalUri, new Size(32, 32), null);
             assertTrue(thumb.getWidth() < full.getWidth());
             assertTrue(thumb.getHeight() < full.getHeight());
@@ -455,6 +455,7 @@
                     MediaStore.Images.Thumbnails.MICRO_KIND
             }) {
                 // Thumbnail should be smaller
+                MediaStore.waitForIdle(mContext);
                 final Bitmap thumb = MediaStore.Images.Thumbnails.getThumbnail(mContentResolver,
                         ContentUris.parseId(finalUri), kind, null);
                 assertTrue(thumb.getWidth() < full.getWidth());
@@ -471,10 +472,11 @@
         }
 
         // Wait a few moments for events to settle
-        SystemClock.sleep(1000);
+        MediaStore.waitForIdle(mContext);
 
         {
             // Thumbnail should match updated contents
+            MediaStore.waitForIdle(mContext);
             final Bitmap thumb = mContentResolver.loadThumbnail(finalUri, new Size(32, 32), null);
             assertColorMostlyEquals(Color.BLUE, thumb.getPixel(16, 16));
         }
@@ -484,6 +486,7 @@
 
         // Thumbnail should no longer exist
         try {
+            MediaStore.waitForIdle(mContext);
             mContentResolver.loadThumbnail(finalUri, new Size(32, 32), null);
             fail("Funky; we somehow made a thumbnail out of nothing?");
         } catch (FileNotFoundException expected) {
diff --git a/tests/tests/provider/src/android/provider/cts/MediaStore_Video_ThumbnailsTest.java b/tests/tests/provider/src/android/provider/cts/MediaStore_Video_ThumbnailsTest.java
index 32ea780..9d39c1c 100644
--- a/tests/tests/provider/src/android/provider/cts/MediaStore_Video_ThumbnailsTest.java
+++ b/tests/tests/provider/src/android/provider/cts/MediaStore_Video_ThumbnailsTest.java
@@ -36,7 +36,6 @@
 import android.media.MediaMetadataRetriever;
 import android.net.Uri;
 import android.os.FileUtils;
-import android.os.SystemClock;
 import android.platform.test.annotations.Presubmit;
 import android.provider.MediaStore;
 import android.provider.MediaStore.Files;
@@ -117,12 +116,14 @@
         // Don't run the test if the codec isn't supported.
         if (!hasCodec()) {
             // Calling getThumbnail should not generate a new thumbnail.
+            MediaStore.waitForIdle(mContext);
             assertNull(Thumbnails.getThumbnail(mResolver, videoId, Thumbnails.MINI_KIND, null));
             Log.i(TAG, "SKIPPING testGetThumbnail(): codec not supported");
             return;
         }
 
         // Calling getThumbnail should generate a new thumbnail.
+        MediaStore.waitForIdle(mContext);
         assertNotNull(Thumbnails.getThumbnail(mResolver, videoId, Thumbnails.MINI_KIND, null));
         assertNotNull(Thumbnails.getThumbnail(mResolver, videoId, Thumbnails.MICRO_KIND, null));
 
@@ -143,11 +144,13 @@
         Uri uri = insertVideo();
 
         // request thumbnail creation
+        MediaStore.waitForIdle(mContext);
         assertNotNull(Thumbnails.getThumbnail(mResolver, Long.valueOf(uri.getLastPathSegment()),
                 Thumbnails.MINI_KIND, null /* options */));
 
         // delete the source video and check that the thumbnail is gone too
         mResolver.delete(uri, null /* where clause */, null /* where args */);
+        MediaStore.waitForIdle(mContext);
         assertNull(Thumbnails.getThumbnail(mResolver, Long.valueOf(uri.getLastPathSegment()),
                 Thumbnails.MINI_KIND, null /* options */));
 
@@ -155,6 +158,7 @@
         uri = insertVideo();
 
         // request thumbnail creation
+        MediaStore.waitForIdle(mContext);
         assertNotNull(Thumbnails.getThumbnail(mResolver, Long.valueOf(uri.getLastPathSegment()),
                 Thumbnails.MINI_KIND, null));
 
@@ -164,9 +168,8 @@
         assertEquals("unexpected number of updated rows",
                 1, mResolver.update(uri, values, null /* where */, null /* where args */));
 
-        SystemClock.sleep(1000);
-
         // video was marked as regular file in the database, which should have deleted its thumbnail
+        MediaStore.waitForIdle(mContext);
         assertNull(Thumbnails.getThumbnail(mResolver, Long.valueOf(uri.getLastPathSegment()),
                 Thumbnails.MINI_KIND, null /* options */));
 
@@ -221,6 +224,7 @@
         }
 
         // Thumbnail should be smaller
+        MediaStore.waitForIdle(mContext);
         final Bitmap beforeThumb = mResolver.loadThumbnail(finalUri, new Size(32, 32), null);
         assertTrue(beforeThumb.getWidth() < full.getWidth());
         assertTrue(beforeThumb.getHeight() < full.getHeight());
@@ -233,6 +237,7 @@
                     MediaStore.Video.Thumbnails.FULL_SCREEN_KIND,
                     MediaStore.Video.Thumbnails.MICRO_KIND
             }) {
+                MediaStore.waitForIdle(mContext);
                 assertNotNull(MediaStore.Video.Thumbnails.getThumbnail(mResolver,
                         ContentUris.parseId(finalUri), kind, null));
             }
@@ -244,10 +249,8 @@
             FileUtils.copy(from, to);
         }
 
-        // Wait a few moments for events to settle
-        SystemClock.sleep(1000);
-
         // Thumbnail should match updated contents
+        MediaStore.waitForIdle(mContext);
         final Bitmap afterThumb = mResolver.loadThumbnail(finalUri, new Size(32, 32), null);
         final int afterColor = afterThumb.getPixel(16, 16);
         assertNotColorMostlyEquals(beforeColor, afterColor);
@@ -257,6 +260,7 @@
 
         // Thumbnail should no longer exist
         try {
+            MediaStore.waitForIdle(mContext);
             mResolver.loadThumbnail(finalUri, new Size(32, 32), null);
             fail("Funky; we somehow made a thumbnail out of nothing?");
         } catch (FileNotFoundException expected) {
diff --git a/tests/tests/rcs/Android.bp b/tests/tests/rcs/Android.bp
new file mode 100644
index 0000000..07b4d3b
--- /dev/null
+++ b/tests/tests/rcs/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2019 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.
+
+android_test {
+    name: "CtsRcsTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "androidx.test.rules",
+        "truth-prebuilt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    platform_apis: true,
+}
diff --git a/tests/tests/rcs/Android.mk b/tests/tests/rcs/Android.mk
deleted file mode 100755
index af2bf4b..0000000
--- a/tests/tests/rcs/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2019 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 := tests
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_DEX_PREOPT := false
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    androidx.test.rules \
-    truth-prebuilt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_PACKAGE_NAME := CtsRcsTestCases
-
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/rcs/src/android/telephony/ims/cts/Rcs1To1ThreadTest.java b/tests/tests/rcs/src/android/telephony/ims/cts/Rcs1To1ThreadTest.java
index 18dee5f..516a5bb 100644
--- a/tests/tests/rcs/src/android/telephony/ims/cts/Rcs1To1ThreadTest.java
+++ b/tests/tests/rcs/src/android/telephony/ims/cts/Rcs1To1ThreadTest.java
@@ -21,8 +21,7 @@
 
 import android.content.Context;
 import android.telephony.ims.Rcs1To1Thread;
-import android.telephony.ims.RcsManager;
-import android.telephony.ims.RcsMessageStore;
+import android.telephony.ims.RcsMessageManager;
 import android.telephony.ims.RcsMessageStoreException;
 import android.telephony.ims.RcsParticipant;
 
@@ -35,7 +34,7 @@
 import org.junit.Test;
 
 public class Rcs1To1ThreadTest {
-    private RcsMessageStore mRcsMessageStore;
+    private RcsMessageManager mRcsMessageManager;
     private Context mContext;
 
     @BeforeClass
@@ -50,8 +49,7 @@
         Assume.assumeTrue(IS_RCS_TABLE_SCHEMA_CODE_COMPLETE);
 
         mContext = InstrumentationRegistry.getTargetContext();
-        RcsManager rcsManager = mContext.getSystemService(RcsManager.class);
-        mRcsMessageStore = rcsManager.getRcsMessageStore();
+        mRcsMessageManager = mContext.getSystemService(RcsMessageManager.class);
 
         cleanup();
     }
@@ -63,16 +61,18 @@
 
     @Test
     public void testRcs1To1Thread_isGroupReturnsFalse() throws RcsMessageStoreException {
-        RcsParticipant participant = mRcsMessageStore.createRcsParticipant("+1234567890", "Alice");
-        Rcs1To1Thread thread = mRcsMessageStore.createRcs1To1Thread(participant);
+        RcsParticipant participant = mRcsMessageManager.createRcsParticipant(
+                "+1234567890", "Alice");
+        Rcs1To1Thread thread = mRcsMessageManager.createRcs1To1Thread(participant);
 
         assertThat(thread.isGroup()).isFalse();
     }
 
     @Test
     public void testRcs1To1Thread_fallbackThreadIdCanBeSet() throws RcsMessageStoreException {
-        RcsParticipant participant = mRcsMessageStore.createRcsParticipant("+1234567890", "Alice");
-        Rcs1To1Thread thread = mRcsMessageStore.createRcs1To1Thread(participant);
+        RcsParticipant participant = mRcsMessageManager.createRcsParticipant(
+                "+1234567890", "Alice");
+        Rcs1To1Thread thread = mRcsMessageManager.createRcs1To1Thread(participant);
 
         thread.setFallbackThreadId(2);
 
diff --git a/tests/tests/rcs/src/android/telephony/ims/cts/RcsEventTest.java b/tests/tests/rcs/src/android/telephony/ims/cts/RcsEventTest.java
index 97a40936..c6ed244 100644
--- a/tests/tests/rcs/src/android/telephony/ims/cts/RcsEventTest.java
+++ b/tests/tests/rcs/src/android/telephony/ims/cts/RcsEventTest.java
@@ -31,8 +31,7 @@
 import android.telephony.ims.RcsGroupThreadNameChangedEvent;
 import android.telephony.ims.RcsGroupThreadParticipantJoinedEvent;
 import android.telephony.ims.RcsGroupThreadParticipantLeftEvent;
-import android.telephony.ims.RcsManager;
-import android.telephony.ims.RcsMessageStore;
+import android.telephony.ims.RcsMessageManager;
 import android.telephony.ims.RcsMessageStoreException;
 import android.telephony.ims.RcsParticipant;
 import android.telephony.ims.RcsParticipantAliasChangedEvent;
@@ -50,7 +49,7 @@
 import java.util.function.Predicate;
 
 public class RcsEventTest {
-    private RcsMessageStore mRcsMessageStore;
+    private RcsMessageManager mRcsMessageManager;
 
     private long mTimestamp;
     private RcsParticipant mParticipant1;
@@ -70,15 +69,14 @@
         Assume.assumeTrue(IS_RCS_TABLE_SCHEMA_CODE_COMPLETE);
 
         Context context = InstrumentationRegistry.getTargetContext();
-        RcsManager rcsManager = context.getSystemService(RcsManager.class);
-        mRcsMessageStore = rcsManager.getRcsMessageStore();
+        mRcsMessageManager = context.getSystemService(RcsMessageManager.class);
 
         cleanup();
 
         mTimestamp = 1234567890;
-        mParticipant1 = mRcsMessageStore.createRcsParticipant("403", "p1");
-        mParticipant2 = mRcsMessageStore.createRcsParticipant("404", "p2");
-        mGroupThread = mRcsMessageStore.createGroupThread(
+        mParticipant1 = mRcsMessageManager.createRcsParticipant("403", "p1");
+        mParticipant2 = mRcsMessageManager.createRcsParticipant("404", "p2");
+        mGroupThread = mRcsMessageManager.createGroupThread(
                 Lists.newArrayList(mParticipant1, mParticipant2), "groupName", Uri.EMPTY);
 
     }
@@ -95,7 +93,7 @@
                 new RcsGroupThreadParticipantJoinedEvent(
                         mTimestamp, mGroupThread, mParticipant1, mParticipant2);
 
-        mRcsMessageStore.persistRcsEvent(rcsGroupThreadParticipantJoinedEvent);
+        mRcsMessageManager.persistRcsEvent(rcsGroupThreadParticipantJoinedEvent);
 
         assertMatchingEventInQuery(
                 RcsEventQueryParams.GROUP_THREAD_PARTICIPANT_JOINED_EVENT,
@@ -109,7 +107,7 @@
                 new RcsGroupThreadNameChangedEvent(
                         mTimestamp, mGroupThread, mParticipant1, "newName");
 
-        mRcsMessageStore.persistRcsEvent(rcsGroupThreadNameChangedEvent);
+        mRcsMessageManager.persistRcsEvent(rcsGroupThreadNameChangedEvent);
 
         assertMatchingEventInQuery(
                 RcsEventQueryParams.GROUP_THREAD_NAME_CHANGED_EVENT,
@@ -122,7 +120,7 @@
         RcsParticipantAliasChangedEvent rcsParticipantAliasChangedEvent
                 = new RcsParticipantAliasChangedEvent(mTimestamp, mParticipant1, "newAlias");
 
-        mRcsMessageStore.persistRcsEvent(rcsParticipantAliasChangedEvent);
+        mRcsMessageManager.persistRcsEvent(rcsParticipantAliasChangedEvent);
 
         assertMatchingEventInQuery(
                 RcsEventQueryParams.PARTICIPANT_ALIAS_CHANGED_EVENT,
@@ -136,7 +134,7 @@
                 new RcsGroupThreadParticipantLeftEvent(
                         mTimestamp, mGroupThread, mParticipant1, mParticipant2);
 
-        mRcsMessageStore.persistRcsEvent(rcsGroupThreadParticipantLeftEvent);
+        mRcsMessageManager.persistRcsEvent(rcsGroupThreadParticipantLeftEvent);
 
         assertMatchingEventInQuery(
                 RcsEventQueryParams.GROUP_THREAD_PARTICIPANT_LEFT_EVENT,
@@ -152,7 +150,7 @@
                 new RcsGroupThreadIconChangedEvent(
                         mTimestamp, mGroupThread, mParticipant1, newIcon);
 
-        mRcsMessageStore.persistRcsEvent(rcsGroupThreadIconChangedEvent);
+        mRcsMessageManager.persistRcsEvent(rcsGroupThreadIconChangedEvent);
 
         assertMatchingEventInQuery(
                 RcsEventQueryParams.GROUP_THREAD_ICON_CHANGED_EVENT,
@@ -161,7 +159,7 @@
 
     private void assertMatchingEventInQuery(int queryMessageType, Predicate<RcsEvent> predicate)
             throws RcsMessageStoreException {
-        RcsEventQueryResult queryResult = mRcsMessageStore.getRcsEvents(
+        RcsEventQueryResult queryResult = mRcsMessageManager.getRcsEvents(
                 new RcsEventQueryParams.Builder()
                         .setEventType(queryMessageType)
                         .build());
diff --git a/tests/tests/rcs/src/android/telephony/ims/cts/RcsParticipantTest.java b/tests/tests/rcs/src/android/telephony/ims/cts/RcsParticipantTest.java
index 0a3fd5c..7da8e63 100644
--- a/tests/tests/rcs/src/android/telephony/ims/cts/RcsParticipantTest.java
+++ b/tests/tests/rcs/src/android/telephony/ims/cts/RcsParticipantTest.java
@@ -21,8 +21,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 import android.content.Context;
-import android.telephony.ims.RcsManager;
-import android.telephony.ims.RcsMessageStore;
+import android.telephony.ims.RcsMessageManager;
 import android.telephony.ims.RcsMessageStoreException;
 import android.telephony.ims.RcsParticipant;
 
@@ -35,7 +34,7 @@
 import org.junit.Test;
 
 public class RcsParticipantTest {
-    RcsMessageStore mRcsMessageStore;
+    RcsMessageManager mRcsMessageManager;
     Context mContext;
 
     @BeforeClass
@@ -50,8 +49,7 @@
         Assume.assumeTrue(IS_RCS_TABLE_SCHEMA_CODE_COMPLETE);
 
         mContext = InstrumentationRegistry.getTargetContext();
-        RcsManager rcsManager = mContext.getSystemService(RcsManager.class);
-        mRcsMessageStore = rcsManager.getRcsMessageStore();
+        mRcsMessageManager = mContext.getSystemService(RcsMessageManager.class);
 
         cleanup();
     }
@@ -83,7 +81,7 @@
     private void createAndValidateParticipant(String expectedCanonicalAddress,
             String expectedAlias) throws RcsMessageStoreException {
         RcsParticipant rcsParticipant =
-                mRcsMessageStore.createRcsParticipant(expectedCanonicalAddress, expectedAlias);
+                mRcsMessageManager.createRcsParticipant(expectedCanonicalAddress, expectedAlias);
 
         assertThat(rcsParticipant).isNotNull();
         assertThat(rcsParticipant.getId()).isGreaterThan(0);
diff --git a/tests/tests/rcs/src/android/telephony/ims/cts/RcsProviderPermissionsTest.java b/tests/tests/rcs/src/android/telephony/ims/cts/RcsProviderPermissionsTest.java
new file mode 100644
index 0000000..c1e0af0
--- /dev/null
+++ b/tests/tests/rcs/src/android/telephony/ims/cts/RcsProviderPermissionsTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+package android.telephony.ims.cts;
+
+import static android.provider.Telephony.RcsColumns.IS_RCS_TABLE_SCHEMA_CODE_COMPLETE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.ContentProviderClient;
+import android.content.Context;
+import android.provider.Telephony;
+
+import androidx.test.InstrumentationRegistry;
+
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class RcsProviderPermissionsTest {
+    @BeforeClass
+    public static void ensureDefaultSmsApp() {
+        DefaultSmsAppHelper.ensureDefaultSmsApp();
+    }
+
+    @Before
+    public void setupTestEnvironment() {
+        // Used to skip tests for production builds without RCS tables, will be removed when
+        // IS_RCS_TABLE_SCHEMA_CODE_COMPLETE flag is removed.
+        Assume.assumeTrue(IS_RCS_TABLE_SCHEMA_CODE_COMPLETE);
+    }
+
+    @Test
+    public void testRcsProvider_shouldNotHaveAccess() {
+        Context context = InstrumentationRegistry.getTargetContext();
+
+        try (ContentProviderClient client =
+                     context.getContentResolver().acquireContentProviderClient(
+                             Telephony.RcsColumns.AUTHORITY)) {
+            assertThat(client).isNull();
+        } catch (SecurityException e) {
+            return;
+        }
+        Assert.fail();
+    }
+}
diff --git a/tests/tests/renderscript/libcoremathtestcpp/Android.bp b/tests/tests/renderscript/libcoremathtestcpp/Android.bp
new file mode 100644
index 0000000..98717ea
--- /dev/null
+++ b/tests/tests/renderscript/libcoremathtestcpp/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2013 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.
+
+//
+// This is the shared library included by the JNI test app.
+//
+
+cc_test_library {
+    name: "libcoremathtestcpp_jni",
+    srcs: ["CoreMathTestJni.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    sdk_version: "21",
+    stl: "c++_static",
+    include_dirs: [
+        "frameworks/rs/cpp",
+        "frameworks/rs",
+    ],
+    shared_libs: [
+        "liblog",
+        "libdl",
+    ],
+    static_libs: ["libRScpp_static"],
+}
diff --git a/tests/tests/renderscript/libcoremathtestcpp/Android.mk b/tests/tests/renderscript/libcoremathtestcpp/Android.mk
deleted file mode 100644
index 52e19a6..0000000
--- a/tests/tests/renderscript/libcoremathtestcpp/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2013 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.
-
-#
-# This is the shared library included by the JNI test app.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-LOCAL_MODULE := libcoremathtestcpp_jni
-LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := CoreMathTestJni.cpp
-
-LOCAL_CFLAGS := -Wall -Werror
-
-LOCAL_SDK_VERSION := 21
-LOCAL_NDK_STL_VARIANT := c++_static
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-LOCAL_C_INCLUDES += frameworks/rs/cpp
-LOCAL_C_INCLUDES += frameworks/rs
-
-LOCAL_LDFLAGS := -llog -ldl
-LOCAL_STATIC_LIBRARIES := libRScpp_static
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/AtomicTest.rs b/tests/tests/renderscript/src/android/renderscript/cts/AtomicTest.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/AtomicTest.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/AtomicTest.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/MatrixTest.rs b/tests/tests/renderscript/src/android/renderscript/cts/MatrixTest.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/MatrixTest.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/MatrixTest.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCtxDim.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestCtxDim.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestCtxDim.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/TestCtxDim.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/allocationCopy2DRange.rs b/tests/tests/renderscript/src/android/renderscript/cts/allocationCopy2DRange.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/allocationCopy2DRange.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/allocationCopy2DRange.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/allocation_resize.rs b/tests/tests/renderscript/src/android/renderscript/cts/allocation_resize.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/allocation_resize.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/allocation_resize.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/array_init.rs b/tests/tests/renderscript/src/android/renderscript/cts/array_init.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/array_init.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/array_init.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/clear_object.rs b/tests/tests/renderscript/src/android/renderscript/cts/clear_object.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/clear_object.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/clear_object.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/double.rs b/tests/tests/renderscript/src/android/renderscript/cts/double.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/double.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/double.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/doubleglobal.rs b/tests/tests/renderscript/src/android/renderscript/cts/doubleglobal.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/doubleglobal.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/doubleglobal.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/fe_all.rs b/tests/tests/renderscript/src/android/renderscript/cts/fe_all.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/fe_all.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/fe_all.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/float16_arithmetic.rs b/tests/tests/renderscript/src/android/renderscript/cts/float16_arithmetic.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/float16_arithmetic.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/float16_arithmetic.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/foreach.rs b/tests/tests/renderscript/src/android/renderscript/cts/foreach.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/foreach.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/foreach.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAbs.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAbs.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestAbs.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestAbs.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAbsRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAbsRelaxed.rs
deleted file mode 100644
index a94e531..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAbsRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestAbs.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAbsRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAbsRelaxed.rscript
new file mode 100644
index 0000000..d37a21a
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAbsRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestAbs.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcos.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcos.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcos.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcos.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcosRelaxed.rs
deleted file mode 100644
index 57773a4..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcosRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestAcos.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcosRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcosRelaxed.rscript
new file mode 100644
index 0000000..ce27dc3
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcosRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestAcos.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcosh.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcosh.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcosh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcosh.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcoshRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcoshRelaxed.rs
deleted file mode 100644
index 81a8fa3..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcoshRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestAcosh.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcoshRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcoshRelaxed.rscript
new file mode 100644
index 0000000..4c02e0c
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcoshRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestAcosh.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcospi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcospi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcospi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcospi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcospiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcospiRelaxed.rs
deleted file mode 100644
index abca2f6..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcospiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestAcospi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcospiRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcospiRelaxed.rscript
new file mode 100644
index 0000000..322bc17
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAcospiRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestAcospi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsin.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsin.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsin.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsin.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinRelaxed.rs
deleted file mode 100644
index da9bd4d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestAsin.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinRelaxed.rscript
new file mode 100644
index 0000000..42be8bd
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestAsin.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinh.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinh.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinh.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinhRelaxed.rs
deleted file mode 100644
index 5820faa..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestAsinh.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinhRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinhRelaxed.rscript
new file mode 100644
index 0000000..55077ff
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinhRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestAsinh.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinpi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinpi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinpiRelaxed.rs
deleted file mode 100644
index 5fa2d67..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestAsinpi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinpiRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinpiRelaxed.rscript
new file mode 100644
index 0000000..1c802d6
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAsinpiRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestAsinpi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2Relaxed.rs
deleted file mode 100644
index 564ba1e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestAtan2.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2Relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2Relaxed.rscript
new file mode 100644
index 0000000..9461bb5
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2Relaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestAtan2.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2pi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2pi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2pi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2pi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2piRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2piRelaxed.rs
deleted file mode 100644
index 9429a81..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2piRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestAtan2pi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2piRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2piRelaxed.rscript
new file mode 100644
index 0000000..cc6a0a4
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtan2piRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestAtan2pi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanRelaxed.rs
deleted file mode 100644
index d370e7f..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestAtan.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanRelaxed.rscript
new file mode 100644
index 0000000..126e83d
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestAtan.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanh.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanh.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanh.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanhRelaxed.rs
deleted file mode 100644
index 00960a9..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestAtanh.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanhRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanhRelaxed.rscript
new file mode 100644
index 0000000..15b1f9a
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanhRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestAtanh.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanpi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanpi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanpiRelaxed.rs
deleted file mode 100644
index 09d487c..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestAtanpi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanpiRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanpiRelaxed.rscript
new file mode 100644
index 0000000..938fcc5
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestAtanpiRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestAtanpi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCbrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCbrt.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestCbrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestCbrt.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCbrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCbrtRelaxed.rs
deleted file mode 100644
index 6a35bd8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCbrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestCbrt.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCbrtRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCbrtRelaxed.rscript
new file mode 100644
index 0000000..8455fac
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCbrtRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestCbrt.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCeil.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCeil.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestCeil.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestCeil.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCeilRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCeilRelaxed.rs
deleted file mode 100644
index 1ed24c76..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCeilRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestCeil.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCeilRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCeilRelaxed.rscript
new file mode 100644
index 0000000..891657e
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCeilRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestCeil.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClamp.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClamp.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestClamp.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestClamp.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClampRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClampRelaxed.rs
deleted file mode 100644
index 0117c74..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClampRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestClamp.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClampRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClampRelaxed.rscript
new file mode 100644
index 0000000..26aca2a
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClampRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestClamp.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClz.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClz.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestClz.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestClz.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClzRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClzRelaxed.rs
deleted file mode 100644
index febe4d4..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClzRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestClz.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClzRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClzRelaxed.rscript
new file mode 100644
index 0000000..be6e202
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestClzRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestClz.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestConvert.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestConvert.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestConvert.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestConvert.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestConvertRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestConvertRelaxed.rs
deleted file mode 100644
index 7229d5d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestConvertRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestConvert.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestConvertRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestConvertRelaxed.rscript
new file mode 100644
index 0000000..717e00b
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestConvertRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestConvert.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCopysign.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCopysign.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestCopysign.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestCopysign.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCopysignRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCopysignRelaxed.rs
deleted file mode 100644
index 872bcab..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCopysignRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestCopysign.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCopysignRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCopysignRelaxed.rscript
new file mode 100644
index 0000000..b5bf57a
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCopysignRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestCopysign.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCos.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCos.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestCos.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestCos.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCosRelaxed.rs
deleted file mode 100644
index a37ed10..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCosRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestCos.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCosRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCosRelaxed.rscript
new file mode 100644
index 0000000..4b34ea6
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCosRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestCos.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCosh.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCosh.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestCosh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestCosh.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCoshRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCoshRelaxed.rs
deleted file mode 100644
index 358062c..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCoshRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestCosh.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCoshRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCoshRelaxed.rscript
new file mode 100644
index 0000000..81fab3c
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCoshRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestCosh.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCospi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCospi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestCospi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestCospi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCospiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCospiRelaxed.rs
deleted file mode 100644
index d7281ba..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCospiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestCospi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCospiRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCospiRelaxed.rscript
new file mode 100644
index 0000000..007f877
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCospiRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestCospi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCross.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCross.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestCross.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestCross.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCrossRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCrossRelaxed.rs
deleted file mode 100644
index 06a685c..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCrossRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestCross.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCrossRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCrossRelaxed.rscript
new file mode 100644
index 0000000..6a29f38
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestCrossRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestCross.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDegrees.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDegrees.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestDegrees.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestDegrees.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDegreesRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDegreesRelaxed.rs
deleted file mode 100644
index 88cc208..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDegreesRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestDegrees.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDegreesRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDegreesRelaxed.rscript
new file mode 100644
index 0000000..de106d7
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDegreesRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestDegrees.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDistance.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDistance.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestDistance.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestDistance.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDistanceRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDistanceRelaxed.rs
deleted file mode 100644
index 0ad21fc..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDistanceRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestDistance.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDistanceRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDistanceRelaxed.rscript
new file mode 100644
index 0000000..db15144
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDistanceRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestDistance.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDot.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDot.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestDot.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestDot.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDotRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDotRelaxed.rs
deleted file mode 100644
index 50ce702..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDotRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestDot.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDotRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDotRelaxed.rscript
new file mode 100644
index 0000000..5781666
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestDotRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestDot.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErf.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErf.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestErf.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestErf.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfRelaxed.rs
deleted file mode 100644
index 17d87f0..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestErf.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfRelaxed.rscript
new file mode 100644
index 0000000..b9600b7
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestErf.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfc.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfc.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfc.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfc.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfcRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfcRelaxed.rs
deleted file mode 100644
index 19a65d9..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfcRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestErfc.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfcRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfcRelaxed.rscript
new file mode 100644
index 0000000..d6535e6
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestErfcRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestErfc.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp10.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp10.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp10.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp10.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp10Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp10Relaxed.rs
deleted file mode 100644
index d95f6a7..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp10Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestExp10.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp10Relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp10Relaxed.rscript
new file mode 100644
index 0000000..091850a
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp10Relaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestExp10.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp2.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp2.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp2.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp2.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp2Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp2Relaxed.rs
deleted file mode 100644
index 53dd864..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp2Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestExp2.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp2Relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp2Relaxed.rscript
new file mode 100644
index 0000000..0b6f3bc
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExp2Relaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestExp2.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpRelaxed.rs
deleted file mode 100644
index 0971e78..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestExp.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpRelaxed.rscript
new file mode 100644
index 0000000..5e4eae6
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestExp.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpm1.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpm1.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpm1.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpm1.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpm1Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpm1Relaxed.rs
deleted file mode 100644
index caf0f9d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpm1Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestExpm1.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpm1Relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpm1Relaxed.rscript
new file mode 100644
index 0000000..88d25ba
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestExpm1Relaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestExpm1.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFabs.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFabs.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestFabs.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestFabs.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFabsRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFabsRelaxed.rs
deleted file mode 100644
index 0069908..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFabsRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestFabs.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFabsRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFabsRelaxed.rscript
new file mode 100644
index 0000000..f49f4c6
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFabsRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestFabs.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastDistance.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastDistance.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastDistance.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastDistance.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastDistanceRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastDistanceRelaxed.rs
deleted file mode 100644
index 60b67d4..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastDistanceRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestFastDistance.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastDistanceRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastDistanceRelaxed.rscript
new file mode 100644
index 0000000..d1d2e27
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastDistanceRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestFastDistance.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastLength.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastLength.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastLength.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastLength.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastLengthRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastLengthRelaxed.rs
deleted file mode 100644
index a7b92f4..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastLengthRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestFastLength.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastLengthRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastLengthRelaxed.rscript
new file mode 100644
index 0000000..c82f4ab
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastLengthRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestFastLength.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastNormalize.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastNormalize.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastNormalize.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastNormalize.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastNormalizeRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastNormalizeRelaxed.rs
deleted file mode 100644
index 93f85a8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastNormalizeRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestFastNormalize.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastNormalizeRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastNormalizeRelaxed.rscript
new file mode 100644
index 0000000..90ea15f
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFastNormalizeRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestFastNormalize.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFdim.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFdim.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestFdim.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestFdim.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFdimRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFdimRelaxed.rs
deleted file mode 100644
index 22b63e9..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFdimRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestFdim.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFdimRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFdimRelaxed.rscript
new file mode 100644
index 0000000..058b411
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFdimRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestFdim.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFloor.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFloor.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestFloor.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestFloor.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFloorRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFloorRelaxed.rs
deleted file mode 100644
index 95f6bfb..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFloorRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestFloor.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFloorRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFloorRelaxed.rscript
new file mode 100644
index 0000000..a02a516
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFloorRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestFloor.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFma.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFma.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestFma.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestFma.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmaRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmaRelaxed.rs
deleted file mode 100644
index 879f4da..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmaRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestFma.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmaRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmaRelaxed.rscript
new file mode 100644
index 0000000..764d574
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmaRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestFma.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmax.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmax.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmax.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmax.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmaxRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmaxRelaxed.rs
deleted file mode 100644
index bf2d071..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmaxRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestFmax.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmaxRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmaxRelaxed.rscript
new file mode 100644
index 0000000..abeee01
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmaxRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestFmax.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmin.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmin.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmin.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmin.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFminRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFminRelaxed.rs
deleted file mode 100644
index 5bbd2cf..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFminRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestFmin.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFminRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFminRelaxed.rscript
new file mode 100644
index 0000000..f3772d0
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFminRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestFmin.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmod.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmod.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmod.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmod.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmodRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmodRelaxed.rs
deleted file mode 100644
index 21493a2..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmodRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestFmod.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmodRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmodRelaxed.rscript
new file mode 100644
index 0000000..8d2b79a
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFmodRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestFmod.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFract.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFract.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestFract.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestFract.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFractRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFractRelaxed.rs
deleted file mode 100644
index 344a263..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFractRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestFract.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFractRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFractRelaxed.rscript
new file mode 100644
index 0000000..a2932c5
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFractRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestFract.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFrexp.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFrexp.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestFrexp.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestFrexp.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFrexpRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFrexpRelaxed.rs
deleted file mode 100644
index d2fce54..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFrexpRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestFrexp.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFrexpRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFrexpRelaxed.rscript
new file mode 100644
index 0000000..95090d3
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFrexpRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestFrexp.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRecip.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRecip.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRecip.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRecip.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRecipRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRecipRelaxed.rs
deleted file mode 100644
index 7dc0a9b..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRecipRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestHalfRecip.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRecipRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRecipRelaxed.rscript
new file mode 100644
index 0000000..afd8282
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRecipRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestHalfRecip.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRsqrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRsqrt.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRsqrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRsqrt.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRsqrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRsqrtRelaxed.rs
deleted file mode 100644
index 7a3aaaf..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRsqrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestHalfRsqrt.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRsqrtRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRsqrtRelaxed.rscript
new file mode 100644
index 0000000..460fa05
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfRsqrtRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestHalfRsqrt.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfSqrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfSqrt.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfSqrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfSqrt.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfSqrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfSqrtRelaxed.rs
deleted file mode 100644
index 7d4827a..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfSqrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestHalfSqrt.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfSqrtRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfSqrtRelaxed.rscript
new file mode 100644
index 0000000..a0d3986
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHalfSqrtRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestHalfSqrt.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHypot.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHypot.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestHypot.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestHypot.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHypotRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHypotRelaxed.rs
deleted file mode 100644
index 39d142a..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHypotRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestHypot.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHypotRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHypotRelaxed.rscript
new file mode 100644
index 0000000..6bb4680
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestHypotRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestHypot.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestIlogb.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestIlogb.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestIlogb.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestIlogb.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestIlogbRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestIlogbRelaxed.rs
deleted file mode 100644
index 0545c3a..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestIlogbRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestIlogb.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestIlogbRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestIlogbRelaxed.rscript
new file mode 100644
index 0000000..e6d131a
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestIlogbRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestIlogb.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLdexp.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLdexp.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestLdexp.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestLdexp.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLdexpRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLdexpRelaxed.rs
deleted file mode 100644
index 66bb775..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLdexpRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestLdexp.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLdexpRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLdexpRelaxed.rscript
new file mode 100644
index 0000000..f02599e
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLdexpRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestLdexp.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLength.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLength.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestLength.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestLength.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLengthRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLengthRelaxed.rs
deleted file mode 100644
index c75aed9..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLengthRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestLength.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLengthRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLengthRelaxed.rscript
new file mode 100644
index 0000000..32cf679
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLengthRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestLength.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLgamma.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLgamma.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestLgamma.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestLgamma.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLgammaRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLgammaRelaxed.rs
deleted file mode 100644
index 2d5a155..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLgammaRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestLgamma.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLgammaRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLgammaRelaxed.rscript
new file mode 100644
index 0000000..071ea4d
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLgammaRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestLgamma.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog10.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog10.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog10.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog10.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog10Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog10Relaxed.rs
deleted file mode 100644
index 48a2d4e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog10Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestLog10.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog10Relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog10Relaxed.rscript
new file mode 100644
index 0000000..95b808f
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog10Relaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestLog10.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog1p.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog1p.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog1p.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog1p.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog1pRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog1pRelaxed.rs
deleted file mode 100644
index 99685fc..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog1pRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestLog1p.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog1pRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog1pRelaxed.rscript
new file mode 100644
index 0000000..b4873bb
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog1pRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestLog1p.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog2.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog2.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog2.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog2.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog2Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog2Relaxed.rs
deleted file mode 100644
index 4ef603e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog2Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestLog2.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog2Relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog2Relaxed.rscript
new file mode 100644
index 0000000..1ade306
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLog2Relaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestLog2.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogRelaxed.rs
deleted file mode 100644
index 4cfbfcb..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestLog.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogRelaxed.rscript
new file mode 100644
index 0000000..3e9a399
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestLog.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogb.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogb.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogb.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogb.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogbRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogbRelaxed.rs
deleted file mode 100644
index 0318d40..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogbRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestLogb.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogbRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogbRelaxed.rscript
new file mode 100644
index 0000000..a36a0bc
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestLogbRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestLogb.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMad.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMad.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestMad.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestMad.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMadRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMadRelaxed.rs
deleted file mode 100644
index f157e6e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMadRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestMad.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMadRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMadRelaxed.rscript
new file mode 100644
index 0000000..d3e104f
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMadRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestMad.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMax.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMax.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestMax.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestMax.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMaxRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMaxRelaxed.rs
deleted file mode 100644
index 1f37a5e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMaxRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestMax.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMaxRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMaxRelaxed.rscript
new file mode 100644
index 0000000..1360d08
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMaxRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestMax.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMin.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMin.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestMin.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestMin.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMinRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMinRelaxed.rs
deleted file mode 100644
index 2a047af..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMinRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestMin.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMinRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMinRelaxed.rscript
new file mode 100644
index 0000000..0eee5ba
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMinRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestMin.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMix.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMix.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestMix.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestMix.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMixRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMixRelaxed.rs
deleted file mode 100644
index 639dd50..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMixRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestMix.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMixRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMixRelaxed.rscript
new file mode 100644
index 0000000..ed5516a
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestMixRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestMix.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestModf.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestModf.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestModf.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestModf.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestModfRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestModfRelaxed.rs
deleted file mode 100644
index 3d73523..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestModfRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestModf.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestModfRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestModfRelaxed.rscript
new file mode 100644
index 0000000..5e5eea1
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestModfRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestModf.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNan.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNan.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNan.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNan.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanHalf.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanHalf.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanHalf.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanHalf.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanHalfRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanHalfRelaxed.rs
deleted file mode 100644
index 619400c..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanHalfRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNanHalf.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanHalfRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanHalfRelaxed.rscript
new file mode 100644
index 0000000..0e6db3d
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanHalfRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNanHalf.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanRelaxed.rs
deleted file mode 100644
index e9970af..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNan.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanRelaxed.rscript
new file mode 100644
index 0000000..590dda3
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNanRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNan.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcos.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcos.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcos.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcos.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcosRelaxed.rs
deleted file mode 100644
index 9b857c8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcosRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeAcos.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcosRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcosRelaxed.rscript
new file mode 100644
index 0000000..07efc25
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcosRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeAcos.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcosh.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcosh.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcosh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcosh.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcoshRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcoshRelaxed.rs
deleted file mode 100644
index 3750a6e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcoshRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeAcosh.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcoshRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcoshRelaxed.rscript
new file mode 100644
index 0000000..757fb1b
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcoshRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeAcosh.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcospi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcospi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcospi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcospi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcospiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcospiRelaxed.rs
deleted file mode 100644
index 5e900e9..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcospiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeAcospi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcospiRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcospiRelaxed.rscript
new file mode 100644
index 0000000..46ec338
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAcospiRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeAcospi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsin.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsin.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsin.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsin.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinRelaxed.rs
deleted file mode 100644
index 76527d8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeAsin.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinRelaxed.rscript
new file mode 100644
index 0000000..d0fe687
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeAsin.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinh.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinh.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinh.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinhRelaxed.rs
deleted file mode 100644
index 9e4df93..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeAsinh.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinhRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinhRelaxed.rscript
new file mode 100644
index 0000000..bc01658
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinhRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeAsinh.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinpi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinpi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinpiRelaxed.rs
deleted file mode 100644
index f1ad731..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeAsinpi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinpiRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinpiRelaxed.rscript
new file mode 100644
index 0000000..e61fbd6
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAsinpiRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeAsinpi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2Relaxed.rs
deleted file mode 100644
index 9ec609d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeAtan2.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2Relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2Relaxed.rscript
new file mode 100644
index 0000000..3f4c67d
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2Relaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeAtan2.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2pi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2pi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2pi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2pi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2piRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2piRelaxed.rs
deleted file mode 100644
index e5773b1..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2piRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeAtan2pi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2piRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2piRelaxed.rscript
new file mode 100644
index 0000000..bc2279f
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtan2piRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeAtan2pi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanRelaxed.rs
deleted file mode 100644
index c4a0fad..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeAtan.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanRelaxed.rscript
new file mode 100644
index 0000000..7218f72
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeAtan.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanh.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanh.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanh.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanhRelaxed.rs
deleted file mode 100644
index c5384fc..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeAtanh.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanhRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanhRelaxed.rscript
new file mode 100644
index 0000000..4e05950
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanhRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeAtanh.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanpi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanpi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanpiRelaxed.rs
deleted file mode 100644
index 66169ee..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeAtanpi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanpiRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanpiRelaxed.rscript
new file mode 100644
index 0000000..2719db1
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeAtanpiRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeAtanpi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCbrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCbrt.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCbrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCbrt.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCbrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCbrtRelaxed.rs
deleted file mode 100644
index 522c6a5..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCbrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeCbrt.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCbrtRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCbrtRelaxed.rscript
new file mode 100644
index 0000000..87b9c77
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCbrtRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeCbrt.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCos.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCos.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCos.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCos.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCosRelaxed.rs
deleted file mode 100644
index 3ab21d9..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCosRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeCos.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCosRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCosRelaxed.rscript
new file mode 100644
index 0000000..b04c067
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCosRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeCos.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCosh.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCosh.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCosh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCosh.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCoshRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCoshRelaxed.rs
deleted file mode 100644
index e549630..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCoshRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeCosh.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCoshRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCoshRelaxed.rscript
new file mode 100644
index 0000000..def42ea
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCoshRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeCosh.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCospi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCospi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCospi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCospi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCospiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCospiRelaxed.rs
deleted file mode 100644
index a37ecea..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCospiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeCospi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCospiRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCospiRelaxed.rscript
new file mode 100644
index 0000000..8225b32
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeCospiRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeCospi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDistance.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDistance.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDistance.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDistance.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDistanceRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDistanceRelaxed.rs
deleted file mode 100644
index 0d2770b..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDistanceRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeDistance.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDistanceRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDistanceRelaxed.rscript
new file mode 100644
index 0000000..342c130
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDistanceRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeDistance.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDivide.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDivide.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDivide.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDivide.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDivideRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDivideRelaxed.rs
deleted file mode 100644
index 32ae7c6..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDivideRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeDivide.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDivideRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDivideRelaxed.rscript
new file mode 100644
index 0000000..64d27b1
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeDivideRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeDivide.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp10.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp10.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp10.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp10.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp10Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp10Relaxed.rs
deleted file mode 100644
index 4883cdf..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp10Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeExp10.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp10Relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp10Relaxed.rscript
new file mode 100644
index 0000000..48afe6e
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp10Relaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeExp10.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp2.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp2.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp2.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp2.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp2Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp2Relaxed.rs
deleted file mode 100644
index 2fd51e6..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp2Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeExp2.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp2Relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp2Relaxed.rscript
new file mode 100644
index 0000000..194c2c7
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExp2Relaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeExp2.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpRelaxed.rs
deleted file mode 100644
index 1200321..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeExp.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpRelaxed.rscript
new file mode 100644
index 0000000..f6a35a9
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeExp.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpm1.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpm1.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpm1.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpm1.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpm1Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpm1Relaxed.rs
deleted file mode 100644
index 4e1ca7c..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpm1Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeExpm1.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpm1Relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpm1Relaxed.rscript
new file mode 100644
index 0000000..e357267
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeExpm1Relaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeExpm1.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeHypot.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeHypot.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeHypot.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeHypot.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeHypotRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeHypotRelaxed.rs
deleted file mode 100644
index 53718a9..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeHypotRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeHypot.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeHypotRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeHypotRelaxed.rscript
new file mode 100644
index 0000000..9da2a45
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeHypotRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeHypot.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLength.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLength.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLength.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLength.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLengthRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLengthRelaxed.rs
deleted file mode 100644
index 0f41162..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLengthRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeLength.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLengthRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLengthRelaxed.rscript
new file mode 100644
index 0000000..e584f18
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLengthRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeLength.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog10.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog10.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog10.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog10.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog10Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog10Relaxed.rs
deleted file mode 100644
index 94a47e1..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog10Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeLog10.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog10Relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog10Relaxed.rscript
new file mode 100644
index 0000000..ba03f3a
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog10Relaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeLog10.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog1p.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog1p.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog1p.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog1p.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog1pRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog1pRelaxed.rs
deleted file mode 100644
index c523f6f..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog1pRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeLog1p.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog1pRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog1pRelaxed.rscript
new file mode 100644
index 0000000..475088b
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog1pRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeLog1p.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog2.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog2.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog2.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog2.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog2Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog2Relaxed.rs
deleted file mode 100644
index e2134e5..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog2Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeLog2.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog2Relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog2Relaxed.rscript
new file mode 100644
index 0000000..d4107aa
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLog2Relaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeLog2.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLogRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLogRelaxed.rs
deleted file mode 100644
index 6f5bfa1..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLogRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeLog.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLogRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLogRelaxed.rscript
new file mode 100644
index 0000000..e00d50e
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeLogRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeLog.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeNormalize.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeNormalize.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeNormalize.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeNormalize.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeNormalizeRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeNormalizeRelaxed.rs
deleted file mode 100644
index 7b84267..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeNormalizeRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeNormalize.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeNormalizeRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeNormalizeRelaxed.rscript
new file mode 100644
index 0000000..d964dbf
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeNormalizeRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeNormalize.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativePowr.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativePowr.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativePowr.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativePowr.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativePowrRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativePowrRelaxed.rs
deleted file mode 100644
index 1ddce4e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativePowrRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativePowr.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativePowrRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativePowrRelaxed.rscript
new file mode 100644
index 0000000..fd4b22e
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativePowrRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativePowr.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRecip.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRecip.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRecip.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRecip.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRecipRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRecipRelaxed.rs
deleted file mode 100644
index 9ea5ea8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRecipRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeRecip.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRecipRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRecipRelaxed.rscript
new file mode 100644
index 0000000..54b9847
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRecipRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeRecip.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRootn.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRootn.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRootn.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRootn.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRootnRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRootnRelaxed.rs
deleted file mode 100644
index d5a0f1f..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRootnRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeRootn.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRootnRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRootnRelaxed.rscript
new file mode 100644
index 0000000..949df21
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRootnRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeRootn.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRsqrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRsqrt.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRsqrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRsqrt.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRsqrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRsqrtRelaxed.rs
deleted file mode 100644
index a832c1c..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRsqrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeRsqrt.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRsqrtRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRsqrtRelaxed.rscript
new file mode 100644
index 0000000..9af886d
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeRsqrtRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeRsqrt.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSin.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSin.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSin.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSin.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinRelaxed.rs
deleted file mode 100644
index 570618f..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeSin.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinRelaxed.rscript
new file mode 100644
index 0000000..7c15005
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeSin.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSincos.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSincos.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSincos.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSincos.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSincosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSincosRelaxed.rs
deleted file mode 100644
index 8b7baa1..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSincosRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeSincos.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSincosRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSincosRelaxed.rscript
new file mode 100644
index 0000000..6453dcb
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSincosRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeSincos.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinh.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinh.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinh.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinhRelaxed.rs
deleted file mode 100644
index 2de990c..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeSinh.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinhRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinhRelaxed.rscript
new file mode 100644
index 0000000..285f134
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinhRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeSinh.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinpi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinpi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinpiRelaxed.rs
deleted file mode 100644
index 9becf5f..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeSinpi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinpiRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinpiRelaxed.rscript
new file mode 100644
index 0000000..6410953
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSinpiRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeSinpi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSqrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSqrt.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSqrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSqrt.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSqrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSqrtRelaxed.rs
deleted file mode 100644
index 9ec1ae1..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSqrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeSqrt.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSqrtRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSqrtRelaxed.rscript
new file mode 100644
index 0000000..45af662
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeSqrtRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeSqrt.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTan.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTan.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTan.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanRelaxed.rs
deleted file mode 100644
index dac15e0..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeTan.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanRelaxed.rscript
new file mode 100644
index 0000000..e307953
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeTan.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanh.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanh.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanh.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanhRelaxed.rs
deleted file mode 100644
index ded8d31..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeTanh.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanhRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanhRelaxed.rscript
new file mode 100644
index 0000000..209f61a
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanhRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeTanh.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanpi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanpi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanpiRelaxed.rs
deleted file mode 100644
index 206ad88..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNativeTanpi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanpiRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanpiRelaxed.rscript
new file mode 100644
index 0000000..a3499a2
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNativeTanpiRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNativeTanpi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNextafter.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNextafter.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNextafter.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNextafter.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNextafterRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNextafterRelaxed.rs
deleted file mode 100644
index 59b48c8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNextafterRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNextafter.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNextafterRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNextafterRelaxed.rscript
new file mode 100644
index 0000000..aad6a18
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNextafterRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNextafter.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNormalize.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNormalize.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestNormalize.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestNormalize.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNormalizeRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNormalizeRelaxed.rs
deleted file mode 100644
index e1d6a16..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNormalizeRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestNormalize.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNormalizeRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNormalizeRelaxed.rscript
new file mode 100644
index 0000000..55b4d90
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestNormalizeRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestNormalize.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPow.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPow.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestPow.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestPow.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowRelaxed.rs
deleted file mode 100644
index f00f3f4..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestPow.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowRelaxed.rscript
new file mode 100644
index 0000000..df13192
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestPow.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPown.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPown.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestPown.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestPown.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPownRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPownRelaxed.rs
deleted file mode 100644
index 21607e8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPownRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestPown.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPownRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPownRelaxed.rscript
new file mode 100644
index 0000000..204c55e
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPownRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestPown.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowr.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowr.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowr.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowr.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowrRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowrRelaxed.rs
deleted file mode 100644
index 9af7c33..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowrRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestPowr.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowrRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowrRelaxed.rscript
new file mode 100644
index 0000000..3200172
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestPowrRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestPowr.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRadians.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRadians.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestRadians.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestRadians.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRadiansRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRadiansRelaxed.rs
deleted file mode 100644
index ae5a805..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRadiansRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestRadians.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRadiansRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRadiansRelaxed.rscript
new file mode 100644
index 0000000..419da17
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRadiansRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestRadians.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemainder.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemainder.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemainder.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemainder.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemainderRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemainderRelaxed.rs
deleted file mode 100644
index f93e980..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemainderRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestRemainder.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemainderRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemainderRelaxed.rscript
new file mode 100644
index 0000000..9ca694a
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemainderRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestRemainder.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemquo.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemquo.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemquo.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemquo.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemquoRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemquoRelaxed.rs
deleted file mode 100644
index e9aa584..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemquoRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestRemquo.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemquoRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemquoRelaxed.rscript
new file mode 100644
index 0000000..a1f30e0
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRemquoRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestRemquo.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRint.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRint.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestRint.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestRint.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRintRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRintRelaxed.rs
deleted file mode 100644
index bfacdea..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRintRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestRint.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRintRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRintRelaxed.rscript
new file mode 100644
index 0000000..d1011b2
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRintRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestRint.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRootn.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRootn.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestRootn.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestRootn.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRootnRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRootnRelaxed.rs
deleted file mode 100644
index 9141954..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRootnRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestRootn.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRootnRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRootnRelaxed.rscript
new file mode 100644
index 0000000..d9e73a6
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRootnRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestRootn.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRound.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRound.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestRound.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestRound.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRoundRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRoundRelaxed.rs
deleted file mode 100644
index dd53e55..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRoundRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestRound.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRoundRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRoundRelaxed.rscript
new file mode 100644
index 0000000..470da59
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRoundRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestRound.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRsqrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRsqrt.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestRsqrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestRsqrt.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRsqrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRsqrtRelaxed.rs
deleted file mode 100644
index 4e5c063..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRsqrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestRsqrt.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRsqrtRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRsqrtRelaxed.rscript
new file mode 100644
index 0000000..bae4726
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestRsqrtRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestRsqrt.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSign.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSign.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestSign.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestSign.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSignRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSignRelaxed.rs
deleted file mode 100644
index da1b77d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSignRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestSign.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSignRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSignRelaxed.rscript
new file mode 100644
index 0000000..9b4d595
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSignRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestSign.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSin.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSin.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestSin.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestSin.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinRelaxed.rs
deleted file mode 100644
index c8ae2c2..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestSin.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinRelaxed.rscript
new file mode 100644
index 0000000..0acb7dd
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestSin.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSincos.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSincos.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestSincos.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestSincos.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSincosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSincosRelaxed.rs
deleted file mode 100644
index 8a90dea..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSincosRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestSincos.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSincosRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSincosRelaxed.rscript
new file mode 100644
index 0000000..413d0b1
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSincosRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestSincos.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinh.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinh.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinh.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinhRelaxed.rs
deleted file mode 100644
index e85bda0..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestSinh.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinhRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinhRelaxed.rscript
new file mode 100644
index 0000000..c85df8e
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinhRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestSinh.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinpi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinpi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinpiRelaxed.rs
deleted file mode 100644
index 11b6f58..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestSinpi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinpiRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinpiRelaxed.rscript
new file mode 100644
index 0000000..cf4af62
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSinpiRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestSinpi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSqrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSqrt.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestSqrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestSqrt.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSqrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSqrtRelaxed.rs
deleted file mode 100644
index 63ac6d3..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSqrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestSqrt.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSqrtRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSqrtRelaxed.rscript
new file mode 100644
index 0000000..bc3cd9e
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestSqrtRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestSqrt.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestStep.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestStep.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestStep.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestStep.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestStepRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestStepRelaxed.rs
deleted file mode 100644
index 0033811..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestStepRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestStep.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestStepRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestStepRelaxed.rscript
new file mode 100644
index 0000000..5544496
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestStepRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestStep.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTan.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestTan.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestTan.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanRelaxed.rs
deleted file mode 100644
index 3d10116..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestTan.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanRelaxed.rscript
new file mode 100644
index 0000000..75b9618
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestTan.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanh.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanh.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanh.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanhRelaxed.rs
deleted file mode 100644
index ad5676e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestTanh.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanhRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanhRelaxed.rscript
new file mode 100644
index 0000000..366e0bf
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanhRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestTanh.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanpi.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanpi.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanpiRelaxed.rs
deleted file mode 100644
index c1484bb..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestTanpi.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanpiRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanpiRelaxed.rscript
new file mode 100644
index 0000000..fbf4499
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTanpiRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestTanpi.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTgamma.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTgamma.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestTgamma.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestTgamma.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTgammaRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTgammaRelaxed.rs
deleted file mode 100644
index 911d7fc..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTgammaRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestTgamma.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTgammaRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTgammaRelaxed.rscript
new file mode 100644
index 0000000..2119b59
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTgammaRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestTgamma.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTrunc.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTrunc.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/generated/TestTrunc.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/generated/TestTrunc.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTruncRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTruncRelaxed.rs
deleted file mode 100644
index 7105b22..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTruncRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
-
-#include "TestTrunc.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTruncRelaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTruncRelaxed.rscript
new file mode 100644
index 0000000..15d2d6e
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/generated/TestTruncRelaxed.rscript
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
+
+#include "TestTrunc.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/get_allocation.rs b/tests/tests/renderscript/src/android/renderscript/cts/get_allocation.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/get_allocation.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/get_allocation.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/get_element_at_x.rs b/tests/tests/renderscript/src/android/renderscript/cts/get_element_at_x.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/get_element_at_x.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/get_element_at_x.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/get_element_at_x_y.rs b/tests/tests/renderscript/src/android/renderscript/cts/get_element_at_x_y.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/get_element_at_x_y.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/get_element_at_x_y.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/getset.rs b/tests/tests/renderscript/src/android/renderscript/cts/getset.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/getset.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/getset.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/getset_relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/getset_relaxed.rs
deleted file mode 100644
index 6b62faf..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/getset_relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
- /*
- * Copyright (C) 2014 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.
- */
-
-#pragma rs_fp_relaxed
-
-#include "getset.rs"
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/getset_relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/getset_relaxed.rscript
new file mode 100644
index 0000000..5b3724b
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/getset_relaxed.rscript
@@ -0,0 +1,20 @@
+ /*
+ * Copyright (C) 2014 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.
+ */
+
+#pragma rs_fp_relaxed
+
+#include "getset.rscript"
+
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/global_sync.rs b/tests/tests/renderscript/src/android/renderscript/cts/global_sync.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/global_sync.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/global_sync.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/group1.rs b/tests/tests/renderscript/src/android/renderscript/cts/group1.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/group1.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/group1.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/group2.rs b/tests/tests/renderscript/src/android/renderscript/cts/group2.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/group2.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/group2.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/increment.rs b/tests/tests/renderscript/src/android/renderscript/cts/increment.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/increment.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/increment.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/init_test.rs b/tests/tests/renderscript/src/android/renderscript/cts/init_test.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/init_test.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/init_test.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/instance.rs b/tests/tests/renderscript/src/android/renderscript/cts/instance.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/instance.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/instance.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_3dlut.rs b/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_3dlut.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/intrinsic_3dlut.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/intrinsic_3dlut.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_blur.rs b/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_blur.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/intrinsic_blur.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/intrinsic_blur.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_colormatrix.rs b/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_colormatrix.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/intrinsic_colormatrix.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/intrinsic_colormatrix.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_convolve3x3.rs b/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_convolve3x3.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/intrinsic_convolve3x3.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/intrinsic_convolve3x3.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_convolve5x5.rs b/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_convolve5x5.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/intrinsic_convolve5x5.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/intrinsic_convolve5x5.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_lut.rs b/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_lut.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/intrinsic_lut.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/intrinsic_lut.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_resize.rs b/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_resize.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/intrinsic_resize.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/intrinsic_resize.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/is_object.rs b/tests/tests/renderscript/src/android/renderscript/cts/is_object.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/is_object.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/is_object.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/kernel_all.rs b/tests/tests/renderscript/src/android/renderscript/cts/kernel_all.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/kernel_all.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/kernel_all.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/kernel_input.rs b/tests/tests/renderscript/src/android/renderscript/cts/kernel_input.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/kernel_input.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/kernel_input.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/large_global.rs b/tests/tests/renderscript/src/android/renderscript/cts/large_global.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/large_global.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/large_global.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/launchclip.rs b/tests/tests/renderscript/src/android/renderscript/cts/launchclip.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/launchclip.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/launchclip.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/matrix.rs b/tests/tests/renderscript/src/android/renderscript/cts/matrix.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/matrix.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/matrix.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/missing_link.rs b/tests/tests/renderscript/src/android/renderscript/cts/missing_link.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/missing_link.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/missing_link.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/negate.rs b/tests/tests/renderscript/src/android/renderscript/cts/negate.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/negate.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/negate.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/noroot.rs b/tests/tests/renderscript/src/android/renderscript/cts/noroot.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/noroot.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/noroot.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/oob.rs b/tests/tests/renderscript/src/android/renderscript/cts/oob.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/oob.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/oob.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/passthrough.rs b/tests/tests/renderscript/src/android/renderscript/cts/passthrough.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/passthrough.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/passthrough.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/primitives.rs b/tests/tests/renderscript/src/android/renderscript/cts/primitives.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/primitives.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/primitives.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/reduce.rs b/tests/tests/renderscript/src/android/renderscript/cts/reduce.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/reduce.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/reduce.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/reduction.rs b/tests/tests/renderscript/src/android/renderscript/cts/reduction.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/reduction.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/reduction.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/refocus/layered_filter_fast_d1new.rs b/tests/tests/renderscript/src/android/renderscript/cts/refocus/layered_filter_fast_d1new.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/refocus/layered_filter_fast_d1new.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/refocus/layered_filter_fast_d1new.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/refocus/layered_filter_fast_f32.rs b/tests/tests/renderscript/src/android/renderscript/cts/refocus/layered_filter_fast_f32.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/refocus/layered_filter_fast_f32.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/refocus/layered_filter_fast_f32.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/rs_frac_f32.rs b/tests/tests/renderscript/src/android/renderscript/cts/rs_frac_f32.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/rs_frac_f32.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/rs_frac_f32.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/rs_frac_f32_relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/rs_frac_f32_relaxed.rs
deleted file mode 100644
index d93b8e2..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/rs_frac_f32_relaxed.rs
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "rs_frac_f32.rs"
-#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/rs_frac_f32_relaxed.rscript b/tests/tests/renderscript/src/android/renderscript/cts/rs_frac_f32_relaxed.rscript
new file mode 100644
index 0000000..1002fcd
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/rs_frac_f32_relaxed.rscript
@@ -0,0 +1,2 @@
+#include "rs_frac_f32.rscript"
+#pragma rs_fp_relaxed
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/rs_pack_color_to_8888.rs b/tests/tests/renderscript/src/android/renderscript/cts/rs_pack_color_to_8888.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/rs_pack_color_to_8888.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/rs_pack_color_to_8888.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/rs_unpack_color_8888.rs b/tests/tests/renderscript/src/android/renderscript/cts/rs_unpack_color_8888.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/rs_unpack_color_8888.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/rs_unpack_color_8888.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/rsallocationcopy.rs b/tests/tests/renderscript/src/android/renderscript/cts/rsallocationcopy.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/rsallocationcopy.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/rsallocationcopy.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/sample.rs b/tests/tests/renderscript/src/android/renderscript/cts/sample.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/sample.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/sample.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/scriptgroup.rs b/tests/tests/renderscript/src/android/renderscript/cts/scriptgroup.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/scriptgroup.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/scriptgroup.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/sendToClientBlocking.rs b/tests/tests/renderscript/src/android/renderscript/cts/sendToClientBlocking.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/sendToClientBlocking.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/sendToClientBlocking.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/send_to_client.rs b/tests/tests/renderscript/src/android/renderscript/cts/send_to_client.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/send_to_client.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/send_to_client.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/send_to_client_1.rs b/tests/tests/renderscript/src/android/renderscript/cts/send_to_client_1.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/send_to_client_1.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/send_to_client_1.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/set_object.rs b/tests/tests/renderscript/src/android/renderscript/cts/set_object.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/set_object.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/set_object.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/setelementat.rs b/tests/tests/renderscript/src/android/renderscript/cts/setelementat.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/setelementat.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/setelementat.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/single_source_alloc.rs b/tests/tests/renderscript/src/android/renderscript/cts/single_source_alloc.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/single_source_alloc.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/single_source_alloc.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/single_source_script.rs b/tests/tests/renderscript/src/android/renderscript/cts/single_source_script.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/single_source_script.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/single_source_script.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/small_structs.rs b/tests/tests/renderscript/src/android/renderscript/cts/small_structs.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/small_structs.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/small_structs.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/struct_array.rs b/tests/tests/renderscript/src/android/renderscript/cts/struct_array.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/struct_array.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/struct_array.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/struct_field.rs b/tests/tests/renderscript/src/android/renderscript/cts/struct_field.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/struct_field.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/struct_field.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/struct_object.rs b/tests/tests/renderscript/src/android/renderscript/cts/struct_object.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/struct_object.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/struct_object.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/struct_pad.rs b/tests/tests/renderscript/src/android/renderscript/cts/struct_pad.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/struct_pad.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/struct_pad.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/utils.rs b/tests/tests/renderscript/src/android/renderscript/cts/utils.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/utils.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/utils.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/vector.rs b/tests/tests/renderscript/src/android/renderscript/cts/vector.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/vector.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/vector.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/verify.rs b/tests/tests/renderscript/src/android/renderscript/cts/verify.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/verify.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/verify.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/vload.rs b/tests/tests/renderscript/src/android/renderscript/cts/vload.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/vload.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/vload.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/vload_relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/vload_relaxed.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/vload_relaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/vload_relaxed.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/void_ptr.rs b/tests/tests/renderscript/src/android/renderscript/cts/void_ptr.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/void_ptr.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/void_ptr.rscript
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/yuv.rs b/tests/tests/renderscript/src/android/renderscript/cts/yuv.rscript
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/yuv.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/yuv.rscript
diff --git a/tests/tests/rsblas/libbnnmdata/Android.bp b/tests/tests/rsblas/libbnnmdata/Android.bp
new file mode 100644
index 0000000..ec6a524
--- /dev/null
+++ b/tests/tests/rsblas/libbnnmdata/Android.bp
@@ -0,0 +1,25 @@
+// Copyright (C) 2015 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.
+
+cc_library_shared {
+    name: "libbnnmdata_jni",
+    srcs: ["test_data.cpp"],
+    sdk_version: "23",
+    stl: "c++_static",
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-const-variable",
+    ],
+}
diff --git a/tests/tests/rsblas/libbnnmdata/Android.mk b/tests/tests/rsblas/libbnnmdata/Android.mk
deleted file mode 100644
index 6a5e542..0000000
--- a/tests/tests/rsblas/libbnnmdata/Android.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_MODULE := libbnnmdata_jni
-LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := test_data.cpp
-LOCAL_SDK_VERSION := 23
-LOCAL_NDK_STL_VARIANT := c++_static
-
-LOCAL_CFLAGS := -Wall -Werror -Wno-unused-const-variable
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/rsblas/src/android/renderscript/cts/verify.rs b/tests/tests/rsblas/src/android/renderscript/cts/verify.rscript
similarity index 100%
rename from tests/tests/rsblas/src/android/renderscript/cts/verify.rs
rename to tests/tests/rsblas/src/android/renderscript/cts/verify.rscript
diff --git a/tests/tests/rscpp/librscpptest/Android.mk b/tests/tests/rscpp/librscpptest/Android.mk
index 8ac550b..0084d82 100644
--- a/tests/tests/rscpp/librscpptest/Android.mk
+++ b/tests/tests/rscpp/librscpptest/Android.mk
@@ -31,14 +31,14 @@
     rs_jni_object.cpp
 
 LOCAL_SRC_FILES += \
-    setelementat.rs \
-    primitives.rs \
-    instance.rs \
-    clear_object.rs \
-    foreach.rs \
-    fe_all.rs \
-    noroot.rs \
-    vector.rs
+    setelementat.rscript \
+    primitives.rscript \
+    instance.rscript \
+    clear_object.rscript \
+    foreach.rscript \
+    fe_all.rscript \
+    noroot.rscript \
+    vector.rscript
 
 LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
 LOCAL_C_INCLUDES += frameworks/rs/cpp
diff --git a/tests/tests/rscpp/librscpptest/clear_object.rs b/tests/tests/rscpp/librscpptest/clear_object.rscript
similarity index 100%
rename from tests/tests/rscpp/librscpptest/clear_object.rs
rename to tests/tests/rscpp/librscpptest/clear_object.rscript
diff --git a/tests/tests/rscpp/librscpptest/fe_all.rs b/tests/tests/rscpp/librscpptest/fe_all.rscript
similarity index 100%
rename from tests/tests/rscpp/librscpptest/fe_all.rs
rename to tests/tests/rscpp/librscpptest/fe_all.rscript
diff --git a/tests/tests/rscpp/librscpptest/foreach.rs b/tests/tests/rscpp/librscpptest/foreach.rscript
similarity index 100%
rename from tests/tests/rscpp/librscpptest/foreach.rs
rename to tests/tests/rscpp/librscpptest/foreach.rscript
diff --git a/tests/tests/rscpp/librscpptest/instance.rs b/tests/tests/rscpp/librscpptest/instance.rscript
similarity index 100%
rename from tests/tests/rscpp/librscpptest/instance.rs
rename to tests/tests/rscpp/librscpptest/instance.rscript
diff --git a/tests/tests/rscpp/librscpptest/noroot.rs b/tests/tests/rscpp/librscpptest/noroot.rscript
similarity index 100%
rename from tests/tests/rscpp/librscpptest/noroot.rs
rename to tests/tests/rscpp/librscpptest/noroot.rscript
diff --git a/tests/tests/rscpp/librscpptest/primitives.rs b/tests/tests/rscpp/librscpptest/primitives.rscript
similarity index 100%
rename from tests/tests/rscpp/librscpptest/primitives.rs
rename to tests/tests/rscpp/librscpptest/primitives.rscript
diff --git a/tests/tests/rscpp/librscpptest/setelementat.rs b/tests/tests/rscpp/librscpptest/setelementat.rscript
similarity index 100%
rename from tests/tests/rscpp/librscpptest/setelementat.rs
rename to tests/tests/rscpp/librscpptest/setelementat.rscript
diff --git a/tests/tests/rscpp/librscpptest/vector.rs b/tests/tests/rscpp/librscpptest/vector.rscript
similarity index 100%
rename from tests/tests/rscpp/librscpptest/vector.rs
rename to tests/tests/rscpp/librscpptest/vector.rscript
diff --git a/tests/tests/rscpp/src/android/cts/rscpp/verify.rs b/tests/tests/rscpp/src/android/cts/rscpp/verify.rscript
similarity index 100%
rename from tests/tests/rscpp/src/android/cts/rscpp/verify.rs
rename to tests/tests/rscpp/src/android/cts/rscpp/verify.rscript
diff --git a/tests/tests/sax/Android.bp b/tests/tests/sax/Android.bp
new file mode 100644
index 0000000..37e9357
--- /dev/null
+++ b/tests/tests/sax/Android.bp
@@ -0,0 +1,28 @@
+// Copyright (C) 2010 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.
+
+android_test {
+    name: "CtsSaxTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: ["ctstestrunner-axt"],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/sax/Android.mk b/tests/tests/sax/Android.mk
deleted file mode 100644
index b7e4b80..0000000
--- a/tests/tests/sax/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2010 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsSaxTestCases
-
-LOCAL_SDK_VERSION := current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/security/Android.bp b/tests/tests/security/Android.bp
new file mode 100644
index 0000000..b41f33d
--- /dev/null
+++ b/tests/tests/security/Android.bp
@@ -0,0 +1,61 @@
+// Copyright (C) 2011 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.
+
+android_test {
+    name: "CtsSecurityTestCases",
+    defaults: ["cts_defaults"],
+    // Include both the 32 and 64 bit versions
+    compile_multilib: "both",
+    static_libs: [
+        "androidx.test.rules",
+        "android-common",
+        "ctstestserver",
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+        "compatibility-common-util-devicesidelib",
+        "guava",
+        "platform-test-annotations",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    jni_libs: [
+        "libctssecurity_jni",
+        "libcts_jni",
+        "libnativehelper_compat_libc++",
+        "libnativehelper",
+        "libcutils",
+        "libcrypto",
+        "libselinux",
+        "libc++",
+        "libpcre2",
+        "libpackagelistparser",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "src/android/security/cts/activity/ISecureRandomService.aidl",
+        "aidl/android/security/cts/IIsolatedService.aidl",
+    ],
+    //sdk_version: "current",
+    platform_apis: true,
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "sts",
+    ],
+}
diff --git a/tests/tests/security/Android.mk b/tests/tests/security/Android.mk
deleted file mode 100644
index 3d4498d..0000000
--- a/tests/tests/security/Android.mk
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (C) 2011 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)
-
-LOCAL_MODULE_TAGS := tests
-
-# Include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    android-common \
-    ctstestserver \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-    compatibility-common-util-devicesidelib \
-    guava \
-    platform-test-annotations
-
-LOCAL_JAVA_LIBRARIES := \
-    android.test.runner.stubs \
-    org.apache.http.legacy \
-    android.test.base.stubs \
-
-
-LOCAL_JNI_SHARED_LIBRARIES := libctssecurity_jni libcts_jni libnativehelper_compat_libc++ \
-                      libnativehelper \
-                      libcutils \
-                      libcrypto \
-                      libselinux \
-                      libc++ \
-                      libpcre2 \
-                      libpackagelistparser
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)\
-                   src/android/security/cts/activity/ISecureRandomService.aidl\
-                   aidl/android/security/cts/IIsolatedService.aidl
-
-LOCAL_PACKAGE_NAME := CtsSecurityTestCases
-
-#LOCAL_SDK_VERSION := current
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests sts
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/security/AndroidManifest.xml b/tests/tests/security/AndroidManifest.xml
index 4207444..54df055 100644
--- a/tests/tests/security/AndroidManifest.xml
+++ b/tests/tests/security/AndroidManifest.xml
@@ -65,6 +65,10 @@
                      android:label="CTS tests of android.security.cts">
         <meta-data android:name="listener"
             android:value="com.android.cts.runner.CtsTestRunListener" />
+    </instrumentation>
+    <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
+                     android:targetPackage="android.security.cts"
+                     android:label="CTS tests of android.security.cts">
         <meta-data android:name="listener"
             android:value="com.android.cts.runner.CrashParserRunListener" />
     </instrumentation>
diff --git a/tests/tests/security/jni/Android.bp b/tests/tests/security/jni/Android.bp
index 7193aba..27f6289 100644
--- a/tests/tests/security/jni/Android.bp
+++ b/tests/tests/security/jni/Android.bp
@@ -30,10 +30,4 @@
         "cpufeatures",
         "libcutils",
     ],
-    cflags: [
-        "-Wno-unused-parameter",
-        "-Wno-sign-compare",
-        "-Wno-unused-label",
-        "-Wno-unused-variable",
-    ],
 }
diff --git a/tests/tests/security/jni/CtsSecurityJniOnLoad.cpp b/tests/tests/security/jni/CtsSecurityJniOnLoad.cpp
index 68a600b..7490d1a 100644
--- a/tests/tests/security/jni/CtsSecurityJniOnLoad.cpp
+++ b/tests/tests/security/jni/CtsSecurityJniOnLoad.cpp
@@ -23,7 +23,7 @@
 extern int register_android_security_cts_MMapExecutableTest(JNIEnv* env);
 extern int register_android_security_cts_EncryptionTest(JNIEnv* env);
 
-jint JNI_OnLoad(JavaVM *vm, void *reserved) {
+jint JNI_OnLoad(JavaVM *vm, void *) {
     JNIEnv *env = NULL;
 
     if (vm->GetEnv((void **) &env, JNI_VERSION_1_4) != JNI_OK) {
diff --git a/tests/tests/security/jni/android_security_cts_LinuxRngTest.cpp b/tests/tests/security/jni/android_security_cts_LinuxRngTest.cpp
index 8514f8b..f928f2f 100644
--- a/tests/tests/security/jni/android_security_cts_LinuxRngTest.cpp
+++ b/tests/tests/security/jni/android_security_cts_LinuxRngTest.cpp
@@ -43,7 +43,7 @@
 }
 
 jint android_security_cts_LinuxRngTest_getCharDeviceMajor(JNIEnv* env,
-        jobject thiz, jstring name)
+        jobject, jstring name)
 {
     const char* nameStr = env->GetStringUTFChars(name, NULL);
 
@@ -69,7 +69,7 @@
 }
 
 jint android_security_cts_LinuxRngTest_getCharDeviceMinor(JNIEnv* env,
-        jobject thiz, jstring name)
+        jobject, jstring name)
 {
     const char* nameStr = env->GetStringUTFChars(name, NULL);
 
diff --git a/tests/tests/security/jni/android_security_cts_NativeCodeTest.cpp b/tests/tests/security/jni/android_security_cts_NativeCodeTest.cpp
index 4c2f61c..ce9169d 100644
--- a/tests/tests/security/jni/android_security_cts_NativeCodeTest.cpp
+++ b/tests/tests/security/jni/android_security_cts_NativeCodeTest.cpp
@@ -41,12 +41,12 @@
 #define SHMEMSIZE 0x1 /* request one page */
 static jboolean android_security_cts_NativeCodeTest_doSysVipcTest(JNIEnv*, jobject)
 {
-    key_t key = 0x1a25;
-
 #if defined(__i386__) || (_MIPS_SIM == _MIPS_SIM_ABI32)
     /* system call does not exist for x86 or mips 32 */
     return true;
 #else
+    key_t key = 0x1a25;
+
     /*
      * Not supported in bionic. Must directly invoke syscall
      * Only acceptable errno is ENOSYS: shmget syscall
diff --git a/tests/tests/security/testeffect/Android.bp b/tests/tests/security/testeffect/Android.bp
new file mode 100644
index 0000000..23bd6fd
--- /dev/null
+++ b/tests/tests/security/testeffect/Android.bp
@@ -0,0 +1,29 @@
+// Copyright (C) 2013 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.
+
+// Test effect library
+cc_test_library {
+    name: "libctstesteffect",
+    srcs: ["CTSTestEffect.cpp"],
+    cflags: [
+        "-O2",
+        "-fvisibility=hidden",
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+        "-Wno-gnu-designator",
+    ],
+    relative_install_path: "soundfx",
+    include_dirs: ["system/media/audio_effects/include"],
+}
diff --git a/tests/tests/security/testeffect/Android.mk b/tests/tests/security/testeffect/Android.mk
deleted file mode 100644
index 0784b5d..0000000
--- a/tests/tests/security/testeffect/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2013 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)
-
-# Test effect library
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
-  CTSTestEffect.cpp
-
-LOCAL_CFLAGS+= -O2 -fvisibility=hidden
-
-LOCAL_MODULE_RELATIVE_PATH := soundfx
-LOCAL_MODULE:= libctstesteffect
-
-LOCAL_C_INCLUDES := \
-  $(call include-path-for, audio-effects)
-
-LOCAL_CFLAGS := -Wall -Werror -Wno-unused-parameter -Wno-gnu-designator
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/selinux/Android.mk b/tests/tests/selinux/Android.mk
deleted file mode 100644
index cddf11e..0000000
--- a/tests/tests/selinux/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2017 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 $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/selinux/OWNERS b/tests/tests/selinux/OWNERS
new file mode 100644
index 0000000..8824b03
--- /dev/null
+++ b/tests/tests/selinux/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 85141
+jeffv@google.com
+jgalenson@google.com
+nnk@google.com
diff --git a/tests/tests/selinux/common/Android.mk b/tests/tests/selinux/common/Android.mk
deleted file mode 100644
index a177b5c..0000000
--- a/tests/tests/selinux/common/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (C) 2018 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 $(call all-makefiles-under,$(LOCAL_PATH))
-
diff --git a/tests/tests/selinux/common/jni/Android.bp b/tests/tests/selinux/common/jni/Android.bp
new file mode 100644
index 0000000..275b0ce
--- /dev/null
+++ b/tests/tests/selinux/common/jni/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 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.
+
+cc_test_library {
+    name: "libctsselinux_jni",
+    srcs: [
+        "CtsSecurityJniOnLoad.cpp",
+        "android_security_SELinuxTargetSdkTest.cpp",
+    ],
+    shared_libs: [
+        "libbase",
+        "libc++",
+        "libcrypto",
+        "liblog",
+        "libnativehelper",
+        "libpackagelistparser",
+        "libpcre2",
+        "libselinux",
+    ],
+    gtest: false,
+}
diff --git a/tests/tests/selinux/common/jni/Android.mk b/tests/tests/selinux/common/jni/Android.mk
deleted file mode 100644
index 8f9234c..0000000
--- a/tests/tests/selinux/common/jni/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE := libctsselinux_jni
-
-# Don't include this package in any configuration by default.
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
-    CtsSecurityJniOnLoad.cpp \
-    android_security_SELinuxTargetSdkTest.cpp
-
-LOCAL_SHARED_LIBRARIES := \
-    libc++ \
-    libcrypto \
-    liblog \
-    libnativehelper \
-    libpackagelistparser \
-    libpcre2 \
-    libselinux \
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/selinux/selinuxEphemeral/Android.bp b/tests/tests/selinux/selinuxEphemeral/Android.bp
new file mode 100644
index 0000000..c3e6459
--- /dev/null
+++ b/tests/tests/selinux/selinuxEphemeral/Android.bp
@@ -0,0 +1,51 @@
+//
+// Copyright (C) 2019 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.
+
+android_test {
+    name: "CtsSelinuxEphemeralTestCases",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.base.stubs",
+        "android.test.runner.stubs",
+    ],
+    jni_libs: [
+        "libbase",
+        "libc++",
+        "libcrypto",
+        "libcts_jni",
+        "libctsselinux_jni",
+        "libnativehelper",
+        "libnativehelper_compat_libc++",
+        "libpackagelistparser",
+        "libpcre2",
+        "libselinux",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "common/**/*.java",
+    ],
+    platform_apis: true,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    min_sdk_version: "21",
+}
diff --git a/tests/tests/selinux/selinuxEphemeral/Android.mk b/tests/tests/selinux/selinuxEphemeral/Android.mk
deleted file mode 100644
index fa29b49..0000000
--- a/tests/tests/selinux/selinuxEphemeral/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2019 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)
-LOCAL_MODULE_TAGS := tests
-LOCAL_MULTILIB := both
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs android.test.runner.stubs
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-    libc++ \
-    libcrypto \
-    libcts_jni \
-    libctsselinux_jni \
-    libnativehelper \
-    libnativehelper_compat_libc++ \
-    libpackagelistparser \
-    libpcre2 \
-    libselinux \
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src common)
-LOCAL_PACKAGE_NAME := CtsSelinuxEphemeralTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MIN_SDK_VERSION := 21
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/selinux/selinuxEphemeral/AndroidTest.xml b/tests/tests/selinux/selinuxEphemeral/AndroidTest.xml
index 46dcab0..fa2b1b9 100644
--- a/tests/tests/selinux/selinuxEphemeral/AndroidTest.xml
+++ b/tests/tests/selinux/selinuxEphemeral/AndroidTest.xml
@@ -17,7 +17,7 @@
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="security" />
     <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
-    <option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
+    <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
     <option name="not-shardable" value="true" />
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
diff --git a/tests/tests/selinux/selinuxTargetSdk25/Android.bp b/tests/tests/selinux/selinuxTargetSdk25/Android.bp
new file mode 100644
index 0000000..f48a8a0
--- /dev/null
+++ b/tests/tests/selinux/selinuxTargetSdk25/Android.bp
@@ -0,0 +1,51 @@
+//
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsSelinuxTargetSdk25TestCases",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.base.stubs",
+        "android.test.runner.stubs",
+    ],
+    jni_libs: [
+        "libbase",
+        "libc++",
+        "libcrypto",
+        "libcts_jni",
+        "libctsselinux_jni",
+        "libnativehelper",
+        "libnativehelper_compat_libc++",
+        "libpackagelistparser",
+        "libpcre2",
+        "libselinux",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "common/**/*.java",
+    ],
+    platform_apis: true,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    min_sdk_version: "21",
+}
diff --git a/tests/tests/selinux/selinuxTargetSdk25/Android.mk b/tests/tests/selinux/selinuxTargetSdk25/Android.mk
deleted file mode 100644
index eadeb45..0000000
--- a/tests/tests/selinux/selinuxTargetSdk25/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2017 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)
-LOCAL_MODULE_TAGS := tests
-LOCAL_MULTILIB := both
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs android.test.runner.stubs
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-    libc++ \
-    libcrypto \
-    libcts_jni \
-    libctsselinux_jni \
-    libnativehelper \
-    libnativehelper_compat_libc++ \
-    libpackagelistparser \
-    libpcre2 \
-    libselinux \
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src common)
-LOCAL_PACKAGE_NAME := CtsSelinuxTargetSdk25TestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MIN_SDK_VERSION := 21
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/selinux/selinuxTargetSdk25/AndroidTest.xml b/tests/tests/selinux/selinuxTargetSdk25/AndroidTest.xml
index ae9576e..cdca38c 100644
--- a/tests/tests/selinux/selinuxTargetSdk25/AndroidTest.xml
+++ b/tests/tests/selinux/selinuxTargetSdk25/AndroidTest.xml
@@ -17,7 +17,7 @@
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="security" />
     <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
-    <option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
+    <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
     <option name="not-shardable" value="true" />
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
diff --git a/tests/tests/selinux/selinuxTargetSdk27/Android.bp b/tests/tests/selinux/selinuxTargetSdk27/Android.bp
new file mode 100644
index 0000000..0187bbd
--- /dev/null
+++ b/tests/tests/selinux/selinuxTargetSdk27/Android.bp
@@ -0,0 +1,51 @@
+//
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsSelinuxTargetSdk27TestCases",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.base.stubs",
+        "android.test.runner.stubs",
+    ],
+    jni_libs: [
+        "libbase",
+        "libc++",
+        "libcrypto",
+        "libcts_jni",
+        "libctsselinux_jni",
+        "libnativehelper",
+        "libnativehelper_compat_libc++",
+        "libpackagelistparser",
+        "libpcre2",
+        "libselinux",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "common/**/*.java",
+    ],
+    platform_apis: true,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    min_sdk_version: "21",
+}
diff --git a/tests/tests/selinux/selinuxTargetSdk27/Android.mk b/tests/tests/selinux/selinuxTargetSdk27/Android.mk
deleted file mode 100644
index 00973b5..0000000
--- a/tests/tests/selinux/selinuxTargetSdk27/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2017 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)
-LOCAL_MODULE_TAGS := tests
-LOCAL_MULTILIB := both
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs android.test.runner.stubs
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-    libc++ \
-    libcrypto \
-    libcts_jni \
-    libctsselinux_jni \
-    libnativehelper \
-    libnativehelper_compat_libc++ \
-    libpackagelistparser \
-    libpcre2 \
-    libselinux \
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src common)
-LOCAL_PACKAGE_NAME := CtsSelinuxTargetSdk27TestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MIN_SDK_VERSION := 21
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/selinux/selinuxTargetSdk27/AndroidTest.xml b/tests/tests/selinux/selinuxTargetSdk27/AndroidTest.xml
index 78e5ad4..ac816b2 100644
--- a/tests/tests/selinux/selinuxTargetSdk27/AndroidTest.xml
+++ b/tests/tests/selinux/selinuxTargetSdk27/AndroidTest.xml
@@ -17,7 +17,7 @@
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="security" />
     <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
-    <option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
+    <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
     <option name="not-shardable" value="true" />
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
diff --git a/tests/tests/selinux/selinuxTargetSdk28/Android.bp b/tests/tests/selinux/selinuxTargetSdk28/Android.bp
new file mode 100644
index 0000000..f4af775
--- /dev/null
+++ b/tests/tests/selinux/selinuxTargetSdk28/Android.bp
@@ -0,0 +1,51 @@
+//
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsSelinuxTargetSdk28TestCases",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.base.stubs",
+        "android.test.runner.stubs",
+    ],
+    jni_libs: [
+        "libbase",
+        "libc++",
+        "libcrypto",
+        "libcts_jni",
+        "libctsselinux_jni",
+        "libnativehelper",
+        "libnativehelper_compat_libc++",
+        "libpackagelistparser",
+        "libpcre2",
+        "libselinux",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "common/**/*.java",
+    ],
+    platform_apis: true,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    min_sdk_version: "21",
+}
diff --git a/tests/tests/selinux/selinuxTargetSdk28/Android.mk b/tests/tests/selinux/selinuxTargetSdk28/Android.mk
deleted file mode 100644
index b43086b..0000000
--- a/tests/tests/selinux/selinuxTargetSdk28/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2018 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)
-LOCAL_MODULE_TAGS := tests
-LOCAL_MULTILIB := both
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs android.test.runner.stubs
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-    libc++ \
-    libcrypto \
-    libcts_jni \
-    libctsselinux_jni \
-    libnativehelper \
-    libnativehelper_compat_libc++ \
-    libpackagelistparser \
-    libpcre2 \
-    libselinux \
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src common)
-LOCAL_PACKAGE_NAME := CtsSelinuxTargetSdk28TestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MIN_SDK_VERSION := 21
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/selinux/selinuxTargetSdk28/AndroidTest.xml b/tests/tests/selinux/selinuxTargetSdk28/AndroidTest.xml
index 71453c9..6a53a30 100644
--- a/tests/tests/selinux/selinuxTargetSdk28/AndroidTest.xml
+++ b/tests/tests/selinux/selinuxTargetSdk28/AndroidTest.xml
@@ -17,7 +17,7 @@
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="security" />
     <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
-    <option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
+    <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
     <option name="not-shardable" value="true" />
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
diff --git a/tests/tests/selinux/selinuxTargetSdkCurrent/Android.bp b/tests/tests/selinux/selinuxTargetSdkCurrent/Android.bp
new file mode 100644
index 0000000..cbe4b8b
--- /dev/null
+++ b/tests/tests/selinux/selinuxTargetSdkCurrent/Android.bp
@@ -0,0 +1,51 @@
+//
+// Copyright (C) 2017 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.
+
+android_test {
+    name: "CtsSelinuxTargetSdkCurrentTestCases",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.base.stubs",
+        "android.test.runner.stubs",
+    ],
+    jni_libs: [
+        "libbase",
+        "libc++",
+        "libcrypto",
+        "libcts_jni",
+        "libctsselinux_jni",
+        "libnativehelper",
+        "libnativehelper_compat_libc++",
+        "libpackagelistparser",
+        "libpcre2",
+        "libselinux",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "common/**/*.java",
+    ],
+    platform_apis: true,
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    min_sdk_version: "21",
+}
diff --git a/tests/tests/selinux/selinuxTargetSdkCurrent/Android.mk b/tests/tests/selinux/selinuxTargetSdkCurrent/Android.mk
deleted file mode 100644
index 09115a4..0000000
--- a/tests/tests/selinux/selinuxTargetSdkCurrent/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2017 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)
-LOCAL_MODULE_TAGS := tests
-LOCAL_MULTILIB := both
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt \
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs android.test.runner.stubs
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-    libc++ \
-    libcrypto \
-    libcts_jni \
-    libctsselinux_jni \
-    libnativehelper \
-    libnativehelper_compat_libc++ \
-    libpackagelistparser \
-    libpcre2 \
-    libselinux \
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src common)
-LOCAL_PACKAGE_NAME := CtsSelinuxTargetSdkCurrentTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_MIN_SDK_VERSION := 21
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/selinux/selinuxTargetSdkCurrent/AndroidTest.xml b/tests/tests/selinux/selinuxTargetSdkCurrent/AndroidTest.xml
index f3f7d84..f4b6aa9 100644
--- a/tests/tests/selinux/selinuxTargetSdkCurrent/AndroidTest.xml
+++ b/tests/tests/selinux/selinuxTargetSdkCurrent/AndroidTest.xml
@@ -17,7 +17,7 @@
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="security" />
     <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
-    <option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
+    <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
     <option name="not-shardable" value="true" />
     <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
         <option name="cleanup-apks" value="true" />
diff --git a/tests/tests/shortcutmanager/Android.bp b/tests/tests/shortcutmanager/Android.bp
new file mode 100644
index 0000000..6b45de3
--- /dev/null
+++ b/tests/tests/shortcutmanager/Android.bp
@@ -0,0 +1,240 @@
+// Copyright (C) 2016 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.
+
+android_test {
+    name: "CtsShortcutManagerTestCases",
+    defaults: [
+        "cts_defaults",
+        "CtsShortcutManagerDefaults",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
+
+//-----------------------------------------------------------
+android_test_helper_app {
+    name: "CtsShortcutManagerLauncher1",
+    defaults: [
+        "cts_defaults",
+        "CtsShortcutManagerDefaults",
+    ],
+    srcs: ["packages/src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    aaptflags: [
+        "--rename-manifest-package",
+        "android.content.pm.cts.shortcutmanager.packages.launcher1",
+    ],
+    manifest: "packages/launchermanifest/AndroidManifest.xml",
+}
+
+//-----------------------------------------------------------
+android_test_helper_app {
+    name: "CtsShortcutManagerLauncher2",
+    defaults: [
+        "cts_defaults",
+        "CtsShortcutManagerDefaults",
+    ],
+    srcs: ["packages/src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    aaptflags: [
+        "--rename-manifest-package",
+        "android.content.pm.cts.shortcutmanager.packages.launcher2",
+    ],
+    manifest: "packages/launchermanifest/AndroidManifest.xml",
+}
+
+//-----------------------------------------------------------
+android_test_helper_app {
+    name: "CtsShortcutManagerLauncher3",
+    defaults: [
+        "cts_defaults",
+        "CtsShortcutManagerDefaults",
+    ],
+    srcs: ["packages/src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    aaptflags: [
+        "--rename-manifest-package",
+        "android.content.pm.cts.shortcutmanager.packages.launcher3",
+    ],
+    manifest: "packages/launchermanifest/AndroidManifest.xml",
+}
+
+android_test_helper_app {
+    name: "CtsShortcutManagerLauncher4",
+    defaults: [
+        "cts_defaults",
+        "CtsShortcutManagerDefaults",
+    ],
+    srcs: ["packages/src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    aaptflags: [
+        "--rename-manifest-package",
+        "android.content.pm.cts.shortcutmanager.packages.launcher4",
+    ],
+    manifest: "packages/launchermanifest_nonshared/AndroidManifest.xml",
+}
+
+android_test_helper_app {
+    name: "CtsShortcutManagerPackage1",
+    defaults: [
+        "cts_defaults",
+        "CtsShortcutManagerDefaults",
+    ],
+    srcs: ["packages/src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    aaptflags: [
+        "--rename-manifest-package",
+        "android.content.pm.cts.shortcutmanager.packages.package1",
+    ],
+    manifest: "packages/packagemanifest/AndroidManifest.xml",
+    resource_dirs: ["packages/packagemanifest/res"],
+}
+
+//-----------------------------------------------------------
+android_test_helper_app {
+    name: "CtsShortcutManagerPackage2",
+    defaults: [
+        "cts_defaults",
+        "CtsShortcutManagerDefaults",
+    ],
+    srcs: ["packages/src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    aaptflags: [
+        "--rename-manifest-package",
+        "android.content.pm.cts.shortcutmanager.packages.package2",
+    ],
+    manifest: "packages/packagemanifest/AndroidManifest.xml",
+    resource_dirs: ["packages/packagemanifest/res"],
+}
+
+//-----------------------------------------------------------
+android_test_helper_app {
+    name: "CtsShortcutManagerPackage3",
+    defaults: [
+        "cts_defaults",
+        "CtsShortcutManagerDefaults",
+    ],
+    srcs: ["packages/src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    aaptflags: [
+        "--rename-manifest-package",
+        "android.content.pm.cts.shortcutmanager.packages.package3",
+    ],
+    manifest: "packages/packagemanifest/AndroidManifest.xml",
+    resource_dirs: ["packages/packagemanifest/res"],
+}
+
+android_test_helper_app {
+    name: "CtsShortcutManagerPackage4",
+    defaults: [
+        "cts_defaults",
+        "CtsShortcutManagerDefaults",
+    ],
+    srcs: ["packages/src/**/*.java"],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    aaptflags: [
+        "--rename-manifest-package",
+        "android.content.pm.cts.shortcutmanager.packages.package4",
+    ],
+    manifest: "packages/packagemanifest_nonshared/AndroidManifest.xml",
+}
+
+android_test_helper_app {
+    name: "CtsShortcutManagerThrottlingTest",
+    defaults: [
+        "cts_defaults",
+        "CtsShortcutManagerDefaults",
+    ],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    srcs: ["throttling/src/**/*.java"],
+    min_sdk_version: "25",
+    manifest: "throttling/AndroidManifest.xml",
+}
+
+java_library {
+    name: "CtsShortcutManagerLib",
+    srcs: ["common/src/**/*.java"],
+    static_libs: [
+        "androidx.test.rules",
+        "ShortcutManagerTestUtils",
+    ],
+}
+
+java_defaults {
+    name: "CtsShortcutManagerDefaults",
+    sdk_version: "test_current",
+    static_libs: [
+        "androidx.test.rules",
+        "androidx.legacy_legacy-support-v4",
+        "mockito-target-minus-junit4",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ub-uiautomator",
+        "ShortcutManagerTestUtils",
+        "CtsShortcutManagerLib",
+    ],
+}
diff --git a/tests/tests/shortcutmanager/Android.mk b/tests/tests/shortcutmanager/Android.mk
deleted file mode 100755
index 56a81a9..0000000
--- a/tests/tests/shortcutmanager/Android.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, common/src)
-
-LOCAL_PACKAGE_NAME := CtsShortcutManagerTestCases
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/shortcutmanager/packages/Android.mk b/tests/tests/shortcutmanager/packages/Android.mk
deleted file mode 100644
index 3d02f9c..0000000
--- a/tests/tests/shortcutmanager/packages/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2016 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 $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/shortcutmanager/packages/launchermanifest/Android.mk b/tests/tests/shortcutmanager/packages/launchermanifest/Android.mk
deleted file mode 100644
index 426bb89..0000000
--- a/tests/tests/shortcutmanager/packages/launchermanifest/Android.mk
+++ /dev/null
@@ -1,105 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_PACKAGE_NAME := CtsShortcutManagerLauncher1
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src) \
-        $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_SDK_VERSION := current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_AAPT_FLAGS += --rename-manifest-package android.content.pm.cts.shortcutmanager.packages.launcher1
-
-include $(BUILD_CTS_PACKAGE)
-
-#-----------------------------------------------------------
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := CtsShortcutManagerLauncher2
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src) \
-        $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_SDK_VERSION := current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_AAPT_FLAGS += --rename-manifest-package android.content.pm.cts.shortcutmanager.packages.launcher2
-
-include $(BUILD_CTS_PACKAGE)
-
-#-----------------------------------------------------------
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := CtsShortcutManagerLauncher3
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src) \
-        $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_SDK_VERSION := current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_AAPT_FLAGS += --rename-manifest-package android.content.pm.cts.shortcutmanager.packages.launcher3
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/shortcutmanager/packages/launchermanifest_nonshared/Android.mk b/tests/tests/shortcutmanager/packages/launchermanifest_nonshared/Android.mk
deleted file mode 100644
index b894f13..0000000
--- a/tests/tests/shortcutmanager/packages/launchermanifest_nonshared/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_PACKAGE_NAME := CtsShortcutManagerLauncher4
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src) \
-        $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_SDK_VERSION := current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_AAPT_FLAGS += --rename-manifest-package android.content.pm.cts.shortcutmanager.packages.launcher4
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/shortcutmanager/packages/packagemanifest/Android.mk b/tests/tests/shortcutmanager/packages/packagemanifest/Android.mk
deleted file mode 100644
index e645177..0000000
--- a/tests/tests/shortcutmanager/packages/packagemanifest/Android.mk
+++ /dev/null
@@ -1,104 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_PACKAGE_NAME := CtsShortcutManagerPackage1
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src) \
-        $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_SDK_VERSION := current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_AAPT_FLAGS += --rename-manifest-package android.content.pm.cts.shortcutmanager.packages.package1
-
-include $(BUILD_CTS_PACKAGE)
-
-#-----------------------------------------------------------
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := CtsShortcutManagerPackage2
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src) \
-        $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_SDK_VERSION := current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_AAPT_FLAGS += --rename-manifest-package android.content.pm.cts.shortcutmanager.packages.package2
-
-include $(BUILD_CTS_PACKAGE)
-
-#-----------------------------------------------------------
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := CtsShortcutManagerPackage3
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src) \
-        $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_SDK_VERSION := current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_AAPT_FLAGS += --rename-manifest-package android.content.pm.cts.shortcutmanager.packages.package3
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/Android.mk b/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/Android.mk
deleted file mode 100644
index aa0112a..0000000
--- a/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_PACKAGE_NAME := CtsShortcutManagerPackage4
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../src) \
-        $(call all-java-files-under, ../../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_SDK_VERSION := current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_AAPT_FLAGS += --rename-manifest-package android.content.pm.cts.shortcutmanager.packages.package4
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/shortcutmanager/throttling/Android.mk b/tests/tests/shortcutmanager/throttling/Android.mk
deleted file mode 100644
index 0300b15..0000000
--- a/tests/tests/shortcutmanager/throttling/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2016 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsShortcutManagerThrottlingTest
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, ../common/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator \
-    ShortcutManagerTestUtils
-
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 25
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/simpleperf/Android.mk b/tests/tests/simpleperf/Android.mk
index 24152c6..a9c17a7 100644
--- a/tests/tests/simpleperf/Android.mk
+++ b/tests/tests/simpleperf/Android.mk
@@ -16,6 +16,7 @@
   libsimpleperf_cts_test \
 
 LOCAL_STATIC_LIBRARIES += \
+  libsimpleperf_etm_decoder \
   libbacktrace \
   libunwindstack \
   libdexfile_support \
@@ -38,6 +39,7 @@
   libLLVMSupport \
   libprotobuf-cpp-lite \
   libevent \
+  libopencsd_decoder \
 
 simpleperf_testdata_files := $(shell cd $(simpleperf_src_path); find testdata -type f)
 
diff --git a/tests/tests/simpleperf/CtsSimpleperfDebuggableApp/Android.bp b/tests/tests/simpleperf/CtsSimpleperfDebuggableApp/Android.bp
new file mode 100644
index 0000000..9513ecd
--- /dev/null
+++ b/tests/tests/simpleperf/CtsSimpleperfDebuggableApp/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsSimpleperfDebuggableApp",
+    defaults: ["cts_defaults"],
+    srcs: ["./**/*.java"],
+    manifest: "AndroidManifest.xml",
+    sdk_version: "current",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/simpleperf/CtsSimpleperfDebuggableApp/Android.mk b/tests/tests/simpleperf/CtsSimpleperfDebuggableApp/Android.mk
deleted file mode 100644
index 9b7821d..0000000
--- a/tests/tests/simpleperf/CtsSimpleperfDebuggableApp/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2016 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_SRC_FILES := $(call all-java-files-under, .)
-
-LOCAL_MANIFEST_FILE := AndroidManifest.xml
-
-LOCAL_PACKAGE_NAME := CtsSimpleperfDebuggableApp
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/simpleperf/CtsSimpleperfProfileableApp/Android.bp b/tests/tests/simpleperf/CtsSimpleperfProfileableApp/Android.bp
new file mode 100644
index 0000000..fef633c
--- /dev/null
+++ b/tests/tests/simpleperf/CtsSimpleperfProfileableApp/Android.bp
@@ -0,0 +1,26 @@
+// Copyright (C) 2016 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.
+
+android_test_helper_app {
+    name: "CtsSimpleperfProfileableApp",
+    defaults: ["cts_defaults"],
+    srcs: ["./**/*.java"],
+    manifest: "AndroidManifest.xml",
+    sdk_version: "current",
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/simpleperf/CtsSimpleperfProfileableApp/Android.mk b/tests/tests/simpleperf/CtsSimpleperfProfileableApp/Android.mk
deleted file mode 100644
index d957ea8..0000000
--- a/tests/tests/simpleperf/CtsSimpleperfProfileableApp/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2016 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_SRC_FILES := $(call all-java-files-under, .)
-
-LOCAL_MANIFEST_FILE := AndroidManifest.xml
-
-LOCAL_PACKAGE_NAME := CtsSimpleperfProfileableApp
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/simpleperf/OWNERS b/tests/tests/simpleperf/OWNERS
new file mode 100644
index 0000000..dad033d
--- /dev/null
+++ b/tests/tests/simpleperf/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 14890
+yabinc@google.com
diff --git a/tests/tests/slice/Android.bp b/tests/tests/slice/Android.bp
new file mode 100644
index 0000000..a721b6f
--- /dev/null
+++ b/tests/tests/slice/Android.bp
@@ -0,0 +1,40 @@
+// Copyright (C) 2008 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.
+
+android_test {
+    name: "CtsSliceTestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    libs: ["android.test.runner.stubs"],
+    static_libs: [
+        "androidx.test.rules",
+        "ctstestrunner-axt",
+        "metrics-helper-lib",
+        "mockito-target-inline-minus-junit4",
+        "platform-test-annotations",
+        "ub-uiautomator",
+    ],
+    compile_multilib: "both",
+    jni_libs: [
+        "libdexmakerjvmtiagent",
+        "libmultiplejvmtiagentsinterferenceagent",
+    ],
+    srcs: ["src/**/*.java"],
+    platform_apis: true,
+}
diff --git a/tests/tests/slice/Android.mk b/tests/tests/slice/Android.mk
deleted file mode 100644
index b440d19..0000000
--- a/tests/tests/slice/Android.mk
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (C) 2008 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    compatibility-device-util-axt \
-    ctsdeviceutillegacy-axt \
-    ctstestrunner-axt \
-    metrics-helper-lib \
-    mockito-target-inline-minus-junit4 \
-    platform-test-annotations \
-    ub-uiautomator
-
-LOCAL_MULTILIB := both
-
-LOCAL_JNI_SHARED_LIBRARIES := \
-    libdexmakerjvmtiagent \
-    libmultiplejvmtiagentsinterferenceagent
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsSliceTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/speech/Android.bp b/tests/tests/speech/Android.bp
new file mode 100644
index 0000000..ee5d124
--- /dev/null
+++ b/tests/tests/speech/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2008 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.
+
+android_test {
+    name: "CtsSpeechTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    // Needed for testing O API
+    //sdk_version: "test_current",
+    platform_apis: true,
+}
diff --git a/tests/tests/speech/Android.mk b/tests/tests/speech/Android.mk
deleted file mode 100755
index 24576d6..0000000
--- a/tests/tests/speech/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2008 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    androidx.test.rules
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_PACKAGE_NAME := CtsSpeechTestCases
-
-# Needed for testing O API
-#LOCAL_SDK_VERSION := test_current
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/syncmanager/Android.bp b/tests/tests/syncmanager/Android.bp
new file mode 100644
index 0000000..e14b629
--- /dev/null
+++ b/tests/tests/syncmanager/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2018 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.
+
+android_test {
+    name: "CtsSyncManagerTestsCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "CtsSyncManagerCommon",
+        "androidx.test.rules",
+        "androidx.legacy_legacy-support-v4",
+        "mockito-target-minus-junit4",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ub-uiautomator",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/syncmanager/Android.mk b/tests/tests/syncmanager/Android.mk
deleted file mode 100755
index ab16ed9..0000000
--- a/tests/tests/syncmanager/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    CtsSyncManagerCommon \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    ub-uiautomator
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsSyncManagerTestsCases
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/syncmanager/apps/Android.bp b/tests/tests/syncmanager/apps/Android.bp
new file mode 100644
index 0000000..9dfe862
--- /dev/null
+++ b/tests/tests/syncmanager/apps/Android.bp
@@ -0,0 +1,59 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "CtsSyncManagerApp1",
+    defaults: ["cts_defaults"],
+    srcs: ["app1/src/**/*.java"],
+    static_libs: [
+        "CtsSyncManagerCommon",
+        "androidx.test.rules",
+        "androidx.legacy_legacy-support-v4",
+        "mockito-target-minus-junit4",
+        "compatibility-device-util-axt",
+        "ub-uiautomator",
+    ],
+    sdk_version: "test_current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    manifest: "app1/AndroidManifest.xml",
+    resource_dirs: ["app1/res"],
+}
+
+android_test_helper_app {
+    name: "CtsSyncManagerApp2",
+    defaults: ["cts_defaults"],
+    srcs: ["app1/src/**/*.java"],
+    static_libs: [
+        "CtsSyncManagerCommon",
+        "androidx.test.rules",
+        "androidx.legacy_legacy-support-v4",
+        "mockito-target-minus-junit4",
+        "compatibility-device-util-axt",
+        "ub-uiautomator",
+    ],
+    sdk_version: "test_current",
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    manifest: "app2/AndroidManifest.xml",
+    resource_dirs: ["app2/res"],
+}
diff --git a/tests/tests/syncmanager/apps/Android.mk b/tests/tests/syncmanager/apps/Android.mk
deleted file mode 100644
index 9aaa6ac..0000000
--- a/tests/tests/syncmanager/apps/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2018 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 $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/syncmanager/apps/app1/Android.mk b/tests/tests/syncmanager/apps/app1/Android.mk
deleted file mode 100644
index c619fe3..0000000
--- a/tests/tests/syncmanager/apps/app1/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsSyncManagerApp1
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    CtsSyncManagerCommon \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ub-uiautomator
-
-LOCAL_SDK_VERSION := test_current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/syncmanager/apps/app2/Android.mk b/tests/tests/syncmanager/apps/app2/Android.mk
deleted file mode 100644
index 50bc2f3..0000000
--- a/tests/tests/syncmanager/apps/app2/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2018 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)
-
-LOCAL_PACKAGE_NAME := CtsSyncManagerApp2
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, ../app1/src)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    CtsSyncManagerCommon \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target-minus-junit4 \
-    compatibility-device-util-axt \
-    ub-uiautomator
-
-LOCAL_SDK_VERSION := test_current
-
-# tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/syncmanager/common/Android.bp b/tests/tests/syncmanager/common/Android.bp
new file mode 100644
index 0000000..cba51fc
--- /dev/null
+++ b/tests/tests/syncmanager/common/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2016 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.
+
+java_library {
+    name: "CtsSyncManagerCommon",
+    srcs: [
+        "src/**/*.java",
+        "proto/**/*.proto",
+    ],
+    proto: {
+        type: "lite",
+    },
+    libs: [
+        "androidx.test.rules",
+        "androidx.legacy_legacy-support-v4",
+        "mockito-target",
+        "compatibility-device-util-axt",
+        "android.test.runner.stubs",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/syncmanager/common/Android.mk b/tests/tests/syncmanager/common/Android.mk
deleted file mode 100644
index c908b19..0000000
--- a/tests/tests/syncmanager/common/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src) \
-    $(call all-proto-files-under, proto)
-
-LOCAL_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    androidx.legacy_legacy-support-v4 \
-    mockito-target \
-    compatibility-device-util-axt \
-    android.test.runner.stubs
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE := CtsSyncManagerCommon
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/tests/tests/systemintents/Android.bp b/tests/tests/systemintents/Android.bp
new file mode 100644
index 0000000..37c4c24
--- /dev/null
+++ b/tests/tests/systemintents/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2016 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.
+
+android_test {
+    name: "CtsSystemIntentTestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    srcs: ["src/**/*.java"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/systemintents/Android.mk b/tests/tests/systemintents/Android.mk
deleted file mode 100644
index c68aaf1..0000000
--- a/tests/tests/systemintents/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsSystemIntentTestCases
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt androidx.test.rules
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/systemui/Android.bp b/tests/tests/systemui/Android.bp
new file mode 100644
index 0000000..51d1af4
--- /dev/null
+++ b/tests/tests/systemui/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2015 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.
+
+android_test {
+    name: "CtsSystemUiTestCases",
+    defaults: ["cts_defaults"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    libs: ["android.test.runner.stubs"],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "cts-wm-util",
+        "ub-uiautomator",
+    ],
+    srcs: ["src/**/*.java"],
+    platform_apis: true,
+}
diff --git a/tests/tests/systemui/Android.mk b/tests/tests/systemui/Android.mk
deleted file mode 100644
index 6bb72ec..0000000
--- a/tests/tests/systemui/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2015 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)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    ctstestrunner-axt \
-    cts-wm-util \
-    androidx.test.rules \
-    ub-uiautomator
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsSystemUiTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/telecom/Android.bp b/tests/tests/telecom/Android.bp
new file mode 100644
index 0000000..11cac38
--- /dev/null
+++ b/tests/tests/telecom/Android.bp
@@ -0,0 +1,86 @@
+// Copyright (C) 2015 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.
+
+android_test {
+    name: "CtsTelecomTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "androidx.test.core",
+        "androidx.test.rules",
+        "CtsTelecomUtilLib",
+    ],
+    libs: [
+        "android.test.base.stubs",
+        "android.test.runner.stubs",
+    ],
+    srcs: [
+        "src/**/*.java",
+        "CallScreeningServiceTestApp/**/*.java",
+        "CallScreeningServiceTestApp/**/I*.aidl",
+        "ThirdPtyInCallServiceTestApp/**/*.java",
+        "ThirdPtyInCallServiceTestApp/**/I*.aidl",
+        "CallRedirectionServiceTestApp/**/*.java",
+        "CallRedirectionServiceTestApp/**/I*.aidl",
+    ],
+    exclude_srcs: [
+        "src/android/telecom/cts/SelfManagedConnection.java",
+        "src/android/telecom/cts/CtsSelfManagedConnectionService.java",
+        "src/android/telecom/cts/TestUtils.java",
+    ],
+    aidl: {
+        local_include_dirs: [
+            "ThirdPtyInCallServiceTestApp/aidl/",
+            "CallRedirectionServiceTestApp/aidl/",
+            "CallScreeningServiceTestApp/aidl/",
+        ],
+    },
+    sdk_version: "test_current",
+    min_sdk_version: "21",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
+
+java_library {
+    name: "CtsTelecomMockLib",
+    srcs: [
+        "src/android/telecom/cts/MockInCallService.java",
+        "src/android/telecom/cts/MockVideoCallCallback.java",
+        "src/android/telecom/cts/MockVideoProvider.java",
+        "src/android/telecom/cts/MockConnection.java",
+    ],
+    static_libs: ["CtsTelecomUtilLib"],
+    libs: [
+        "androidx.test.core",
+        "androidx.test.rules",
+    ],
+}
+
+java_library {
+    name: "CtsTelecomUtilLib",
+    srcs: [
+        "src/android/telecom/cts/SelfManagedConnection.java",
+        "src/android/telecom/cts/CtsSelfManagedConnectionService.java",
+        "src/android/telecom/cts/TestUtils.java",
+    ],
+    libs: [
+        "androidx.test.core",
+        "androidx.test.rules",
+    ],
+}
diff --git a/tests/tests/telecom/Android.mk b/tests/tests/telecom/Android.mk
deleted file mode 100644
index ddf5518..0000000
--- a/tests/tests/telecom/Android.mk
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_PACKAGE_NAME := CtsTelecomTestCases
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-	compatibility-device-util-axt \
-	ctstestrunner-axt \
-	androidx.test.core \
-	androidx.test.rules
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-	           $(call all-java-files-under, CallScreeningServiceTestApp) \
-                   $(call all-Iaidl-files-under, CallScreeningServiceTestApp) \
-                   $(call all-java-files-under, ThirdPtyInCallServiceTestApp) \
-                   $(call all-Iaidl-files-under, ThirdPtyInCallServiceTestApp) \
-                   $(call all-java-files-under, CallRedirectionServiceTestApp) \
-                   $(call all-Iaidl-files-under, CallRedirectionServiceTestApp)
-
-LOCAL_AIDL_INCLUDES := ThirdPtyInCallServiceTestApp/aidl/ \
-                       CallRedirectionServiceTestApp/aidl/ \
-	               CallScreeningServiceTestApp/aidl/
-
-LOCAL_SDK_VERSION := test_current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_JAVA_LIBRARIES += android.test.runner.stubs
-
-include $(BUILD_CTS_PACKAGE)
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/telecom/CallRedirectionServiceTestApp/Android.bp b/tests/tests/telecom/CallRedirectionServiceTestApp/Android.bp
new file mode 100644
index 0000000..822534f
--- /dev/null
+++ b/tests/tests/telecom/CallRedirectionServiceTestApp/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2019 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.
+
+android_test_helper_app {
+    name: "CallRedirectionServiceTestApp",
+    srcs: [
+        "src/**/*.java",
+        "aidl/**/I*.aidl",
+    ],
+    aidl: {
+        local_include_dirs: ["aidl/"],
+    },
+    sdk_version: "test_current",
+    test_suites: [
+        "cts",
+        "vts",
+    ],
+    optimize: {
+        enabled: false,
+    },
+}
diff --git a/tests/tests/telecom/CallRedirectionServiceTestApp/Android.mk b/tests/tests/telecom/CallRedirectionServiceTestApp/Android.mk
deleted file mode 100644
index 5b89784..0000000
--- a/tests/tests/telecom/CallRedirectionServiceTestApp/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2019 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)
-
-src_dirs := src
-
-LOCAL_SRC_FILES := $(call all-java-files-under, $(src_dirs)) \
-                   $(call all-Iaidl-files-under, aidl)
-
-LOCAL_AIDL_INCLUDES := aidl/
-
-LOCAL_PACKAGE_NAME := CallRedirectionServiceTestApp
-
-LOCAL_MODULE_TAGS := optional
-LOCAL_SDK_VERSION := test_current
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_PROGUARD_ENABLED := disabled
-include $(BUILD_PACKAGE)
diff --git a/tests/tests/telecom/CallScreeningServiceTestApp/Android.bp b/tests/tests/telecom/CallScreeningServiceTestApp/Android.bp
new file mode 100644
index 0000000..a8ff58c
--- /dev/null
+++ b/tests/tests/telecom/CallScreeningServiceTestApp/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2018 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.
+
+// Build the Call Screening test app.
+// This is intentionally packaged separately so that the app can use its own
+// package name which does not conflict with the CallScreeningService
+// associated with the CTS InCallService.
+
+android_test_helper_app {
+    name: "CallScreeningServiceTestApp",
+    srcs: [
+        "src/**/*.java",
+        "aidl/**/I*.aidl",
+    ],
+    sdk_version: "test_current",
+    test_suites: [
+        "cts",
+        "vts",
+    ],
+    optimize: {
+        enabled: false,
+    },
+}
diff --git a/tests/tests/telecom/CallScreeningServiceTestApp/Android.mk b/tests/tests/telecom/CallScreeningServiceTestApp/Android.mk
deleted file mode 100644
index ae09720..0000000
--- a/tests/tests/telecom/CallScreeningServiceTestApp/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2018 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)
-
-# Build the Call Screening test app.
-# This is intentionally packaged separately so that the app can use its own
-# package name which does not conflict with the CallScreeningService
-# associated with the CTS InCallService.
-include $(CLEAR_VARS)
-
-src_dirs := src
-
-LOCAL_AIDL_INCLUDES := $(call all-Iaidl-files-under, aidl)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, $(src_dirs)) \
-                   $(call all-Iaidl-files-under, aidl)
-
-LOCAL_PACKAGE_NAME := CallScreeningServiceTestApp
-
-LOCAL_MODULE_TAGS := optional
-LOCAL_SDK_VERSION := test_current
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_PROGUARD_ENABLED := disabled
-include $(BUILD_PACKAGE)
diff --git a/tests/tests/telecom/ThirdPtyInCallServiceTestApp/Android.bp b/tests/tests/telecom/ThirdPtyInCallServiceTestApp/Android.bp
new file mode 100644
index 0000000..92a3c42
--- /dev/null
+++ b/tests/tests/telecom/ThirdPtyInCallServiceTestApp/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2018 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.
+
+android_test_helper_app {
+    name: "ThirdPtyInCallServiceTestApp",
+    defaults: ["cts_defaults"],
+    srcs: [
+        "src/**/*.java",
+        "aidl/**/I*.aidl",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+        "CtsTelecomMockLib",
+    ],
+    sdk_version: "test_current",
+    test_suites: [
+        "cts",
+        "vts",
+    ],
+}
diff --git a/tests/tests/telecom/ThirdPtyInCallServiceTestApp/Android.mk b/tests/tests/telecom/ThirdPtyInCallServiceTestApp/Android.mk
deleted file mode 100644
index 9152435..0000000
--- a/tests/tests/telecom/ThirdPtyInCallServiceTestApp/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2018 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)
-
-src_dirs := src \
-    ../src/android/telecom/cts/MockInCallService.java \
-    ../src/android/telecom/cts/MockVideoCallCallback.java \
-    ../src/android/telecom/cts/MockVideoProvider.java \
-    ../src/android/telecom/cts/TestUtils.java \
-    ../src/android/telecom/cts/MockConnection.java \
-    ../src/android/telecom/cts/SelfManagedConnection.java \
-    ../src/android/telecom/cts/CtsSelfManagedConnectionService.java
-
-LOCAL_SRC_FILES := $(call all-java-files-under, $(src_dirs)) \
-                   $(call all-Iaidl-files-under, aidl)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-	compatibility-device-util-axt \
-	ctstestrunner-axt \
-	androidx.test.rules
-
-LOCAL_AIDL_INCLUDES := aidl/
-
-LOCAL_PACKAGE_NAME := ThirdPtyInCallServiceTestApp
-
-LOCAL_MODULE_TAGS := optional
-LOCAL_SDK_VERSION := test_current
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_PROGUARD_ENABLED := disabled
-include $(BUILD_CTS_PACKAGE)
\ No newline at end of file
diff --git a/tests/tests/telecom/ThirdPtyInCallServiceTestApp/AndroidManifest.xml b/tests/tests/telecom/ThirdPtyInCallServiceTestApp/AndroidManifest.xml
index 4f439fb..eb509ec 100644
--- a/tests/tests/telecom/ThirdPtyInCallServiceTestApp/AndroidManifest.xml
+++ b/tests/tests/telecom/ThirdPtyInCallServiceTestApp/AndroidManifest.xml
@@ -35,6 +35,8 @@
             <intent-filter>
                 <action android:name="android.telecom.InCallService"/>
             </intent-filter>
+            <meta-data android:name="android.telecom.IN_CALL_SERVICE_CAR_MODE_UI"
+                       android:value="true" />
             <meta-data android:name="android.telecom.INCLUDE_EXTERNAL_CALLS"
                        android:value="true" />
         </service>
@@ -45,18 +47,6 @@
                     android:name="android.telecom.cts.thirdptyincallservice.ACTION_THIRDPTY_CTRL"/>
             </intent-filter>
         </service>
-        <service android:name=".CtsThirdPartyInCallService"
-                 android:permission="android.permission.BIND_INCALL_SERVICE"
-                 android:launchMode="singleInstance"
-                 android:exported="true">
-            <intent-filter>
-                <action android:name="android.telecom.InCallService"/>
-            </intent-filter>
-            <meta-data android:name="android.telecom.IN_CALL_SERVICE_CAR_MODE_UI"
-                       android:value="true" />
-            <meta-data android:name="android.telecom.INCLUDE_EXTERNAL_CALLS"
-                       android:value="true" />
-        </service>
     </application>
 
 </manifest>
diff --git a/tests/tests/telecom2/Android.bp b/tests/tests/telecom2/Android.bp
new file mode 100644
index 0000000..b80bb47
--- /dev/null
+++ b/tests/tests/telecom2/Android.bp
@@ -0,0 +1,41 @@
+// Copyright (C) 2015 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.
+
+android_test {
+    name: "CtsTelecomTestCases2",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "CtsTelecomUtilLib",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: [
+        "src/**/*.java",
+    ],
+    aaptflags: [
+        "--auto-add-overlay",
+        "--extra-packages",
+        "android.telecom.cts",
+        "--rename-manifest-package",
+        "android.telecom2.cts",
+    ],
+    sdk_version: "test_current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/telecom2/Android.mk b/tests/tests/telecom2/Android.mk
deleted file mode 100644
index 1a207b7..0000000
--- a/tests/tests/telecom2/Android.mk
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright (C) 2015 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)
-
-LOCAL_PACKAGE_NAME := CtsTelecomTestCases2
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-	compatibility-device-util-axt \
-	ctstestrunner-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-src_dirs := src \
-    ../telecom/src/android/telecom/cts/SelfManagedConnection.java \
-    ../telecom/src/android/telecom/cts/CtsSelfManagedConnectionService.java \
-    ../telecom/src/android/telecom/cts/TestUtils.java
-
-res_dirs := res \
-    ../telecom/res
-
-LOCAL_SRC_FILES := $(call all-java-files-under, $(src_dirs))
-
-LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dirs))
-
-LOCAL_AAPT_FLAGS := \
-    --auto-add-overlay \
-    --extra-packages android.telecom.cts \
-    --rename-manifest-package android.telecom2.cts \
-
-LOCAL_SDK_VERSION := test_current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/telecom3/Android.bp b/tests/tests/telecom3/Android.bp
new file mode 100644
index 0000000..bfc580f
--- /dev/null
+++ b/tests/tests/telecom3/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2017 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.
+
+res_dirs = ["../telecom/res"]
+android_test {
+    name: "CtsTelecomTestCases3",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "CtsTelecomUtilLib",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    aaptflags: [
+        "--auto-add-overlay",
+        "--extra-packages android.telecom.cts",
+        "--rename-manifest-package android.telecom3.cts",
+    ],
+    sdk_version: "test_current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/tests/telecom3/Android.mk b/tests/tests/telecom3/Android.mk
deleted file mode 100644
index ff195bd..0000000
--- a/tests/tests/telecom3/Android.mk
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_PACKAGE_NAME := CtsTelecomTestCases3
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util-axt ctstestrunner-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-src_dirs := src \
-    ../telecom/src/android/telecom/cts/SelfManagedConnection.java \
-    ../telecom/src/android/telecom/cts/CtsSelfManagedConnectionService.java \
-    ../telecom/src/android/telecom/cts/TestUtils.java
-
-res_dirs := ../telecom/res
-
-LOCAL_SRC_FILES := $(call all-java-files-under, $(src_dirs))
-
-LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dirs))
-
-LOCAL_AAPT_FLAGS := \
-    --auto-add-overlay \
-    --extra-packages android.telecom.cts \
-    --rename-manifest-package android.telecom3.cts \
-
-LOCAL_SDK_VERSION := test_current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/CellInfoTest.java b/tests/tests/telephony/current/src/android/telephony/cts/CellInfoTest.java
index 9167313..4bd9f4c 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/CellInfoTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/CellInfoTest.java
@@ -878,9 +878,7 @@
         assertTrue("getTimingAdvance() out of range [0,219] | Integer.MAX_VALUE, ta=" + ta,
                 ta == Integer.MAX_VALUE || (ta >= 0 && ta <= 219));
 
-        // Dbm here does not have specific limits. So just calling to verify that it does not
-        // crash the phone
-        gsm.getDbm();
+        assertEquals(gsm.getDbm(), gsm.getRssi());
 
         int asuLevel = gsm.getAsuLevel();
         assertTrue("getLevel() out of range [0,31] (or 99 is unknown), level=" + asuLevel,
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/PhoneNumberUtilsTest.java b/tests/tests/telephony/current/src/android/telephony/cts/PhoneNumberUtilsTest.java
index d9a989f..daf078b 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/PhoneNumberUtilsTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/PhoneNumberUtilsTest.java
@@ -40,13 +40,30 @@
 
 import java.util.Locale;
 
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 
 public class PhoneNumberUtilsTest {
+    private static final int MIN_MATCH = 7;
+
     // mPhoneNumber ~ "+17005550020", length == 7.
     private byte[] mPhoneNumber = { (byte) 0x91, (byte) 0x71, (byte) 0x00, (byte) 0x55,
             (byte) 0x05, (byte) 0x20, (byte) 0xF0 };
 
+    private int mOldMinMatch;
+
+    @Before
+    public void setUp() throws Exception {
+        mOldMinMatch = PhoneNumberUtils.getMinMatchForTest();
+        PhoneNumberUtils.setMinMatchForTest(MIN_MATCH);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        PhoneNumberUtils.setMinMatchForTest(mOldMinMatch);
+    }
+
     @Test
     public void testExtractMethods() {
 
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/SmsManagerTest.java b/tests/tests/telephony/current/src/android/telephony/cts/SmsManagerTest.java
index c81240d..26358f0 100755
--- a/tests/tests/telephony/current/src/android/telephony/cts/SmsManagerTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/SmsManagerTest.java
@@ -443,9 +443,6 @@
 
     @Test
     public void testContentProviderAccessRestriction() throws Exception {
-        if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
-            return;
-        }
         Uri dummySmsUri = null;
         Context context = getInstrumentation().getContext();
         ContentResolver contentResolver = context.getContentResolver();
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java b/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java
index 807ef0c..c0e08f1 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java
@@ -47,9 +47,12 @@
 import android.telecom.TelecomManager;
 import android.telephony.AccessNetworkConstants;
 import android.telephony.AvailableNetworkInfo;
+import android.telephony.CallAttributes;
+import android.telephony.CallQuality;
 import android.telephony.CellLocation;
 import android.telephony.NetworkRegistrationInfo;
 import android.telephony.PhoneStateListener;
+import android.telephony.PreciseCallState;
 import android.telephony.ServiceState;
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
@@ -1228,11 +1231,7 @@
      * Tests that a SecurityException is thrown when trying to access UiccCardsInfo.
      */
     @Test
-    public void testGetUiccCardsInfo() {
-        if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
-            Log.d(TAG, "Skipping test that requires FEATURE_TELEPHONY");
-            return;
-        }
+    public void testGetUiccCardsInfoException() {
         try {
             // Requires READ_PRIVILEGED_PHONE_STATE or carrier privileges
             List<UiccCardInfo> infos = mTelephonyManager.getUiccCardsInfo();
@@ -1241,6 +1240,31 @@
         }
     }
 
+    /**
+     * Tests that UiccCardsInfo methods don't crash.
+     */
+    @Test
+    public void testGetUiccCardsInfo() {
+        if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
+            Log.d(TAG, "Skipping test that requires FEATURE_TELEPHONY");
+            return;
+        }
+        // Requires READ_PRIVILEGED_PHONE_STATE or carrier privileges
+        List<UiccCardInfo> infos =
+                ShellIdentityUtils.invokeMethodWithShellPermissions(mTelephonyManager,
+                (tm) -> tm.getUiccCardsInfo());
+        // test that these methods don't crash
+        if (infos.size() > 0) {
+            UiccCardInfo info = infos.get(0);
+            info.getIccId();
+            info.getEid();
+            info.isRemovable();
+            info.isEuicc();
+            info.getCardId();
+            info.getSlotIndex();
+        }
+    }
+
     private static Context getContext() {
         return InstrumentationRegistry.getContext();
     }
@@ -1282,6 +1306,38 @@
     }
 
     /**
+     * Construct a CallAttributes object and test getters.
+     */
+    @Test
+    public void testCallAttributes() {
+        CallQuality cq = new CallQuality();
+        PreciseCallState pcs = new PreciseCallState();
+        CallAttributes ca = new CallAttributes(pcs, TelephonyManager.NETWORK_TYPE_UNKNOWN, cq);
+        assertEquals(pcs, ca.getPreciseCallState());
+        assertEquals(TelephonyManager.NETWORK_TYPE_UNKNOWN, ca.getNetworkType());
+        assertEquals(cq, ca.getCallQuality());
+    }
+
+    /**
+     * Checks that a zeroed-out default CallQuality object can be created
+     */
+    @Test
+    public void testCallQuality() {
+        CallQuality cq = new CallQuality();
+        assertEquals(0, cq.getDownlinkCallQualityLevel());
+        assertEquals(0, cq.getUplinkCallQualityLevel());
+        assertEquals(0, cq.getCallDuration());
+        assertEquals(0, cq.getNumRtpPacketsTransmitted());
+        assertEquals(0, cq.getNumRtpPacketsReceived());
+        assertEquals(0, cq.getNumRtpPacketsTransmittedLost());
+        assertEquals(0, cq.getNumRtpPacketsNotReceived());
+        assertEquals(0, cq.getAverageRelativeJitter());
+        assertEquals(0, cq.getMaxRelativeJitter());
+        assertEquals(0, cq.getAverageRoundTripTime());
+        assertEquals(0, cq.getCodecType());
+    }
+
+    /**
      * Tests TelephonyManager.getEmergencyNumberList.
      */
     @Test
diff --git a/tests/tests/telephony/current/src/android/telephony/euicc/cts/EuiccProfileInfoTest.java b/tests/tests/telephony/current/src/android/telephony/euicc/cts/EuiccProfileInfoTest.java
new file mode 100644
index 0000000..ca203f8
--- /dev/null
+++ b/tests/tests/telephony/current/src/android/telephony/euicc/cts/EuiccProfileInfoTest.java
@@ -0,0 +1,238 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+package android.telephony.euicc.cts;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+
+import android.os.Parcel;
+import android.service.carrier.CarrierIdentifier;
+import android.service.euicc.EuiccProfileInfo;
+import android.telephony.UiccAccessRule;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.Arrays;
+
+/**
+ * This class is an exact copy of
+ * frameworks/base/core/tests/coretests/src/android/service/euicc/EuiccProfileInfoTest.java, except
+ * {@link #testBuilderBuild_IllegalIccid}
+ */
+@RunWith(AndroidJUnit4.class)
+public class EuiccProfileInfoTest {
+    @Test
+    public void testWriteToParcel() {
+        EuiccProfileInfo p =
+                new EuiccProfileInfo.Builder("21430000000000006587")
+                        .setNickname("profile nickname")
+                        .setServiceProviderName("service provider")
+                        .setProfileName("profile name")
+                        .setProfileClass(EuiccProfileInfo.PROFILE_CLASS_OPERATIONAL)
+                        .setState(EuiccProfileInfo.PROFILE_STATE_ENABLED)
+                        .setCarrierIdentifier(
+                                new CarrierIdentifier(
+                                        new byte[] {0x23, 0x45, 0x67},
+                                        "123",
+                                        "45"))
+                        .setPolicyRules(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE)
+                        .setUiccAccessRule(
+                                Arrays.asList(new UiccAccessRule(new byte[] {}, "package", 12345L)))
+                        .build();
+
+        Parcel parcel = Parcel.obtain();
+        assertTrue(parcel != null);
+        p.writeToParcel(parcel, 0);
+
+        parcel.setDataPosition(0);
+        EuiccProfileInfo fromParcel = EuiccProfileInfo.CREATOR.createFromParcel(parcel);
+
+        assertEquals(p, fromParcel);
+    }
+
+    @Test
+    public void testWriteToParcelNullCarrierId() {
+        EuiccProfileInfo p =
+                new EuiccProfileInfo.Builder("21430000000000006587")
+                        .setNickname("profile nickname")
+                        .setServiceProviderName("service provider")
+                        .setProfileName("profile name")
+                        .setProfileClass(EuiccProfileInfo.PROFILE_CLASS_OPERATIONAL)
+                        .setState(EuiccProfileInfo.PROFILE_STATE_ENABLED)
+                        .setPolicyRules(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE)
+                        .setUiccAccessRule(
+                                Arrays.asList(new UiccAccessRule(new byte[] {}, "package", 12345L))
+                        )
+                        .build();
+
+        Parcel parcel = Parcel.obtain();
+        assertTrue(parcel != null);
+        p.writeToParcel(parcel, 0);
+
+        parcel.setDataPosition(0);
+        EuiccProfileInfo fromParcel = EuiccProfileInfo.CREATOR.createFromParcel(parcel);
+
+        assertEquals(p, fromParcel);
+    }
+
+    @Test
+    public void testBuilderAndGetters() {
+        EuiccProfileInfo p =
+                new EuiccProfileInfo.Builder("21430000000000006587")
+                        .setNickname("profile nickname")
+                        .setProfileName("profile name")
+                        .setServiceProviderName("service provider")
+                        .setCarrierIdentifier(
+                                new CarrierIdentifier(
+                                        new byte[] {0x23, 0x45, 0x67},
+                                        "123",
+                                        "45"))
+                        .setState(EuiccProfileInfo.PROFILE_STATE_ENABLED)
+                        .setProfileClass(EuiccProfileInfo.PROFILE_CLASS_OPERATIONAL)
+                        .setPolicyRules(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE)
+                        .setUiccAccessRule(Arrays.asList(new UiccAccessRule(new byte[0], null, 0)))
+                        .build();
+
+        assertEquals("21430000000000006587", p.getIccid());
+        assertEquals("profile nickname", p.getNickname());
+        assertEquals("profile name", p.getProfileName());
+        assertEquals("service provider", p.getServiceProviderName());
+        assertEquals("325", p.getCarrierIdentifier().getMcc());
+        assertEquals("764", p.getCarrierIdentifier().getMnc());
+        assertEquals("123", p.getCarrierIdentifier().getGid1());
+        assertEquals("45", p.getCarrierIdentifier().getGid2());
+        assertEquals(EuiccProfileInfo.PROFILE_STATE_ENABLED, p.getState());
+        assertEquals(EuiccProfileInfo.PROFILE_CLASS_OPERATIONAL, p.getProfileClass());
+        assertEquals(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE, p.getPolicyRules());
+        assertTrue(p.hasPolicyRules());
+        assertTrue(p.hasPolicyRule(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE));
+        assertFalse(p.hasPolicyRule(EuiccProfileInfo.POLICY_RULE_DO_NOT_DISABLE));
+        assertArrayEquals(
+                new UiccAccessRule[] {new UiccAccessRule(new byte[0], null, 0)},
+                p.getUiccAccessRules().toArray());
+    }
+
+    @Test
+    public void testBuilder_BasedOnAnotherProfile() {
+        EuiccProfileInfo p =
+                new EuiccProfileInfo.Builder("21430000000000006587")
+                        .setNickname("profile nickname")
+                        .setProfileName("profile name")
+                        .setServiceProviderName("service provider")
+                        .setCarrierIdentifier(
+                                new CarrierIdentifier(
+                                        new byte[] {0x23, 0x45, 0x67},
+                                        "123",
+                                        "45"))
+                        .setState(EuiccProfileInfo.PROFILE_STATE_ENABLED)
+                        .setProfileClass(EuiccProfileInfo.PROFILE_CLASS_OPERATIONAL)
+                        .setPolicyRules(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE)
+                        .setUiccAccessRule(
+                                Arrays.asList(new UiccAccessRule(new byte[] {}, "package", 12345L)))
+                        .build();
+
+        EuiccProfileInfo copied = new EuiccProfileInfo.Builder(p).build();
+
+        assertEquals(p, copied);
+        assertEquals(p.hashCode(), copied.hashCode());
+    }
+
+    @Test
+    public void testEqualsHashCode() {
+        EuiccProfileInfo p =
+                new EuiccProfileInfo.Builder("21430000000000006587")
+                        .setNickname("profile nickname")
+                        .setProfileName("profile name")
+                        .setServiceProviderName("service provider")
+                        .setCarrierIdentifier(
+                                new CarrierIdentifier(
+                                        new byte[] {0x23, 0x45, 0x67},
+                                        "123",
+                                        "45"))
+                        .setState(EuiccProfileInfo.PROFILE_STATE_ENABLED)
+                        .setProfileClass(EuiccProfileInfo.PROFILE_STATE_ENABLED)
+                        .setPolicyRules(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE)
+                        .setUiccAccessRule(Arrays.asList(new UiccAccessRule(new byte[0], null, 0)))
+                        .build();
+
+        assertTrue(p.equals(p));
+        assertFalse(p.equals(new Object()));
+
+        EuiccProfileInfo t = null;
+        assertFalse(p.equals(t));
+
+        t = new EuiccProfileInfo.Builder(p).setIccid("21").build();
+        assertFalse(p.equals(t));
+        assertNotEquals(p.hashCode(), t.hashCode());
+
+        t = new EuiccProfileInfo.Builder(p).setNickname(null).build();
+        assertFalse(p.equals(t));
+        assertNotEquals(p.hashCode(), t.hashCode());
+
+        t = new EuiccProfileInfo.Builder(p).setProfileName(null).build();
+        assertFalse(p.equals(t));
+        assertNotEquals(p.hashCode(), t.hashCode());
+
+        t = new EuiccProfileInfo.Builder(p).setServiceProviderName(null).build();
+        assertFalse(p.equals(t));
+        assertNotEquals(p.hashCode(), t.hashCode());
+
+        t = new EuiccProfileInfo.Builder(p).setCarrierIdentifier(null).build();
+        assertFalse(p.equals(t));
+        assertNotEquals(p.hashCode(), t.hashCode());
+
+        t = new EuiccProfileInfo.Builder(p)
+                .setState(EuiccProfileInfo.PROFILE_STATE_DISABLED).build();
+        assertFalse(p.equals(t));
+        assertNotEquals(p.hashCode(), t.hashCode());
+
+        t = new EuiccProfileInfo.Builder(p)
+                .setProfileClass(EuiccProfileInfo.PROFILE_CLASS_TESTING).build();
+        assertFalse(p.equals(t));
+        assertNotEquals(p.hashCode(), t.hashCode());
+
+        t = new EuiccProfileInfo.Builder(p).setPolicyRules(0).build();
+        assertFalse(p.equals(t));
+        assertNotEquals(p.hashCode(), t.hashCode());
+
+        t = new EuiccProfileInfo.Builder(p).setUiccAccessRule(null).build();
+        assertFalse(p.equals(t));
+        assertNotEquals(p.hashCode(), t.hashCode());
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testBuilderBuild_IllegalIccid() {
+        new EuiccProfileInfo.Builder("abc").build();
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testBuilderSetOperatorMccMnc_Illegal() {
+        new EuiccProfileInfo.Builder("21430000000000006587")
+                .setCarrierIdentifier(new CarrierIdentifier(new byte[] {1, 2, 3, 4}, null, null));
+    }
+
+    @Test
+    public void testCreatorNewArray() {
+        EuiccProfileInfo[] profiles = EuiccProfileInfo.CREATOR.newArray(123);
+        assertEquals(123, profiles.length);
+    }
+}
diff --git a/tests/tests/telephony2/Android.bp b/tests/tests/telephony2/Android.bp
new file mode 100644
index 0000000..def3a75
--- /dev/null
+++ b/tests/tests/telephony2/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2015 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.
+
+android_test {
+    name: "CtsTelephony2TestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    sdk_version: "test_current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+}
diff --git a/tests/tests/telephony2/Android.mk b/tests/tests/telephony2/Android.mk
deleted file mode 100644
index 90cfe97..0000000
--- a/tests/tests/telephony2/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2015 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner-axt \
-    compatibility-device-util-axt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsTelephony2TestCases
-LOCAL_SDK_VERSION := current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_JAVA_LIBRARIES += android.test.runner.stubs
-LOCAL_JAVA_LIBRARIES += android.test.base.stubs
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/LockedMessageTest.java b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/LockedMessageTest.java
new file mode 100644
index 0000000..f3d04cb
--- /dev/null
+++ b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/LockedMessageTest.java
@@ -0,0 +1,183 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+package android.telephonyprovider.cts;
+
+import static androidx.test.InstrumentationRegistry.getInstrumentation;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.ContentResolver;
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.net.Uri;
+import android.provider.Telephony;
+
+import androidx.test.filters.SmallTest;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+@SmallTest
+public class LockedMessageTest {
+    private static final String MMS_SUBJECT_ONE = "MMS Subject CTS One";
+    private static final String SMS_SUBJECT_TWO = "SMS Subject CTS One";
+    private static final String TEST_SMS_BODY = "TEST_SMS_BODY";
+    private static final String TEST_ADDRESS = "+19998880001";
+    private static final int TEST_THREAD_ID = 101;
+
+    private ContentResolver mContentResolver;
+
+    @BeforeClass
+    public static void ensureDefaultSmsApp() {
+        DefaultSmsAppHelper.ensureDefaultSmsApp();
+    }
+
+    @AfterClass
+    public static void cleanup() {
+        ContentResolver contentResolver = getInstrumentation().getContext().getContentResolver();
+        contentResolver.delete(Telephony.Mms.CONTENT_URI, null, null);
+        contentResolver.delete(Telephony.Sms.CONTENT_URI, null, null);
+    }
+
+    @Before
+    public void setupTestEnvironment() {
+        cleanup();
+        mContentResolver = getInstrumentation().getContext().getContentResolver();
+    }
+
+    /**
+     * The purpose of this test is to check at least one locked message found in the union of MMS
+     * and SMS messages.
+     */
+    @Test
+    @Ignore
+    public void testLockedMessage_atMostOneLockedMessage() {
+        Uri mmsUri = insertMmsWithLockedMessage();
+        String mmsId = mmsUri.getLastPathSegment();
+
+        Uri smsUri = insertSmsWithLockedMessage();
+        String smsId = smsUri.getLastPathSegment();
+
+        Cursor cursor = mContentResolver.query(Telephony.MmsSms.CONTENT_LOCKED_URI, null, null,
+                null);
+        assertThat(cursor.getCount()).isEqualTo(1);
+        assertThat(cursor.moveToFirst()).isEqualTo(true);
+        assertThat(cursor.getColumnCount()).isEqualTo(1);
+        assertThat(cursor.getColumnNames()).isEqualTo(new String[]{Telephony.BaseMmsColumns._ID});
+        assertThat(cursor.getInt(cursor.getColumnIndex(Telephony.BaseMmsColumns._ID)))
+                .isNotEqualTo(Integer.parseInt(mmsId));
+        assertThat(cursor.getInt(cursor.getColumnIndex(Telephony.BaseMmsColumns._ID)))
+                .isEqualTo(Integer.parseInt(smsId));
+    }
+
+    /**
+     * The purpose of this test is to check there is no locked message found in the union of MMS and
+     * SMS messages.
+     */
+    @Test
+    public void testLockedMessage_getNoLockedMessage() {
+        Uri mmsUri = insertIntoMmsTable(MMS_SUBJECT_ONE, Telephony.Sms.MESSAGE_TYPE_SENT);
+        assertThat(mmsUri).isNotNull();
+        Cursor mmsCursor = mContentResolver.query(mmsUri, null, null, null);
+        assertThat(mmsCursor.getCount()).isEqualTo(1);
+
+        Uri smsUri = insertIntoSmsTable(SMS_SUBJECT_TWO);
+        assertThat(smsUri).isNotNull();
+        Cursor smCursor = mContentResolver.query(smsUri, null, null, null);
+        assertThat(smCursor.getCount()).isEqualTo(1);
+
+        Cursor cursor = mContentResolver.query(Telephony.MmsSms.CONTENT_LOCKED_URI, null, null,
+                null);
+        assertThat(cursor.getCount()).isEqualTo(0);
+    }
+
+    private Uri insertMmsWithLockedMessage() {
+        Uri mmsUri = insertIntoMmsTable(MMS_SUBJECT_ONE, Telephony.Sms.MESSAGE_TYPE_SENT);
+        assertThat(mmsUri).isNotNull();
+
+        Cursor cursor = mContentResolver.query(mmsUri, null, null, null);
+
+        assertThat(cursor.getCount()).isEqualTo(1);
+
+        final ContentValues updateValues = new ContentValues();
+        updateValues.put(Telephony.Mms.LOCKED, 1);
+
+        int cursorUpdate = mContentResolver.update(mmsUri, updateValues, null, null);
+        assertThat(cursorUpdate).isEqualTo(1);
+
+        Cursor cursorAfterReadUpdate = mContentResolver.query(mmsUri, null, null, null);
+
+        assertThat(cursorAfterReadUpdate.getCount()).isEqualTo(1);
+        assertThat(cursorAfterReadUpdate.moveToFirst()).isEqualTo(true);
+        assertThat(
+                cursorAfterReadUpdate.getInt(
+                        cursorAfterReadUpdate.getColumnIndex(Telephony.Mms.LOCKED)))
+                .isEqualTo(
+                        1);
+        return mmsUri;
+    }
+
+    private Uri insertSmsWithLockedMessage() {
+        Uri smsUri = insertIntoSmsTable(SMS_SUBJECT_TWO);
+        assertThat(smsUri).isNotNull();
+
+        Cursor cursor = mContentResolver.query(smsUri, null, null, null);
+
+        assertThat(cursor.getCount()).isEqualTo(1);
+
+        final ContentValues updateValues = new ContentValues();
+        updateValues.put(Telephony.Sms.LOCKED, 1);
+
+        int cursorUpdate = mContentResolver.update(smsUri, updateValues, null, null);
+        assertThat(cursorUpdate).isEqualTo(1);
+
+        Cursor cursorAfterReadUpdate = mContentResolver.query(smsUri, null, null, null);
+
+        assertThat(cursorAfterReadUpdate.getCount()).isEqualTo(1);
+        assertThat(cursorAfterReadUpdate.moveToFirst()).isEqualTo(true);
+        assertThat(
+                cursorAfterReadUpdate.getInt(
+                        cursorAfterReadUpdate.getColumnIndex(Telephony.Sms.LOCKED)))
+                .isEqualTo(
+                        1);
+        return smsUri;
+    }
+
+    private Uri insertIntoMmsTable(String subject, int messageType) {
+        final ContentValues mmsValues = new ContentValues();
+        mmsValues.put(Telephony.Mms.TEXT_ONLY, 1);
+        mmsValues.put(Telephony.Mms.MESSAGE_TYPE, messageType);
+        mmsValues.put(Telephony.Mms.SUBJECT, subject);
+        mmsValues.put(Telephony.Mms.THREAD_ID, TEST_THREAD_ID);
+        final Uri mmsUri = mContentResolver.insert(Telephony.Mms.CONTENT_URI, mmsValues);
+        return mmsUri;
+    }
+
+    private Uri insertIntoSmsTable(String subject) {
+        final ContentValues smsValues = new ContentValues();
+        smsValues.put(Telephony.Sms.SUBJECT, subject);
+        smsValues.put(Telephony.Sms.ADDRESS, TEST_ADDRESS);
+        smsValues.put(Telephony.Sms.BODY, TEST_SMS_BODY);
+        smsValues.put(Telephony.Sms.THREAD_ID, TEST_THREAD_ID);
+        final Uri smsUri = mContentResolver.insert(Telephony.Sms.CONTENT_URI, smsValues);
+        return smsUri;
+    }
+
+}
diff --git a/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/MmsPartTest.java b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/MmsPartTest.java
index 26eee31..9e45328 100644
--- a/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/MmsPartTest.java
+++ b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/MmsPartTest.java
@@ -21,6 +21,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 import android.content.ContentResolver;
+import android.content.ContentUris;
 import android.content.ContentValues;
 import android.database.Cursor;
 import android.net.Uri;
@@ -34,31 +35,36 @@
 import javax.annotation.Nullable;
 
 public class MmsPartTest {
-    private ContentResolver mContentResolver;
 
+    private static final String MMS_SUBJECT_ONE = "MMS Subject CTS One";
+    private static final String MMS_BODY = "MMS body CTS";
+    private static final String MMS_BODY_UPDATE = "MMS body CTS Update";
+    private static final String TEXT_PLAIN = "text/plain";
+    private static final String SRC_NAME = String.format("text.%06d.txt", 0);
     /**
-     * Parts must be inserted in relation to a message, this message ID is used for inserting a
-     * part when the message ID is not important in relation to the current test.
+     * Parts must be inserted in relation to a message, this message ID is used for inserting a part
+     * when the message ID is not important in relation to the current test.
      */
     private static final String TEST_MESSAGE_ID = "100";
+    private ContentResolver mContentResolver;
 
     @BeforeClass
     public static void ensureDefaultSmsApp() {
         DefaultSmsAppHelper.ensureDefaultSmsApp();
     }
 
-    @Before
-    public void setupTestEnvironment() {
-        cleanup();
-        mContentResolver = getInstrumentation().getContext().getContentResolver();
-    }
-
     @AfterClass
     public static void cleanup() {
         ContentResolver contentResolver = getInstrumentation().getContext().getContentResolver();
         contentResolver.delete(Telephony.Mms.Part.CONTENT_URI, null, null);
     }
 
+    @Before
+    public void setupTestEnvironment() {
+        cleanup();
+        mContentResolver = getInstrumentation().getContext().getContentResolver();
+    }
+
     @Test
     public void testMmsPartInsert_cannotInsertPartWithDataColumn() {
         ContentValues values = new ContentValues();
@@ -73,8 +79,14 @@
     public void testMmsPartInsert_canInsertPartWithoutDataColumn() {
         String name = "testMmsInsert_canInsertPartWithoutDataColumn";
 
-        Uri uri = insertTestMmsPartWithName(name);
-        assertThatMmsPartInsertSucceeded(uri, name);
+        Uri mmsUri = insertIntoMmsTable(MMS_SUBJECT_ONE);
+        assertThat(mmsUri).isNotNull();
+        final long mmsId = ContentUris.parseId(mmsUri);
+
+        //Creating part uri using mmsId.
+        final Uri partUri = Telephony.Mms.Part.getPartUriForMessage(String.valueOf(mmsId));
+        Uri insertPartUri = insertIntoMmsPartTable(mmsUri, partUri, mmsId, MMS_BODY, name);
+        assertThatMmsPartInsertSucceeded(insertPartUri, name, MMS_BODY);
     }
 
     @Test
@@ -88,10 +100,57 @@
         assertThat(id2).isGreaterThan(id1);
     }
 
+    @Test
+    public void testMmsPartUpdate() {
+        //Inserting data to MMS table.
+        Uri mmsUri = insertIntoMmsTable(MMS_SUBJECT_ONE);
+        assertThat(mmsUri).isNotNull();
+        final long mmsId = ContentUris.parseId(mmsUri);
+
+        //Creating part uri using mmsId.
+        final Uri partUri = Telephony.Mms.Part.getPartUriForMessage(String.valueOf(mmsId));
+
+        //Inserting data to MmsPart table with mapping with mms uri.
+        Uri insertPartUri = insertIntoMmsPartTable(mmsUri, partUri, mmsId, MMS_BODY, SRC_NAME);
+        assertThatMmsPartInsertSucceeded(insertPartUri, SRC_NAME, MMS_BODY);
+
+        final ContentValues updateValues = new ContentValues();
+        updateValues.put(Telephony.Mms.Part.TEXT, MMS_BODY_UPDATE);
+
+        // Updating part table.
+        int cursorUpdate = mContentResolver.update(partUri, updateValues, null, null);
+        assertThat(cursorUpdate).isEqualTo(1);
+        assertThatMmsPartInsertSucceeded(insertPartUri, SRC_NAME, MMS_BODY_UPDATE);
+
+    }
+
+    @Test
+    public void testMmsPartDelete_canDeleteById() {
+        Uri mmsUri = insertIntoMmsTable(MMS_SUBJECT_ONE);
+        assertThat(mmsUri).isNotNull();
+        final long mmsId = ContentUris.parseId(mmsUri);
+        final Uri partUri = Telephony.Mms.Part.getPartUriForMessage(String.valueOf(mmsId));
+
+        Uri insertPartUri = insertIntoMmsPartTable(mmsUri, partUri, mmsId, MMS_BODY, SRC_NAME);
+        assertThat(insertPartUri).isNotNull();
+
+        int deletedRows = mContentResolver.delete(partUri, null, null);
+
+        assertThat(deletedRows).isEqualTo(1);
+
+    }
+
     private long insertAndVerifyMmsPartReturningId(String name) {
-        Uri uri = insertTestMmsPartWithName(name);
-        assertThatMmsPartInsertSucceeded(uri, name);
-        return Long.parseLong(uri.getLastPathSegment());
+        Uri mmsUri = insertIntoMmsTable(MMS_SUBJECT_ONE);
+        assertThat(mmsUri).isNotNull();
+        final long mmsId = ContentUris.parseId(mmsUri);
+
+        //Creating part uri using mmsId.
+        final Uri partUri = Telephony.Mms.Part.getPartUriForMessage(String.valueOf(mmsId));
+        Uri insertPartUri = insertIntoMmsPartTable(mmsUri, partUri, mmsId, MMS_BODY, name);
+
+        assertThatMmsPartInsertSucceeded(insertPartUri, name, MMS_BODY);
+        return Long.parseLong(insertPartUri.getLastPathSegment());
     }
 
     private void deletePartById(long partId) {
@@ -100,33 +159,49 @@
         assertThat(deletedRows).isEqualTo(1);
     }
 
-    private Uri insertTestMmsPartWithName(String name) {
-        ContentValues values = new ContentValues();
-        values.put(Telephony.Mms.Part.NAME, name);
-        return insertTestMmsPartWithValues(values);
-    }
-
     private Uri insertTestMmsPartWithValues(ContentValues values) {
-        Uri insertUri = Telephony.Mms.CONTENT_URI.buildUpon()
-                .appendPath(TEST_MESSAGE_ID)
-                .appendPath("part")
-                .build();
+        Uri insertUri = Telephony.Mms.Part.getPartUriForMessage(TEST_MESSAGE_ID);
 
         Uri uri = mContentResolver.insert(insertUri, values);
         return uri;
     }
 
     private void assertThatMmsPartInsertSucceeded(@Nullable Uri uriReturnedFromInsert,
-            String nameOfAttemptedInsert) {
+            String nameOfAttemptedInsert, String textBody) {
         assertThat(uriReturnedFromInsert).isNotNull();
 
         Cursor cursor = mContentResolver.query(uriReturnedFromInsert, null, null, null);
-
         assertThat(cursor.getCount()).isEqualTo(1);
 
         cursor.moveToNext();
         String actualName = cursor.getString(cursor.getColumnIndex(Telephony.Mms.Part.NAME));
         assertThat(actualName).isEqualTo(nameOfAttemptedInsert);
+        assertThat(cursor.getString(cursor.getColumnIndex(Telephony.Mms.Part.TEXT))).isEqualTo(
+                textBody);
     }
 
+    private Uri insertIntoMmsTable(String subject) {
+        final ContentValues mmsValues = new ContentValues();
+        mmsValues.put(Telephony.Mms.TEXT_ONLY, 1);
+        mmsValues.put(Telephony.Mms.MESSAGE_TYPE, 128);
+        mmsValues.put(Telephony.Mms.SUBJECT, subject);
+        final Uri mmsUri = mContentResolver.insert(Telephony.Mms.CONTENT_URI, mmsValues);
+        return mmsUri;
+    }
+
+    private Uri insertIntoMmsPartTable(Uri mmsUri, Uri partUri, long mmsId, String body,
+            String name) {
+        // Insert body part.
+        final ContentValues values = new ContentValues();
+        values.put(Telephony.Mms.Part.MSG_ID, mmsId);
+        values.put(Telephony.Mms.Part.NAME, name);
+        values.put(Telephony.Mms.Part.SEQ, 0);
+        values.put(Telephony.Mms.Part.CONTENT_TYPE, TEXT_PLAIN);
+        values.put(Telephony.Mms.Part.CONTENT_ID, "<" + SRC_NAME + ">");
+        values.put(Telephony.Mms.Part.CONTENT_LOCATION, SRC_NAME);
+        values.put(Telephony.Mms.Part.CHARSET, 111);
+        values.put(Telephony.Mms.Part.TEXT, body);
+        Uri insertPartUri = mContentResolver.insert(partUri, values);
+        return insertPartUri;
+    }
 }
diff --git a/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/MmsTest.java b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/MmsTest.java
index 707e2b2..14f05a5 100644
--- a/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/MmsTest.java
+++ b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/MmsTest.java
@@ -21,10 +21,16 @@
 import static com.google.common.truth.Truth.assertThat;
 
 import android.content.ContentResolver;
+import android.content.ContentUris;
 import android.content.ContentValues;
 import android.database.Cursor;
 import android.net.Uri;
 import android.provider.Telephony;
+import android.provider.Telephony.Mms.Draft;
+import android.provider.Telephony.Mms.Inbox;
+import android.provider.Telephony.Mms.Outbox;
+import android.provider.Telephony.Mms.Sent;
+import android.provider.Telephony.Sms;
 
 import androidx.test.filters.SmallTest;
 
@@ -37,6 +43,13 @@
 
 @SmallTest
 public class MmsTest {
+
+    private static final String[] MMS_ADDRESSES = new String[]{"+1223", "+43234234"};
+    private static final String MMS_SUBJECT_ONE = "MMS Subject CTS One";
+    private static final String MMS_SUBJECT_TWO = "MMS Subject CTS Two";
+    private static final String MMS_BODY = "MMS body CTS";
+    private static final String TEXT_PLAIN = "text/plain";
+
     private ContentResolver mContentResolver;
 
     @BeforeClass
@@ -44,18 +57,18 @@
         DefaultSmsAppHelper.ensureDefaultSmsApp();
     }
 
-    @Before
-    public void setupTestEnvironment() {
-        cleanup();
-        mContentResolver = getInstrumentation().getContext().getContentResolver();
-    }
-
     @AfterClass
     public static void cleanup() {
         ContentResolver contentResolver = getInstrumentation().getContext().getContentResolver();
         contentResolver.delete(Telephony.Mms.CONTENT_URI, null, null);
     }
 
+    @Before
+    public void setupTestEnvironment() {
+        cleanup();
+        mContentResolver = getInstrumentation().getContext().getContentResolver();
+    }
+
     @Test
     public void testMmsInsert_insertSendReqSucceeds() {
         String expectedSubject = "testMmsInsert_insertSendReqSucceeds";
@@ -102,6 +115,348 @@
         assertThatMmsInsertSucceeded(uri, expectedSubject);
     }
 
+    @Test
+    public void testMmsInsert_canInsertTextMms() {
+        Uri mmsUri = insertIntoMmsTable(MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_SENT);
+        assertThat(mmsUri).isNotNull();
+
+        final long mmsId = ContentUris.parseId(mmsUri);
+        final Uri partUri = Telephony.Mms.Part.getPartUriForMessage(String.valueOf(mmsId));
+
+        Uri insertPartUri = insertIntoMmsPartTable(mmsUri, partUri, mmsId, MMS_BODY);
+        assertThat(insertPartUri).isNotNull();
+
+        insertIntoMmsAddressTable(mmsId, MMS_ADDRESSES);
+
+        Cursor mmsCursor = mContentResolver.query(mmsUri, null, null, null);
+        assertThat(mmsCursor.getCount()).isEqualTo(1);
+
+        assertThat(mmsCursor.moveToFirst()).isEqualTo(true);
+        assertThatMmsCursorValues(mmsCursor, MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_SENT);
+
+        Cursor partCursor = mContentResolver.query(partUri, null, null, null);
+        assertThat(partCursor.getCount()).isEqualTo(1);
+        assertThat(partCursor.moveToFirst()).isEqualTo(true);
+        assertThat(partCursor.getLong(partCursor.getColumnIndex(Telephony.Mms.Part.MSG_ID)))
+                .isEqualTo(
+                        mmsId);
+        assertThat(partCursor.getInt(partCursor.getColumnIndex(Telephony.Mms.Part.SEQ))).isEqualTo(
+                0);
+        assertThat(partCursor.getString(partCursor.getColumnIndex(Telephony.Mms.Part.CONTENT_TYPE)))
+                .isEqualTo(
+                        TEXT_PLAIN);
+        assertThat(partCursor.getString(partCursor.getColumnIndex(Telephony.Mms.Part.TEXT)))
+                .isEqualTo(
+                        MMS_BODY);
+    }
+
+    @Test
+    public void testInsertMessageBoxUri_canSaveAndQueryMmsSent() {
+        Uri mmsUri = saveMmsWithMessageBoxUri(MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_SENT);
+        assertThat(mmsUri).isNotNull();
+
+        Uri mmsUri1 = saveMmsWithMessageBoxUri(MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_SENT);
+        assertThat(mmsUri1).isNotNull();
+
+        Cursor msgCursor = mContentResolver.query(Sent.CONTENT_URI, null, null, null);
+        assertThat(msgCursor.getCount()).isEqualTo(2);
+
+        assertThat(msgCursor.moveToFirst()).isEqualTo(true);
+        assertThatMmsCursorValues(msgCursor, MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_SENT);
+
+        assertThat(msgCursor.moveToNext()).isEqualTo(true);
+        assertThatMmsCursorValues(msgCursor, MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_SENT);
+    }
+
+    @Test
+    public void testInsertMessageBoxUri_canSaveAndQueryMmsDraft() {
+        Uri mmsUri = saveMmsWithMessageBoxUri(MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_DRAFT);
+        assertThat(mmsUri).isNotNull();
+
+        Uri mmsUri1 = saveMmsWithMessageBoxUri(MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_DRAFT);
+        assertThat(mmsUri1).isNotNull();
+
+        Cursor msgCursor = mContentResolver.query(Draft.CONTENT_URI, null, null, null);
+        assertThat(msgCursor.getCount()).isEqualTo(2);
+
+        assertThat(msgCursor.moveToFirst()).isEqualTo(true);
+        assertThatMmsCursorValues(msgCursor, MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_DRAFT);
+
+        assertThat(msgCursor.moveToNext()).isEqualTo(true);
+        assertThatMmsCursorValues(msgCursor, MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_DRAFT);
+    }
+
+    @Test
+    public void testInsertMessageBoxUri_canSaveAndQueryMmsInbox() {
+        Uri mmsUri = saveMmsWithMessageBoxUri(MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_INBOX);
+        assertThat(mmsUri).isNotNull();
+
+        Uri mmsUri1 = saveMmsWithMessageBoxUri(MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_INBOX);
+        assertThat(mmsUri1).isNotNull();
+
+        Cursor msgCursor = mContentResolver.query(Inbox.CONTENT_URI, null, null, null);
+        assertThat(msgCursor.getCount()).isEqualTo(2);
+
+        assertThat(msgCursor.moveToFirst()).isEqualTo(true);
+        assertThatMmsCursorValues(msgCursor, MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_INBOX);
+
+        assertThat(msgCursor.moveToNext()).isEqualTo(true);
+        assertThatMmsCursorValues(msgCursor, MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_INBOX);
+    }
+
+    @Test
+    public void testInsertMessageBoxUri_canSaveAndQueryMmsOutbox() {
+        Uri mmsUri = saveMmsWithMessageBoxUri(MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_OUTBOX);
+        assertThat(mmsUri).isNotNull();
+
+        Uri mmsUri1 = saveMmsWithMessageBoxUri(MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_OUTBOX);
+        assertThat(mmsUri1).isNotNull();
+
+        Cursor msgCursor = mContentResolver.query(Outbox.CONTENT_URI, null, null, null);
+        assertThat(msgCursor.getCount()).isEqualTo(2);
+
+        assertThat(msgCursor.moveToFirst()).isEqualTo(true);
+        assertThatMmsCursorValues(msgCursor, MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_OUTBOX);
+
+        assertThat(msgCursor.moveToNext()).isEqualTo(true);
+        assertThatMmsCursorValues(msgCursor, MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_OUTBOX);
+    }
+
+    @Test
+    public void testMmsQuery_retrieveAllWhenSelectorNotSpecified() {
+        insertIntoMmsTableWithDifferentMessageBoxUriOfMms();
+
+        Cursor cursor = mContentResolver
+                .query(Telephony.Mms.CONTENT_URI, null, null, null, null, null);
+
+        assertThat(cursor.getCount() >= 5).isEqualTo(true);
+        assertThat(cursor.moveToFirst()).isEqualTo(true);
+        assertThatMmsCursorValues(cursor, MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_SENT);
+
+        assertThat(cursor.moveToNext()).isEqualTo(true);
+        assertThatMmsCursorValues(cursor, MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_SENT);
+
+        assertThat(cursor.moveToNext()).isEqualTo(true);
+        assertThatMmsCursorValues(cursor, MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_OUTBOX);
+
+        assertThat(cursor.moveToNext()).isEqualTo(true);
+        assertThatMmsCursorValues(cursor, MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_INBOX);
+
+        assertThat(cursor.moveToNext()).isEqualTo(true);
+        assertThatMmsCursorValues(cursor, MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_DRAFT);
+
+        assertThat(cursor.moveToNext()).isEqualTo(false);
+
+    }
+
+    private void assertThatMmsCursorValues(Cursor cursor,
+            String subject, int msgType) {
+        assertThat(cursor.getString(cursor.getColumnIndex(Telephony.Mms.SUBJECT)))
+                .isEqualTo(subject);
+        assertThat(cursor.getInt(cursor.getColumnIndex(Telephony.Mms.MESSAGE_TYPE)))
+                .isEqualTo(msgType);
+    }
+
+    @Test
+    public void testMmsQuery_retrieveAllFailedMmsWhenSelectorSpecified() {
+        insertIntoMmsTableWithDifferentStatusOfMms();
+
+        String selection = Telephony.Mms.MESSAGE_TYPE + "=" + Sms.MESSAGE_TYPE_FAILED;
+
+        Cursor cursor = mContentResolver
+                .query(Telephony.Mms.CONTENT_URI, null, selection, null, null);
+
+        assertThat(cursor.getCount()).isEqualTo(1);
+        assertThat(cursor.moveToFirst()).isEqualTo(true);
+        assertThatMmsCursorValues(cursor, MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_FAILED);
+    }
+
+    @Test
+    public void testMmsQuery_retrieveAllSentMmsWhenSelectorSpecified() {
+        insertIntoMmsTableWithDifferentStatusOfMms();
+
+        String selection = Telephony.Mms.MESSAGE_TYPE + "=" + Sms.MESSAGE_TYPE_SENT;
+
+        Cursor cursor = mContentResolver
+                .query(Telephony.Mms.CONTENT_URI, null, selection, null, null);
+
+        assertThat(cursor.getCount()).isEqualTo(1);
+        assertThat(cursor.moveToFirst()).isEqualTo(true);
+        assertThatMmsCursorValues(cursor, MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_SENT);
+    }
+
+    @Test
+    public void testMmsQuery_retrieveAllQueuedMmsWhenSelectorSpecified() {
+        insertIntoMmsTableWithDifferentStatusOfMms();
+
+        String selection = Telephony.Mms.MESSAGE_TYPE + "=" + Sms.MESSAGE_TYPE_QUEUED;
+
+        Cursor cursor = mContentResolver
+                .query(Telephony.Mms.CONTENT_URI, null, selection, null, null);
+
+        assertThat(cursor.getCount()).isEqualTo(1);
+        assertThat(cursor.moveToFirst()).isEqualTo(true);
+        assertThatMmsCursorValues(cursor, MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_QUEUED);
+    }
+
+    @Test
+    public void testMmsUpdate() {
+        Uri mmsUri = insertIntoMmsTable(MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_SENT);
+        assertThat(mmsUri).isNotNull();
+
+        Cursor cursor = mContentResolver.query(mmsUri, null, null, null);
+
+        assertThat(cursor.getCount()).isEqualTo(1);
+        assertThat(cursor.moveToFirst()).isEqualTo(true);
+        assertThat(cursor.getString(cursor.getColumnIndex(Telephony.Mms.SUBJECT)))
+                .isEqualTo(MMS_SUBJECT_ONE);
+
+        final ContentValues updateValues = new ContentValues();
+        updateValues.put(Telephony.Mms.SUBJECT, MMS_SUBJECT_TWO);
+
+        int cursorUpdate = mContentResolver.update(mmsUri, updateValues, null, null);
+        assertThat(cursorUpdate).isEqualTo(1);
+
+        Cursor cursorAfterUpdate = mContentResolver.query(mmsUri, null, null, null);
+
+        assertThat(cursorAfterUpdate.getCount()).isEqualTo(1);
+        assertThat(cursorAfterUpdate.moveToFirst()).isEqualTo(true);
+        assertThat(
+                cursorAfterUpdate.getString(
+                        cursorAfterUpdate.getColumnIndex(Telephony.Mms.SUBJECT)))
+                .isEqualTo(MMS_SUBJECT_TWO);
+
+    }
+
+    @Test
+    public void testMmsUpdate_canUpdateReadAndSeenStatus() {
+        Uri mmsUri = insertIntoMmsTable(MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_SENT);
+        assertThat(mmsUri).isNotNull();
+
+        Cursor cursor = mContentResolver.query(mmsUri, null, null, null);
+
+        assertThat(cursor.getCount()).isEqualTo(1);
+
+        final ContentValues updateValues = new ContentValues();
+        updateValues.put(Telephony.Mms.READ, 1);
+        updateValues.put(Telephony.Mms.SEEN, 1);
+
+        int cursorUpdate = mContentResolver.update(mmsUri, updateValues, null, null);
+        assertThat(cursorUpdate).isEqualTo(1);
+
+        Cursor cursorAfterReadUpdate = mContentResolver.query(mmsUri, null, null, null);
+
+        assertThat(cursorAfterReadUpdate.getCount()).isEqualTo(1);
+        assertThat(cursorAfterReadUpdate.moveToFirst()).isEqualTo(true);
+        assertThat(
+                cursorAfterReadUpdate.getInt(
+                        cursorAfterReadUpdate.getColumnIndex(Telephony.Mms.READ)))
+                .isEqualTo(
+                        1);
+        assertThat(
+                cursorAfterReadUpdate.getInt(
+                        cursorAfterReadUpdate.getColumnIndex(Telephony.Mms.SEEN)))
+                .isEqualTo(
+                        1);
+    }
+
+    private void insertIntoMmsTableWithDifferentMessageBoxUriOfMms() {
+        Uri mmsUri1 = saveMmsWithMessageBoxUri(MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_SENT);
+        assertThat(mmsUri1).isNotNull();
+        Uri mmsUri2 = saveMmsWithMessageBoxUri(MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_SENT);
+        assertThat(mmsUri2).isNotNull();
+        Uri mmsUri3 = saveMmsWithMessageBoxUri(MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_OUTBOX);
+        assertThat(mmsUri3).isNotNull();
+        Uri mmsUri4 = saveMmsWithMessageBoxUri(MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_INBOX);
+        assertThat(mmsUri4).isNotNull();
+        Uri mmsUri15 = saveMmsWithMessageBoxUri(MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_DRAFT);
+        assertThat(mmsUri15).isNotNull();
+    }
+
+
+    private void insertIntoMmsTableWithDifferentStatusOfMms() {
+        Uri mmsUri = insertIntoMmsTable(MMS_SUBJECT_ONE, Sms.MESSAGE_TYPE_SENT);
+        assertThat(mmsUri).isNotNull();
+        mmsUri = insertIntoMmsTable(MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_INBOX);
+        assertThat(mmsUri).isNotNull();
+        mmsUri = insertIntoMmsTable(MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_OUTBOX);
+        assertThat(mmsUri).isNotNull();
+        mmsUri = insertIntoMmsTable(MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_ALL);
+        assertThat(mmsUri).isNotNull();
+        mmsUri = insertIntoMmsTable(MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_FAILED);
+        assertThat(mmsUri).isNotNull();
+        mmsUri = insertIntoMmsTable(MMS_SUBJECT_TWO, Sms.MESSAGE_TYPE_QUEUED);
+        assertThat(mmsUri).isNotNull();
+    }
+
+    private Uri insertIntoMmsTable(String subject, int messageType) {
+        final ContentValues mmsValues = new ContentValues();
+        mmsValues.put(Telephony.Mms.TEXT_ONLY, 1);
+        mmsValues.put(Telephony.Mms.MESSAGE_TYPE, messageType);
+        mmsValues.put(Telephony.Mms.SUBJECT, subject);
+        final Uri mmsUri = mContentResolver.insert(Telephony.Mms.CONTENT_URI, mmsValues);
+        return mmsUri;
+    }
+
+    private Uri saveMmsWithMessageBoxUri(String subject, int messageType) {
+        Uri mmsUri = Telephony.Mms.CONTENT_URI;
+
+        final ContentValues mmsValues = new ContentValues();
+        mmsValues.put(Telephony.Mms.TEXT_ONLY, 1);
+        mmsValues.put(Telephony.Mms.MESSAGE_TYPE, messageType);
+        mmsValues.put(Telephony.Mms.SUBJECT, subject);
+
+        switch (messageType) {
+            case Sms.MESSAGE_TYPE_SENT:
+                mmsUri = Sent.CONTENT_URI;
+                break;
+            case Sms.MESSAGE_TYPE_INBOX:
+                mmsUri = Inbox.CONTENT_URI;
+                break;
+            case Sms.MESSAGE_TYPE_DRAFT:
+                mmsUri = Draft.CONTENT_URI;
+                break;
+            case Sms.MESSAGE_TYPE_OUTBOX:
+                mmsUri = Outbox.CONTENT_URI;
+                break;
+            default:
+                mmsUri = Telephony.Mms.CONTENT_URI;
+                break;
+        }
+
+        final Uri msgUri = mContentResolver.insert(mmsUri, mmsValues);
+        return msgUri;
+    }
+
+    private Uri insertIntoMmsPartTable(Uri mmsUri, Uri partUri, long mmsId, String body) {
+        final String srcName = String.format("text.%06d.txt", 0);
+        // Insert body part.
+        final ContentValues values = new ContentValues();
+        values.put(Telephony.Mms.Part.MSG_ID, mmsId);
+        values.put(Telephony.Mms.Part.SEQ, 0);
+        values.put(Telephony.Mms.Part.CONTENT_TYPE, TEXT_PLAIN);
+        values.put(Telephony.Mms.Part.NAME, srcName);
+        values.put(Telephony.Mms.Part.CONTENT_ID, "<" + srcName + ">");
+        values.put(Telephony.Mms.Part.CONTENT_LOCATION, srcName);
+        values.put(Telephony.Mms.Part.CHARSET, 111);
+        values.put(Telephony.Mms.Part.TEXT, body);
+        Uri insertPartUri = mContentResolver.insert(partUri, values);
+        return insertPartUri;
+    }
+
+    private void insertIntoMmsAddressTable(long mmsId, String[] addresses) {
+        final Uri addrUri = Telephony.Mms.Addr.getAddrUriForMessage(String.valueOf(mmsId));
+        for (int i = 0; i < addresses.length; ++i) {
+            ContentValues addrValues = new ContentValues();
+            addrValues.put(Telephony.Mms.Addr.TYPE, i);
+            addrValues.put(Telephony.Mms.Addr.CHARSET, i + 1);
+            addrValues.put(Telephony.Mms.Addr.ADDRESS, addresses[i]);
+            addrValues.put(Telephony.Mms.Addr.MSG_ID, mmsId);
+            Uri insertAddressUri = mContentResolver.insert(addrUri, addrValues);
+            assertThat(insertAddressUri).isNotNull();
+        }
+    }
+
     /**
      * Asserts that a URI returned from an MMS insert operation represents a failed insert.
      *
diff --git a/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/SmsConversationTest.java b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/SmsConversationTest.java
new file mode 100644
index 0000000..69f3ce6
--- /dev/null
+++ b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/SmsConversationTest.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+package android.telephonyprovider.cts;
+
+import static androidx.test.InstrumentationRegistry.getInstrumentation;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.ContentResolver;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.net.Uri;
+import android.provider.Telephony;
+import android.provider.Telephony.Sms.Conversations;
+
+import androidx.test.filters.SmallTest;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+@SmallTest
+public class SmsConversationTest {
+
+    private static final String TEST_ADDRESS = "+19998880001";
+    private static final String TEST_SMS_BODY = "TEST_SMS_BODY";
+    private Context mContext;
+    private ContentResolver mContentResolver;
+
+    @BeforeClass
+    public static void ensureDefaultSmsApp() {
+        DefaultSmsAppHelper.ensureDefaultSmsApp();
+    }
+
+    @AfterClass
+    public static void cleanup() {
+        ContentResolver contentResolver = getInstrumentation().getContext().getContentResolver();
+        contentResolver.delete(Telephony.Sms.CONTENT_URI, null, null);
+    }
+
+    @Before
+    public void setupTestEnvironment() {
+        cleanup();
+        mContentResolver = getInstrumentation().getContext().getContentResolver();
+    }
+
+    /**
+     * The purpose of this test is to check most recent insert sms body equals to the Conversation
+     * Snippet
+     */
+    @Test
+    public void testQueryConversation_snippetEqualsMostRecentMessageBody() {
+        String testSmsMostRecent = "TEST_SMS_MOST_RECENT";
+
+        saveToTelephony(TEST_SMS_BODY, TEST_ADDRESS);
+        saveToTelephony(testSmsMostRecent, TEST_ADDRESS);
+
+        Cursor cursor = mContentResolver
+                .query(Telephony.Sms.CONTENT_URI, null, null, null);
+        assertThat(cursor.getCount()).isEqualTo(2);
+
+        Cursor conversationCursor = mContentResolver
+                .query(Conversations.CONTENT_URI, null, null, null);
+        assertThat(conversationCursor.getCount()).isEqualTo(1);
+        conversationCursor.moveToNext();
+
+        assertThat(
+            conversationCursor.getString(conversationCursor.getColumnIndex(Conversations.SNIPPET)))
+            .isEqualTo(testSmsMostRecent);
+    }
+
+    /**
+     * The purpose of this test is to check Conversation message count is equal to the number of sms
+     * inserted.
+     */
+    @Test
+    public void testQueryConversation_returnsCorrectMessageCount() {
+        String testSecondSmsBody = "TEST_SECOND_SMS_BODY";
+
+        saveToTelephony(TEST_SMS_BODY, TEST_ADDRESS);
+        saveToTelephony(testSecondSmsBody, TEST_ADDRESS);
+
+        Cursor cursor = mContentResolver
+                .query(Telephony.Sms.CONTENT_URI, null, null, null);
+        assertThat(cursor.getCount()).isEqualTo(2);
+
+        Cursor conversationCursor = mContentResolver
+                .query(Conversations.CONTENT_URI, null, null, null);
+        assertThat(conversationCursor.getCount()).isEqualTo(1);
+        conversationCursor.moveToNext();
+
+        assertThat(conversationCursor
+            .getInt(conversationCursor.getColumnIndex(Conversations.MESSAGE_COUNT)))
+            .isEqualTo(2);
+    }
+
+    public void saveToTelephony(String messageBody, String address) {
+        ContentValues values = new ContentValues();
+        values.put(Telephony.Sms.BODY, messageBody);
+        values.put(Telephony.Sms.ADDRESS, address);
+        Uri uri1 = mContentResolver.insert(Telephony.Sms.CONTENT_URI, values);
+    }
+}
+
diff --git a/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/SmsTest.java b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/SmsTest.java
new file mode 100644
index 0000000..7831bb5
--- /dev/null
+++ b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/SmsTest.java
@@ -0,0 +1,283 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+package android.telephonyprovider.cts;
+
+import static androidx.test.InstrumentationRegistry.getInstrumentation;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.ContentResolver;
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.net.Uri;
+import android.provider.Telephony;
+
+import androidx.test.filters.SmallTest;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+@SmallTest
+public class SmsTest {
+
+    private static final String TEST_SMS_BODY = "TEST_SMS_BODY";
+    private static final String TEST_ADDRESS = "+19998880001";
+    private static final int TEST_THREAD_ID_1 = 101;
+    private ContentResolver mContentResolver;
+    private SmsTestHelper mSmsTestHelper;
+
+    @BeforeClass
+    public static void ensureDefaultSmsApp() {
+        DefaultSmsAppHelper.ensureDefaultSmsApp();
+    }
+
+    @AfterClass
+    public static void cleanup() {
+        ContentResolver contentResolver = getInstrumentation().getContext().getContentResolver();
+        contentResolver.delete(Telephony.Sms.CONTENT_URI, null, null);
+        contentResolver.delete(Telephony.Threads.CONTENT_URI, null, null);
+    }
+
+    @Before
+    public void setupTestEnvironment() {
+        cleanup();
+        mContentResolver = getInstrumentation().getContext().getContentResolver();
+        mSmsTestHelper = new SmsTestHelper();
+    }
+
+    /**
+     * Asserts that a URI returned from an SMS insert operation represents a pass Insert.
+     */
+    @Test
+    public void testSmsInsert() {
+        Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, TEST_SMS_BODY);
+        assertThat(uri).isNotNull();
+
+        Cursor cursor = mContentResolver.query(uri, null, null, null);
+        assertThat(cursor.getCount()).isEqualTo(1);
+        cursor.moveToNext();
+
+        String actualSmsBody = cursor.getString(cursor.getColumnIndex(Telephony.Sms.BODY));
+        assertThat(actualSmsBody).isEqualTo(TEST_SMS_BODY);
+    }
+
+    /**
+     * The purpose of this test is to perform delete operation and assert that SMS is deleted.
+     */
+    @Test
+    public void testSmsDelete() {
+        Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, TEST_SMS_BODY);
+        assertThat(uri).isNotNull();
+
+        int deletedRows = mContentResolver.delete(uri, null, null);
+
+        assertThat(deletedRows).isEqualTo(1);
+
+        Cursor cursor = mContentResolver.query(uri, null, null, null);
+        assertThat(cursor.getCount()).isEqualTo(0);
+    }
+
+    /**
+     * The purpose of this test is to update the message body and verify the message body is
+     * updated.
+     */
+    @Test
+    public void testSmsUpdate() {
+        String testSmsBodyUpdate = "TEST_SMS_BODY_UPDATED";
+        Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, TEST_SMS_BODY);
+        assertThat(uri).isNotNull();
+
+        mSmsTestHelper.assertSmsColumnEquals(Telephony.Sms.BODY, uri, TEST_SMS_BODY);
+
+        ContentValues values = new ContentValues();
+        values.put(Telephony.Sms.ADDRESS, TEST_ADDRESS);
+        values.put(Telephony.Sms.BODY, testSmsBodyUpdate);
+
+        mContentResolver.update(uri, values, null, null);
+
+        mSmsTestHelper.assertSmsColumnEquals(Telephony.Sms.BODY, uri, testSmsBodyUpdate);
+    }
+
+    @Test
+    public void testInsertSmsFromSubid_verifySmsFromNotOtherSubId() {
+        int subId = 1;
+
+        ContentValues values = new ContentValues();
+        values.put(Telephony.Sms.BODY, TEST_SMS_BODY);
+        values.put(Telephony.Sms.SUBSCRIPTION_ID, subId);
+        Uri uri = mContentResolver.insert(Telephony.Sms.CONTENT_URI, values);
+
+        assertThat(uri).isNotNull();
+
+        mSmsTestHelper.assertSmsColumnEquals(Telephony.Sms.SUBSCRIPTION_ID, uri,
+                String.valueOf(subId));
+    }
+
+    @Test
+    public void testInsertSms_canUpdateSeen() {
+        Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, TEST_SMS_BODY);
+        assertThat(uri).isNotNull();
+
+        Cursor cursor = mContentResolver.query(uri, null, null, null);
+        assertThat(cursor.getCount()).isEqualTo(1);
+
+        final ContentValues updateValues = new ContentValues();
+        updateValues.put(Telephony.Sms.SEEN, 1);
+
+        int cursorUpdate = mContentResolver.update(uri, updateValues, null, null);
+
+        assertThat(cursorUpdate).isEqualTo(1);
+
+        mSmsTestHelper.assertSmsColumnEquals(Telephony.Sms.SEEN, uri, String.valueOf(1));
+    }
+
+    @Test
+    public void testInsertSms_canUpdateSmsStatus() {
+        Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, TEST_SMS_BODY);
+        assertThat(uri).isNotNull();
+
+        Cursor cursor = mContentResolver.query(uri, null, null, null);
+
+        assertThat(cursor.getCount()).isEqualTo(1);
+        // STATUS_FAILED = 64;  0x40
+        mSmsTestHelper.assertUpdateSmsStatus(Telephony.Sms.STATUS_FAILED, uri);
+        // STATUS_PENDING = 32;  0x20
+        mSmsTestHelper.assertUpdateSmsStatus(Telephony.Sms.STATUS_PENDING, uri);
+        //  STATUS_COMPLETE = 0; 0x0
+        mSmsTestHelper.assertUpdateSmsStatus(Telephony.Sms.STATUS_COMPLETE, uri);
+    }
+
+    @Test
+    public void testInsertSms_canUpdateSmsType() {
+        Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, TEST_SMS_BODY);
+        assertThat(uri).isNotNull();
+
+        Cursor cursor = mContentResolver.query(uri, null, null, null);
+        assertThat(cursor.getCount()).isEqualTo(1);
+        // MESSAGE_TYPE_INBOX = 1;  0x1
+        mSmsTestHelper.assertUpdateSmsType(Telephony.Sms.MESSAGE_TYPE_INBOX, uri);
+        // MESSAGE_TYPE_SENT = 2;  0x2
+        mSmsTestHelper.assertUpdateSmsType(Telephony.Sms.MESSAGE_TYPE_SENT, uri);
+    }
+
+    // Queries for a thread ID returns the same and correct thread ID.
+    @Test
+    public void testQueryThreadId_returnSameThreadId() {
+        ContentValues values = new ContentValues();
+        values.put(Telephony.Sms.THREAD_ID, TEST_THREAD_ID_1);
+        values.put(Telephony.Sms.BODY, TEST_SMS_BODY);
+        Uri uri = mContentResolver.insert(Telephony.Sms.CONTENT_URI, values);
+
+        assertThat(uri).isNotNull();
+
+        mSmsTestHelper.assertSmsColumnEquals(Telephony.Sms.THREAD_ID, uri,
+                String.valueOf(TEST_THREAD_ID_1));
+    }
+
+    /**
+     * Asserts that content provider bulk insert and returns the same count while query.
+     */
+    @Test
+    public void testSmsBulkInsert() {
+        ContentValues[] smsContentValues = new ContentValues[] {
+                mSmsTestHelper.createSmsValues(mSmsTestHelper.SMS_ADDRESS_BODY_1),
+                mSmsTestHelper.createSmsValues(mSmsTestHelper.SMS_ADDRESS_BODY_2)};
+
+        int count = mContentResolver.bulkInsert(Telephony.Sms.CONTENT_URI, smsContentValues);
+        mSmsTestHelper.assertBulkSmsContentEqual(count, smsContentValues);
+    }
+
+    /**
+     * Asserts that SMS inserted is auto populated with default values as mentioned in the table
+     * schema.
+     */
+    @Test
+    public void testDefaultValuesAreInsertedInSmsTable() {
+        Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, TEST_SMS_BODY);
+        assertThat(uri).isNotNull();
+
+        Cursor cursor = mContentResolver.query(Telephony.Sms.CONTENT_URI, null, null, null);
+        assertThat(cursor.getCount()).isEqualTo(1);
+        cursor.moveToNext();
+
+        assertThat(
+            cursor.getInt(cursor.getColumnIndex(Telephony.Sms.READ))).isEqualTo(0);
+
+        assertThat(
+            cursor.getInt(cursor.getColumnIndex(Telephony.Sms.STATUS))).isEqualTo(-1);
+
+        assertThat(
+            cursor.getInt(cursor.getColumnIndex(Telephony.Sms.DATE_SENT))).isEqualTo(0);
+
+        assertThat(
+            cursor.getInt(cursor.getColumnIndex(Telephony.Sms.LOCKED))).isEqualTo(0);
+
+        assertThat(
+            cursor.getInt(cursor.getColumnIndex(Telephony.Sms.SUBSCRIPTION_ID))).isEqualTo(-1);
+
+        assertThat(
+            cursor.getInt(cursor.getColumnIndex(Telephony.Sms.ERROR_CODE))).isEqualTo(-1);
+
+        assertThat(
+            cursor.getInt(cursor.getColumnIndex(Telephony.Sms.SEEN))).isEqualTo(0);
+    }
+
+    @Test
+    public void testDeleteSms_ifLastSmsDeletedThenThreadIsDeleted() {
+        int testThreadId2 = 102;
+
+        Uri uri1 = mSmsTestHelper
+                .insertTestSmsWithThread(TEST_SMS_BODY, TEST_ADDRESS, TEST_THREAD_ID_1);
+        assertThat(uri1).isNotNull();
+
+        Uri uri2 = mSmsTestHelper
+                .insertTestSmsWithThread(TEST_SMS_BODY, TEST_ADDRESS, testThreadId2);
+        assertThat(uri2).isNotNull();
+
+        int deletedRows = mContentResolver.delete(uri1, null, null);
+        assertThat(deletedRows).isEqualTo(1);
+
+        Cursor cursor = mContentResolver.query(Telephony.Sms.CONTENT_URI, null, null, null);
+        assertThat(cursor.getCount()).isEqualTo(1);
+        cursor.moveToNext();
+
+        int thread_id = cursor.getInt(cursor.getColumnIndex(Telephony.Sms.THREAD_ID));
+        assertThat(thread_id).isNotEqualTo(TEST_THREAD_ID_1);
+    }
+
+    /**
+     * Asserts that a Emoji SMS body returned from an SMS insert operation are equal
+     */
+    @Test
+    public void testInsertEmoji_andVerify() {
+        String testSmsBodyEmoji = "\uD83D\uDE0D\uD83D\uDE02"
+                + "\uD83D\uDE1B\uD83D\uDE00\uD83D\uDE1E☺️\uD83D\uDE1B"
+                + "\uD83D\uDE1E☺️\uD83D\uDE0D";
+
+        Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, testSmsBodyEmoji);
+
+        assertThat(uri).isNotNull();
+
+        mSmsTestHelper.assertSmsColumnEquals(Telephony.Sms.BODY, uri,
+                String.valueOf(testSmsBodyEmoji));
+    }
+
+}
+
diff --git a/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/SmsTestHelper.java b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/SmsTestHelper.java
new file mode 100644
index 0000000..fc668e2
--- /dev/null
+++ b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/SmsTestHelper.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+package android.telephonyprovider.cts;
+
+import static androidx.test.InstrumentationRegistry.getInstrumentation;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.ContentResolver;
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.net.Uri;
+import android.provider.Telephony;
+
+class SmsTestHelper {
+
+    private ContentResolver mContentResolver;
+    private ContentValues mContentValues;
+    public static final String SMS_ADDRESS_BODY_1 = "sms CTS text 1",
+            SMS_ADDRESS_BODY_2 = "sms CTS text 2";
+    SmsTestHelper() {
+        mContentResolver = getInstrumentation().getContext().getContentResolver();
+        mContentValues = new ContentValues();
+    }
+
+    public Uri insertTestSms(String testAddress, String testSmsBody) {
+        mContentValues.put(Telephony.Sms.ADDRESS, testAddress);
+        mContentValues.put(Telephony.Sms.BODY, testSmsBody);
+        return mContentResolver.insert(Telephony.Sms.CONTENT_URI, mContentValues);
+    }
+
+    public ContentValues createSmsValues(String messageBody) {
+        ContentValues smsRow = new ContentValues();
+        smsRow.put(Telephony.Sms.BODY, messageBody);
+        return smsRow;
+    }
+
+    public Uri insertTestSmsWithThread(String testAddress, String testSmsBody, int threadId) {
+        mContentValues.put(Telephony.Sms.ADDRESS, testAddress);
+        mContentValues.put(Telephony.Sms.BODY, testSmsBody);
+        mContentValues.put(Telephony.Sms.THREAD_ID, threadId);
+
+        return mContentResolver.insert(Telephony.Sms.CONTENT_URI, mContentValues);
+    }
+    /**
+     * Asserts the verify message details
+     */
+    public void assertSmsColumnEquals(String columnName, Uri uri, String expectedValue) {
+        Cursor cursor = mContentResolver.query(uri, null, null, null);
+
+        assertThat(cursor.getCount()).isEqualTo(1);
+        assertThat(cursor.moveToNext()).isEqualTo(true);
+
+        assertThat(cursor.getString(cursor.getColumnIndex(columnName))).isEqualTo(expectedValue);
+    }
+
+    public void assertBulkSmsContentEqual(int count, ContentValues[] smsContentValues) {
+        Cursor cursor = mContentResolver.query(Telephony.Sms.CONTENT_URI, null, null, null);
+
+        assertThat(count).isEqualTo(smsContentValues.length);
+        assertThat(cursor.getCount()).isEqualTo(smsContentValues.length);
+
+        assertThat(cursor.moveToNext()).isEqualTo(true);
+        assertThat(cursor.getString(cursor.getColumnIndex(Telephony.Sms.BODY)))
+                .isEqualTo(SMS_ADDRESS_BODY_2);
+
+        assertThat(cursor.moveToNext()).isEqualTo(true);
+        assertThat(cursor.getString(cursor.getColumnIndex(Telephony.Sms.BODY)))
+                .isEqualTo(SMS_ADDRESS_BODY_1);
+
+    }
+    public void assertUpdateSmsStatus(int status, Uri uri) {
+        ContentValues mContentValues = new ContentValues();
+        mContentValues.put(Telephony.Sms.STATUS, status);
+
+        int cursorUpdate = mContentResolver.update(uri, mContentValues, null, null);
+        assertThat(cursorUpdate).isEqualTo(1);
+
+        Cursor cursorStatus = mContentResolver.query(uri, null, null, null);
+        assertThat(cursorStatus.getCount()).isEqualTo(1);
+        cursorStatus.moveToNext();
+
+        int statusResult = cursorStatus.getInt(cursorStatus.getColumnIndex(Telephony.Sms.STATUS));
+        assertThat(statusResult).isAnyOf(0, 32, 64);
+        assertThat(statusResult).isEqualTo(status);
+    }
+
+    public void assertUpdateSmsType(int type, Uri uri) {
+        mContentValues.put(Telephony.Sms.TYPE, type);
+
+        int cursorUpdate = mContentResolver.update(uri, mContentValues, null, null);
+        assertThat(cursorUpdate).isEqualTo(1);
+
+        Cursor cursorStatus = mContentResolver.query(uri, null, null, null);
+        assertThat(cursorStatus.getCount()).isEqualTo(1);
+        cursorStatus.moveToNext();
+
+        int typeResult = cursorStatus.getInt(cursorStatus.getColumnIndex(Telephony.Sms.TYPE));
+        assertThat(typeResult).isAnyOf(1, 2);
+        assertThat(typeResult).isEqualTo(type);
+    }
+}
+
diff --git a/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/ThreadsTest.java b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/ThreadsTest.java
index e6d8520..a92870d 100644
--- a/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/ThreadsTest.java
+++ b/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/ThreadsTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
 package android.telephonyprovider.cts;
 
 import static androidx.test.InstrumentationRegistry.getInstrumentation;
@@ -7,6 +23,7 @@
 import android.content.ContentResolver;
 import android.content.ContentValues;
 import android.content.Context;
+import android.database.Cursor;
 import android.net.Uri;
 import android.provider.Telephony;
 
@@ -19,6 +36,11 @@
 
 @SmallTest
 public class ThreadsTest {
+
+    private static final String DESTINATION = "+19998880001";
+    private static final String MESSAGE_BODY = "MESSAGE_BODY";
+    private static final int THREAD_ID = 101;
+
     private Context mContext;
     private ContentResolver mContentResolver;
 
@@ -27,6 +49,13 @@
         DefaultSmsAppHelper.ensureDefaultSmsApp();
     }
 
+    @AfterClass
+    public static void cleanup() {
+        ContentResolver contentResolver = getInstrumentation().getContext().getContentResolver();
+        contentResolver.delete(Telephony.Threads.CONTENT_URI, null, null);
+        contentResolver.delete(Telephony.Sms.CONTENT_URI, null, null);
+    }
+
     @Before
     public void setupTestEnvironment() {
         cleanup();
@@ -34,29 +63,17 @@
         mContentResolver = mContext.getContentResolver();
     }
 
-    @AfterClass
-    public static void cleanup() {
-        ContentResolver contentResolver = getInstrumentation().getContext().getContentResolver();
-        contentResolver.delete(Telephony.Threads.CONTENT_URI, null, null);
-    }
-
     @Test
     public void testThreadDeletion_doNotReuseThreadIdsFromEmptyThreads() {
-        String destination1 = "+19998880001";
         String destination2 = "+19998880002";
 
-        long threadId1 = Telephony.Threads.getOrCreateThreadId(mContext, destination1);
+        long threadId1 = Telephony.Threads.getOrCreateThreadId(mContext, DESTINATION);
 
-        Uri inboxUri = saveToTelephony(threadId1, destination1, "testThreadDeletion body");
-
-        // The URI returned by the insert operation points to the message ID in the inbox. Though
-        // this is a valid ID for queries, the SMS provider does not handle it for delete
-        // operations. This takes the ID off the end of the URI and creates a URI pointing at that
-        // row from the root of the SMS provider.
-        Uri rootUri =
-                Uri.withAppendedPath(Telephony.Sms.CONTENT_URI, inboxUri.getLastPathSegment());
-
-        int deletedCount = mContentResolver.delete(rootUri, null, null);
+        int deletedCount =
+                mContentResolver.delete(
+                        saveToTelephony(threadId1, destination2, "testThreadDeletion body"),
+                        null,
+                        null);
 
         assertThat(deletedCount).isEqualTo(1);
 
@@ -65,6 +82,46 @@
         assertThat(threadId2).isGreaterThan(threadId1);
     }
 
+    // This purpose of this test case is to return latest date inserted as sms from thread
+    @Test
+    public void testMultipleSmsInsertDate_returnsLatestDateFromThread() {
+        final long earlierTime = 1557382640;
+
+        Uri smsUri = addMessageToTelephonyWithDate(earlierTime, MESSAGE_BODY, THREAD_ID);
+        assertThat(smsUri).isNotNull();
+
+        assertVerifyThreadDate(earlierTime);
+
+        final long laterTime = 1557382650;
+
+        Uri smsUri2 = addMessageToTelephonyWithDate(laterTime, MESSAGE_BODY,
+                THREAD_ID);
+        assertThat(smsUri2).isNotNull();
+
+        assertVerifyThreadDate(laterTime);
+    }
+
+    private Uri addMessageToTelephonyWithDate(long date, String messageBody, long threadId) {
+        ContentValues contentValues = new ContentValues();
+
+        contentValues.put(Telephony.Sms.THREAD_ID, threadId);
+        contentValues.put(Telephony.Sms.DATE, date);
+        contentValues.put(Telephony.Sms.BODY, messageBody);
+
+        return mContext.getContentResolver().insert(Telephony.Sms.CONTENT_URI, contentValues);
+    }
+
+    private void assertVerifyThreadDate(long timeStamp) {
+        Cursor cursor = mContentResolver.query(Telephony.Threads.CONTENT_URI,
+                null, null, null);
+
+        assertThat(cursor.getCount()).isEqualTo(1);
+        assertThat(cursor.moveToNext()).isEqualTo(true);
+
+        assertThat(cursor.getLong(cursor.getColumnIndex(Telephony.Threads.DATE)))
+            .isEqualTo(timeStamp);
+    }
+
     private Uri saveToTelephony(long threadId, String address, String body) {
         ContentValues contentValues = new ContentValues();
         contentValues.put(Telephony.Sms.THREAD_ID, threadId);
@@ -74,4 +131,3 @@
         return mContext.getContentResolver().insert(Telephony.Sms.Inbox.CONTENT_URI, contentValues);
     }
 }
-
diff --git a/tests/tests/text/Android.bp b/tests/tests/text/Android.bp
index bd65797..26a60ee 100644
--- a/tests/tests/text/Android.bp
+++ b/tests/tests/text/Android.bp
@@ -36,6 +36,14 @@
         "android.test.base.stubs",
     ],
 
+    jni_libs: [
+        "libctstext_jni",
+        "libc++",
+    ],
+    // Include both the 32 and 64 bit versions of libctstext_jni, where
+    // applicable.
+    compile_multilib: "both",
+
     test_suites: [
         "cts",
         "vts",
diff --git a/tests/tests/text/jni/Android.bp b/tests/tests/text/jni/Android.bp
new file mode 100644
index 0000000..8055f40
--- /dev/null
+++ b/tests/tests/text/jni/Android.bp
@@ -0,0 +1,22 @@
+// Copyright (C) 2019 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.
+
+cc_library {
+    name: "libctstext_jni",
+    srcs: [
+        "CtsTextJniOnLoad.cpp",
+        "android_text_format_cts_NativeTimeFunctions.cpp",
+    ],
+    static_libs: ["libnativehelper"],
+}
diff --git a/tests/tests/text/jni/CtsTextJniOnLoad.cpp b/tests/tests/text/jni/CtsTextJniOnLoad.cpp
new file mode 100644
index 0000000..04e14f5
--- /dev/null
+++ b/tests/tests/text/jni/CtsTextJniOnLoad.cpp
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2019 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 <jni.h>
+#include <stdio.h>
+
+extern int register_android_text_format_cts_NativeTimeFunctions(JNIEnv*);
+
+jint JNI_OnLoad(JavaVM *vm, void *) {
+    JNIEnv *env = NULL;
+
+    if (vm->GetEnv((void **) &env, JNI_VERSION_1_4) != JNI_OK) {
+        return JNI_ERR;
+    }
+
+    if (register_android_text_format_cts_NativeTimeFunctions(env)) {
+        return JNI_ERR;
+    }
+
+    return JNI_VERSION_1_4;
+}
diff --git a/tests/tests/text/jni/android_text_format_cts_NativeTimeFunctions.cpp b/tests/tests/text/jni/android_text_format_cts_NativeTimeFunctions.cpp
new file mode 100644
index 0000000..0c85c1e
--- /dev/null
+++ b/tests/tests/text/jni/android_text_format_cts_NativeTimeFunctions.cpp
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2019 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 <jni.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include "nativehelper/scoped_utf_chars.h"
+
+// Information about the Java StructTm class.
+static struct {
+    jclass clazz;
+    jmethodID ctor;
+    jfieldID tm_sec;
+    jfieldID tm_min;
+    jfieldID tm_hour;
+    jfieldID tm_mday;
+    jfieldID tm_mon;
+    jfieldID tm_year;
+    jfieldID tm_wday;
+    jfieldID tm_yday;
+    jfieldID tm_isdst;
+    jfieldID tm_gmtoff;
+    jfieldID tm_zone;
+} gStructTmClassInfo;
+
+// The following is not threadsafe but that's a problem with getenv(), setenv(), mktime() it
+// would be impractical to get around. Luckily, tests are single threaded.
+#define SET_TZ(jni_env, javaTzId) \
+    char _originalTz[64]; \
+    char* _tzEnv = getenv("TZ"); \
+    if (_tzEnv != nullptr) { \
+        strncpy(_originalTz, _tzEnv, sizeof(_originalTz)); \
+        _originalTz[sizeof(_originalTz) - 1] = 0; \
+    } \
+    ScopedUtfChars _tzId(jni_env, javaTzId); \
+    setenv("TZ", _tzId.c_str(), 1);
+
+#define UNSET_TZ() \
+    if (_tzEnv != nullptr) { \
+        setenv("TZ", _originalTz, 1); \
+    }
+
+
+static jobject android_text_format_cts_NativeTimeFunctions_localtime_tz(
+        JNIEnv* env, jclass, jint javaTimep, jstring javaTzId)
+{
+    // Call localtime_r
+    struct tm out_tm;
+    {
+        SET_TZ(env, javaTzId);
+
+        const time_t timep = javaTimep;
+        localtime_r(&timep, &out_tm);
+
+        UNSET_TZ();
+    }
+
+    // Copy the results to a StructTm object.
+    jobject javaTm = env->NewObject(gStructTmClassInfo.clazz, gStructTmClassInfo.ctor);
+    env->SetIntField(javaTm, gStructTmClassInfo.tm_sec, out_tm.tm_sec);
+    env->SetIntField(javaTm, gStructTmClassInfo.tm_min, out_tm.tm_min);
+    env->SetIntField(javaTm, gStructTmClassInfo.tm_hour, out_tm.tm_hour);
+    env->SetIntField(javaTm, gStructTmClassInfo.tm_mday, out_tm.tm_mday);
+    env->SetIntField(javaTm, gStructTmClassInfo.tm_mon, out_tm.tm_mon);
+    env->SetIntField(javaTm, gStructTmClassInfo.tm_year, out_tm.tm_year);
+    env->SetIntField(javaTm, gStructTmClassInfo.tm_wday, out_tm.tm_wday);
+    env->SetIntField(javaTm, gStructTmClassInfo.tm_yday, out_tm.tm_yday);
+    env->SetIntField(javaTm, gStructTmClassInfo.tm_isdst, out_tm.tm_isdst);
+    env->SetLongField(javaTm, gStructTmClassInfo.tm_gmtoff, out_tm.tm_gmtoff);
+    env->SetObjectField(javaTm, gStructTmClassInfo.tm_zone, env->NewStringUTF(out_tm.tm_zone));
+    return javaTm;
+}
+
+static jint android_text_format_cts_NativeTimeFunctions_mktime_tz(
+        JNIEnv* env, jclass, jobject javaTm, jstring javaTzId)
+{
+    // Populate a tm struct from the Java StructTm object.
+    struct tm in_tm;
+    in_tm.tm_sec = env->GetIntField(javaTm, gStructTmClassInfo.tm_sec);
+    in_tm.tm_min = env->GetIntField(javaTm, gStructTmClassInfo.tm_min);
+    in_tm.tm_hour = env->GetIntField(javaTm, gStructTmClassInfo.tm_hour);
+    in_tm.tm_mday = env->GetIntField(javaTm, gStructTmClassInfo.tm_mday);
+    in_tm.tm_mon = env->GetIntField(javaTm, gStructTmClassInfo.tm_mon);
+    in_tm.tm_year = env->GetIntField(javaTm, gStructTmClassInfo.tm_year);
+    in_tm.tm_wday = env->GetIntField(javaTm, gStructTmClassInfo.tm_wday);
+    in_tm.tm_yday = env->GetIntField(javaTm, gStructTmClassInfo.tm_yday);
+    in_tm.tm_isdst = env->GetIntField(javaTm, gStructTmClassInfo.tm_isdst);
+    in_tm.tm_gmtoff = env->GetLongField(javaTm, gStructTmClassInfo.tm_gmtoff);
+
+    jstring javaTmZone =
+            static_cast<jstring>(env->GetObjectField(javaTm, gStructTmClassInfo.tm_zone));
+    const char* tmZone = nullptr;
+    if (javaTmZone != nullptr) {
+        tmZone = env->GetStringUTFChars(javaTmZone, nullptr);
+        in_tm.tm_zone = tmZone;
+    }
+
+    // Call mktime
+    jint result = -1;
+    {
+        SET_TZ(env, javaTzId);
+
+        result = mktime(&in_tm);
+
+        UNSET_TZ();
+    }
+
+    if (javaTmZone != nullptr) {
+        env->ReleaseStringUTFChars(javaTmZone, tmZone);
+    }
+
+    return result;
+}
+
+static JNINativeMethod gMethods[] = {
+    { "localtime_tz", "(ILjava/lang/String;)Landroid/text/format/cts/NativeTimeFunctions$StructTm;",
+        (void *) android_text_format_cts_NativeTimeFunctions_localtime_tz },
+    { "mktime_tz", "(Landroid/text/format/cts/NativeTimeFunctions$StructTm;Ljava/lang/String;)I",
+        (void *) android_text_format_cts_NativeTimeFunctions_mktime_tz },
+};
+
+int register_android_text_format_cts_NativeTimeFunctions(JNIEnv* env)
+{
+    jclass javaTmClass = env->FindClass("android/text/format/cts/NativeTimeFunctions$StructTm");
+    gStructTmClassInfo.clazz = (jclass) env->NewGlobalRef(javaTmClass);
+    gStructTmClassInfo.ctor = env->GetMethodID(javaTmClass, "<init>", "()V");
+    gStructTmClassInfo.tm_sec = env->GetFieldID(javaTmClass, "tm_sec", "I");
+    gStructTmClassInfo.tm_min = env->GetFieldID(javaTmClass, "tm_min", "I");
+    gStructTmClassInfo.tm_hour = env->GetFieldID(javaTmClass, "tm_hour", "I");
+    gStructTmClassInfo.tm_mday = env->GetFieldID(javaTmClass, "tm_mday", "I");
+    gStructTmClassInfo.tm_mon = env->GetFieldID(javaTmClass, "tm_mon", "I");
+    gStructTmClassInfo.tm_year = env->GetFieldID(javaTmClass, "tm_year", "I");
+    gStructTmClassInfo.tm_wday = env->GetFieldID(javaTmClass, "tm_wday", "I");
+    gStructTmClassInfo.tm_yday = env->GetFieldID(javaTmClass, "tm_yday", "I");
+    gStructTmClassInfo.tm_isdst = env->GetFieldID(javaTmClass, "tm_isdst", "I");
+    gStructTmClassInfo.tm_gmtoff = env->GetFieldID(javaTmClass, "tm_gmtoff", "J");
+    gStructTmClassInfo.tm_zone = env->GetFieldID(javaTmClass, "tm_zone", "Ljava/lang/String;");
+
+    jclass clazz = env->FindClass("android/text/format/cts/NativeTimeFunctions");
+    return env->RegisterNatives(clazz, gMethods,
+            sizeof(gMethods) / sizeof(JNINativeMethod));
+}
diff --git a/tests/tests/text/src/android/text/format/cts/NativeTimeFunctions.java b/tests/tests/text/src/android/text/format/cts/NativeTimeFunctions.java
new file mode 100644
index 0000000..628ceb0
--- /dev/null
+++ b/tests/tests/text/src/android/text/format/cts/NativeTimeFunctions.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+package android.text.format.cts;
+
+import static junit.framework.Assert.assertEquals;
+
+import java.time.LocalDateTime;
+
+/**
+ * A test helper class for calling localtime_r() and mktime() for a given time zone.
+ */
+class NativeTimeFunctions {
+    static {
+        System.loadLibrary("ctstext_jni");
+    }
+
+    private NativeTimeFunctions() {}
+
+    private static native StructTm localtime_tz(int timep, String tzId);
+    private static native int mktime_tz(StructTm tm, String tzId);
+
+    /**
+     * Tries native time functions to see if they produce expected results.
+     *
+     * <p>localtime() is called with {tzId + localDateTime} and the result is checked against
+     * timeMillis. mktime() is called with {tzId + timeMillis} and the result is checked against
+     * localDateTime.
+     *
+     * <p>This method only works to second precision in the range of times that Android's
+     * localtime() / mktime() work across all architectures; signed int32 seconds (because time_t
+     * is dependent on word-size on Android). It may not work for ambiguous local times, i.e. local
+     * times that don't exist (because of a "skip forward") or are duplicated (because of a "fall
+     * back"). This method is not threadsafe as it uses the TZ environment variable.
+     */
+    static void assertNativeTimeResults(String tzId, LocalDateTime localDateTime, long timeMillis) {
+        assertLocaltimeResult(tzId, timeMillis, localDateTime);
+        assertMktimeResult(tzId, localDateTime, timeMillis);
+    }
+
+    private static void assertLocaltimeResult(String tzId, long timeMillis,
+            LocalDateTime expected) {
+        StructTm structTm = localtime_tz((int) (timeMillis / 1000), tzId);
+
+        LocalDateTime actual = LocalDateTime.of(
+                structTm.tm_year + 1900,
+                structTm.tm_mon + 1,
+                structTm.tm_mday,
+                structTm.tm_hour,
+                structTm.tm_min,
+                structTm.tm_sec);
+        assertEquals(timeMillis + " in " + tzId, expected, actual);
+    }
+
+    private static void assertMktimeResult(String tzId, LocalDateTime localDateTime,
+            long expectedTimeMillis) {
+
+        // Create a StructTm from the (second precision) information held in the LocalDateTime.
+        StructTm tm = new StructTm();
+        tm.tm_sec = localDateTime.getSecond();
+        tm.tm_min = localDateTime.getMinute();
+        tm.tm_hour = localDateTime.getHour();
+        tm.tm_mday = localDateTime.getDayOfMonth();
+        tm.tm_mon = localDateTime.getMonthValue() - 1;
+        tm.tm_year = localDateTime.getYear() - 1900;
+        tm.tm_isdst = -1;
+        int actualTimeMillis = mktime_tz(tm, tzId);
+        assertEquals(localDateTime + " in " + tzId,
+                expectedTimeMillis, actualTimeMillis * 1000L);
+    }
+
+    /**
+     * A basic Java representation of bionic's struct tm.
+     */
+    static class StructTm {
+        public int tm_sec;    /* Seconds (0-60) */
+        public int tm_min;    /* Minutes (0-59) */
+        public int tm_hour;   /* Hours (0-23) */
+        public int tm_mday;   /* Day of the month (1-31) */
+        public int tm_mon;    /* Month (0-11) */
+        public int tm_year;   /* Year - 1900 */
+        public int tm_wday;   /* Day of the week (0-6, Sunday = 0) */
+        public int tm_yday;   /* Day in the year (0-365, 1 Jan = 0) */
+        public int tm_isdst;  /* Daylight saving time */
+        public long tm_gmtoff;
+        public String tm_zone;
+    }
+}
diff --git a/tests/tests/text/src/android/text/format/cts/TimeTest.java b/tests/tests/text/src/android/text/format/cts/TimeTest.java
index 631f6f8..ad5c3bf 100644
--- a/tests/tests/text/src/android/text/format/cts/TimeTest.java
+++ b/tests/tests/text/src/android/text/format/cts/TimeTest.java
@@ -1572,7 +1572,7 @@
     }
 
     @Test
-    public void testToMillis_beforeTzRecords() {
+    public void testToMillis_before32BitSeconds() {
         int[] timeFields = new int[] { 1900, 0, 1, 2, 3, 4, -999 /* not used */, 9, 9, 9 };
         verifyToMillisInvalid(timeFields, PstPdt.ID);
         verifyToMillisInvalid(timeFields, Time.TIMEZONE_UTC);
@@ -1613,7 +1613,7 @@
     }
 
     @Test
-    public void testToMillis_afterTzRecords() {
+    public void testToMillis_after32BitSeconds() {
         int[] timeFields = new int[] { 2039, 0, 1, 2, 3, 4, -999 /* not used */, 9, 9, 9 };
         verifyToMillisInvalid(timeFields, PstPdt.ID);
         verifyToMillisInvalid(timeFields, Time.TIMEZONE_UTC);
@@ -2515,7 +2515,7 @@
     }
 
     @Test
-    public void testNormalize_beforeTzRecords() {
+    public void testNormalize_before32BitSeconds() {
         int[] timeFields = new int[] { 1900, 0, 1, 2, 3, 4, -999 /* not used */, 9, 9, 9 };
         verifyNormalizeInvalid(timeFields, PstPdt.ID);
         verifyNormalizeInvalid(timeFields, Time.TIMEZONE_UTC);
@@ -2569,7 +2569,7 @@
     }
 
     @Test
-    public void testNormalize_afterTzRecords() {
+    public void testNormalize_after32BitSeconds() {
         int[] timeFields = new int[] { 2039, 0, 1, 2, 3, 4, -999 /* not used */, 9, 9, 9 };
         verifyNormalizeInvalid(timeFields, PstPdt.ID);
         verifyNormalizeInvalid(timeFields, Time.TIMEZONE_UTC);
@@ -2843,7 +2843,7 @@
         LocalDateTime localDateTime = LocalDateTime.of(2018, Month.OCTOBER, 30, 12, 48, 32);
         assertLocalTimeMillis("Asia/Singapore", localDateTime, 1540874912000L);
 
-        // The following tests check the upper limits of what we support. There's no guarantee
+        // The following tests check the upper limits of what Time supports. There's no guarantee
         // we can't deal with values higher that this but the exact value depends on the version of
         // zic being used as a transition at exactly Integer.MAX_VALUE can affect our ability to
         // deal with times. So, we just assert what we know we must be able to do to catch major
@@ -2861,16 +2861,21 @@
         // Negative offset, has no MAX_VALUE transition with zic 2018e.
         checkUpperSupportedLimit("America/Los_Angeles");
 
-        // See comment above, but for Integer.MIN_VALUE / lower bound. Most zones have a MIN_VALUE
-        // transition with zic 2018e so it is harder to test zones without them so we just cover the
-        // same ones as we do for upper bound above.
+        // See comment above, but for Integer.MIN_VALUE / lower bound. Most zones do not have an
+        // explicit MIN_VALUE transition with zic 2018e 64-bit data but some zones differ around
+        // whether there are known transitions before Integer.MIN_VALUE.
 
-        // Positive offset, has MIN_VALUE transition with zic 2018e.
+        // Positive offset zones with first transition before Integer.MIN_VALUE.
         checkLowerSupportedLimit("Asia/Singapore");
         checkLowerSupportedLimit("Asia/Shanghai");
-        // Negative offset, has MIN_VALUE transition with zic 2018e.
+        // Negative offset zones with first transition before Integer.MIN_VALUE.
         checkLowerSupportedLimit("America/Argentina/Buenos_Aires");
         checkLowerSupportedLimit("America/Los_Angeles");
+
+        // Positive offset zone with first transition after Integer.MIN_VALUE.
+        checkLowerSupportedLimit("Asia/Kathmandu");
+        // Negative offset zone with first transition after Integer.MIN_VALUE.
+        checkLowerSupportedLimit("America/Yellowknife");
     }
 
     private static void checkUpperSupportedLimit(String timeZoneId) {
@@ -2930,6 +2935,9 @@
                 testLocalTime.getSecond(),
                 0 /* isDst */, 0, 0, 0);
         assertEquals(expectedMillis, t.toMillis(true /* ignoreDst */));
+
+        // Check that Time agrees with native localtime / mktime.
+        NativeTimeFunctions.assertNativeTimeResults(timeZoneId, testLocalTime, expectedMillis);
     }
 
     /**
@@ -2965,10 +2973,28 @@
                         + time, timeZone.inDaylightTime(new Date(timeInMillis)), (time.isDst != 0));
                 assertEquals(timeZone.getOffset(timeInMillis),
                         Duration.ofSeconds(time.gmtoff).toMillis());
+
+                // Check that Time agrees with native localtime / mktime.
+                NativeTimeFunctions.assertNativeTimeResults(
+                        tzId, createLocalDateTime(calendar), timeInMillis);
             }
         }
     }
 
+    /**
+     * Creates a LocalDateTime from a Calendar by reading out the current date/time (to second
+     * precision only!).
+     */
+    private static LocalDateTime createLocalDateTime(Calendar calendar) {
+        return LocalDateTime.of(
+                calendar.get(Calendar.YEAR),
+                calendar.get(Calendar.MONTH) + 1,
+                calendar.get(Calendar.DAY_OF_MONTH),
+                calendar.get(Calendar.HOUR_OF_DAY),
+                calendar.get(Calendar.MINUTE),
+                calendar.get(Calendar.SECOND));
+    }
+
     private static List<Long> calculateToMillisTestTimes(String tzId) {
         List<Long> times = new ArrayList<>();
 
@@ -3042,7 +3068,8 @@
         // should pass regardless of zic version used as the Android behavior is stable for this
         // zone as we have fixed the logic used to determine the offset before the first transition
         // AND the first transition for the zone is after Integer.MIN_VALUE.
-        Time t = new Time("Africa/Abidjan");
+        String tzId = "Africa/Abidjan";
+        Time t = new Time(tzId);
         // Jan 1, 1912 12:16:08 AM UTC / Jan 1, 1912 00:00:00 local time
         Instant oldEarliestTransition = Instant.ofEpochSecond(-1830383032);
         Instant beforeOldEarliestTransition = oldEarliestTransition.minus(Duration.ofDays(1));
@@ -3050,10 +3077,14 @@
 
         // The expected local time equivalent to the oldEarliestTransition time minus 1 day and
         // offset by -968 seconds.
-        Time expected = new Time("Africa/Abidjan");
+        Time expected = new Time(tzId);
         Fields.set(expected, 1911, 11, 31, 0, 0, 0, 0 /* isDst */, -968, 364, 0);
-
         Fields.verifyTimeEquals(expected, t);
+
+        // Check that Time agrees with native localtime / mktime.
+        NativeTimeFunctions.assertNativeTimeResults(
+                tzId, LocalDateTime.of(1911, Month.DECEMBER, 31, 0, 0, 0),
+                beforeOldEarliestTransition.toEpochMilli());
     }
 
     private static void verifyNormalizeResult(boolean normalizeArgument, Time toNormalize,
diff --git a/tests/tests/toast/Android.bp b/tests/tests/toast/Android.bp
new file mode 100644
index 0000000..72c785f
--- /dev/null
+++ b/tests/tests/toast/Android.bp
@@ -0,0 +1,38 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test {
+    name: "CtsToastTestCases",
+    defaults: ["cts_defaults"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    static_libs: [
+        "androidx.test.rules",
+        "ctstestrunner-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    min_sdk_version: "25",
+}
+
+filegroup {
+    name: "CtsToastBaseToastTest",
+    srcs: ["src/android/widget/toast/cts/BaseToastTest.java"],
+}
diff --git a/tests/tests/toast/Android.mk b/tests/tests/toast/Android.mk
deleted file mode 100644
index 20a2dab..0000000
--- a/tests/tests/toast/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt androidx.test.rules
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsToastTestCases
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 25
-
-include $(BUILD_CTS_PACKAGE)
-
diff --git a/tests/tests/toastlegacy/Android.bp b/tests/tests/toastlegacy/Android.bp
new file mode 100644
index 0000000..f2fac30
--- /dev/null
+++ b/tests/tests/toastlegacy/Android.bp
@@ -0,0 +1,35 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_test {
+    name: "CtsToastLegacyTestCases",
+    defaults: ["cts_defaults"],
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "androidx.test.rules",
+    ],
+    srcs: [
+        "src/**/*.java",
+        ":CtsToastBaseToastTest",
+    ],
+    sdk_version: "current",
+    min_sdk_version: "25",
+}
diff --git a/tests/tests/toastlegacy/Android.mk b/tests/tests/toastlegacy/Android.mk
deleted file mode 100644
index da3924d..0000000
--- a/tests/tests/toastlegacy/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Copyright (C) 2016 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)
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt androidx.test.rules
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    ../toast/src/android/widget/toast/cts/BaseToastTest.java
-
-LOCAL_PACKAGE_NAME := CtsToastLegacyTestCases
-LOCAL_SDK_VERSION := current
-LOCAL_MIN_SDK_VERSION := 25
-
-include $(BUILD_CTS_PACKAGE)
-
diff --git a/tests/tests/tv/Android.bp b/tests/tests/tv/Android.bp
new file mode 100644
index 0000000..640b963
--- /dev/null
+++ b/tests/tests/tv/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2014 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.
+
+android_test {
+    name: "CtsTvTestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    srcs: ["src/**/*.java"],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/tv/Android.mk b/tests/tests/tv/Android.mk
deleted file mode 100644
index 072d800..0000000
--- a/tests/tests/tv/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2014 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsTvTestCases
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util-axt ctstestrunner-axt
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/uiautomation/Android.bp b/tests/tests/uiautomation/Android.bp
new file mode 100644
index 0000000..22dd8f6
--- /dev/null
+++ b/tests/tests/uiautomation/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2014 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.
+
+android_test {
+    name: "CtsUiAutomationTestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "ub-uiautomator",
+    ],
+    libs: ["android.test.base.stubs"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/uiautomation/Android.mk b/tests/tests/uiautomation/Android.mk
deleted file mode 100644
index 85db3b3..0000000
--- a/tests/tests/uiautomation/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2014 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)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util-axt ctstestrunner-axt ub-uiautomator
-
-LOCAL_JAVA_LIBRARIES := android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsUiAutomationTestCases
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-
diff --git a/tests/tests/uidisolation/Android.bp b/tests/tests/uidisolation/Android.bp
new file mode 100644
index 0000000..80059bc
--- /dev/null
+++ b/tests/tests/uidisolation/Android.bp
@@ -0,0 +1,36 @@
+// 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.
+
+android_test {
+    name: "CtsUidIsolationTestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+        "cts_instant",
+    ],
+    static_libs: [
+        "ctstestrunner-axt",
+        "ctstestserver",
+    ],
+    libs: [
+        "org.apache.http.legacy",
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+}
diff --git a/tests/tests/uidisolation/Android.mk b/tests/tests/uidisolation/Android.mk
deleted file mode 100644
index de39ac6..0000000
--- a/tests/tests/uidisolation/Android.mk
+++ /dev/null
@@ -1,41 +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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests cts_instant
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt ctstestserver
-
-LOCAL_JAVA_LIBRARIES := \
-    org.apache.http.legacy \
-    android.test.runner.stubs \
-    android.test.base.stubs \
-
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsUidIsolationTestCases
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/uirendering/res/drawable/sunset1.jpg b/tests/tests/uirendering/res/drawable/sunset1.jpg
index 92851f3..3b30b36 100644
--- a/tests/tests/uirendering/res/drawable/sunset1.jpg
+++ b/tests/tests/uirendering/res/drawable/sunset1.jpg
Binary files differ
diff --git a/tests/tests/uirendering/src/android/uirendering/cts/testclasses/HardwareRendererTests.kt b/tests/tests/uirendering/src/android/uirendering/cts/testclasses/HardwareRendererTests.kt
index 47191b5..0f82370 100644
--- a/tests/tests/uirendering/src/android/uirendering/cts/testclasses/HardwareRendererTests.kt
+++ b/tests/tests/uirendering/src/android/uirendering/cts/testclasses/HardwareRendererTests.kt
@@ -223,7 +223,7 @@
             assertNotNull(buffer)
             Log.d("HardwareRenderer", "buffer usage bits: " +
                     java.lang.Long.toHexString(buffer.usage))
-            val bitmap = Bitmap.wrapHardwareBuffer(buffer, null)
+            val bitmap = Bitmap.wrapHardwareBuffer(buffer, null)!!
                 .copy(Bitmap.Config.ARGB_8888, false)
 
             assertEquals(TEST_WIDTH, bitmap.width)
@@ -483,4 +483,4 @@
             reader.close()
         }
     }
-}
\ No newline at end of file
+}
diff --git a/tests/tests/util/Android.bp b/tests/tests/util/Android.bp
new file mode 100644
index 0000000..3533502
--- /dev/null
+++ b/tests/tests/util/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2008 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.
+
+android_test {
+    name: "CtsUtilTestCases",
+    defaults: ["cts_defaults"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    libs: ["android.test.runner.stubs"],
+    static_libs: [
+        "androidx.annotation_annotation",
+        "androidx.test.rules",
+        "ctstestrunner-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    platform_apis: true,
+}
diff --git a/tests/tests/util/Android.mk b/tests/tests/util/Android.mk
deleted file mode 100644
index 3aadfa1..0000000
--- a/tests/tests/util/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2008 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_JAVA_LIBRARIES += android.test.runner.stubs
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.annotation_annotation \
-    androidx.test.rules \
-    ctstestrunner-axt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsUtilTestCases
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/view/surfacevalidator/src/android/view/cts/surfacevalidator/PixelCounter.rs b/tests/tests/view/surfacevalidator/src/android/view/cts/surfacevalidator/PixelCounter.rscript
similarity index 100%
rename from tests/tests/view/surfacevalidator/src/android/view/cts/surfacevalidator/PixelCounter.rs
rename to tests/tests/view/surfacevalidator/src/android/view/cts/surfacevalidator/PixelCounter.rscript
diff --git a/tests/tests/voiceinteraction/Android.bp b/tests/tests/voiceinteraction/Android.bp
new file mode 100644
index 0000000..bd04cce
--- /dev/null
+++ b/tests/tests/voiceinteraction/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2015 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.
+
+android_test {
+    name: "CtsVoiceInteractionTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "CtsVoiceInteractionCommon",
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+	"androidx.test.ext.junit",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/voiceinteraction/Android.mk b/tests/tests/voiceinteraction/Android.mk
deleted file mode 100644
index ac78196..0000000
--- a/tests/tests/voiceinteraction/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2015 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-  CtsVoiceInteractionCommon \
-  ctstestrunner-axt \
-  compatibility-device-util-axt \
-  androidx.test.ext.junit
-
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsVoiceInteractionTestCases
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_PACKAGE)
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/voiceinteraction/common/Android.bp b/tests/tests/voiceinteraction/common/Android.bp
new file mode 100644
index 0000000..904dce6
--- /dev/null
+++ b/tests/tests/voiceinteraction/common/Android.bp
@@ -0,0 +1,19 @@
+// Copyright (C) 2015 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.
+
+java_library {
+    name: "CtsVoiceInteractionCommon",
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+}
diff --git a/tests/tests/voiceinteraction/common/Android.mk b/tests/tests/voiceinteraction/common/Android.mk
deleted file mode 100644
index 8b994c9..0000000
--- a/tests/tests/voiceinteraction/common/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2015 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := CtsVoiceInteractionCommon
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/tests/tests/voiceinteraction/service/Android.bp b/tests/tests/voiceinteraction/service/Android.bp
new file mode 100644
index 0000000..2ceeef8
--- /dev/null
+++ b/tests/tests/voiceinteraction/service/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2015 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.
+
+android_test_helper_app {
+    name: "CtsVoiceInteractionService",
+    defaults: ["cts_support_defaults"],
+    static_libs: [
+        "CtsVoiceInteractionCommon",
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/voiceinteraction/service/Android.mk b/tests/tests/voiceinteraction/service/Android.mk
deleted file mode 100644
index abae526..0000000
--- a/tests/tests/voiceinteraction/service/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2015 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := CtsVoiceInteractionCommon ctstestrunner-axt compatibility-device-util-axt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsVoiceInteractionService
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := test_current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/tests/voiceinteraction/testapp/Android.bp b/tests/tests/voiceinteraction/testapp/Android.bp
new file mode 100644
index 0000000..a7123f2
--- /dev/null
+++ b/tests/tests/voiceinteraction/testapp/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2015 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.
+
+android_test_helper_app {
+    name: "CtsVoiceInteractionApp",
+    defaults: ["cts_support_defaults"],
+    static_libs: ["CtsVoiceInteractionCommon", "androidx.core_core"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "test_current",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
\ No newline at end of file
diff --git a/tests/tests/voiceinteraction/testapp/Android.mk b/tests/tests/voiceinteraction/testapp/Android.mk
deleted file mode 100644
index 0191d61..0000000
--- a/tests/tests/voiceinteraction/testapp/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2015 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := CtsVoiceInteractionCommon \
-      androidx.core_core \
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsVoiceInteractionApp
-
-LOCAL_SDK_VERSION := test_current
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/tests/voicesettings/Android.bp b/tests/tests/voicesettings/Android.bp
new file mode 100644
index 0000000..cf3daad
--- /dev/null
+++ b/tests/tests/voicesettings/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2015 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.
+
+android_test {
+    name: "CtsVoiceSettingsTestCases",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/voicesettings/Android.mk b/tests/tests/voicesettings/Android.mk
deleted file mode 100644
index f81afaa..0000000
--- a/tests/tests/voicesettings/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2015 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsVoiceSettingsTestCases
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/voicesettings/service/Android.bp b/tests/tests/voicesettings/service/Android.bp
new file mode 100644
index 0000000..8550417
--- /dev/null
+++ b/tests/tests/voicesettings/service/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2015 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.
+
+android_test_helper_app {
+    name: "CtsVoiceSettingsService",
+    defaults: ["cts_support_defaults"],
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/tests/voicesettings/service/Android.mk b/tests/tests/voicesettings/service/Android.mk
deleted file mode 100644
index 0d86bf8..0000000
--- a/tests/tests/voicesettings/service/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2015 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt compatibility-device-util-axt
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsVoiceSettingsService
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/tests/webkit/Android.bp b/tests/tests/webkit/Android.bp
new file mode 100644
index 0000000..afe9f2b
--- /dev/null
+++ b/tests/tests/webkit/Android.bp
@@ -0,0 +1,40 @@
+// Copyright (C) 2008 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.
+
+android_test {
+    name: "CtsWebkitTestCases",
+    defaults: ["cts_defaults"],
+    libs: [
+        "android.test.runner.stubs",
+        "org.apache.http.legacy",
+        "android.test.base.stubs",
+    ],
+    static_libs: [
+        "compatibility-device-util-axt",
+        "ctsdeviceutillegacy-axt",
+        "ctstestserver",
+        "ctstestrunner-axt",
+        "hamcrest-library",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    // uncomment when dalvik.annotation.Test* are removed or part of SDK
+    //sdk_version: "current"
+    platform_apis: true,
+}
diff --git a/tests/tests/webkit/Android.mk b/tests/tests/webkit/Android.mk
deleted file mode 100644
index d638588..0000000
--- a/tests/tests/webkit/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (C) 2008 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_JAVA_LIBRARIES := \
-    android.test.runner.stubs \
-    org.apache.http.legacy \
-    android.test.base.stubs \
-
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    compatibility-device-util-axt \
-    ctsdeviceutillegacy-axt \
-    ctstestserver \
-    ctstestrunner-axt \
-    hamcrest-library
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsWebkitTestCases
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-# uncomment when dalvik.annotation.Test* are removed or part of SDK
-#LOCAL_SDK_VERSION := current
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/wrap/OWNERS b/tests/tests/wrap/OWNERS
new file mode 100644
index 0000000..6ea7640
--- /dev/null
+++ b/tests/tests/wrap/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 86431
+yabinc@google.com
diff --git a/tests/video/Android.bp b/tests/video/Android.bp
new file mode 100644
index 0000000..aeb08cf
--- /dev/null
+++ b/tests/video/Android.bp
@@ -0,0 +1,40 @@
+// Copyright (C) 2013 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.
+
+android_test {
+    name: "CtsVideoTestCases",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    static_libs: [
+        "ctsmediautil",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    jni_libs: [
+        "libctscodecutils_jni",
+        "libnativehelper_compat_libc++",
+    ],
+    srcs: ["src/**/*.java"],
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+    sdk_version: "test_current",
+}
diff --git a/tests/video/Android.mk b/tests/video/Android.mk
deleted file mode 100644
index f922734..0000000
--- a/tests/video/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 2013 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
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctsmediautil compatibility-device-util-axt ctstestrunner-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_JNI_SHARED_LIBRARIES := libctscodecutils_jni libnativehelper_compat_libc++
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CtsVideoTestCases
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_CTS_PACKAGE)
-
diff --git a/tests/vr/Android.bp b/tests/vr/Android.bp
new file mode 100644
index 0000000..4ba27ad
--- /dev/null
+++ b/tests/vr/Android.bp
@@ -0,0 +1,43 @@
+// Copyright (C) 2016 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.
+
+android_test {
+    name: "CtsVrTestCases",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    static_libs: [
+        "ctstestrunner-axt",
+        "compatibility-device-util-axt",
+    ],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    jni_libs: [
+        "libctsvrextensions_jni",
+        "libnativehelper_compat_libc++",
+    ],
+    srcs: [
+        "src/**/*.java",
+        ":CtsVerifierMockVrListenerServiceFiles",
+    ],
+    sdk_version: "test_current",
+    min_sdk_version: "14",
+    // Tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+        "general-tests",
+    ],
+}
diff --git a/tests/vr/Android.mk b/tests/vr/Android.mk
deleted file mode 100644
index e945e04..0000000
--- a/tests/vr/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2016 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)
-
-LOCAL_PACKAGE_NAME := CtsVrTestCases
-
-# Don't include this package in any target.
-LOCAL_MODULE_TAGS := optional
-
-# Include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-# When built, explicitly put it in the data partition.
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner-axt compatibility-device-util-axt
-
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_JNI_SHARED_LIBRARIES := libctsvrextensions_jni libnativehelper_compat_libc++
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) ../../apps/CtsVerifier/src/com/android/cts/verifier/vr/MockVrListenerService.java
-
-LOCAL_SDK_VERSION := test_current
-LOCAL_MIN_SDK_VERSION := 14
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-
-include $(BUILD_CTS_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/vr/jni/Android.bp b/tests/vr/jni/Android.bp
new file mode 100644
index 0000000..1bdc092
--- /dev/null
+++ b/tests/vr/jni/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 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.
+//
+
+cc_library_shared {
+    name: "libctsvrextensions_jni",
+    cflags: [
+        "-Werror",
+        "-Wall",
+        "-Wextra",
+    ],
+    srcs: ["VrExtensionsJni.cpp"],
+    include_dirs: [
+        "system/core/include",
+        "frameworks/native/opengl/include",
+    ],
+    shared_libs: [
+        "libandroid",
+        "libnativehelper_compat_libc++",
+        "liblog",
+        "libEGL",
+        "libGLESv2",
+    ],
+    sdk_version: "current",
+    stl: "c++_static",
+}
diff --git a/tests/vr/jni/Android.mk b/tests/vr/jni/Android.mk
deleted file mode 100644
index 3b62b8a..0000000
--- a/tests/vr/jni/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 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)
-
-LOCAL_MODULE    := libctsvrextensions_jni
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS += -Werror -Wall -Wextra
-
-LOCAL_SRC_FILES := VrExtensionsJni.cpp
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE) $(call include-path-for, system-core) frameworks/native/opengl/include
-
-LOCAL_SHARED_LIBRARIES := libandroid libnativehelper_compat_libc++ liblog libEGL libGLESv2
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_NDK_STL_VARIANT := c++_static
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tools/cts-api-coverage/Android.bp b/tools/cts-api-coverage/Android.bp
index ed802ca..b0df7f1 100644
--- a/tools/cts-api-coverage/Android.bp
+++ b/tools/cts-api-coverage/Android.bp
@@ -27,7 +27,6 @@
     },
 
     java_resource_dirs: ["res"],
-    manifest: "MANIFEST.mf",
 
     static_libs: [
         "compatibility-host-util",
@@ -45,10 +44,13 @@
     name: "cts-api-coverage",
     wrapper: "etc/cts-api-coverage",
     static_libs: ["api-coverage"],
+    manifest: "MANIFEST.mf",
 }
 
+
 java_binary_host {
     name: "ndk-api-report",
     wrapper: "etc/ndk-api-report",
     static_libs: ["api-coverage"],
+    manifest: "MANIFEST.mf",
 }
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiClass.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiClass.java
index 8c04be7..734a8bb 100644
--- a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiClass.java
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiClass.java
@@ -36,9 +36,9 @@
 
     private final boolean mAbstract;
 
-    private final List<ApiConstructor> mApiConstructors = new ArrayList<ApiConstructor>();
+    private final List<ApiConstructor> mApiConstructors = Collections.synchronizedList(new ArrayList<>());
 
-    private final List<ApiMethod> mApiMethods = new ArrayList<ApiMethod>();
+    private final List<ApiMethod> mApiMethods = Collections.synchronizedList(new ArrayList<>());
 
     private final String mSuperClassName;
 
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiConstructor.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiConstructor.java
index a6fbf12..665ce7d 100644
--- a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiConstructor.java
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiConstructor.java
@@ -20,7 +20,9 @@
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 
 /** Representation of a constructor in the API with parameters (arguments). */
 class ApiConstructor implements Comparable<ApiConstructor> {
@@ -32,7 +34,7 @@
     private final boolean mDeprecated;
 
     // A list of test APKs (aka CTS modules) that use this method.
-    private final Set<String> mCoveredWith = new HashSet<>();
+    private final Map<String, Boolean> mCoveredWith = new ConcurrentHashMap<>();
 
     ApiConstructor(String name, List<String> parameterTypes, boolean deprecated) {
         mName = name;
@@ -65,10 +67,10 @@
         if (coveredWithModule.endsWith(".apk")) {
             coveredWithModule = coveredWithModule.substring(0, coveredWithModule.length() - 4);
         }
-        mCoveredWith.add(coveredWithModule);
+        mCoveredWith.put(coveredWithModule, true);
     }
 
     public Set<String> getCoveredWith() {
-        return mCoveredWith;
+        return mCoveredWith.keySet();
     }
 }
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiCoverage.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiCoverage.java
index 953aab3..5ab0ee3 100644
--- a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiCoverage.java
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiCoverage.java
@@ -21,18 +21,19 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 /** Representation of the entire API containing packages. */
 class ApiCoverage {
 
-    private final Map<String, ApiPackage> mPackages = new HashMap<String, ApiPackage>();
+    private final Map<String, ApiPackage> mPackages = new ConcurrentHashMap<>();
 
     public void addPackage(ApiPackage pkg) {
         mPackages.put(pkg.getName(), pkg);
     }
 
     public ApiPackage getPackage(String name) {
-        return mPackages.get(name);
+        return name == null ? null : mPackages.get(name);
     }
 
     public Collection<ApiPackage> getPackages() {
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiMethod.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiMethod.java
index 56c225d..0b6f09b 100644
--- a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiMethod.java
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiMethod.java
@@ -20,7 +20,9 @@
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 
 
 /** Representation of a method in the API with parameters (arguments) and a return value. */
@@ -43,7 +45,7 @@
     private final boolean mAbstractMethod;
 
     // A list of test APKs (aka CTS modules) that use this method.
-    private final Set<String> mCoveredWith = new HashSet<>();
+    private final Map<String, Boolean> mCoveredWith = new ConcurrentHashMap<>();
 
     ApiMethod(
             String name,
@@ -97,13 +99,13 @@
 
     public boolean isFinalMethod() { return mFinalMethod; }
 
-    public Set<String> getCoveredWith() { return mCoveredWith; }
+    public Set<String> getCoveredWith() { return mCoveredWith.keySet(); }
 
     public void setCovered(String coveredWithModule) {
         if (coveredWithModule.endsWith(".apk")) {
             coveredWithModule = coveredWithModule.substring(0, coveredWithModule.length() - 4);
         }
 
-        mCoveredWith.add(coveredWithModule);
+        mCoveredWith.put(coveredWithModule, true);
     }
 }
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiPackage.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiPackage.java
index b09a281..07d8654 100644
--- a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiPackage.java
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiPackage.java
@@ -22,13 +22,14 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
 
 /** Representation of a package in the API containing classes. */
 class ApiPackage implements HasCoverage {
 
     private final String mName;
 
-    private final Map<String, ApiClass> mApiClassMap = new HashMap<String, ApiClass>();
+    private final Map<String, ApiClass> mApiClassMap = new ConcurrentHashMap<>();
 
     ApiPackage(String name) {
         mName = name;
@@ -44,7 +45,7 @@
     }
 
     public ApiClass getClass(String name) {
-        return mApiClassMap.get(name);
+        return name == null ? null : mApiClassMap.get(name);
     }
 
     public Collection<ApiClass> getClasses() {
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/CddCoverage.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/CddCoverage.java
index 3d1a07d..591a929 100644
--- a/tools/cts-api-coverage/src/com/android/cts/apicoverage/CddCoverage.java
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/CddCoverage.java
@@ -24,11 +24,12 @@
 import java.util.Map;
 import java.util.List;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 
 /** Representation of the entire CDD. */
 class CddCoverage {
 
-    private final Map<String, CddRequirement> requirements = new HashMap<>();
+    private final Map<String, CddRequirement> requirements = new ConcurrentHashMap<>();
 
     public void addCddRequirement(CddRequirement cddRequirement) {
         requirements.put(cddRequirement.getRequirementId(), cddRequirement);
@@ -39,10 +40,10 @@
     }
 
     public void addCoverage(String cddRequirementId, TestMethod testMethod) {
-        if (!requirements.containsKey(cddRequirementId)) {
-            requirements.put(cddRequirementId, new CddRequirement(cddRequirementId));
-        }
+        if (cddRequirementId == null)
+            return;
 
+        requirements.putIfAbsent(cddRequirementId, new CddRequirement(cddRequirementId));
         requirements.get(cddRequirementId).addTestMethod(testMethod);
     }
 
@@ -52,7 +53,7 @@
 
         CddRequirement(String requirementId) {
             this.mRequirementId = requirementId;
-            this.mtestMethods = new ArrayList<>();
+            this.mtestMethods = Collections.synchronizedList(new ArrayList<>());
         }
 
         @Override
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/CtsApiCoverage.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/CtsApiCoverage.java
index a5fa922..c46df15 100644
--- a/tools/cts-api-coverage/src/com/android/cts/apicoverage/CtsApiCoverage.java
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/CtsApiCoverage.java
@@ -45,6 +45,9 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Set;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
 
 import javax.xml.transform.TransformerException;
 
@@ -195,10 +198,22 @@
 
         // Add superclass information into api coverage.
         apiCoverage.resolveSuperClasses();
+
+        ExecutorService service =
+            Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
+        List<Future> tasks = new ArrayList<>();
         for (File testApk : testApks) {
-            addApiCoverage(apiCoverage, testApk, dexDeps);
-            addCddCoverage(cddCoverage, testApk, apiLevel);
+            tasks.add(addApiCoverage(service, apiCoverage, testApk, dexDeps));
+            tasks.add(addCddCoverage(service, cddCoverage, testApk, apiLevel));
         }
+        // Wait until all tasks finish.
+        for (Future task : tasks) {
+            task.get();
+        }
+        service.shutdown();
+
+        // The below two coverage methods assume all classes and methods have been already
+        // registered, which is why we don't run them parallelly with others.
 
         try {
             // Add coverage for GTest modules
@@ -265,22 +280,26 @@
      * @param apiCoverage object to which the coverage statistics will be added to
      * @param testApk containing the tests that will be scanned by dexdeps
      */
-    private static void addApiCoverage(ApiCoverage apiCoverage, File testApk, String dexdeps)
-            throws SAXException, IOException {
-        XMLReader xmlReader = XMLReaderFactory.createXMLReader();
-        String testApkName = testApk.getName();
-        DexDepsXmlHandler dexDepsXmlHandler = new DexDepsXmlHandler(apiCoverage, testApkName);
-        xmlReader.setContentHandler(dexDepsXmlHandler);
+    private static Future addApiCoverage(
+        ExecutorService service, ApiCoverage apiCoverage, File testApk, String dexdeps) {
+        return service.submit(() -> {
+            String apkPath = testApk.getPath();
+            try {
+                XMLReader xmlReader = XMLReaderFactory.createXMLReader();
+                String testApkName = testApk.getName();
+                DexDepsXmlHandler dexDepsXmlHandler = new DexDepsXmlHandler(apiCoverage, testApkName);
+                xmlReader.setContentHandler(dexDepsXmlHandler);
 
-        String apkPath = testApk.getPath();
-        Process process = new ProcessBuilder(dexdeps, "--format=xml", apkPath).start();
-        try {
-            xmlReader.parse(new InputSource(process.getInputStream()));
-        } catch (SAXException e) {
-          // Catch this exception, but continue. SAXException is acceptable in cases
-          // where the apk does not contain a classes.dex and therefore parsing won't work.
-          System.err.println("warning: dexdeps failed for: " + apkPath);
-        }
+                Process process = new ProcessBuilder(dexdeps, "--format=xml", apkPath).start();
+                xmlReader.parse(new InputSource(process.getInputStream()));
+            } catch (SAXException e) {
+                // Catch this exception, but continue. SAXException is acceptable in cases
+                // where the apk does not contain a classes.dex and therefore parsing won't work.
+                System.err.println("warning: dexdeps failed for: " + apkPath);
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        });
     }
 
     /**
@@ -379,16 +398,22 @@
         }
     }
 
-    private static void addCddCoverage(CddCoverage cddCoverage, File testSource, int api)
-            throws IOException {
-
-        if (testSource.getName().endsWith(".apk")) {
-            addCddApkCoverage(cddCoverage, testSource, api);
-        } else if (testSource.getName().endsWith(".jar")) {
-            addCddJarCoverage(cddCoverage, testSource);
-        } else {
-            System.err.println("Unsupported file type for CDD coverage: " + testSource.getPath());
-        }
+    private static Future addCddCoverage(
+        ExecutorService service, CddCoverage cddCoverage, File testSource, int api) {
+        return service.submit(() -> {
+            try {
+                if (testSource.getName().endsWith(".apk")) {
+                    addCddApkCoverage(cddCoverage, testSource, api);
+                } else if (testSource.getName().endsWith(".jar")) {
+                    addCddJarCoverage(cddCoverage, testSource);
+                } else {
+                    System.err
+                        .println("Unsupported file type for CDD coverage: " + testSource.getPath());
+                }
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        });
     }
 
     private static void addCddJarCoverage(CddCoverage cddCoverage, File testSource)
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/HasCoverage.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/HasCoverage.java
index f8d8054..ab44c56 100644
--- a/tools/cts-api-coverage/src/com/android/cts/apicoverage/HasCoverage.java
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/HasCoverage.java
@@ -30,8 +30,14 @@
         int rhsPct = Math.round(otherEntity.getCoveragePercentage());
         int diff = Integer.compare(getCoveragePercentageSegment(lhsPct),
                 getCoveragePercentageSegment(rhsPct));
-        return diff != 0 ? diff :
-            Integer.compare(otherEntity.getMemberSize(), entity.getMemberSize());
+        if (diff != 0) {
+            return diff;
+        }
+        diff = Integer.compare(otherEntity.getMemberSize(), entity.getMemberSize());
+        if (diff != 0) {
+            return diff;
+        }
+        return entity.getName().compareTo(otherEntity.getName());
     }
 
     /**
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/XmlReport.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/XmlReport.java
index e6ac3af..e44ce60 100644
--- a/tools/cts-api-coverage/src/com/android/cts/apicoverage/XmlReport.java
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/XmlReport.java
@@ -45,6 +45,7 @@
 
         out.println("<debug>");
         out.println("<sources>");
+        Collections.sort(testApks);
         for (File testApk : testApks) {
             out.println("<apk path=\"" + testApk.getPath() + "\" />");
         }
@@ -85,12 +86,13 @@
                                 + "\">");
 
                         for (ApiConstructor constructor : apiClass.getConstructors()) {
-                            String coveredWithList =
-                                    constructor.getCoveredWith().stream().collect(Collectors.joining(","));
+                            List<String> coveredWithList = new ArrayList<String>(constructor.getCoveredWith());
+                            Collections.sort(coveredWithList);
+                            String coveredWith = coveredWithList.stream().collect(Collectors.joining(","));
                             out.println("<constructor name=\"" + constructor.getName()
                                     + "\" deprecated=\"" + constructor.isDeprecated()
                                     + "\" covered=\"" + constructor.isCovered()
-                                    + "\" with=\"" + coveredWithList
+                                    + "\" with=\"" + coveredWith
                                     + "\">");
                             if (constructor.isDeprecated()) {
                                 if (constructor.isCovered()) {
@@ -106,8 +108,9 @@
                         }
 
                         for (ApiMethod method : apiClass.getMethods()) {
-                            String coveredWithList =
-                                    method.getCoveredWith().stream().collect(Collectors.joining(","));
+                            List<String> coveredWithList = new ArrayList<String>(method.getCoveredWith());
+                            Collections.sort(coveredWithList);
+                            String coveredWith = coveredWithList.stream().collect(Collectors.joining(","));
                             out.println("<method name=\"" + method.getName()
                                     + "\" returnType=\"" + method.getReturnType()
                                     + "\" deprecated=\"" + method.isDeprecated()
@@ -116,7 +119,7 @@
                                     + "\" visibility=\"" + method.getVisibility()
                                     + "\" abstract=\"" + method.isAbstractMethod()
                                     + "\" covered=\"" + method.isCovered()
-                                    + "\" with=\"" + coveredWithList
+                                    + "\" with=\"" + coveredWith
                                     + "\">");
                             if (method.isDeprecated()) {
                                 if (method.isCovered()) {
diff --git a/tools/utils/CollectAllTests.java b/tools/utils/CollectAllTests.java
index 1c6fa99..2582149 100644
--- a/tools/utils/CollectAllTests.java
+++ b/tools/utils/CollectAllTests.java
@@ -22,8 +22,8 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import vogar.Expectation;
-import vogar.ExpectationStore;
+import vogar.expect.Expectation;
+import vogar.expect.ExpectationStore;
 
 import java.io.BufferedReader;
 import java.io.File;
diff --git a/tools/utils/DescriptionGenerator.java b/tools/utils/DescriptionGenerator.java
index 1e2542f..ada9b4d 100644
--- a/tools/utils/DescriptionGenerator.java
+++ b/tools/utils/DescriptionGenerator.java
@@ -38,8 +38,8 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import vogar.ExpectationStore;
-import vogar.Expectation;
+import vogar.expect.ExpectationStore;
+import vogar.expect.Expectation;
 
 import com.sun.javadoc.AnnotationDesc;
 import com.sun.javadoc.AnnotationTypeDoc;
diff --git a/tools/utils/VogarUtils.java b/tools/utils/VogarUtils.java
index 8657aa6..d760d7d 100644
--- a/tools/utils/VogarUtils.java
+++ b/tools/utils/VogarUtils.java
@@ -14,10 +14,10 @@
  * limitations under the License.
  */
 
-import vogar.Expectation;
-import vogar.ExpectationStore;
-import vogar.ModeId;
-import vogar.Result;
+import vogar.expect.Expectation;
+import vogar.expect.ExpectationStore;
+import vogar.expect.ModeId;
+import vogar.expect.Result;
 
 import com.android.tradefed.util.AbiUtils;