summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2017-12-08 00:02:42 +0000
committerPaul Duffin <paulduffin@google.com>2017-12-08 00:07:17 +0000
commitb866307f99c35252dcb76e9269bb57d97c3c4b86 (patch)
treece8d4edc1cf2edbc48029214dfbde2213a3d9466
parent9d25218985ba8ea944b4a51d194744b5a85a1105 (diff)
Stop statically including legacy-android-test
Statically including legacy-android-test leads to duplicate classes which causes build time problems (with Proguard) and runtime problems on older SDK versions. This change: * Stops statically including legacy-android-test. * Adds compile time dependencies on andoid.test.base, android.test.mock and android.test.runner where necessary. * Adds <uses-library android:name="android.test.runner"/> to any affected package to ensure that the classes that were included by legacy-android-test are still available at runtime. That also adds a dependency on android.test.base and android.test.mock. The following change descriptions were generated automatically and so may be a little repetitive. They are provided to give the reviewer enough information to check the comments match what has actually been changed and check the reasoning behind the changes. * apct-tests/perftests/core/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in CorePerfTests results in duplicate classes which leads to build time and compile time issues. Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because CorePerfTests's source depends on its classes and because of these changes they are no longer present on the compilation path. * core/tests/ConnectivityManagerTest/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because ConnectivityManagerTest's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in ConnectivityManagerTest results in duplicate classes which leads to build time and compile time issues. * core/tests/bandwidthtests/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because BandwidthTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in BandwidthTests results in duplicate classes which leads to build time and compile time issues. * core/tests/bluetoothtests/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because BluetoothTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in BluetoothTests results in duplicate classes which leads to build time and compile time issues. * core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in DownloadManagerTestApp results in duplicate classes which leads to build time and compile time issues. Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because DownloadManagerTestApp's source depends on its classes and because of these changes they are no longer present on the compilation path. * core/tests/hosttests/test-apps/ExternalSharedPerms/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in ExternalSharedPermsTestApp results in duplicate classes which leads to build time and compile time issues. * core/tests/hosttests/test-apps/ExternalSharedPermsBT/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in ExternalSharedPermsBTTestApp results in duplicate classes which leads to build time and compile time issues. * core/tests/hosttests/test-apps/ExternalSharedPermsDiffKey/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in ExternalSharedPermsDiffKeyTestApp results in duplicate classes which leads to build time and compile time issues. * core/tests/hosttests/test-apps/ExternalSharedPermsFL/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in ExternalSharedPermsFLTestApp results in duplicate classes which leads to build time and compile time issues. * core/tests/notificationtests/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because NotificationStressTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in NotificationStressTests results in duplicate classes which leads to build time and compile time issues. * keystore/tests/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in KeystoreTests results in duplicate classes which leads to build time and compile time issues. * media/mca/tests/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because CameraEffectsTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in CameraEffectsTests results in duplicate classes which leads to build time and compile time issues. * media/tests/MediaFrameworkTest/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because mediaframeworktest's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in mediaframeworktest results in duplicate classes which leads to build time and compile time issues. * nfc-extras/tests/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in NfcExtrasTests results in duplicate classes which leads to build time and compile time issues. * packages/CarrierDefaultApp/tests/unit/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because CarrierDefaultAppUnitTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in CarrierDefaultAppUnitTests results in duplicate classes which leads to build time and compile time issues. * packages/ExtServices/tests/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because ExtServicesUnitTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in ExtServicesUnitTests results in duplicate classes which leads to build time and compile time issues. * packages/MtpDocumentsProvider/tests/Android.mk Added 'android.test.base' and 'android.test.mock' to LOCAL_JAVA_LIBRARIES because MtpDocumentsProviderTests's source depends on their classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in MtpDocumentsProviderTests results in duplicate classes which leads to build time and compile time issues. * packages/SettingsLib/tests/integ/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because SettingsLibTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in SettingsLibTests results in duplicate classes which leads to build time and compile time issues. * packages/SettingsProvider/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in SettingsProvider results in duplicate classes which leads to build time and compile time issues. * packages/SettingsProvider/AndroidManifest.xml Add uses-library for android.test.runner because otherwise this change would change the set of files available to SettingsProvider at runtime. * packages/Shell/tests/Android.mk Added 'android.test.base' and 'android.test.mock' to LOCAL_JAVA_LIBRARIES because ShellTests's source depends on their classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in ShellTests results in duplicate classes which leads to build time and compile time issues. * packages/SystemUI/shared/tests/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in SystemUISharedLibTests results in duplicate classes which leads to build time and compile time issues. * packages/SystemUI/tests/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in SystemUITests results in duplicate classes which leads to build time and compile time issues. Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because SystemUITests's source depends on its classes and because of these changes they are no longer present on the compilation path. * packages/WAPPushManager/tests/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because WAPPushManagerTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in WAPPushManagerTests results in duplicate classes which leads to build time and compile time issues. * sax/tests/saxtests/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because FrameworksSaxTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in FrameworksSaxTests results in duplicate classes which leads to build time and compile time issues. * tests/BrowserPowerTest/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because BrowserPowerTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in BrowserPowerTests results in duplicate classes which leads to build time and compile time issues. * tests/CanvasCompare/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because CanvasCompare's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in CanvasCompare results in duplicate classes which leads to build time and compile time issues. * tests/CoreTests/android/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because CoreTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in CoreTests results in duplicate classes which leads to build time and compile time issues. * tests/DataIdleTest/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because DataIdleTest's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in DataIdleTest results in duplicate classes which leads to build time and compile time issues. * tests/FrameworkPerf/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because FrameworkPerf's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in FrameworkPerf results in duplicate classes which leads to build time and compile time issues. * tests/HierarchyViewerTest/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because HierarchyViewerTest's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in HierarchyViewerTest results in duplicate classes which leads to build time and compile time issues. * tests/ImfTest/tests/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because ImfTestTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in ImfTestTests results in duplicate classes which leads to build time and compile time issues. * tests/Internal/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in InternalTests results in duplicate classes which leads to build time and compile time issues. * tests/MemoryUsage/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because MemoryUsage's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in MemoryUsage results in duplicate classes which leads to build time and compile time issues. * tests/NetworkSecurityConfigTest/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because NetworkSecurityConfigTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in NetworkSecurityConfigTests results in duplicate classes which leads to build time and compile time issues. * tests/SoundTriggerTests/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in SoundTriggerTests results in duplicate classes which leads to build time and compile time issues. Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because SoundTriggerTests's source depends on its classes and because of these changes they are no longer present on the compilation path. * tests/SurfaceComposition/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in SurfaceComposition results in duplicate classes which leads to build time and compile time issues. Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because SurfaceComposition's source depends on its classes and because of these changes they are no longer present on the compilation path. * tests/TtsTests/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in TtsTests results in duplicate classes which leads to build time and compile time issues. Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because TtsTests's source depends on its classes and because of these changes they are no longer present on the compilation path. * tests/WindowAnimationJank/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in WindowAnimationJank results in duplicate classes which leads to build time and compile time issues. * tests/permission/Android.mk Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because FrameworkPermissionTests's source depends on its classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in FrameworkPermissionTests results in duplicate classes which leads to build time and compile time issues. * tests/testables/tests/Android.mk Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in TestablesTests results in duplicate classes which leads to build time and compile time issues. Added 'android.test.base' and 'android.test.mock' to LOCAL_JAVA_LIBRARIES because TestablesTests's source depends on their classes and because of these changes they are no longer present on the compilation path. Bug: 30188076 Test: make checkbuild Change-Id: Iacfc939c97415314366ed61c5f3b7aa1a40f0ec9
-rw-r--r--apct-tests/perftests/core/Android.mk5
-rw-r--r--core/tests/ConnectivityManagerTest/Android.mk4
-rw-r--r--core/tests/bandwidthtests/Android.mk8
-rw-r--r--core/tests/bluetoothtests/Android.mk4
-rw-r--r--core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.mk4
-rw-r--r--core/tests/hosttests/test-apps/ExternalSharedPerms/Android.mk2
-rw-r--r--core/tests/hosttests/test-apps/ExternalSharedPermsBT/Android.mk2
-rw-r--r--core/tests/hosttests/test-apps/ExternalSharedPermsDiffKey/Android.mk2
-rw-r--r--core/tests/hosttests/test-apps/ExternalSharedPermsFL/Android.mk2
-rw-r--r--core/tests/notificationtests/Android.mk3
-rw-r--r--keystore/tests/Android.mk3
-rw-r--r--media/mca/tests/Android.mk4
-rw-r--r--media/tests/MediaFrameworkTest/Android.mk5
-rw-r--r--nfc-extras/tests/Android.mk2
-rw-r--r--packages/CarrierDefaultApp/tests/unit/Android.mk4
-rw-r--r--packages/ExtServices/tests/Android.mk3
-rw-r--r--packages/MtpDocumentsProvider/tests/Android.mk4
-rw-r--r--packages/SettingsLib/tests/integ/Android.mk3
-rw-r--r--packages/SettingsProvider/Android.mk2
-rw-r--r--packages/SettingsProvider/AndroidManifest.xml2
-rw-r--r--packages/Shell/tests/Android.mk3
-rw-r--r--packages/SystemUI/shared/tests/Android.mk3
-rw-r--r--packages/SystemUI/tests/Android.mk8
-rw-r--r--packages/WAPPushManager/tests/Android.mk4
-rw-r--r--sax/tests/saxtests/Android.mk4
-rw-r--r--tests/BrowserPowerTest/Android.mk4
-rw-r--r--tests/CanvasCompare/Android.mk4
-rw-r--r--tests/CoreTests/android/Android.mk10
-rw-r--r--tests/DataIdleTest/Android.mk4
-rw-r--r--tests/FrameworkPerf/Android.mk4
-rw-r--r--tests/HierarchyViewerTest/Android.mk4
-rw-r--r--tests/ImfTest/tests/Android.mk4
-rw-r--r--tests/Internal/Android.mk1
-rw-r--r--tests/MemoryUsage/Android.mk4
-rw-r--r--tests/NetworkSecurityConfigTest/Android.mk9
-rw-r--r--tests/SoundTriggerTests/Android.mk4
-rw-r--r--tests/SurfaceComposition/Android.mk4
-rw-r--r--tests/TtsTests/Android.mk4
-rw-r--r--tests/WindowAnimationJank/Android.mk1
-rw-r--r--tests/permission/Android.mk4
-rw-r--r--tests/testables/tests/Android.mk3
41 files changed, 86 insertions, 72 deletions
diff --git a/apct-tests/perftests/core/Android.mk b/apct-tests/perftests/core/Android.mk
index f08b4025f95e..75cb229e36d6 100644
--- a/apct-tests/perftests/core/Android.mk
+++ b/apct-tests/perftests/core/Android.mk
@@ -11,8 +11,9 @@ LOCAL_SRC_FILES := \
LOCAL_STATIC_JAVA_LIBRARIES := \
android-support-test \
apct-perftests-utils \
- guava \
- legacy-android-test
+ guava
+
+LOCAL_JAVA_LIBRARIES := android.test.base
LOCAL_PACKAGE_NAME := CorePerfTests
diff --git a/core/tests/ConnectivityManagerTest/Android.mk b/core/tests/ConnectivityManagerTest/Android.mk
index 39cf4a49ffbf..5ed93f317b3f 100644
--- a/core/tests/ConnectivityManagerTest/Android.mk
+++ b/core/tests/ConnectivityManagerTest/Android.mk
@@ -18,8 +18,8 @@ include $(CLEAR_VARS)
# We only want this apk build for tests.
LOCAL_MODULE_TAGS := tests
-LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
+LOCAL_STATIC_JAVA_LIBRARIES := junit
# Include all test java files.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/core/tests/bandwidthtests/Android.mk b/core/tests/bandwidthtests/Android.mk
index 2af92dfe6104..ff9a0fe60f34 100644
--- a/core/tests/bandwidthtests/Android.mk
+++ b/core/tests/bandwidthtests/Android.mk
@@ -22,8 +22,12 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := \
$(call all-java-files-under, src)
-LOCAL_JAVA_LIBRARIES := android.test.runner org.apache.http.legacy
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := \
+ android.test.runner \
+ org.apache.http.legacy \
+ android.test.base \
+
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_PACKAGE_NAME := BandwidthTests
include $(BUILD_PACKAGE)
diff --git a/core/tests/bluetoothtests/Android.mk b/core/tests/bluetoothtests/Android.mk
index f53419ab53cd..744e5b04974e 100644
--- a/core/tests/bluetoothtests/Android.mk
+++ b/core/tests/bluetoothtests/Android.mk
@@ -8,8 +8,8 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := \
$(call all-java-files-under, src)
-LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_PACKAGE_NAME := BluetoothTests
LOCAL_CERTIFICATE := platform
diff --git a/core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.mk b/core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.mk
index 47ee2cfe6e90..1d9f62442d3f 100644
--- a/core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.mk
+++ b/core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.mk
@@ -20,8 +20,8 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := android-common mockwebserver junit legacy-android-test
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_STATIC_JAVA_LIBRARIES := android-common mockwebserver junit
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
LOCAL_PACKAGE_NAME := DownloadManagerTestApp
diff --git a/core/tests/hosttests/test-apps/ExternalSharedPerms/Android.mk b/core/tests/hosttests/test-apps/ExternalSharedPerms/Android.mk
index b35cbae58621..193e6010cef3 100644
--- a/core/tests/hosttests/test-apps/ExternalSharedPerms/Android.mk
+++ b/core/tests/hosttests/test-apps/ExternalSharedPerms/Android.mk
@@ -20,7 +20,7 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := legacy-android-test junit
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_SDK_VERSION := current
diff --git a/core/tests/hosttests/test-apps/ExternalSharedPermsBT/Android.mk b/core/tests/hosttests/test-apps/ExternalSharedPermsBT/Android.mk
index 06812b511686..9f44767eed49 100644
--- a/core/tests/hosttests/test-apps/ExternalSharedPermsBT/Android.mk
+++ b/core/tests/hosttests/test-apps/ExternalSharedPermsBT/Android.mk
@@ -20,7 +20,7 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := legacy-android-test junit
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_SDK_VERSION := current
diff --git a/core/tests/hosttests/test-apps/ExternalSharedPermsDiffKey/Android.mk b/core/tests/hosttests/test-apps/ExternalSharedPermsDiffKey/Android.mk
index 48bceafac26b..b4d354c6f359 100644
--- a/core/tests/hosttests/test-apps/ExternalSharedPermsDiffKey/Android.mk
+++ b/core/tests/hosttests/test-apps/ExternalSharedPermsDiffKey/Android.mk
@@ -20,7 +20,7 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := legacy-android-test junit
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_SDK_VERSION := current
diff --git a/core/tests/hosttests/test-apps/ExternalSharedPermsFL/Android.mk b/core/tests/hosttests/test-apps/ExternalSharedPermsFL/Android.mk
index 569d102358da..969e58871903 100644
--- a/core/tests/hosttests/test-apps/ExternalSharedPermsFL/Android.mk
+++ b/core/tests/hosttests/test-apps/ExternalSharedPermsFL/Android.mk
@@ -20,7 +20,7 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := legacy-android-test junit
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_SDK_VERSION := current
diff --git a/core/tests/notificationtests/Android.mk b/core/tests/notificationtests/Android.mk
index 0551eb6b75ad..30c2dcaaacaa 100644
--- a/core/tests/notificationtests/Android.mk
+++ b/core/tests/notificationtests/Android.mk
@@ -8,12 +8,11 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := \
$(call all-java-files-under, src)
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
LOCAL_PACKAGE_NAME := NotificationStressTests
LOCAL_STATIC_JAVA_LIBRARIES := \
junit \
- legacy-android-test \
ub-uiautomator
include $(BUILD_PACKAGE)
diff --git a/keystore/tests/Android.mk b/keystore/tests/Android.mk
index 51adde4d68af..1167f76725f1 100644
--- a/keystore/tests/Android.mk
+++ b/keystore/tests/Android.mk
@@ -21,8 +21,7 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_JAVA_LIBRARIES := \
- android-support-test \
- legacy-android-test
+ android-support-test
LOCAL_PACKAGE_NAME := KeystoreTests
diff --git a/media/mca/tests/Android.mk b/media/mca/tests/Android.mk
index eb451f72e49e..394f5422c215 100644
--- a/media/mca/tests/Android.mk
+++ b/media/mca/tests/Android.mk
@@ -4,8 +4,8 @@ include $(CLEAR_VARS)
# We only want this apk build for tests.
LOCAL_MODULE_TAGS := tests
-LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
+LOCAL_STATIC_JAVA_LIBRARIES := junit
# Include all test java files.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/media/tests/MediaFrameworkTest/Android.mk b/media/tests/MediaFrameworkTest/Android.mk
index 0d9f42b93007..145cde68a4d5 100644
--- a/media/tests/MediaFrameworkTest/Android.mk
+++ b/media/tests/MediaFrameworkTest/Android.mk
@@ -5,13 +5,12 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-subdir-java-files)
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
LOCAL_STATIC_JAVA_LIBRARIES := \
mockito-target-minus-junit4 \
android-support-test \
- android-ex-camera2 \
- legacy-android-test
+ android-ex-camera2
LOCAL_PACKAGE_NAME := mediaframeworktest
diff --git a/nfc-extras/tests/Android.mk b/nfc-extras/tests/Android.mk
index d8fe5a6cca30..be2bb532b956 100644
--- a/nfc-extras/tests/Android.mk
+++ b/nfc-extras/tests/Android.mk
@@ -22,7 +22,7 @@ LOCAL_JAVA_LIBRARIES := \
android.test.runner \
com.android.nfc_extras
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := junit
# Include all test java files.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/packages/CarrierDefaultApp/tests/unit/Android.mk b/packages/CarrierDefaultApp/tests/unit/Android.mk
index 63bd0b13c61f..6e120a6355e8 100644
--- a/packages/CarrierDefaultApp/tests/unit/Android.mk
+++ b/packages/CarrierDefaultApp/tests/unit/Android.mk
@@ -19,9 +19,9 @@ include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
LOCAL_CERTIFICATE := platform
-LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common
+LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common android.test.base
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test mockito-target-minus-junit4 legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test mockito-target-minus-junit4
# Include all test java files.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/packages/ExtServices/tests/Android.mk b/packages/ExtServices/tests/Android.mk
index 92afbeb98abd..1eb5847459ff 100644
--- a/packages/ExtServices/tests/Android.mk
+++ b/packages/ExtServices/tests/Android.mk
@@ -5,14 +5,13 @@ include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
LOCAL_CERTIFICATE := platform
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
LOCAL_STATIC_JAVA_LIBRARIES := \
android-support-test \
mockito-target-minus-junit4 \
espresso-core \
truth-prebuilt \
- legacy-android-test \
testables
# Include all test java files.
diff --git a/packages/MtpDocumentsProvider/tests/Android.mk b/packages/MtpDocumentsProvider/tests/Android.mk
index 148cd0d930ab..ba346f424829 100644
--- a/packages/MtpDocumentsProvider/tests/Android.mk
+++ b/packages/MtpDocumentsProvider/tests/Android.mk
@@ -3,8 +3,8 @@ include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base android.test.mock
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_PACKAGE_NAME := MtpDocumentsProviderTests
LOCAL_INSTRUMENTATION_FOR := MtpDocumentsProvider
LOCAL_CERTIFICATE := media
diff --git a/packages/SettingsLib/tests/integ/Android.mk b/packages/SettingsLib/tests/integ/Android.mk
index 7ace048324c3..9018f25b49f0 100644
--- a/packages/SettingsLib/tests/integ/Android.mk
+++ b/packages/SettingsLib/tests/integ/Android.mk
@@ -20,7 +20,7 @@ LOCAL_CERTIFICATE := platform
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common
+LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common android.test.base
LOCAL_JACK_FLAGS := --multi-dex native
@@ -31,7 +31,6 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
android-support-test \
espresso-core \
mockito-target-minus-junit4 \
- legacy-android-test \
truth-prebuilt
# Code coverage puts us over the dex limit, so enable multi-dex for coverage-enabled builds
diff --git a/packages/SettingsProvider/Android.mk b/packages/SettingsProvider/Android.mk
index 069e83a8d2d6..0f2c5ab45c1a 100644
--- a/packages/SettingsProvider/Android.mk
+++ b/packages/SettingsProvider/Android.mk
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src) \
src/com/android/providers/settings/EventLogTags.logtags
LOCAL_JAVA_LIBRARIES := telephony-common ims-common
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_PACKAGE_NAME := SettingsProvider
LOCAL_CERTIFICATE := platform
diff --git a/packages/SettingsProvider/AndroidManifest.xml b/packages/SettingsProvider/AndroidManifest.xml
index 9374d522707b..287a888a23b2 100644
--- a/packages/SettingsProvider/AndroidManifest.xml
+++ b/packages/SettingsProvider/AndroidManifest.xml
@@ -11,6 +11,8 @@
android:icon="@mipmap/ic_launcher_settings"
android:defaultToDeviceProtectedStorage="true"
android:directBootAware="true">
+ <uses-library android:name="android.test.runner" />
+
<provider android:name="SettingsProvider"
android:authorities="settings"
diff --git a/packages/Shell/tests/Android.mk b/packages/Shell/tests/Android.mk
index 48b757c30cd1..7f24a386e734 100644
--- a/packages/Shell/tests/Android.mk
+++ b/packages/Shell/tests/Android.mk
@@ -6,14 +6,13 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base android.test.mock
LOCAL_STATIC_JAVA_LIBRARIES := \
android-support-test \
mockito-target-minus-junit4 \
ub-uiautomator \
junit \
- legacy-android-test \
LOCAL_PACKAGE_NAME := ShellTests
LOCAL_COMPATIBILITY_SUITE := device-tests
diff --git a/packages/SystemUI/shared/tests/Android.mk b/packages/SystemUI/shared/tests/Android.mk
index ce3b4424de50..239a4e37e832 100644
--- a/packages/SystemUI/shared/tests/Android.mk
+++ b/packages/SystemUI/shared/tests/Android.mk
@@ -38,7 +38,6 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
mockito-target-minus-junit4 \
SystemUI-proto \
SystemUI-tags \
- legacy-android-test \
testables \
truth-prebuilt \
@@ -50,4 +49,4 @@ LOCAL_CERTIFICATE := platform
ifeq ($(EXCLUDE_SYSTEMUI_TESTS),)
include $(BUILD_PACKAGE)
-endif \ No newline at end of file
+endif
diff --git a/packages/SystemUI/tests/Android.mk b/packages/SystemUI/tests/Android.mk
index b695919dc2b5..9d44895dbe8d 100644
--- a/packages/SystemUI/tests/Android.mk
+++ b/packages/SystemUI/tests/Android.mk
@@ -54,11 +54,15 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
mockito-target-minus-junit4 \
SystemUI-proto \
SystemUI-tags \
- legacy-android-test \
testables \
truth-prebuilt \
-LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common android.car
+LOCAL_JAVA_LIBRARIES := \
+ android.test.runner \
+ telephony-common \
+ android.car \
+ android.test.base \
+
LOCAL_AAPT_FLAGS := --extra-packages com.android.systemui:com.android.keyguard
diff --git a/packages/WAPPushManager/tests/Android.mk b/packages/WAPPushManager/tests/Android.mk
index 1dea798e83b2..bfc85ab5ca84 100644
--- a/packages/WAPPushManager/tests/Android.mk
+++ b/packages/WAPPushManager/tests/Android.mk
@@ -18,8 +18,8 @@ include $(CLEAR_VARS)
# We only want this apk build for tests.
LOCAL_MODULE_TAGS := tests
-LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common android.test.base
+LOCAL_STATIC_JAVA_LIBRARIES := junit
# Include all test java files.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/sax/tests/saxtests/Android.mk b/sax/tests/saxtests/Android.mk
index d3fbd0569e78..e0e490c146a4 100644
--- a/sax/tests/saxtests/Android.mk
+++ b/sax/tests/saxtests/Android.mk
@@ -7,8 +7,8 @@ LOCAL_MODULE_TAGS := tests
# Include all test java files.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_PACKAGE_NAME := FrameworksSaxTests
include $(BUILD_PACKAGE)
diff --git a/tests/BrowserPowerTest/Android.mk b/tests/BrowserPowerTest/Android.mk
index 59bc729a6280..57655751cfd8 100644
--- a/tests/BrowserPowerTest/Android.mk
+++ b/tests/BrowserPowerTest/Android.mk
@@ -18,8 +18,8 @@ include $(CLEAR_VARS)
# We only want this apk build for tests.
LOCAL_MODULE_TAGS := tests
-LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
+LOCAL_STATIC_JAVA_LIBRARIES := junit
# Include all test java files.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/tests/CanvasCompare/Android.mk b/tests/CanvasCompare/Android.mk
index 90de503ebd81..b071ec4c494b 100644
--- a/tests/CanvasCompare/Android.mk
+++ b/tests/CanvasCompare/Android.mk
@@ -23,7 +23,7 @@ LOCAL_PACKAGE_NAME := CanvasCompare
LOCAL_MODULE_TAGS := tests
-LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
+LOCAL_STATIC_JAVA_LIBRARIES := junit
include $(BUILD_PACKAGE)
diff --git a/tests/CoreTests/android/Android.mk b/tests/CoreTests/android/Android.mk
index c9f11615381f..56d7918aa01e 100644
--- a/tests/CoreTests/android/Android.mk
+++ b/tests/CoreTests/android/Android.mk
@@ -6,8 +6,14 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := \
$(call all-subdir-java-files)
-LOCAL_JAVA_LIBRARIES := android.test.runner bouncycastle conscrypt org.apache.http.legacy
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := \
+ android.test.runner \
+ bouncycastle \
+ conscrypt \
+ org.apache.http.legacy \
+ android.test.base \
+
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_PACKAGE_NAME := CoreTests
diff --git a/tests/DataIdleTest/Android.mk b/tests/DataIdleTest/Android.mk
index 4e15729221a9..85f7edf7438d 100644
--- a/tests/DataIdleTest/Android.mk
+++ b/tests/DataIdleTest/Android.mk
@@ -20,8 +20,8 @@ include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
LOCAL_PACKAGE_NAME := DataIdleTest
-LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_SRC_FILES := $(call all-java-files-under, src)
# We need to sign it to get access to the network usage history.
diff --git a/tests/FrameworkPerf/Android.mk b/tests/FrameworkPerf/Android.mk
index d2ec75347531..1873cc1de8a9 100644
--- a/tests/FrameworkPerf/Android.mk
+++ b/tests/FrameworkPerf/Android.mk
@@ -7,8 +7,8 @@ LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_PACKAGE_NAME := FrameworkPerf
-LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_AAPT_FLAGS = -c 120dpi,240dpi,160dpi,161dpi,320dpi,nodpi
diff --git a/tests/HierarchyViewerTest/Android.mk b/tests/HierarchyViewerTest/Android.mk
index f8c865631f93..8550d703678c 100644
--- a/tests/HierarchyViewerTest/Android.mk
+++ b/tests/HierarchyViewerTest/Android.mk
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_PACKAGE_NAME := HierarchyViewerTest
-LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
+LOCAL_STATIC_JAVA_LIBRARIES := junit
include $(BUILD_PACKAGE)
diff --git a/tests/ImfTest/tests/Android.mk b/tests/ImfTest/tests/Android.mk
index 60424712d02c..a0df959cf185 100644
--- a/tests/ImfTest/tests/Android.mk
+++ b/tests/ImfTest/tests/Android.mk
@@ -7,8 +7,8 @@ LOCAL_MODULE_TAGS := tests
# Include all test java files.
LOCAL_SRC_FILES := $(call all-subdir-java-files)
-LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_PACKAGE_NAME := ImfTestTests
diff --git a/tests/Internal/Android.mk b/tests/Internal/Android.mk
index fc001e928e80..73181ec36e17 100644
--- a/tests/Internal/Android.mk
+++ b/tests/Internal/Android.mk
@@ -11,7 +11,6 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_JAVA_LIBRARIES := android.test.runner
LOCAL_STATIC_JAVA_LIBRARIES := junit \
- legacy-android-test \
android-support-test \
mockito-target-minus-junit4
diff --git a/tests/MemoryUsage/Android.mk b/tests/MemoryUsage/Android.mk
index 578e628987f1..e186e9fb03c9 100644
--- a/tests/MemoryUsage/Android.mk
+++ b/tests/MemoryUsage/Android.mk
@@ -9,8 +9,8 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := MemoryUsage
LOCAL_CERTIFICATE := platform
-LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
+LOCAL_STATIC_JAVA_LIBRARIES := junit
include $(BUILD_PACKAGE)
diff --git a/tests/NetworkSecurityConfigTest/Android.mk b/tests/NetworkSecurityConfigTest/Android.mk
index dd9ff11971eb..6fb60259a2fc 100644
--- a/tests/NetworkSecurityConfigTest/Android.mk
+++ b/tests/NetworkSecurityConfigTest/Android.mk
@@ -5,8 +5,13 @@ include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
LOCAL_CERTIFICATE := platform
-LOCAL_JAVA_LIBRARIES := android.test.runner bouncycastle conscrypt
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := \
+ android.test.runner \
+ bouncycastle \
+ conscrypt \
+ android.test.base \
+
+LOCAL_STATIC_JAVA_LIBRARIES := junit
# Include all test java files.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/tests/SoundTriggerTests/Android.mk b/tests/SoundTriggerTests/Android.mk
index 359484ee63d7..030d5f4738dc 100644
--- a/tests/SoundTriggerTests/Android.mk
+++ b/tests/SoundTriggerTests/Android.mk
@@ -27,8 +27,8 @@ else
LOCAL_SRC_FILES := src/android/hardware/soundtrigger/SoundTriggerTest.java
endif
-LOCAL_STATIC_JAVA_LIBRARIES := mockito-target legacy-android-test
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_STATIC_JAVA_LIBRARIES := mockito-target
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
LOCAL_PACKAGE_NAME := SoundTriggerTests
diff --git a/tests/SurfaceComposition/Android.mk b/tests/SurfaceComposition/Android.mk
index d97c3f4cd66f..1962791c8392 100644
--- a/tests/SurfaceComposition/Android.mk
+++ b/tests/SurfaceComposition/Android.mk
@@ -27,7 +27,9 @@ LOCAL_PROGUARD_ENABLED := disabled
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := legacy-android-test junit
+LOCAL_STATIC_JAVA_LIBRARIES := junit
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
LOCAL_PACKAGE_NAME := SurfaceComposition
diff --git a/tests/TtsTests/Android.mk b/tests/TtsTests/Android.mk
index 3c3cd77813f7..2fa19508c32c 100644
--- a/tests/TtsTests/Android.mk
+++ b/tests/TtsTests/Android.mk
@@ -20,8 +20,8 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-subdir-java-files)
-LOCAL_STATIC_JAVA_LIBRARIES := mockito-target legacy-android-test
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_STATIC_JAVA_LIBRARIES := mockito-target
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
LOCAL_PACKAGE_NAME := TtsTests
diff --git a/tests/WindowAnimationJank/Android.mk b/tests/WindowAnimationJank/Android.mk
index f356afb799a2..8aac8a15c705 100644
--- a/tests/WindowAnimationJank/Android.mk
+++ b/tests/WindowAnimationJank/Android.mk
@@ -27,7 +27,6 @@ LOCAL_PACKAGE_NAME := WindowAnimationJank
LOCAL_STATIC_JAVA_LIBRARIES := \
ub-uiautomator \
ub-janktesthelper \
- legacy-android-test \
junit
LOCAL_SDK_VERSION := current
diff --git a/tests/permission/Android.mk b/tests/permission/Android.mk
index 54688c891046..7f81d9a3a894 100644
--- a/tests/permission/Android.mk
+++ b/tests/permission/Android.mk
@@ -7,8 +7,8 @@ LOCAL_MODULE_TAGS := tests
# Include all test java files.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common android.test.base
+LOCAL_STATIC_JAVA_LIBRARIES := junit
LOCAL_PACKAGE_NAME := FrameworkPermissionTests
include $(BUILD_PACKAGE)
diff --git a/tests/testables/tests/Android.mk b/tests/testables/tests/Android.mk
index 16fe5351c161..6e20d797fb5d 100644
--- a/tests/testables/tests/Android.mk
+++ b/tests/testables/tests/Android.mk
@@ -28,10 +28,9 @@ LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_STATIC_JAVA_LIBRARIES := \
android-support-test \
mockito-target-minus-junit4 \
- legacy-android-test \
testables
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base android.test.mock
LOCAL_CERTIFICATE := platform