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.

* hostsidetests/abioverride/app/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsAbiOverrideTestApp
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/abioverride/app/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsAbiOverrideTestApp at runtime.

* hostsidetests/appsecurity/test-apps/AccessSerialModern/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsAccessSerialModern
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/appsecurity/test-apps/AccessSerialModern/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsAccessSerialModern at runtime.

* hostsidetests/appsecurity/test-apps/AppAccessData/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsAppAccessData
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/appsecurity/test-apps/AppWithData/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsAppWithData results
    in duplicate classes which leads to build time and compile time
    issues.

* hostsidetests/appsecurity/test-apps/DocumentProvider/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsDocumentProvider
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/appsecurity/test-apps/DocumentProvider/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsDocumentProvider at runtime.

* hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsEphemeralTestsEphemeralApp1'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
    CtsEphemeralTestsEphemeralApp1 results in duplicate classes which
    leads to build time and compile time issues.

* hostsidetests/appsecurity/test-apps/EphemeralTestApp/ImplicitlyExposedApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsEphemeralTestsImplicitApp results in duplicate classes which
    leads to build time and compile time issues.

* hostsidetests/appsecurity/test-apps/EphemeralTestApp/NormalApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsEphemeralTestsNormalApp results in duplicate classes which leads
    to build time and compile time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsEphemeralTestsNormalApp's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

* hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsEphemeralTestsUserApp results in duplicate classes which leads
    to build time and compile time issues.

* hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserAppTest/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsEphemeralTestsUserAppTest results in duplicate classes which
    leads to build time and compile time issues.

* hostsidetests/appsecurity/test-apps/ExternalStorageApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsExternalStorageApp
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/appsecurity/test-apps/InstrumentationAppDiffCert/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsInstrumentationAppDiffCert results in duplicate classes which
    leads to build time and compile time issues.

* hostsidetests/appsecurity/test-apps/MultiUserStorageApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsMultiUserStorageApp
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsReadExternalStorageApp results in duplicate classes which leads
    to build time and compile time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsReadExternalStorageApp's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

* hostsidetests/appsecurity/test-apps/SplitApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsSplitApp results in
    duplicate classes which leads to build time and compile time
    issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsSplitApp'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 CtsSplitAppDiffRevision
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsSplitAppDiffRevision'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 CtsSplitAppDiffVersion
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsSplitAppDiffVersion'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 CtsSplitAppDiffCert
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsSplitAppDiffCert's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

* hostsidetests/appsecurity/test-apps/StorageAppA/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsStorageAppA results
    in duplicate classes which leads to build time and compile time
    issues.

* hostsidetests/appsecurity/test-apps/StorageAppB/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsStorageAppB results
    in duplicate classes which leads to build time and compile time
    issues.

* hostsidetests/appsecurity/test-apps/StorageStatsApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsStorageStatsApp
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/appsecurity/test-apps/UsePermissionApp23/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsUsePermissionApp23
    results in duplicate classes which leads to build time and compile
    time issues. It is also unnecessary as CtsUsePermissionApp23
    targets SDK version 23 which provides all the classes at runtime.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsUsePermissionApp23's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* hostsidetests/appsecurity/test-apps/UsePermissionApp23/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsUsePermissionApp23 at runtime.

* hostsidetests/appsecurity/test-apps/UsePermissionApp25/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsUsePermissionApp25
    results in duplicate classes which leads to build time and compile
    time issues. It is also unnecessary as CtsUsePermissionApp25
    targets SDK version 25 which provides all the classes at runtime.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsUsePermissionApp25's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* hostsidetests/appsecurity/test-apps/UsePermissionApp25/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsUsePermissionApp25 at runtime.

* hostsidetests/appsecurity/test-apps/UsePermissionApp26/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsUsePermissionApp26
    results in duplicate classes which leads to build time and compile
    time issues. It is also unnecessary as CtsUsePermissionApp26
    targets SDK version 26 which provides all the classes at runtime.

* hostsidetests/appsecurity/test-apps/UsePermissionApp26/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsUsePermissionApp26 at runtime.

* hostsidetests/appsecurity/test-apps/UsePermissionAppLatest/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsUsePermissionAppLatest results in duplicate classes which leads
    to build time and compile time issues.

* hostsidetests/appsecurity/test-apps/UsePermissionAppLatest/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsUsePermissionAppLatest at runtime.

* hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsUsePermissionDiffCert results in duplicate classes which leads
    to build time and compile time issues.

* hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsWriteExternalStorageApp results in duplicate classes which leads
    to build time and compile time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsWriteExternalStorageApp's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

* hostsidetests/appsecurity/test-apps/keysets/testApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsKeySetTestApp
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/devicepolicy/app/AccountCheck/Auth/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsAccountCheckAuthApp
    results in duplicate classes which leads to build time and compile
    time issues. It is also unnecessary as CtsAccountCheckAuthApp
    targets SDK version 25 which provides all the classes at runtime.

* hostsidetests/devicepolicy/app/AccountCheck/Auth/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsAccountCheckAuthApp at runtime.

* hostsidetests/devicepolicy/app/AccountManagement/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsAccountManagementDevicePolicyApp results in duplicate classes
    which leads to build time and compile time issues.

* hostsidetests/devicepolicy/app/AccountManagement/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsAccountManagementDevicePolicyApp at runtime.

* hostsidetests/devicepolicy/app/Assistant/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsDevicePolicyAssistApp results in duplicate classes which leads
    to build time and compile time issues.

* hostsidetests/devicepolicy/app/Assistant/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsDevicePolicyAssistApp at runtime.

* hostsidetests/devicepolicy/app/CrossProfileAppsTest/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsCrossProfileAppsTests results in duplicate classes which leads
    to build time and compile time issues. It is also unnecessary as
    CtsCrossProfileAppsTests targets SDK version 25 which provides all
    the classes at runtime.

* hostsidetests/devicepolicy/app/CustomizationApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsCustomizationApp
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/devicepolicy/app/CustomizationApp/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsCustomizationApp at runtime.

* hostsidetests/devicepolicy/app/DelegateApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsDelegateApp results
    in duplicate classes which leads to build time and compile time
    issues.

* hostsidetests/devicepolicy/app/DeviceAdmin/api23/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsDeviceAdminApp23
    results in duplicate classes which leads to build time and compile
    time issues. It is also unnecessary as CtsDeviceAdminApp23 targets
    SDK version 23 which provides all the classes at runtime.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsDeviceAdminApp23's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

* hostsidetests/devicepolicy/app/DeviceAdmin/api24/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsDeviceAdminApp24
    results in duplicate classes which leads to build time and compile
    time issues. It is also unnecessary as CtsDeviceAdminApp24 targets
    SDK version 24 which provides all the classes at runtime.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsDeviceAdminApp24's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

* hostsidetests/devicepolicy/app/DeviceOwner/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsDeviceOwnerApp
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/devicepolicy/app/IntentReceiver/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsIntentReceiverApp
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/devicepolicy/app/IntentSender/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsIntentSenderApp
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/devicepolicy/app/LauncherTests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsLauncherAppsTests
    results in duplicate classes which leads to build time and compile
    time issues. It is also unnecessary as CtsLauncherAppsTests targets
    SDK version 25 which provides all the classes at runtime.

* hostsidetests/devicepolicy/app/ManagedProfile/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsManagedProfileApp
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/devicepolicy/app/PackageInstaller/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsPackageInstallerApp
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/devicepolicy/app/ProfileOwner/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsProfileOwnerApp
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/devicepolicy/app/SingleAdminApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsDevicePolicySingleAdminTestApp results in duplicate classes
    which leads to build time and compile time issues.

* hostsidetests/devicepolicy/app/WifiConfigCreator/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsWifiConfigCreator
    results in duplicate classes which leads to build time and compile
    time issues.

* hostsidetests/devicepolicy/app/WifiConfigCreator/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsWifiConfigCreator at runtime.

* hostsidetests/dumpsys/apps/ProcStatsHelperApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsProcStatsHelperApp
    results in duplicate classes which leads to build time and compile
    time issues. It is also unnecessary as CtsProcStatsHelperApp
    targets SDK version 24 which provides all the classes at runtime.

* hostsidetests/dumpsys/apps/ProcStatsHelperApp/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsProcStatsHelperApp at runtime.

* hostsidetests/media/app/MediaSessionTest/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsMediaSessionHostTestApp results in duplicate classes which leads
    to build time and compile time issues.

* hostsidetests/media/app/MediaSessionTest/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsMediaSessionHostTestApp at runtime.

* hostsidetests/numberblocking/app/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsHostsideNumberBlockingAppTest results in duplicate classes which
    leads to build time and compile time issues.

* hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsStaticSharedLibConsumerApp1 results in duplicate classes which
    leads to build time and compile time issues.

* hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsStaticSharedLibConsumerApp1 at runtime.

* hostsidetests/shortcuts/deviceside/backup/launcher1/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupLauncher1 results in duplicate classes which leads
    to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/launcher1/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupLauncher1 at runtime.

* hostsidetests/shortcuts/deviceside/backup/launcher2/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupLauncher2 results in duplicate classes which leads
    to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/launcher2/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupLauncher2 at runtime.

* hostsidetests/shortcuts/deviceside/backup/launcher3/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupLauncher3 results in duplicate classes which leads
    to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/launcher3/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupLauncher3 at runtime.

* hostsidetests/shortcuts/deviceside/backup/launcher4new/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupLauncher4new results in duplicate classes which
    leads to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/launcher4new/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupLauncher4new at runtime.

* hostsidetests/shortcuts/deviceside/backup/launcher4old/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupLauncher4old results in duplicate classes which
    leads to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/launcher4old/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupLauncher4old at runtime.

* hostsidetests/shortcuts/deviceside/backup/publisher1/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupPublisher1 results in duplicate classes which
    leads to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/publisher1/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupPublisher1 at runtime.

* hostsidetests/shortcuts/deviceside/backup/publisher2/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupPublisher2 results in duplicate classes which
    leads to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/publisher2/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupPublisher2 at runtime.

* hostsidetests/shortcuts/deviceside/backup/publisher3/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupPublisher3 results in duplicate classes which
    leads to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/publisher3/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupPublisher3 at runtime.

* hostsidetests/shortcuts/deviceside/backup/publisher4new/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupPublisher4new results in duplicate classes which
    leads to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/publisher4new/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupPublisher4new at runtime.

* hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupPublisher4new_nobackup results in duplicate
    classes which leads to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupPublisher4new_nobackup at runtime.

* hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupPublisher4new_nomanifest results in duplicate
    classes which leads to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupPublisher4new_nomanifest at runtime.

* hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupPublisher4new_wrongkey results in duplicate
    classes which leads to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupPublisher4new_wrongkey at runtime.

* hostsidetests/shortcuts/deviceside/backup/publisher4old/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupPublisher4old results in duplicate classes which
    leads to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/publisher4old/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupPublisher4old at runtime.

* hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutBackupPublisher4old_nomanifest results in duplicate
    classes which leads to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutBackupPublisher4old_nomanifest at runtime.

* hostsidetests/shortcuts/deviceside/multiuser/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutMultiuserTest results in duplicate classes which leads
    to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/multiuser/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutMultiuserTest at runtime.

* hostsidetests/shortcuts/deviceside/upgrade/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutUpgradeVersion1 results in duplicate classes which leads
    to build time and compile time issues.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutUpgradeVersion2 results in duplicate classes which leads
    to build time and compile time issues.

* hostsidetests/shortcuts/deviceside/upgrade/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutUpgradeVersion1 at runtime.

* hostsidetests/ui/appA/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsDeviceTaskSwitchingAppA results in duplicate classes which leads
    to build time and compile time issues.

* hostsidetests/ui/appA/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsDeviceTaskSwitchingAppA at runtime.

* hostsidetests/ui/appB/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsDeviceTaskSwitchingAppB results in duplicate classes which leads
    to build time and compile time issues.

* hostsidetests/ui/appB/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsDeviceTaskSwitchingAppB at runtime.

* hostsidetests/usb/SerialTestApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsUsbSerialTestApp
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/JobScheduler/jobperm/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsJobSchedulerJobPerm
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/JobScheduler/jobperm/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsJobSchedulerJobPerm at runtime.

* tests/JobScheduler/shareduid/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsJobSchedulerSharedUid results in duplicate classes which leads
    to build time and compile time issues.

* tests/JobScheduler/shareduid/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsJobSchedulerSharedUid at runtime.

* tests/ProcessTest/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in ProcessTests results in
    duplicate classes which leads to build time and compile time
    issues.

* tests/acceleration/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsAccelerationTestCases results in duplicate classes which leads
    to build time and compile time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsAccelerationTestCases's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

* tests/accessibilityservice/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsAccessibilityServiceTestCases results in duplicate classes which
    leads to build time and compile time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsAccessibilityServiceTestCases's source depends on its classes
    and because of these changes they are no longer present on the
    compilation path.

* tests/admin/app/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsAdminApp results in
    duplicate classes which leads to build time and compile time
    issues.

* tests/app/app/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsAppTestStubs'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 CtsAppTestStubs results
    in duplicate classes which leads to build time and compile time
    issues.

* tests/app/app2/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsAppTestStubsDifferentUid results in duplicate classes which
    leads to build time and compile time issues.

* tests/app/app2/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsAppTestStubsDifferentUid at runtime.

* tests/backup/app/fullbackup/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsFullBackupApp
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/backup/app/fullbackup/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to CtsFullBackupApp
    at runtime.

* tests/backup/app/keyvalue/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsKeyValueBackupApp
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/backup/app/keyvalue/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsKeyValueBackupApp at runtime.

* tests/fragment/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsFragmentTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/framework/base/windowmanager/alertwindowservice/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsAlertWindowService
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/framework/base/windowmanager/alertwindowservice/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsAlertWindowService at runtime.

* tests/jank/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsJankDeviceTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsJankDeviceTestCases's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* tests/leanbackjank/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsLeanbackJankTestCases results in duplicate classes which leads
    to build time and compile time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsLeanbackJankTestCases's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

* tests/leanbackjank/app/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsLeanbackJankApp
    results in duplicate classes which leads to build time and compile
    time issues. It is also unnecessary as CtsLeanbackJankApp targets
    SDK version 23 which provides all the classes at runtime.

* tests/leanbackjank/app/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsLeanbackJankApp at runtime.

* tests/netlegacy22.api/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsNetTestCasesLegacyApi22 results in duplicate classes which leads
    to build time and compile time issues.

* tests/netlegacy22.permission/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsNetTestCasesLegacyPermission22 results in duplicate classes
    which leads to build time and compile time issues.

* tests/pdf/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsPdfTestCases results
    in duplicate classes which leads to build time and compile time
    issues.

* tests/sample/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsSampleDeviceTestCases results in duplicate classes which leads
    to build time and compile time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsSampleDeviceTestCases's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

* tests/tests/accounts/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsAccountManagerTestCases results in duplicate classes which leads
    to build time and compile time issues. It is also unnecessary as
    CtsAccountManagerTestCases targets SDK version 26 which provides
    all the classes at runtime.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsAccountManagerTestCases's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

* tests/tests/animation/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsAnimationTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/app.usage/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsUsageStatsTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' and 'android.test.runner' to
    LOCAL_JAVA_LIBRARIES because CtsUsageStatsTestCases's source
    depends on their classes and because of these changes they are no
    longer present on the compilation path.

* tests/tests/app/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsAndroidAppTestCases'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 CtsAndroidAppTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/appwidget/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsAppWidgetTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsAppWidgetTestCases's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* tests/tests/bluetooth/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsBluetoothTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/calendarcommon/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsCalendarcommon2TestCases results in duplicate classes which
    leads to build time and compile time issues. It is also unnecessary
    as CtsCalendarcommon2TestCases targets SDK version 15 which
    provides all the classes at runtime.

* tests/tests/car/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsCarTestCases results
    in duplicate classes which leads to build time and compile time
    issues.

* tests/tests/carrierapi/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsCarrierApiTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsCarrierApiTestCases's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* tests/tests/colormode/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsColorModeTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/content/Android.mk
    Added 'android.test.base' and 'android.test.mock' to
    LOCAL_JAVA_LIBRARIES because CtsContentTestCases'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 CtsContentTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/database/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsDatabaseTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/display/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsDisplayTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/dpi/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsDpiTestCases results
    in duplicate classes which leads to build time and compile time
    issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsDpiTestCases's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

* tests/tests/dreams/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsDreamsTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsDreamsTestCases's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

* tests/tests/drm/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsDrmTestCases results
    in duplicate classes which leads to build time and compile time
    issues.

* tests/tests/dynamic_linker/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsDynamicLinkerTestCases results in duplicate classes which leads
    to build time and compile time issues.

* tests/tests/externalservice/service/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsExternalServiceService results in duplicate classes which leads
    to build time and compile time issues.

* tests/tests/externalservice/service/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsExternalServiceService at runtime.

* tests/tests/graphics/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsGraphicsTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/hardware/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsHardwareTestCases'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 CtsHardwareTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/incident/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsIncidentTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/keystore/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsKeystoreTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsKeystoreTestCases's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

* tests/tests/libcorefileio/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsLibcoreFileIOTestCases results in duplicate classes which leads
    to build time and compile time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsLibcoreFileIOTestCases's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

* tests/tests/location2/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsLocation2TestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsLocation2TestCases's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* tests/tests/media/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsMediaTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsMediaTestCases's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

* tests/tests/net/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsNetTestCases'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 CtsNetTestCases results
    in duplicate classes which leads to build time and compile time
    issues.

* tests/tests/netsecpolicy/usescleartexttraffic-false/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsNetSecPolicyUsesCleartextTrafficFalseTestCases results in
    duplicate classes which leads to build time and compile time
    issues.

* tests/tests/netsecpolicy/usescleartexttraffic-true/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsNetSecPolicyUsesCleartextTrafficTrueTestCases results in
    duplicate classes which leads to build time and compile time
    issues.

* tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsNetSecPolicyUsesCleartextTrafficUnspecifiedTestCases results in
    duplicate classes which leads to build time and compile time
    issues.

* tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsNetSecConfigDownloadManagerTestCases results in duplicate
    classes which leads to build time and compile time issues.

* tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsNetSecConfigResourcesSrcTestCases results in duplicate classes
    which leads to build time and compile time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsNetSecConfigResourcesSrcTestCases's source depends on its
    classes and because of these changes they are no longer present on
    the compilation path.

* tests/tests/opengl/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsOpenGLTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsOpenGLTestCases's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

* tests/tests/os/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsOsTestCases results
    in duplicate classes which leads to build time and compile time
    issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsOsTestCases's source depends on its classes and because of these
    changes they are no longer present on the compilation path.

* tests/tests/packageinstaller/adminpackageinstaller/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsAdminPackageInstallerTestCases results in duplicate classes
    which leads to build time and compile time issues.

* tests/tests/permission/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsPermissionTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsPermissionTestCases's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* tests/tests/permission2/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsPermission2TestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/preference/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsPreferenceTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsPreferenceTestCases's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* tests/tests/preference2/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsPreference2TestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsPreference2TestCases's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* tests/tests/renderscript/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsRenderscriptTestCases results in duplicate classes which leads
    to build time and compile time issues.

* tests/tests/rsblas/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsRsBlasTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/rscpp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsRsCppTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/sax/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsSaxTestCases results
    in duplicate classes which leads to build time and compile time
    issues.

* tests/tests/security/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsSecurityTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsSecurityTestCases's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

* tests/tests/selinux/selinuxTargetSdk2/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsSelinuxTargetSdk2TestCases results in duplicate classes which
    leads to build time and compile time issues.

* tests/tests/shortcutmanager/packages/launchermanifest/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutManagerLauncher1 results in duplicate classes which
    leads to build time and compile time issues.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutManagerLauncher2 results in duplicate classes which
    leads to build time and compile time issues.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutManagerLauncher3 results in duplicate classes which
    leads to build time and compile time issues.

* tests/tests/shortcutmanager/packages/launchermanifest/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutManagerLauncher1 at runtime.

* tests/tests/shortcutmanager/packages/launchermanifest_nonshared/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutManagerLauncher4 results in duplicate classes which
    leads to build time and compile time issues.

* tests/tests/shortcutmanager/packages/launchermanifest_nonshared/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutManagerLauncher4 at runtime.

* tests/tests/shortcutmanager/packages/packagemanifest/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutManagerPackage1 results in duplicate classes which leads
    to build time and compile time issues.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutManagerPackage2 results in duplicate classes which leads
    to build time and compile time issues.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutManagerPackage3 results in duplicate classes which leads
    to build time and compile time issues.

* tests/tests/shortcutmanager/packages/packagemanifest/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutManagerPackage1 at runtime.

* tests/tests/shortcutmanager/packages/packagemanifest_nonshared/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutManagerPackage4 results in duplicate classes which leads
    to build time and compile time issues.

* tests/tests/shortcutmanager/packages/packagemanifest_nonshared/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutManagerPackage4 at runtime.

* tests/tests/shortcutmanager/throttling/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsShortcutManagerThrottlingTest results in duplicate classes which
    leads to build time and compile time issues. It is also unnecessary
    as CtsShortcutManagerThrottlingTest targets SDK version 25 which
    provides all the classes at runtime.

* tests/tests/shortcutmanager/throttling/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to
    CtsShortcutManagerThrottlingTest at runtime.

* tests/tests/simpleperf/CtsSimpleperfDebugApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsSimpleperfDebugApp
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/slice/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsSliceTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/speech/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsSpeechTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsSpeechTestCases's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

* tests/tests/systemintents/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsSystemIntentTestCases results in duplicate classes which leads
    to build time and compile time issues.

* tests/tests/systemui/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsSystemUiTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/telecom/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsTelecomTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/telecom2/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsTelecomTestCases2
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/telephony/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsTelephonyTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsTelephonyTestCases's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* tests/tests/telephony2/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsTelephony2TestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsTelephony2TestCases's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* tests/tests/theme/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsThemeDeviceTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsThemeDeviceTestCases's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* tests/tests/transition/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsTransitionTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/uiautomation/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsUiAutomationTestCases results in duplicate classes which leads
    to build time and compile time issues.

* tests/tests/uidisolation/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsUidIsolationTestCases results in duplicate classes which leads
    to build time and compile time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsUidIsolationTestCases's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

* tests/tests/uirendering/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsUiRenderingTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/util/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsUtilTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/view/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CtsViewTestCases'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 CtsViewTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/widget/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsWidgetTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/tests/wrap/nowrap/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsWrapNoWrapTestCases
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsWrapNoWrapTestCases's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* tests/tests/wrap/wrap_debug/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsWrapWrapDebugTestCases results in duplicate classes which leads
    to build time and compile time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsWrapWrapDebugTestCases's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

* tests/tests/wrap/wrap_debug_malloc_debug/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsWrapWrapDebugMallocDebugTestCases results in duplicate classes
    which leads to build time and compile time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsWrapWrapDebugMallocDebugTestCases's source depends on its
    classes and because of these changes they are no longer present on
    the compilation path.

* tests/tests/wrap/wrap_nodebug/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CtsWrapWrapNoDebugTestCases results in duplicate classes which
    leads to build time and compile time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsWrapWrapNoDebugTestCases's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

* tests/vr/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsVrTestCases results
    in duplicate classes which leads to build time and compile time
    issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsVrTestCases's source depends on its classes and because of these
    changes they are no longer present on the compilation path.

* tools/cts-holo-generation/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsHoloGeneration
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    CtsHoloGeneration's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

* tools/cts-preconditions/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CtsPreconditions
    results in duplicate classes which leads to build time and compile
    time issues.

Bug: 30188076
Test: make checkbuild
Change-Id: I56c62344ab09338ed35586d76c0440d6f9515d72
diff --git a/hostsidetests/abioverride/app/Android.mk b/hostsidetests/abioverride/app/Android.mk
index 13771a7..9dd8d1f 100755
--- a/hostsidetests/abioverride/app/Android.mk
+++ b/hostsidetests/abioverride/app/Android.mk
@@ -30,7 +30,6 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     compatibility-device-util \
     ctstestrunner \
-    legacy-android-test \
 
 
 LOCAL_JNI_SHARED_LIBRARIES := libctsabioverride
diff --git a/hostsidetests/abioverride/app/AndroidManifest.xml b/hostsidetests/abioverride/app/AndroidManifest.xml
index c42d3a8..6135732 100755
--- a/hostsidetests/abioverride/app/AndroidManifest.xml
+++ b/hostsidetests/abioverride/app/AndroidManifest.xml
@@ -19,6 +19,8 @@
     package="android.abioverride.app">
 
     <application android:use32bitAbi="true" android:multiArch="true">
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name=".AbiOverrideActivity" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/appsecurity/test-apps/AccessSerialModern/Android.mk b/hostsidetests/appsecurity/test-apps/AccessSerialModern/Android.mk
index 6b45943..20d51b6 100644
--- a/hostsidetests/appsecurity/test-apps/AccessSerialModern/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/AccessSerialModern/Android.mk
@@ -22,7 +22,6 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     compatibility-device-util \
     android-support-test \
-    legacy-android-test \
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/hostsidetests/appsecurity/test-apps/AccessSerialModern/AndroidManifest.xml b/hostsidetests/appsecurity/test-apps/AccessSerialModern/AndroidManifest.xml
index 087aa21..2eb5777 100644
--- a/hostsidetests/appsecurity/test-apps/AccessSerialModern/AndroidManifest.xml
+++ b/hostsidetests/appsecurity/test-apps/AccessSerialModern/AndroidManifest.xml
@@ -21,7 +21,9 @@
 
     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
 
-    <application/>
+    <application>
+        <uses-library android:name="android.test.runner" />
+    </application>
 
     <instrumentation
             android:name="android.support.test.runner.AndroidJUnitRunner"
diff --git a/hostsidetests/appsecurity/test-apps/AppAccessData/Android.mk b/hostsidetests/appsecurity/test-apps/AppAccessData/Android.mk
index 2e6911d..e1fb84a 100644
--- a/hostsidetests/appsecurity/test-apps/AppAccessData/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/AppAccessData/Android.mk
@@ -21,7 +21,7 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
 
 LOCAL_PACKAGE_NAME := CtsAppAccessData
 
diff --git a/hostsidetests/appsecurity/test-apps/AppWithData/Android.mk b/hostsidetests/appsecurity/test-apps/AppWithData/Android.mk
index 3d11a83..212dab1 100644
--- a/hostsidetests/appsecurity/test-apps/AppWithData/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/AppWithData/Android.mk
@@ -21,7 +21,7 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
 
 LOCAL_PACKAGE_NAME := CtsAppWithData
 
diff --git a/hostsidetests/appsecurity/test-apps/DocumentProvider/Android.mk b/hostsidetests/appsecurity/test-apps/DocumentProvider/Android.mk
index c1fd027..42aa074 100644
--- a/hostsidetests/appsecurity/test-apps/DocumentProvider/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/DocumentProvider/Android.mk
@@ -25,7 +25,6 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    legacy-android-test \
 
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/hostsidetests/appsecurity/test-apps/DocumentProvider/AndroidManifest.xml b/hostsidetests/appsecurity/test-apps/DocumentProvider/AndroidManifest.xml
index 894eff1..6e140d7 100644
--- a/hostsidetests/appsecurity/test-apps/DocumentProvider/AndroidManifest.xml
+++ b/hostsidetests/appsecurity/test-apps/DocumentProvider/AndroidManifest.xml
@@ -17,6 +17,8 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
           package="com.android.cts.documentprovider">
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <provider android:name=".MyDocumentsProvider"
                 android:authorities="com.android.cts.documentprovider"
                 android:exported="true"
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/Android.mk b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/Android.mk
index aaeb8c0..f011c80 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/Android.mk
@@ -17,12 +17,11 @@
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
 LOCAL_MODULE_TAGS := tests
 LOCAL_STATIC_JAVA_LIBRARIES := \
     cts-aia-util \
     android-support-test \
-    legacy-android-test \
 	ctsdeviceutillegacy \
 	ctstestrunner
 
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/ImplicitlyExposedApp/Android.mk b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/ImplicitlyExposedApp/Android.mk
index 31a45b0..6309704 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/ImplicitlyExposedApp/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/ImplicitlyExposedApp/Android.mk
@@ -20,8 +20,7 @@
 LOCAL_MODULE_TAGS := tests
 LOCAL_STATIC_JAVA_LIBRARIES := \
     cts-aia-util \
-    android-support-test \
-    legacy-android-test
+    android-support-test
 
 # tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/NormalApp/Android.mk b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/NormalApp/Android.mk
index 43deb82..d9fa238 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/NormalApp/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/NormalApp/Android.mk
@@ -20,8 +20,9 @@
 LOCAL_MODULE_TAGS := tests
 LOCAL_STATIC_JAVA_LIBRARIES := \
     cts-aia-util \
-    android-support-test \
-    legacy-android-test
+    android-support-test
+
+LOCAL_JAVA_LIBRARIES := android.test.base
 
 # tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserApp/Android.mk b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserApp/Android.mk
index 1206e56..35c089f 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserApp/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserApp/Android.mk
@@ -20,8 +20,7 @@
 LOCAL_MODULE_TAGS := tests
 LOCAL_STATIC_JAVA_LIBRARIES := \
     cts-aia-util \
-    android-support-test \
-    legacy-android-test
+    android-support-test
 
 # tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserAppTest/Android.mk b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserAppTest/Android.mk
index f446140..cfa0b55 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserAppTest/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UserAppTest/Android.mk
@@ -19,8 +19,7 @@
 
 LOCAL_MODULE_TAGS := tests
 LOCAL_STATIC_JAVA_LIBRARIES := \
-    android-support-test \
-    legacy-android-test
+    android-support-test
 
 # tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/hostsidetests/appsecurity/test-apps/ExternalStorageApp/Android.mk b/hostsidetests/appsecurity/test-apps/ExternalStorageApp/Android.mk
index 47d468e..19bded4 100644
--- a/hostsidetests/appsecurity/test-apps/ExternalStorageApp/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/ExternalStorageApp/Android.mk
@@ -18,7 +18,7 @@
 
 LOCAL_MODULE_TAGS := tests
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_PACKAGE_NAME := CtsExternalStorageApp
diff --git a/hostsidetests/appsecurity/test-apps/InstrumentationAppDiffCert/Android.mk b/hostsidetests/appsecurity/test-apps/InstrumentationAppDiffCert/Android.mk
index a48abbf..e6ca813 100644
--- a/hostsidetests/appsecurity/test-apps/InstrumentationAppDiffCert/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/InstrumentationAppDiffCert/Android.mk
@@ -21,7 +21,7 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
 
 LOCAL_PACKAGE_NAME := CtsInstrumentationAppDiffCert
 
diff --git a/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/Android.mk b/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/Android.mk
index 0744834..1ef18c7 100644
--- a/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/Android.mk
@@ -18,7 +18,7 @@
 
 LOCAL_MODULE_TAGS := tests
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) \
     ../ExternalStorageApp/src/com/android/cts/externalstorageapp/CommonExternalStorageTest.java
diff --git a/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/Android.mk b/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/Android.mk
index 4f828ad..8bcc282 100644
--- a/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/Android.mk
@@ -18,7 +18,9 @@
 
 LOCAL_MODULE_TAGS := tests
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) \
     ../ExternalStorageApp/src/com/android/cts/externalstorageapp/CommonExternalStorageTest.java
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/Android.mk b/hostsidetests/appsecurity/test-apps/SplitApp/Android.mk
index 9341949..0be6e50 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/Android.mk
@@ -20,7 +20,9 @@
 
 LOCAL_MODULE_TAGS := tests
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
@@ -48,7 +50,9 @@
 
 LOCAL_MODULE_TAGS := tests
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
@@ -75,7 +79,9 @@
 
 LOCAL_MODULE_TAGS := tests
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
@@ -101,7 +107,9 @@
 
 LOCAL_MODULE_TAGS := tests
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/hostsidetests/appsecurity/test-apps/StorageAppA/Android.mk b/hostsidetests/appsecurity/test-apps/StorageAppA/Android.mk
index f3d7d35..32558b2 100644
--- a/hostsidetests/appsecurity/test-apps/StorageAppA/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/StorageAppA/Android.mk
@@ -18,7 +18,7 @@
 
 LOCAL_MODULE_TAGS := tests
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
 
 LOCAL_SRC_FILES := $(call all-java-files-under, ../StorageApp/src/)
 
diff --git a/hostsidetests/appsecurity/test-apps/StorageAppB/Android.mk b/hostsidetests/appsecurity/test-apps/StorageAppB/Android.mk
index 5f85459..432fe97 100644
--- a/hostsidetests/appsecurity/test-apps/StorageAppB/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/StorageAppB/Android.mk
@@ -18,7 +18,7 @@
 
 LOCAL_MODULE_TAGS := tests
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
 
 LOCAL_SRC_FILES := $(call all-java-files-under, ../StorageApp/src/)
 
diff --git a/hostsidetests/appsecurity/test-apps/StorageStatsApp/Android.mk b/hostsidetests/appsecurity/test-apps/StorageStatsApp/Android.mk
index b5c30fb..bc84b74 100644
--- a/hostsidetests/appsecurity/test-apps/StorageStatsApp/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/StorageStatsApp/Android.mk
@@ -18,7 +18,7 @@
 
 LOCAL_MODULE_TAGS := tests
 LOCAL_SDK_VERSION := test_current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test ub-uiautomator legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test ub-uiautomator
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) \
 	$(call all-java-files-under, ../StorageApp/src)
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionApp23/Android.mk b/hostsidetests/appsecurity/test-apps/UsePermissionApp23/Android.mk
index 60f22f8..22d4a5f 100644
--- a/hostsidetests/appsecurity/test-apps/UsePermissionApp23/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionApp23/Android.mk
@@ -23,8 +23,9 @@
     android-support-test \
     compatibility-device-util \
     ctstestrunner \
-    ub-uiautomator \
-    legacy-android-test
+    ub-uiautomator
+
+LOCAL_JAVA_LIBRARIES := android.test.base
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) \
     ../ExternalStorageApp/src/com/android/cts/externalstorageapp/CommonExternalStorageTest.java
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionApp23/AndroidManifest.xml b/hostsidetests/appsecurity/test-apps/UsePermissionApp23/AndroidManifest.xml
index 71eadaa..9d25826 100644
--- a/hostsidetests/appsecurity/test-apps/UsePermissionApp23/AndroidManifest.xml
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionApp23/AndroidManifest.xml
@@ -66,6 +66,8 @@
     <uses-permission android:name="android.permission.BODY_SENSORS"/>
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="com.android.cts.usepermission.BasePermissionActivity" />
     </application>
 
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionApp25/Android.mk b/hostsidetests/appsecurity/test-apps/UsePermissionApp25/Android.mk
index 0744d4b..7edb1d1 100644
--- a/hostsidetests/appsecurity/test-apps/UsePermissionApp25/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionApp25/Android.mk
@@ -23,8 +23,9 @@
     android-support-test \
     compatibility-device-util \
     ctstestrunner \
-    ub-uiautomator \
-    legacy-android-test
+    ub-uiautomator
+
+LOCAL_JAVA_LIBRARIES := android.test.base
 
 LOCAL_SRC_FILES := $(call all-java-files-under, ../UsePermissionApp23/src) \
     ../ExternalStorageApp/src/com/android/cts/externalstorageapp/CommonExternalStorageTest.java
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionApp25/AndroidManifest.xml b/hostsidetests/appsecurity/test-apps/UsePermissionApp25/AndroidManifest.xml
index acaeeb0..c6a6316 100644
--- a/hostsidetests/appsecurity/test-apps/UsePermissionApp25/AndroidManifest.xml
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionApp25/AndroidManifest.xml
@@ -67,6 +67,8 @@
     <uses-permission android:name="android.permission.BODY_SENSORS"/>
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="com.android.cts.usepermission.BasePermissionActivity" />
     </application>
 
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionApp26/Android.mk b/hostsidetests/appsecurity/test-apps/UsePermissionApp26/Android.mk
index 05ebc47..7064288 100644
--- a/hostsidetests/appsecurity/test-apps/UsePermissionApp26/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionApp26/Android.mk
@@ -23,8 +23,7 @@
     android-support-test \
     compatibility-device-util \
     ctstestrunner \
-    ub-uiautomator \
-    legacy-android-test
+    ub-uiautomator
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) \
     ../UsePermissionApp23/src/com/android/cts/usepermission/BasePermissionActivity.java \
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionApp26/AndroidManifest.xml b/hostsidetests/appsecurity/test-apps/UsePermissionApp26/AndroidManifest.xml
index 845e43d..9458db3 100644
--- a/hostsidetests/appsecurity/test-apps/UsePermissionApp26/AndroidManifest.xml
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionApp26/AndroidManifest.xml
@@ -24,6 +24,8 @@
     <uses-permission android:name="android.permission.RECEIVE_SMS" />
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="com.android.cts.usepermission.BasePermissionActivity" />
     </application>
 
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionAppLatest/Android.mk b/hostsidetests/appsecurity/test-apps/UsePermissionAppLatest/Android.mk
index 574adcb..62a15e4 100644
--- a/hostsidetests/appsecurity/test-apps/UsePermissionAppLatest/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionAppLatest/Android.mk
@@ -23,8 +23,7 @@
     android-support-test \
     compatibility-device-util \
     ctstestrunner \
-    ub-uiautomator \
-    legacy-android-test
+    ub-uiautomator
 
 LOCAL_SRC_FILES := $(call all-java-files-under, ../UsePermissionApp26/src)  \
     ../UsePermissionApp23/src/com/android/cts/usepermission/BasePermissionActivity.java \
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionAppLatest/AndroidManifest.xml b/hostsidetests/appsecurity/test-apps/UsePermissionAppLatest/AndroidManifest.xml
index cac6790..57a58ab 100644
--- a/hostsidetests/appsecurity/test-apps/UsePermissionAppLatest/AndroidManifest.xml
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionAppLatest/AndroidManifest.xml
@@ -23,6 +23,8 @@
     <uses-permission android:name="android.permission.RECEIVE_SMS" />
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="com.android.cts.usepermission.BasePermissionActivity" />
     </application>
 
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.mk b/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.mk
index 498e8ca..e47c5da 100644
--- a/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/Android.mk
@@ -22,7 +22,7 @@
     ../PermissionDeclareApp/src/com/android/cts/permissiondeclareapp/GrantUriPermission.java
 
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
 
 LOCAL_PACKAGE_NAME := CtsUsePermissionDiffCert
 
diff --git a/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.mk b/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.mk
index 8574d63..de77eb8 100644
--- a/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/Android.mk
@@ -20,8 +20,9 @@
 LOCAL_SDK_VERSION := current
 LOCAL_STATIC_JAVA_LIBRARIES := \
 	android-support-test \
-	compatibility-device-util \
-	legacy-android-test
+	compatibility-device-util
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) \
     ../ExternalStorageApp/src/com/android/cts/externalstorageapp/CommonExternalStorageTest.java
diff --git a/hostsidetests/appsecurity/test-apps/keysets/testApp/Android.mk b/hostsidetests/appsecurity/test-apps/keysets/testApp/Android.mk
index 907ae36..324ba4f 100644
--- a/hostsidetests/appsecurity/test-apps/keysets/testApp/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/keysets/testApp/Android.mk
@@ -22,7 +22,7 @@
 LOCAL_MODULE_TAGS := tests
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_SDK_VERSION := current
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
 LOCAL_PACKAGE_NAME := CtsKeySetTestApp
 LOCAL_DEX_PREOPT := false
 
diff --git a/hostsidetests/devicepolicy/app/AccountCheck/Auth/Android.mk b/hostsidetests/devicepolicy/app/AccountCheck/Auth/Android.mk
index 0873334..9c86388 100644
--- a/hostsidetests/devicepolicy/app/AccountCheck/Auth/Android.mk
+++ b/hostsidetests/devicepolicy/app/AccountCheck/Auth/Android.mk
@@ -31,8 +31,7 @@
     android-support-v4  \
     ctstestrunner  \
     ub-uiautomator  \
-    android-support-test \
-    legacy-android-test
+    android-support-test
 
 LOCAL_JAVA_LIBRARIES := legacy-android-test
 
diff --git a/hostsidetests/devicepolicy/app/AccountCheck/Auth/AndroidManifest.xml b/hostsidetests/devicepolicy/app/AccountCheck/Auth/AndroidManifest.xml
index 1f488e5..97659b3 100644
--- a/hostsidetests/devicepolicy/app/AccountCheck/Auth/AndroidManifest.xml
+++ b/hostsidetests/devicepolicy/app/AccountCheck/Auth/AndroidManifest.xml
@@ -27,6 +27,8 @@
     <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <service android:name="com.android.cts.devicepolicy.accountcheck.TestAuthenticator"
             android:exported="true">
             <intent-filter>
diff --git a/hostsidetests/devicepolicy/app/AccountManagement/Android.mk b/hostsidetests/devicepolicy/app/AccountManagement/Android.mk
index b7d99bf..391f573 100644
--- a/hostsidetests/devicepolicy/app/AccountManagement/Android.mk
+++ b/hostsidetests/devicepolicy/app/AccountManagement/Android.mk
@@ -31,8 +31,7 @@
     android-support-v4 \
     ctstestrunner \
     ub-uiautomator \
-    android-support-test \
-    legacy-android-test
+    android-support-test
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/devicepolicy/app/AccountManagement/AndroidManifest.xml b/hostsidetests/devicepolicy/app/AccountManagement/AndroidManifest.xml
index b1e1b53..9c31a62 100644
--- a/hostsidetests/devicepolicy/app/AccountManagement/AndroidManifest.xml
+++ b/hostsidetests/devicepolicy/app/AccountManagement/AndroidManifest.xml
@@ -22,6 +22,8 @@
     <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <service android:name=".MockAccountService" android:exported="true">
             <intent-filter>
                 <action android:name="android.accounts.AccountAuthenticator" />
diff --git a/hostsidetests/devicepolicy/app/Assistant/Android.mk b/hostsidetests/devicepolicy/app/Assistant/Android.mk
index fa909d5..308c0a1 100644
--- a/hostsidetests/devicepolicy/app/Assistant/Android.mk
+++ b/hostsidetests/devicepolicy/app/Assistant/Android.mk
@@ -33,7 +33,6 @@
     android-support-v4 \
     compatibility-device-util \
     android-support-test \
-    legacy-android-test \
 
 
 LOCAL_SDK_VERSION := current
diff --git a/hostsidetests/devicepolicy/app/Assistant/AndroidManifest.xml b/hostsidetests/devicepolicy/app/Assistant/AndroidManifest.xml
index 5fc20de..17ca642 100644
--- a/hostsidetests/devicepolicy/app/Assistant/AndroidManifest.xml
+++ b/hostsidetests/devicepolicy/app/Assistant/AndroidManifest.xml
@@ -19,6 +19,8 @@
     package="com.android.cts.devicepolicy.assistapp" >
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
 
         <service android:name=".MyInteractionService"
                 android:label="CTS test voice interaction service"
@@ -45,4 +47,4 @@
             android:targetPackage="com.android.cts.devicepolicy.assistapp"
             android:label="Assistant related device policy CTS" />
 
-</manifest>
\ No newline at end of file
+</manifest>
diff --git a/hostsidetests/devicepolicy/app/CrossProfileAppsTest/Android.mk b/hostsidetests/devicepolicy/app/CrossProfileAppsTest/Android.mk
index fca48d3..70532f2 100644
--- a/hostsidetests/devicepolicy/app/CrossProfileAppsTest/Android.mk
+++ b/hostsidetests/devicepolicy/app/CrossProfileAppsTest/Android.mk
@@ -30,7 +30,6 @@
 	android-support-v4 \
 	ctstestrunner \
 	android-support-test \
-	legacy-android-test \
 	truth-prebuilt \
 	ub-uiautomator
 
diff --git a/hostsidetests/devicepolicy/app/CustomizationApp/Android.mk b/hostsidetests/devicepolicy/app/CustomizationApp/Android.mk
index 09f6f53..b88d4a2 100644
--- a/hostsidetests/devicepolicy/app/CustomizationApp/Android.mk
+++ b/hostsidetests/devicepolicy/app/CustomizationApp/Android.mk
@@ -29,7 +29,6 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     android-support-test \
     compatibility-device-util \
-    legacy-android-test \
 
 
 LOCAL_SDK_VERSION := current
diff --git a/hostsidetests/devicepolicy/app/CustomizationApp/AndroidManifest.xml b/hostsidetests/devicepolicy/app/CustomizationApp/AndroidManifest.xml
index 4b20829..be6249f 100644
--- a/hostsidetests/devicepolicy/app/CustomizationApp/AndroidManifest.xml
+++ b/hostsidetests/devicepolicy/app/CustomizationApp/AndroidManifest.xml
@@ -23,6 +23,7 @@
     <uses-permission android:name="android.permission.SET_WALLPAPER" />
 
     <application>
+        <uses-library android:name="android.test.runner" />
     </application>
 
     <instrumentation
diff --git a/hostsidetests/devicepolicy/app/DelegateApp/Android.mk b/hostsidetests/devicepolicy/app/DelegateApp/Android.mk
index a46eed8..07b92e5 100644
--- a/hostsidetests/devicepolicy/app/DelegateApp/Android.mk
+++ b/hostsidetests/devicepolicy/app/DelegateApp/Android.mk
@@ -29,8 +29,7 @@
 LOCAL_STATIC_JAVA_LIBRARIES = \
     android-support-v4 \
     ctstestrunner \
-    android-support-test \
-    legacy-android-test
+    android-support-test
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/devicepolicy/app/DeviceAdmin/api23/Android.mk b/hostsidetests/devicepolicy/app/DeviceAdmin/api23/Android.mk
index a8f4f05..dfdd34c 100644
--- a/hostsidetests/devicepolicy/app/DeviceAdmin/api23/Android.mk
+++ b/hostsidetests/devicepolicy/app/DeviceAdmin/api23/Android.mk
@@ -28,10 +28,9 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
-    compatibility-device-util \
-    legacy-android-test
+    compatibility-device-util
 
-LOCAL_JAVA_LIBRARIES := legacy-android-test
+LOCAL_JAVA_LIBRARIES := legacy-android-test android.test.runner.stubs
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/devicepolicy/app/DeviceAdmin/api24/Android.mk b/hostsidetests/devicepolicy/app/DeviceAdmin/api24/Android.mk
index 4e2cfb6..340f2da 100644
--- a/hostsidetests/devicepolicy/app/DeviceAdmin/api24/Android.mk
+++ b/hostsidetests/devicepolicy/app/DeviceAdmin/api24/Android.mk
@@ -28,10 +28,9 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
-    compatibility-device-util \
-    legacy-android-test
+    compatibility-device-util
 
-LOCAL_JAVA_LIBRARIES := legacy-android-test
+LOCAL_JAVA_LIBRARIES := legacy-android-test android.test.runner.stubs
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/devicepolicy/app/DeviceOwner/Android.mk b/hostsidetests/devicepolicy/app/DeviceOwner/Android.mk
index 4084099..393d38a 100644
--- a/hostsidetests/devicepolicy/app/DeviceOwner/Android.mk
+++ b/hostsidetests/devicepolicy/app/DeviceOwner/Android.mk
@@ -33,8 +33,7 @@
     ctstestrunner \
     compatibility-device-util \
     android-support-v4 \
-    android-support-test \
-    legacy-android-test
+    android-support-test
 
 LOCAL_SDK_VERSION := test_current
 
diff --git a/hostsidetests/devicepolicy/app/IntentReceiver/Android.mk b/hostsidetests/devicepolicy/app/IntentReceiver/Android.mk
index 08edf44..530738c 100644
--- a/hostsidetests/devicepolicy/app/IntentReceiver/Android.mk
+++ b/hostsidetests/devicepolicy/app/IntentReceiver/Android.mk
@@ -28,8 +28,7 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     android-support-v4 \
-    ctstestrunner \
-    legacy-android-test
+    ctstestrunner
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/devicepolicy/app/IntentSender/Android.mk b/hostsidetests/devicepolicy/app/IntentSender/Android.mk
index b71ddfb..5cfa129 100644
--- a/hostsidetests/devicepolicy/app/IntentSender/Android.mk
+++ b/hostsidetests/devicepolicy/app/IntentSender/Android.mk
@@ -29,8 +29,7 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
 	android-support-v4 \
 	ctstestrunner \
-	ub-uiautomator \
-	legacy-android-test
+	ub-uiautomator
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/devicepolicy/app/LauncherTests/Android.mk b/hostsidetests/devicepolicy/app/LauncherTests/Android.mk
index ed4943f..8789605 100644
--- a/hostsidetests/devicepolicy/app/LauncherTests/Android.mk
+++ b/hostsidetests/devicepolicy/app/LauncherTests/Android.mk
@@ -29,8 +29,7 @@
 LOCAL_STATIC_JAVA_LIBRARIES = \
 	android-support-v4 \
 	ctstestrunner \
-	android-support-test \
-	legacy-android-test
+	android-support-test
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/devicepolicy/app/ManagedProfile/Android.mk b/hostsidetests/devicepolicy/app/ManagedProfile/Android.mk
index b947a61..f2c64c0 100644
--- a/hostsidetests/devicepolicy/app/ManagedProfile/Android.mk
+++ b/hostsidetests/devicepolicy/app/ManagedProfile/Android.mk
@@ -32,8 +32,7 @@
 	compatibility-device-util \
 	ub-uiautomator \
 	android-support-test \
-	guava \
-	legacy-android-test
+	guava
 
 LOCAL_SDK_VERSION := test_current
 
diff --git a/hostsidetests/devicepolicy/app/PackageInstaller/Android.mk b/hostsidetests/devicepolicy/app/PackageInstaller/Android.mk
index 11680e9..c9d1f1e 100644
--- a/hostsidetests/devicepolicy/app/PackageInstaller/Android.mk
+++ b/hostsidetests/devicepolicy/app/PackageInstaller/Android.mk
@@ -29,8 +29,7 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     android-support-v4 \
     ctstestrunner \
-    ub-uiautomator \
-    legacy-android-test
+    ub-uiautomator
 
 LOCAL_SDK_VERSION := test_current
 
diff --git a/hostsidetests/devicepolicy/app/ProfileOwner/Android.mk b/hostsidetests/devicepolicy/app/ProfileOwner/Android.mk
index 34b8e08..1df0d07 100644
--- a/hostsidetests/devicepolicy/app/ProfileOwner/Android.mk
+++ b/hostsidetests/devicepolicy/app/ProfileOwner/Android.mk
@@ -29,8 +29,7 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
     compatibility-device-util \
-    ub-uiautomator \
-    legacy-android-test
+    ub-uiautomator
 
 LOCAL_SDK_VERSION := test_current
 
diff --git a/hostsidetests/devicepolicy/app/SingleAdminApp/Android.mk b/hostsidetests/devicepolicy/app/SingleAdminApp/Android.mk
index 426dbf2..4e5d874 100644
--- a/hostsidetests/devicepolicy/app/SingleAdminApp/Android.mk
+++ b/hostsidetests/devicepolicy/app/SingleAdminApp/Android.mk
@@ -31,8 +31,7 @@
     ctstestrunner \
     compatibility-device-util \
     ub-uiautomator \
-    android-support-test \
-    legacy-android-test
+    android-support-test
 
 LOCAL_SDK_VERSION := test_current
 
diff --git a/hostsidetests/devicepolicy/app/WifiConfigCreator/Android.mk b/hostsidetests/devicepolicy/app/WifiConfigCreator/Android.mk
index 874dd95..b03cf95 100644
--- a/hostsidetests/devicepolicy/app/WifiConfigCreator/Android.mk
+++ b/hostsidetests/devicepolicy/app/WifiConfigCreator/Android.mk
@@ -26,7 +26,7 @@
 
 LOCAL_PACKAGE_NAME := CtsWifiConfigCreator
 
-LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/devicepolicy/app/WifiConfigCreator/AndroidManifest.xml b/hostsidetests/devicepolicy/app/WifiConfigCreator/AndroidManifest.xml
index 1b98259..cd3f9b7 100644
--- a/hostsidetests/devicepolicy/app/WifiConfigCreator/AndroidManifest.xml
+++ b/hostsidetests/devicepolicy/app/WifiConfigCreator/AndroidManifest.xml
@@ -22,6 +22,8 @@
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name=".WifiConfigCreatorActivity"
             android:exported="true"
             android:theme="@android:style/Theme.NoDisplay"
diff --git a/hostsidetests/dumpsys/apps/ProcStatsHelperApp/Android.mk b/hostsidetests/dumpsys/apps/ProcStatsHelperApp/Android.mk
index d4452e3..3f7bd08 100644
--- a/hostsidetests/dumpsys/apps/ProcStatsHelperApp/Android.mk
+++ b/hostsidetests/dumpsys/apps/ProcStatsHelperApp/Android.mk
@@ -29,8 +29,7 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
     compatibility-device-util \
-    android-support-v4 \
-    legacy-android-test
+    android-support-v4
 
 LOCAL_SDK_VERSION := test_current
 
diff --git a/hostsidetests/dumpsys/apps/ProcStatsHelperApp/AndroidManifest.xml b/hostsidetests/dumpsys/apps/ProcStatsHelperApp/AndroidManifest.xml
index 1a84011..01b9ca8 100644
--- a/hostsidetests/dumpsys/apps/ProcStatsHelperApp/AndroidManifest.xml
+++ b/hostsidetests/dumpsys/apps/ProcStatsHelperApp/AndroidManifest.xml
@@ -21,6 +21,8 @@
     <uses-sdk android:minSdkVersion="24" android:targetSdkVersion="24"/>
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name=".MainActivity"
             android:exported="true" />
         <service android:name=".ProcStatsHelperServiceMain"
diff --git a/hostsidetests/media/app/MediaSessionTest/Android.mk b/hostsidetests/media/app/MediaSessionTest/Android.mk
index 53f9824..7303147 100644
--- a/hostsidetests/media/app/MediaSessionTest/Android.mk
+++ b/hostsidetests/media/app/MediaSessionTest/Android.mk
@@ -32,7 +32,6 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     android-support-test \
     compatibility-device-util \
-    legacy-android-test \
 
 
 LOCAL_SDK_VERSION := current
diff --git a/hostsidetests/media/app/MediaSessionTest/AndroidManifest.xml b/hostsidetests/media/app/MediaSessionTest/AndroidManifest.xml
index 5ae6f96..18060e1 100644
--- a/hostsidetests/media/app/MediaSessionTest/AndroidManifest.xml
+++ b/hostsidetests/media/app/MediaSessionTest/AndroidManifest.xml
@@ -21,6 +21,8 @@
 
     <application
         android:testOnly="true">
+        <uses-library android:name="android.test.runner" />
+
         <service
             android:name=".MediaSessionManagerTest"
             android:label="MediaSessionManagerTest"
diff --git a/hostsidetests/numberblocking/app/Android.mk b/hostsidetests/numberblocking/app/Android.mk
index cfbccbe..0d5df67 100644
--- a/hostsidetests/numberblocking/app/Android.mk
+++ b/hostsidetests/numberblocking/app/Android.mk
@@ -27,7 +27,7 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner android-support-test
 
 # tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/Android.mk b/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/Android.mk
index 0f30b3b..9d0d001 100644
--- a/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/Android.mk
+++ b/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/Android.mk
@@ -24,8 +24,7 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     android-support-test \
-    compatibility-device-util \
-    legacy-android-test
+    compatibility-device-util
 
 LOCAL_RES_LIBRARIES := CtsStaticSharedLibProviderApp1
 
diff --git a/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/AndroidManifest.xml b/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/AndroidManifest.xml
index cbeb342..a1550a6 100755
--- a/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/AndroidManifest.xml
+++ b/hostsidetests/os/test-apps/StaticSharedLibConsumerApp1/AndroidManifest.xml
@@ -23,6 +23,8 @@
     <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <uses-static-library
                 android:name="foo.bar.lib"
                 android:version="1"
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher1/Android.mk b/hostsidetests/shortcuts/deviceside/backup/launcher1/Android.mk
index dae8ba0..d6077a4 100644
--- a/hostsidetests/shortcuts/deviceside/backup/launcher1/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher1/Android.mk
@@ -35,8 +35,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher1/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/launcher1/AndroidManifest.xml
index 75b3ca0..d84c7b5 100644
--- a/hostsidetests/shortcuts/deviceside/backup/launcher1/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher1/AndroidManifest.xml
@@ -19,6 +19,8 @@
     package="android.content.pm.cts.shortcut.backup.launcher1">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher2/Android.mk b/hostsidetests/shortcuts/deviceside/backup/launcher2/Android.mk
index 29e238a..8f124a0 100644
--- a/hostsidetests/shortcuts/deviceside/backup/launcher2/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher2/Android.mk
@@ -35,8 +35,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher2/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/launcher2/AndroidManifest.xml
index 71ffc61..9297220 100644
--- a/hostsidetests/shortcuts/deviceside/backup/launcher2/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher2/AndroidManifest.xml
@@ -19,6 +19,8 @@
     package="android.content.pm.cts.shortcut.backup.launcher2">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher3/Android.mk b/hostsidetests/shortcuts/deviceside/backup/launcher3/Android.mk
index 8155d8f..9883e5c 100644
--- a/hostsidetests/shortcuts/deviceside/backup/launcher3/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher3/Android.mk
@@ -35,8 +35,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher3/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/launcher3/AndroidManifest.xml
index 82dc28f..8f1c1a7 100644
--- a/hostsidetests/shortcuts/deviceside/backup/launcher3/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher3/AndroidManifest.xml
@@ -19,6 +19,8 @@
     package="android.content.pm.cts.shortcut.backup.launcher3">
 
     <application android:allowBackup="false">
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher4new/Android.mk b/hostsidetests/shortcuts/deviceside/backup/launcher4new/Android.mk
index 0b162fc..856ff1f 100644
--- a/hostsidetests/shortcuts/deviceside/backup/launcher4new/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher4new/Android.mk
@@ -35,8 +35,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher4new/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/launcher4new/AndroidManifest.xml
index 4d21e50..1032971 100644
--- a/hostsidetests/shortcuts/deviceside/backup/launcher4new/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher4new/AndroidManifest.xml
@@ -20,6 +20,8 @@
     android:versionCode="11">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher4old/Android.mk b/hostsidetests/shortcuts/deviceside/backup/launcher4old/Android.mk
index 587fd41..0147dd6 100644
--- a/hostsidetests/shortcuts/deviceside/backup/launcher4old/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher4old/Android.mk
@@ -35,8 +35,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/launcher4old/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/launcher4old/AndroidManifest.xml
index cded495..e7c81b3 100644
--- a/hostsidetests/shortcuts/deviceside/backup/launcher4old/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/launcher4old/AndroidManifest.xml
@@ -20,6 +20,8 @@
     android:versionCode="10">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher1/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher1/Android.mk
index db5a12c..72da903 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher1/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher1/Android.mk
@@ -35,8 +35,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher1/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/publisher1/AndroidManifest.xml
index 3d23c72..f35fcef 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher1/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher1/AndroidManifest.xml
@@ -18,6 +18,8 @@
     package="android.content.pm.cts.shortcut.backup.publisher1">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher2/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher2/Android.mk
index efa2116..286dded 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher2/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher2/Android.mk
@@ -35,8 +35,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher2/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/publisher2/AndroidManifest.xml
index c3271b4..e4c5720 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher2/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher2/AndroidManifest.xml
@@ -18,6 +18,8 @@
     package="android.content.pm.cts.shortcut.backup.publisher2">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher3/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher3/Android.mk
index 7852b0c..f1421d1 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher3/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher3/Android.mk
@@ -35,8 +35,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher3/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/publisher3/AndroidManifest.xml
index 5e03ff8..9f47f2a 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher3/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher3/AndroidManifest.xml
@@ -18,6 +18,8 @@
     package="android.content.pm.cts.shortcut.backup.publisher3">
 
     <application android:allowBackup="false">
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher4new/Android.mk
index e507530..ace1afe 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4new/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4new/Android.mk
@@ -37,8 +37,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/publisher4new/AndroidManifest.xml
index dae61ca..c671d95 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4new/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4new/AndroidManifest.xml
@@ -19,6 +19,8 @@
     android:versionCode="11">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/Android.mk
index 26b1f11..75a025b 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/Android.mk
@@ -37,8 +37,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/AndroidManifest.xml
index 33e5121..e176c81 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nobackup/AndroidManifest.xml
@@ -19,6 +19,8 @@
     android:versionCode="11">
 
     <application android:allowBackup="false">
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/Android.mk
index 7c22ff3..4a712f7 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/Android.mk
@@ -37,8 +37,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/AndroidManifest.xml
index ccf0382..a08611a 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4new_nomanifest/AndroidManifest.xml
@@ -19,6 +19,8 @@
     android:versionCode="11">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/Android.mk
index 72654d8..9d4739e 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/Android.mk
@@ -37,8 +37,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_CERTIFICATE := cts/hostsidetests/appsecurity/certs/cts-testkey1
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/AndroidManifest.xml
index 33e5121..e176c81 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4new_wrongkey/AndroidManifest.xml
@@ -19,6 +19,8 @@
     android:versionCode="11">
 
     <application android:allowBackup="false">
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4old/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher4old/Android.mk
index 3aba422..b7187f0 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4old/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4old/Android.mk
@@ -35,8 +35,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4old/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/publisher4old/AndroidManifest.xml
index 149c351..0c9f4ab 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4old/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4old/AndroidManifest.xml
@@ -19,6 +19,8 @@
     android:versionCode="10">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/Android.mk b/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/Android.mk
index b1536bf..537c811 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/Android.mk
@@ -37,8 +37,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/AndroidManifest.xml
index 59dd54e..af47b93 100644
--- a/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/backup/publisher4old_nomanifest/AndroidManifest.xml
@@ -19,6 +19,8 @@
     android:versionCode="10">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="MainActivity" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/multiuser/Android.mk b/hostsidetests/shortcuts/deviceside/multiuser/Android.mk
index 6b484a9..619bdfe 100644
--- a/hostsidetests/shortcuts/deviceside/multiuser/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/multiuser/Android.mk
@@ -37,8 +37,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/multiuser/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/multiuser/AndroidManifest.xml
index 3fbed5f..886aded 100644
--- a/hostsidetests/shortcuts/deviceside/multiuser/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/multiuser/AndroidManifest.xml
@@ -18,6 +18,8 @@
     package="android.content.pm.cts.shortcut.multiuser">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="Launcher" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/shortcuts/deviceside/upgrade/Android.mk b/hostsidetests/shortcuts/deviceside/upgrade/Android.mk
index b3e1d7f..ae0bf75 100644
--- a/hostsidetests/shortcuts/deviceside/upgrade/Android.mk
+++ b/hostsidetests/shortcuts/deviceside/upgrade/Android.mk
@@ -41,8 +41,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
@@ -73,8 +72,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/shortcuts/deviceside/upgrade/AndroidManifest.xml b/hostsidetests/shortcuts/deviceside/upgrade/AndroidManifest.xml
index 1b88d5e..72d7dfc 100644
--- a/hostsidetests/shortcuts/deviceside/upgrade/AndroidManifest.xml
+++ b/hostsidetests/shortcuts/deviceside/upgrade/AndroidManifest.xml
@@ -18,6 +18,8 @@
     package="android.content.pm.cts.shortcut.upgrade">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="Launcher" android:exported="true" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/hostsidetests/ui/appA/Android.mk b/hostsidetests/ui/appA/Android.mk
index 85b1c5e..3abc7a0 100644
--- a/hostsidetests/ui/appA/Android.mk
+++ b/hostsidetests/ui/appA/Android.mk
@@ -23,7 +23,6 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     compatibility-device-util \
     ctstestrunner \
-    legacy-android-test \
 
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/hostsidetests/ui/appA/AndroidManifest.xml b/hostsidetests/ui/appA/AndroidManifest.xml
index f336abd..dd2a901 100644
--- a/hostsidetests/ui/appA/AndroidManifest.xml
+++ b/hostsidetests/ui/appA/AndroidManifest.xml
@@ -21,6 +21,8 @@
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity
             android:name=".AppAActivity"
             android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
@@ -33,4 +35,4 @@
         </activity>
     </application>
 
-</manifest>
\ No newline at end of file
+</manifest>
diff --git a/hostsidetests/ui/appB/Android.mk b/hostsidetests/ui/appB/Android.mk
index d993b7c..4501cf3 100644
--- a/hostsidetests/ui/appB/Android.mk
+++ b/hostsidetests/ui/appB/Android.mk
@@ -23,7 +23,6 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     compatibility-device-util \
     ctstestrunner \
-    legacy-android-test \
 
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/hostsidetests/ui/appB/AndroidManifest.xml b/hostsidetests/ui/appB/AndroidManifest.xml
index aaf7a2c..9d99377 100644
--- a/hostsidetests/ui/appB/AndroidManifest.xml
+++ b/hostsidetests/ui/appB/AndroidManifest.xml
@@ -20,6 +20,8 @@
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity
             android:name=".AppBActivity"
             android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
diff --git a/hostsidetests/usb/SerialTestApp/Android.mk b/hostsidetests/usb/SerialTestApp/Android.mk
index 2ddf30f..16a6cdb 100644
--- a/hostsidetests/usb/SerialTestApp/Android.mk
+++ b/hostsidetests/usb/SerialTestApp/Android.mk
@@ -20,7 +20,7 @@
 
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/JobScheduler/jobperm/Android.mk b/tests/JobScheduler/jobperm/Android.mk
index 5c9b835..f54f8d6 100644
--- a/tests/JobScheduler/jobperm/Android.mk
+++ b/tests/JobScheduler/jobperm/Android.mk
@@ -21,7 +21,6 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     compatibility-device-util \
-    legacy-android-test \
 
 LOCAL_SRC_FILES := \
     $(call all-java-files-under, src) \
diff --git a/tests/JobScheduler/jobperm/AndroidManifest.xml b/tests/JobScheduler/jobperm/AndroidManifest.xml
index 14eb02b..493c3e8 100755
--- a/tests/JobScheduler/jobperm/AndroidManifest.xml
+++ b/tests/JobScheduler/jobperm/AndroidManifest.xml
@@ -27,6 +27,8 @@
     <uses-permission android:name="android.jobscheduler.cts.jobperm.perm" />
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <!-- Need a way for another app to try to access the permission. So create a content
         provider which is enforced by the permission -->
         <provider android:name=".JobPermProvider"
diff --git a/tests/JobScheduler/shareduid/Android.mk b/tests/JobScheduler/shareduid/Android.mk
index c851fba..ac4d8b3 100644
--- a/tests/JobScheduler/shareduid/Android.mk
+++ b/tests/JobScheduler/shareduid/Android.mk
@@ -21,7 +21,6 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     compatibility-device-util \
-    legacy-android-test \
 
 LOCAL_SRC_FILES := \
     $(call all-java-files-under, src) \
diff --git a/tests/JobScheduler/shareduid/AndroidManifest.xml b/tests/JobScheduler/shareduid/AndroidManifest.xml
index 756a067..7b4bb56 100755
--- a/tests/JobScheduler/shareduid/AndroidManifest.xml
+++ b/tests/JobScheduler/shareduid/AndroidManifest.xml
@@ -19,5 +19,6 @@
           package="android.jobscheduler.cts.shareduid"
           android:sharedUserId="android.jobscheduler.cts.shared.uid">
     <application>
+        <uses-library android:name="android.test.runner" />
     </application>
 </manifest>
diff --git a/tests/ProcessTest/Android.mk b/tests/ProcessTest/Android.mk
index 2feff2e..775ec3f 100644
--- a/tests/ProcessTest/Android.mk
+++ b/tests/ProcessTest/Android.mk
@@ -24,7 +24,7 @@
 
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 
-LOCAL_STATIC_JAVA_LIBRARIES := legacy-android-test junit
+LOCAL_STATIC_JAVA_LIBRARIES := junit
 
 LOCAL_PACKAGE_NAME := ProcessTests
 
diff --git a/tests/acceleration/Android.mk b/tests/acceleration/Android.mk
index 81869bf..3cbe797 100644
--- a/tests/acceleration/Android.mk
+++ b/tests/acceleration/Android.mk
@@ -25,7 +25,9 @@
 LOCAL_PROGUARD_ENABLED := disabled
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner compatibility-device-util legacy-android-test
+    ctstestrunner compatibility-device-util
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/accessibilityservice/Android.mk b/tests/accessibilityservice/Android.mk
index 9a3bbe2..3848ea7 100644
--- a/tests/accessibilityservice/Android.mk
+++ b/tests/accessibilityservice/Android.mk
@@ -20,8 +20,9 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
 	ctstestrunner \
-	mockito-target-minus-junit4 \
-	legacy-android-test
+	mockito-target-minus-junit4
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/admin/app/Android.mk b/tests/admin/app/Android.mk
index 22b5c83..947fb7d 100644
--- a/tests/admin/app/Android.mk
+++ b/tests/admin/app/Android.mk
@@ -22,7 +22,7 @@
 
 LOCAL_JAVA_LIBRARIES := guava
 
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/app/app/Android.mk b/tests/app/app/Android.mk
index 191f4cc..d982246 100644
--- a/tests/app/app/Android.mk
+++ b/tests/app/app/Android.mk
@@ -23,15 +23,20 @@
 
 LOCAL_PROGUARD_ENABLED := disabled
 
-LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common voip-common org.apache.http.legacy
+LOCAL_JAVA_LIBRARIES := \
+    android.test.runner \
+    telephony-common \
+    voip-common \
+    org.apache.http.legacy \
+    android.test.base \
+
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     compatibility-device-util \
     ctstestrunner \
     ctstestserver \
     mockito-target-minus-junit4 \
-    android-support-v4 \
-    legacy-android-test
+    android-support-v4
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) \
               src/android/app/stubs/ISecondary.aidl
diff --git a/tests/app/app2/Android.mk b/tests/app/app2/Android.mk
index 45cab18..304f79e 100644
--- a/tests/app/app2/Android.mk
+++ b/tests/app/app2/Android.mk
@@ -20,7 +20,6 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     compatibility-device-util \
-    legacy-android-test \
 
 LOCAL_SRC_FILES := \
     ../app/src/android/app/stubs/LocalService.java
diff --git a/tests/app/app2/AndroidManifest.xml b/tests/app/app2/AndroidManifest.xml
index 8c30996..0926251 100644
--- a/tests/app/app2/AndroidManifest.xml
+++ b/tests/app/app2/AndroidManifest.xml
@@ -19,6 +19,8 @@
     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <service android:name="android.app.stubs.LocalService"
                  android:exported="true"/>
         <service android:name=".AlertWindowService"
diff --git a/tests/backup/app/fullbackup/Android.mk b/tests/backup/app/fullbackup/Android.mk
index 29e3577..ac53252 100644
--- a/tests/backup/app/fullbackup/Android.mk
+++ b/tests/backup/app/fullbackup/Android.mk
@@ -29,7 +29,6 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     compatibility-device-util \
-    ctstestrunner \
-    legacy-android-test
+    ctstestrunner
 
 include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/backup/app/fullbackup/AndroidManifest.xml b/tests/backup/app/fullbackup/AndroidManifest.xml
index 8161a95..138c774 100644
--- a/tests/backup/app/fullbackup/AndroidManifest.xml
+++ b/tests/backup/app/fullbackup/AndroidManifest.xml
@@ -23,6 +23,8 @@
         android:backupAgent="FullBackupBackupAgent"
         android:label="Android Backup CTS App"
         android:fullBackupOnly="true">
+        <uses-library android:name="android.test.runner" />
+
 
         <activity
             android:name=".MainActivity"
diff --git a/tests/backup/app/keyvalue/Android.mk b/tests/backup/app/keyvalue/Android.mk
index 7857bae..3c36f50 100644
--- a/tests/backup/app/keyvalue/Android.mk
+++ b/tests/backup/app/keyvalue/Android.mk
@@ -29,7 +29,6 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     compatibility-device-util \
-    ctstestrunner \
-    legacy-android-test
+    ctstestrunner
 
 include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/backup/app/keyvalue/AndroidManifest.xml b/tests/backup/app/keyvalue/AndroidManifest.xml
index c99b4b4..3ed302d 100644
--- a/tests/backup/app/keyvalue/AndroidManifest.xml
+++ b/tests/backup/app/keyvalue/AndroidManifest.xml
@@ -22,6 +22,8 @@
         android:allowBackup="true"
         android:backupAgent="android.backup.app.KeyValueBackupAgent"
         android:label="Android Key Value Backup CTS App">
+        <uses-library android:name="android.test.runner" />
+
         <activity
             android:name="android.backup.app.MainActivity"
             android:label="Android Key Value Backup CTS App" >
diff --git a/tests/fragment/Android.mk b/tests/fragment/Android.mk
index 1785097..89cfa89 100644
--- a/tests/fragment/Android.mk
+++ b/tests/fragment/Android.mk
@@ -33,8 +33,7 @@
     mockito-target-minus-junit4 \
     android-common \
     compatibility-device-util \
-    ctstestrunner \
-    legacy-android-test
+    ctstestrunner
 #LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util android-support-test
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/tests/framework/base/windowmanager/alertwindowservice/Android.mk b/tests/framework/base/windowmanager/alertwindowservice/Android.mk
index 436c3bc..c012a65 100644
--- a/tests/framework/base/windowmanager/alertwindowservice/Android.mk
+++ b/tests/framework/base/windowmanager/alertwindowservice/Android.mk
@@ -20,7 +20,6 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     compatibility-device-util \
-    legacy-android-test \
 
 LOCAL_SRC_FILES := \
     $(call all-java-files-under, src) \
diff --git a/tests/framework/base/windowmanager/alertwindowservice/AndroidManifest.xml b/tests/framework/base/windowmanager/alertwindowservice/AndroidManifest.xml
index 21b6f7c..76c30bd 100644
--- a/tests/framework/base/windowmanager/alertwindowservice/AndroidManifest.xml
+++ b/tests/framework/base/windowmanager/alertwindowservice/AndroidManifest.xml
@@ -19,6 +19,8 @@
     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <service android:name=".AlertWindowService"
                  android:exported="true"/>
     </application>
diff --git a/tests/jank/Android.mk b/tests/jank/Android.mk
index 16954f2..230f3e8 100644
--- a/tests/jank/Android.mk
+++ b/tests/jank/Android.mk
@@ -32,7 +32,8 @@
     ctstestrunner \
     ub-uiautomator \
     ub-janktesthelper \
-    junit \
-    legacy-android-test
+    junit
+
+LOCAL_JAVA_LIBRARIES := android.test.base
 
 include $(BUILD_CTS_PACKAGE)
diff --git a/tests/leanbackjank/Android.mk b/tests/leanbackjank/Android.mk
index 246cf5e..0c6ff9d 100644
--- a/tests/leanbackjank/Android.mk
+++ b/tests/leanbackjank/Android.mk
@@ -32,8 +32,9 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ub-janktesthelper \
-    legacy-android-test
+    ub-janktesthelper
+
+LOCAL_JAVA_LIBRARIES := android.test.base
 
 include $(BUILD_CTS_PACKAGE)
 
diff --git a/tests/leanbackjank/app/Android.mk b/tests/leanbackjank/app/Android.mk
index c8c70b0..04c3d3f 100644
--- a/tests/leanbackjank/app/Android.mk
+++ b/tests/leanbackjank/app/Android.mk
@@ -36,8 +36,7 @@
     ctstestrunner \
     ub-uiautomator \
     ub-janktesthelper \
-    glide \
-    legacy-android-test
+    glide
 
 LOCAL_STATIC_ANDROID_LIBRARIES := \
     android-support-v4 \
diff --git a/tests/leanbackjank/app/AndroidManifest.xml b/tests/leanbackjank/app/AndroidManifest.xml
index 1e1ff3b..1ea3f3f 100644
--- a/tests/leanbackjank/app/AndroidManifest.xml
+++ b/tests/leanbackjank/app/AndroidManifest.xml
@@ -40,6 +40,8 @@
         android:label="@string/app_name"
         android:logo="@drawable/videos_by_google_banner"
         android:theme="@style/Theme.Example.Leanback" >
+        <uses-library android:name="android.test.runner" />
+
         <activity
             android:name=".ui.MainActivity"
             android:icon="@drawable/videos_by_google_banner"
diff --git a/tests/netlegacy22.api/Android.mk b/tests/netlegacy22.api/Android.mk
index 8639514..5a330e5 100644
--- a/tests/netlegacy22.api/Android.mk
+++ b/tests/netlegacy22.api/Android.mk
@@ -27,7 +27,7 @@
 
 LOCAL_SDK_VERSION := 22
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
 
 # Tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/tests/netlegacy22.permission/Android.mk b/tests/netlegacy22.permission/Android.mk
index 262e600..f5cc38b 100644
--- a/tests/netlegacy22.permission/Android.mk
+++ b/tests/netlegacy22.permission/Android.mk
@@ -27,7 +27,7 @@
 
 LOCAL_SDK_VERSION := 22
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
 
 # Tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/tests/pdf/Android.mk b/tests/pdf/Android.mk
index 2b301af..53ec66c 100644
--- a/tests/pdf/Android.mk
+++ b/tests/pdf/Android.mk
@@ -28,8 +28,7 @@
     compatibility-device-util \
     ctstestrunner \
     android-support-annotations \
-    junit \
-    legacy-android-test
+    junit
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/sample/Android.mk b/tests/sample/Android.mk
index f6d8760..c5bfb63 100755
--- a/tests/sample/Android.mk
+++ b/tests/sample/Android.mk
@@ -27,8 +27,9 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     compatibility-device-util \
-    android-support-test \
-    legacy-android-test
+    android-support-test
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/accounts/Android.mk b/tests/tests/accounts/Android.mk
index f5ac4fa..a815b1f 100644
--- a/tests/tests/accounts/Android.mk
+++ b/tests/tests/accounts/Android.mk
@@ -22,9 +22,9 @@
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
-    CtsAccountTestsCommon ctstestrunner legacy-android-test
+    CtsAccountTestsCommon ctstestrunner
 
-LOCAL_JAVA_LIBRARIES := legacy-android-test
+LOCAL_JAVA_LIBRARIES := legacy-android-test android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/animation/Android.mk b/tests/tests/animation/Android.mk
index c625cbe..2311683 100644
--- a/tests/tests/animation/Android.mk
+++ b/tests/tests/animation/Android.mk
@@ -30,8 +30,7 @@
     android-common \
     compatibility-device-util \
     ctstestrunner \
-    platform-test-annotations \
-    legacy-android-test
+    platform-test-annotations
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
diff --git a/tests/tests/app.usage/Android.mk b/tests/tests/app.usage/Android.mk
index dbef83c..4233c0b 100644
--- a/tests/tests/app.usage/Android.mk
+++ b/tests/tests/app.usage/Android.mk
@@ -28,9 +28,10 @@
     android-support-test \
     ctstestrunner \
     junit \
-    legacy-android-test \
     ub-uiautomator
 
+LOCAL_JAVA_LIBRARIES := android.test.base android.test.runner
+
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 # Tag this module as a cts test artifact
diff --git a/tests/tests/app/Android.mk b/tests/tests/app/Android.mk
index bd679a4..4c0e217 100644
--- a/tests/tests/app/Android.mk
+++ b/tests/tests/app/Android.mk
@@ -24,13 +24,12 @@
 # and when built explicitly put it in the data partition
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
     android-support-test \
-    junit \
-    legacy-android-test
+    junit
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/appwidget/Android.mk b/tests/tests/appwidget/Android.mk
index 5df6046..0857835 100644
--- a/tests/tests/appwidget/Android.mk
+++ b/tests/tests/appwidget/Android.mk
@@ -28,8 +28,9 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     mockito-target-minus-junit4 \
     ctstestrunner \
-    junit \
-    legacy-android-test
+    junit
+
+LOCAL_JAVA_LIBRARIES := android.test.base
 
 # Tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/tests/tests/bluetooth/Android.mk b/tests/tests/bluetooth/Android.mk
index 1af4a3f..d27e7a1 100644
--- a/tests/tests/bluetooth/Android.mk
+++ b/tests/tests/bluetooth/Android.mk
@@ -24,7 +24,7 @@
 # When built, explicitly put it in the data partition.
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
 LOCAL_JAVA_LIBRARIES += android.test.runner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/tests/tests/calendarcommon/Android.mk b/tests/tests/calendarcommon/Android.mk
index 18ae49e..8e39bd3 100644
--- a/tests/tests/calendarcommon/Android.mk
+++ b/tests/tests/calendarcommon/Android.mk
@@ -25,7 +25,7 @@
 # When built, explicitly put it in the data partition.
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
 
 LOCAL_JAVA_LIBRARIES := legacy-android-test
 
diff --git a/tests/tests/car/Android.mk b/tests/tests/car/Android.mk
index db12143..846da34 100644
--- a/tests/tests/car/Android.mk
+++ b/tests/tests/car/Android.mk
@@ -24,7 +24,7 @@
 # When built, explicitly put it in the data partition.
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner android-support-test
 
 LOCAL_JAVA_LIBRARIES := android.car
 
diff --git a/tests/tests/carrierapi/Android.mk b/tests/tests/carrierapi/Android.mk
index 954ae14..4969e8e 100644
--- a/tests/tests/carrierapi/Android.mk
+++ b/tests/tests/carrierapi/Android.mk
@@ -25,8 +25,7 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
     compatibility-device-util \
-    junit \
-    legacy-android-test
+    junit
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
@@ -36,5 +35,6 @@
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 
 LOCAL_JAVA_LIBRARIES += android.test.runner telephony-common
+LOCAL_JAVA_LIBRARIES += android.test.base
 
 include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/colormode/Android.mk b/tests/tests/colormode/Android.mk
index a506fa5..d589a4f 100644
--- a/tests/tests/colormode/Android.mk
+++ b/tests/tests/colormode/Android.mk
@@ -24,7 +24,7 @@
 
 LOCAL_PROGUARD_ENABLED := disabled
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/content/Android.mk b/tests/tests/content/Android.mk
index 3b64fa1..e340d00 100644
--- a/tests/tests/content/Android.mk
+++ b/tests/tests/content/Android.mk
@@ -24,14 +24,13 @@
 
 LOCAL_JNI_SHARED_LIBRARIES := libnativecursorwindow_jni libnativehelper_compat_libc++
 
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base android.test.mock
 
 LOCAL_STATIC_JAVA_LIBRARIES :=  \
     compatibility-device-util \
     ctstestrunner \
     services.core \
     junit \
-    legacy-android-test \
     truth-prebuilt
 
 LOCAL_STATIC_ANDROID_LIBRARIES := android-support-v4
diff --git a/tests/tests/database/Android.mk b/tests/tests/database/Android.mk
index 0e24c15..f52b458 100644
--- a/tests/tests/database/Android.mk
+++ b/tests/tests/database/Android.mk
@@ -26,8 +26,7 @@
     ctstestrunner \
     ctstestrunner \
     ub-uiautomator \
-    junit \
-    legacy-android-test
+    junit
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
diff --git a/tests/tests/display/Android.mk b/tests/tests/display/Android.mk
index 53ae177..442eddd 100644
--- a/tests/tests/display/Android.mk
+++ b/tests/tests/display/Android.mk
@@ -27,7 +27,7 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
 
 # Tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/tests/tests/dpi/Android.mk b/tests/tests/dpi/Android.mk
index 0e07bec..a6a65ef 100644
--- a/tests/tests/dpi/Android.mk
+++ b/tests/tests/dpi/Android.mk
@@ -17,7 +17,9 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner junit legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner junit
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/dreams/Android.mk b/tests/tests/dreams/Android.mk
index 383c9c3..50c4d7f 100644
--- a/tests/tests/dreams/Android.mk
+++ b/tests/tests/dreams/Android.mk
@@ -24,9 +24,9 @@
 # When built, explicitly put it in the data partition.
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner junit legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner junit
 
-LOCAL_JAVA_LIBRARIES :=  android.test.runner
+LOCAL_JAVA_LIBRARIES :=  android.test.runner android.test.base
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/drm/Android.mk b/tests/tests/drm/Android.mk
index 13ac8d6..798dd8d 100644
--- a/tests/tests/drm/Android.mk
+++ b/tests/tests/drm/Android.mk
@@ -24,7 +24,7 @@
 # and when built explicitly put it in the data partition
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner compatibility-device-util legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner compatibility-device-util
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/dynamic_linker/Android.mk b/tests/tests/dynamic_linker/Android.mk
index fead807..ef122ca 100644
--- a/tests/tests/dynamic_linker/Android.mk
+++ b/tests/tests/dynamic_linker/Android.mk
@@ -39,7 +39,7 @@
 include $(CLEAR_VARS)
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
 LOCAL_SRC_FILES := $(call all-java-files-under, .)
 LOCAL_MULTILIB := both
 LOCAL_JNI_SHARED_LIBRARIES := libdynamiclinker_native_lib_a libdynamiclinker_native_lib_b
diff --git a/tests/tests/externalservice/service/Android.mk b/tests/tests/externalservice/service/Android.mk
index c151f3b..8563cb1 100644
--- a/tests/tests/externalservice/service/Android.mk
+++ b/tests/tests/externalservice/service/Android.mk
@@ -25,7 +25,6 @@
     CtsExternalServiceCommon \
     ctstestrunner \
     compatibility-device-util \
-    legacy-android-test \
 
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/tests/tests/externalservice/service/AndroidManifest.xml b/tests/tests/externalservice/service/AndroidManifest.xml
index 06fa80e..74d0825 100644
--- a/tests/tests/externalservice/service/AndroidManifest.xml
+++ b/tests/tests/externalservice/service/AndroidManifest.xml
@@ -19,6 +19,8 @@
     package="android.externalservice.service">
 
     <application android:label="External Service Host">
+        <uses-library android:name="android.test.runner" />
+
         <!-- Service used to start .ExternalService from this package. -->
         <service android:name=".ServiceCreator"
                  android:isolatedProcess="false"
diff --git a/tests/tests/graphics/Android.mk b/tests/tests/graphics/Android.mk
index 7ea5eec..b3710fe 100644
--- a/tests/tests/graphics/Android.mk
+++ b/tests/tests/graphics/Android.mk
@@ -29,8 +29,7 @@
     ctsdeviceutillegacy \
     ctstestrunner \
     android-support-annotations \
-    junit \
-    legacy-android-test
+    junit
 
 LOCAL_JNI_SHARED_LIBRARIES := libctsgraphics_jni
 
diff --git a/tests/tests/hardware/Android.mk b/tests/tests/hardware/Android.mk
index 3adf811..62c67fc 100644
--- a/tests/tests/hardware/Android.mk
+++ b/tests/tests/hardware/Android.mk
@@ -26,7 +26,7 @@
 
 LOCAL_MULTILIB := both
 
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     android-support-test \
@@ -34,8 +34,7 @@
     ctstestrunner \
     mockito-target-minus-junit4 \
     platform-test-annotations \
-    ub-uiautomator \
-    legacy-android-test
+    ub-uiautomator
 
 LOCAL_JNI_SHARED_LIBRARIES := libctshardware_jni libnativehelper_compat_libc++
 
diff --git a/tests/tests/incident/Android.mk b/tests/tests/incident/Android.mk
index 1309c99..6c6ef62 100644
--- a/tests/tests/incident/Android.mk
+++ b/tests/tests/incident/Android.mk
@@ -33,7 +33,6 @@
 LOCAL_JAVA_LIBRARIES += android.test.runner
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
-        ctstestrunner \
-	legacy-android-test
+        ctstestrunner
 
 include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/keystore/Android.mk b/tests/tests/keystore/Android.mk
index ea24954..bc03cdb 100644
--- a/tests/tests/keystore/Android.mk
+++ b/tests/tests/keystore/Android.mk
@@ -31,8 +31,7 @@
         compatibility-device-util \
         ctstestrunner \
         guava \
-        junit \
-        legacy-android-test
+        junit
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
@@ -49,6 +48,7 @@
 # Uncomment when b/13282254 is fixed.
 # LOCAL_SDK_VERSION := current
 LOCAL_JAVA_LIBRARIES += android.test.runner
+LOCAL_JAVA_LIBRARIES += android.test.base
 
 include $(BUILD_CTS_PACKAGE)
 
diff --git a/tests/tests/libcorefileio/Android.mk b/tests/tests/libcorefileio/Android.mk
index cfd9775..bc224f6 100644
--- a/tests/tests/libcorefileio/Android.mk
+++ b/tests/tests/libcorefileio/Android.mk
@@ -21,7 +21,9 @@
 # and when built explicitly put it in the data partition
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner junit legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner junit
+
+LOCAL_JAVA_LIBRARIES := android.test.base
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/location2/Android.mk b/tests/tests/location2/Android.mk
index 5b9f327..08993d5 100644
--- a/tests/tests/location2/Android.mk
+++ b/tests/tests/location2/Android.mk
@@ -24,7 +24,9 @@
 # Tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner junit legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner junit
+
+LOCAL_JAVA_LIBRARIES := android.test.base
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/media/Android.mk b/tests/tests/media/Android.mk
index e03eb76..75c1f07 100644
--- a/tests/tests/media/Android.mk
+++ b/tests/tests/media/Android.mk
@@ -51,7 +51,6 @@
     ctstestrunner \
     ctstestserver \
     junit \
-    legacy-android-test \
     ndkaudio \
     testng
 
@@ -75,6 +74,7 @@
 #LOCAL_SDK_VERSION := current
 
 LOCAL_JAVA_LIBRARIES += android.test.runner org.apache.http.legacy
+LOCAL_JAVA_LIBRARIES += android.test.base
 
 # Tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/tests/tests/net/Android.mk b/tests/tests/net/Android.mk
index 4aeab38..1d4d54b 100644
--- a/tests/tests/net/Android.mk
+++ b/tests/tests/net/Android.mk
@@ -24,7 +24,12 @@
 # Include both the 32 and 64 bit versions
 LOCAL_MULTILIB := both
 
-LOCAL_JAVA_LIBRARIES := voip-common conscrypt org.apache.http.legacy
+LOCAL_JAVA_LIBRARIES := \
+    voip-common \
+    conscrypt \
+    org.apache.http.legacy \
+    android.test.base \
+
 
 LOCAL_JNI_SHARED_LIBRARIES := libcts_jni libnativedns_jni \
                               libnativemultinetwork_jni libnativehelper_compat_libc++
@@ -40,8 +45,7 @@
     ctstestrunner \
     ctstestserver \
     mockwebserver \
-    junit \
-    legacy-android-test
+    junit
 
 # uncomment when b/13249961 is fixed
 #LOCAL_SDK_VERSION := current
diff --git a/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.mk b/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.mk
index b45bfe0..2fc843e 100644
--- a/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.mk
+++ b/tests/tests/netsecpolicy/usescleartexttraffic-false/Android.mk
@@ -22,8 +22,7 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
-    ctstestserver \
-    legacy-android-test
+    ctstestserver
 
 LOCAL_JAVA_LIBRARIES := org.apache.http.legacy
 
diff --git a/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.mk b/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.mk
index 89195cd..ef9e1a7 100644
--- a/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.mk
+++ b/tests/tests/netsecpolicy/usescleartexttraffic-true/Android.mk
@@ -22,8 +22,7 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
-    ctstestserver \
-    legacy-android-test
+    ctstestserver
 
 LOCAL_JAVA_LIBRARIES := org.apache.http.legacy
 
diff --git a/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.mk b/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.mk
index bad2cbc..0b0a126 100644
--- a/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.mk
+++ b/tests/tests/netsecpolicy/usescleartexttraffic-unspecified/Android.mk
@@ -22,8 +22,7 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
-    ctstestserver \
-    legacy-android-test
+    ctstestserver
 
 LOCAL_JAVA_LIBRARIES := org.apache.http.legacy
 
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.mk b/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.mk
index 54727c6..ce4c74d 100644
--- a/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.mk
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-downloadmanager/Android.mk
@@ -22,8 +22,7 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
-    android-support-test \
-    legacy-android-test
+    android-support-test
 
 LOCAL_JAVA_LIBRARIES := org.apache.http.legacy
 
diff --git a/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.mk b/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.mk
index 4e7efdeb..b0be2ae 100644
--- a/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.mk
+++ b/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/Android.mk
@@ -22,10 +22,9 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
-    android-support-test \
-    legacy-android-test
+    android-support-test
 
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy
+LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_SRC_FILES += $(call all-java-files-under, ../src)
diff --git a/tests/tests/opengl/Android.mk b/tests/tests/opengl/Android.mk
index d623932..3b89443 100644
--- a/tests/tests/opengl/Android.mk
+++ b/tests/tests/opengl/Android.mk
@@ -29,7 +29,9 @@
 
 LOCAL_JNI_SHARED_LIBRARIES := libopengltest_jni
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/os/Android.mk b/tests/tests/os/Android.mk
index d826a72..7984227 100644
--- a/tests/tests/os/Android.mk
+++ b/tests/tests/os/Android.mk
@@ -30,8 +30,7 @@
     ctstestrunner \
     truth-prebuilt \
     guava \
-    junit \
-    legacy-android-test
+    junit
 
 LOCAL_JNI_SHARED_LIBRARIES := libcts_jni libctsos_jni libnativehelper_compat_libc++
 
@@ -51,6 +50,7 @@
 # uncomment when b/13282254 is fixed
 #LOCAL_SDK_VERSION := current
 LOCAL_JAVA_LIBRARIES += android.test.runner
+LOCAL_JAVA_LIBRARIES += android.test.base
 
 # Do not compress minijail policy files.
 LOCAL_AAPT_FLAGS := -0 .policy
diff --git a/tests/tests/packageinstaller/adminpackageinstaller/Android.mk b/tests/tests/packageinstaller/adminpackageinstaller/Android.mk
index 0e24292..db2e563 100755
--- a/tests/tests/packageinstaller/adminpackageinstaller/Android.mk
+++ b/tests/tests/packageinstaller/adminpackageinstaller/Android.mk
@@ -29,8 +29,7 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
 	ub-uiautomator \
 	android-support-test \
-	android-support-v4 \
-	legacy-android-test
+	android-support-v4
 
 LOCAL_SDK_VERSION := test_current
 
diff --git a/tests/tests/permission/Android.mk b/tests/tests/permission/Android.mk
index b24774f..08c8714 100644
--- a/tests/tests/permission/Android.mk
+++ b/tests/tests/permission/Android.mk
@@ -32,8 +32,7 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
     guava \
-    android-ex-camera2 \
-    legacy-android-test
+    android-ex-camera2
 
 LOCAL_JNI_SHARED_LIBRARIES := libctspermission_jni libnativehelper_compat_libc++
 
@@ -44,6 +43,7 @@
 # uncomment when b/13249777 is fixed
 #LOCAL_SDK_VERSION := current
 LOCAL_JAVA_LIBRARIES += android.test.runner
+LOCAL_JAVA_LIBRARIES += android.test.base
 
 include $(BUILD_CTS_PACKAGE)
 
diff --git a/tests/tests/permission2/Android.mk b/tests/tests/permission2/Android.mk
index 062aeb7..5726255 100755
--- a/tests/tests/permission2/Android.mk
+++ b/tests/tests/permission2/Android.mk
@@ -28,8 +28,7 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
 	compatibility-device-util \
-	ctstestrunner \
-	legacy-android-test
+	ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/preference/Android.mk b/tests/tests/preference/Android.mk
index 9223ce8..0d58f6d 100644
--- a/tests/tests/preference/Android.mk
+++ b/tests/tests/preference/Android.mk
@@ -23,7 +23,9 @@
 # Tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/preference2/Android.mk b/tests/tests/preference2/Android.mk
index 7529f43..5ba5212 100644
--- a/tests/tests/preference2/Android.mk
+++ b/tests/tests/preference2/Android.mk
@@ -29,8 +29,9 @@
     ctstestrunner \
     compatibility-device-util \
     mockito-target-minus-junit4 \
-    ub-uiautomator \
-    legacy-android-test
+    ub-uiautomator
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/renderscript/Android.mk b/tests/tests/renderscript/Android.mk
index 1a8c549..aa990d6 100644
--- a/tests/tests/renderscript/Android.mk
+++ b/tests/tests/renderscript/Android.mk
@@ -30,8 +30,7 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
-    xmp_toolkit \
-    legacy-android-test
+    xmp_toolkit
 LOCAL_JNI_SHARED_LIBRARIES := libcoremathtestcpp_jni
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
diff --git a/tests/tests/rsblas/Android.mk b/tests/tests/rsblas/Android.mk
index 0385573..8808752 100644
--- a/tests/tests/rsblas/Android.mk
+++ b/tests/tests/rsblas/Android.mk
@@ -27,7 +27,7 @@
 # When built, explicitly put it in the data partition.
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
 LOCAL_JNI_SHARED_LIBRARIES := libbnnmdata_jni
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
diff --git a/tests/tests/rscpp/Android.mk b/tests/tests/rscpp/Android.mk
index 11957bf..22dc6fd 100644
--- a/tests/tests/rscpp/Android.mk
+++ b/tests/tests/rscpp/Android.mk
@@ -28,7 +28,7 @@
 # When built, explicitly put it in the data partition.
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
 LOCAL_JNI_SHARED_LIBRARIES := librscpptest_jni
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
diff --git a/tests/tests/sax/Android.mk b/tests/tests/sax/Android.mk
index 0c2a2b3..b83cc35 100644
--- a/tests/tests/sax/Android.mk
+++ b/tests/tests/sax/Android.mk
@@ -21,7 +21,7 @@
 # and when built explicitly put it in the data partition
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/security/Android.mk b/tests/tests/security/Android.mk
index b22f6c7..62952ef 100644
--- a/tests/tests/security/Android.mk
+++ b/tests/tests/security/Android.mk
@@ -28,10 +28,13 @@
     ctstestrunner \
     compatibility-device-util \
     guava \
-    platform-test-annotations \
-    legacy-android-test
+    platform-test-annotations
 
-LOCAL_JAVA_LIBRARIES := android.test.runner org.apache.http.legacy
+LOCAL_JAVA_LIBRARIES := \
+    android.test.runner \
+    org.apache.http.legacy \
+    android.test.base \
+
 
 LOCAL_JNI_SHARED_LIBRARIES := libctssecurity_jni libcts_jni libnativehelper_compat_libc++ \
                       libnativehelper \
diff --git a/tests/tests/selinux/selinuxTargetSdk2/Android.mk b/tests/tests/selinux/selinuxTargetSdk2/Android.mk
index f475f9f..25d0acf 100755
--- a/tests/tests/selinux/selinuxTargetSdk2/Android.mk
+++ b/tests/tests/selinux/selinuxTargetSdk2/Android.mk
@@ -20,8 +20,7 @@
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 LOCAL_STATIC_JAVA_LIBRARIES := \
     compatibility-device-util \
-    ctstestrunner \
-    legacy-android-test
+    ctstestrunner
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_PACKAGE_NAME := CtsSelinuxTargetSdk2TestCases
 LOCAL_SDK_VERSION := current
diff --git a/tests/tests/shortcutmanager/packages/launchermanifest/Android.mk b/tests/tests/shortcutmanager/packages/launchermanifest/Android.mk
index b810801..5774466 100644
--- a/tests/tests/shortcutmanager/packages/launchermanifest/Android.mk
+++ b/tests/tests/shortcutmanager/packages/launchermanifest/Android.mk
@@ -33,8 +33,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
@@ -64,8 +63,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
@@ -95,8 +93,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/tests/tests/shortcutmanager/packages/launchermanifest/AndroidManifest.xml b/tests/tests/shortcutmanager/packages/launchermanifest/AndroidManifest.xml
index 1872a7d..ec688fe 100755
--- a/tests/tests/shortcutmanager/packages/launchermanifest/AndroidManifest.xml
+++ b/tests/tests/shortcutmanager/packages/launchermanifest/AndroidManifest.xml
@@ -20,6 +20,8 @@
     android:sharedUserId="android.content.pm.cts.shortcutmanager.packages">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="Launcher">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/tests/tests/shortcutmanager/packages/launchermanifest_nonshared/Android.mk b/tests/tests/shortcutmanager/packages/launchermanifest_nonshared/Android.mk
index 93f30eb..0d954e2 100644
--- a/tests/tests/shortcutmanager/packages/launchermanifest_nonshared/Android.mk
+++ b/tests/tests/shortcutmanager/packages/launchermanifest_nonshared/Android.mk
@@ -32,8 +32,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/tests/tests/shortcutmanager/packages/launchermanifest_nonshared/AndroidManifest.xml b/tests/tests/shortcutmanager/packages/launchermanifest_nonshared/AndroidManifest.xml
index c43d574..90d0df5 100755
--- a/tests/tests/shortcutmanager/packages/launchermanifest_nonshared/AndroidManifest.xml
+++ b/tests/tests/shortcutmanager/packages/launchermanifest_nonshared/AndroidManifest.xml
@@ -19,6 +19,8 @@
     package="android.content.pm.cts.shortcutmanager.packages">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="Launcher">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/tests/tests/shortcutmanager/packages/packagemanifest/Android.mk b/tests/tests/shortcutmanager/packages/packagemanifest/Android.mk
index ddfbe76..b8741f2 100644
--- a/tests/tests/shortcutmanager/packages/packagemanifest/Android.mk
+++ b/tests/tests/shortcutmanager/packages/packagemanifest/Android.mk
@@ -32,8 +32,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
@@ -63,8 +62,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
@@ -94,8 +92,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/tests/tests/shortcutmanager/packages/packagemanifest/AndroidManifest.xml b/tests/tests/shortcutmanager/packages/packagemanifest/AndroidManifest.xml
index 18a118e..a5a0060 100755
--- a/tests/tests/shortcutmanager/packages/packagemanifest/AndroidManifest.xml
+++ b/tests/tests/shortcutmanager/packages/packagemanifest/AndroidManifest.xml
@@ -20,6 +20,8 @@
     android:sharedUserId="android.content.pm.cts.shortcutmanager.packages">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="Launcher"
             android:enabled="true">
             <intent-filter>
diff --git a/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/Android.mk b/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/Android.mk
index e8b5024..ac09355 100644
--- a/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/Android.mk
+++ b/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/Android.mk
@@ -32,8 +32,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/AndroidManifest.xml b/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/AndroidManifest.xml
index ee92b8c..d2cc04a 100755
--- a/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/AndroidManifest.xml
+++ b/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/AndroidManifest.xml
@@ -19,6 +19,8 @@
     package="android.content.pm.cts.shortcutmanager.packages">
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <activity android:name="Launcher" android:enabled="true" android:exported="false">
         </activity>
     </application>
diff --git a/tests/tests/shortcutmanager/throttling/Android.mk b/tests/tests/shortcutmanager/throttling/Android.mk
index 79b3db8..62f959e 100644
--- a/tests/tests/shortcutmanager/throttling/Android.mk
+++ b/tests/tests/shortcutmanager/throttling/Android.mk
@@ -35,8 +35,7 @@
     compatibility-device-util \
     ctstestrunner \
     ub-uiautomator \
-    ShortcutManagerTestUtils \
-    legacy-android-test
+    ShortcutManagerTestUtils
 
 LOCAL_SDK_VERSION := current
 
diff --git a/tests/tests/shortcutmanager/throttling/AndroidManifest.xml b/tests/tests/shortcutmanager/throttling/AndroidManifest.xml
index fcbc167..0d444d4 100644
--- a/tests/tests/shortcutmanager/throttling/AndroidManifest.xml
+++ b/tests/tests/shortcutmanager/throttling/AndroidManifest.xml
@@ -22,6 +22,8 @@
     <uses-sdk android:minSdkVersion="25" android:targetSdkVersion="25" />
 
     <application>
+        <uses-library android:name="android.test.runner" />
+
         <receiver
             android:name="ShortcutManagerThrottlingTestReceiver"
             android:exported="true">
diff --git a/tests/tests/simpleperf/CtsSimpleperfDebugApp/Android.mk b/tests/tests/simpleperf/CtsSimpleperfDebugApp/Android.mk
index 2a172b5..5c224f5 100644
--- a/tests/tests/simpleperf/CtsSimpleperfDebugApp/Android.mk
+++ b/tests/tests/simpleperf/CtsSimpleperfDebugApp/Android.mk
@@ -20,7 +20,7 @@
 
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, .)
 
diff --git a/tests/tests/slice/Android.mk b/tests/tests/slice/Android.mk
index 184e8d4..0e29781 100644
--- a/tests/tests/slice/Android.mk
+++ b/tests/tests/slice/Android.mk
@@ -33,8 +33,7 @@
     ctstestrunner \
     mockito-target-minus-junit4 \
     platform-test-annotations \
-    ub-uiautomator \
-    legacy-android-test
+    ub-uiautomator
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/speech/Android.mk b/tests/tests/speech/Android.mk
index 05f9388..1093467 100755
--- a/tests/tests/speech/Android.mk
+++ b/tests/tests/speech/Android.mk
@@ -23,8 +23,9 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
-    android-support-test \
-    legacy-android-test
+    android-support-test
+
+LOCAL_JAVA_LIBRARIES := android.test.base
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/systemintents/Android.mk b/tests/tests/systemintents/Android.mk
index 77b28a4..09ac3314 100644
--- a/tests/tests/systemintents/Android.mk
+++ b/tests/tests/systemintents/Android.mk
@@ -27,7 +27,7 @@
 
 LOCAL_PACKAGE_NAME := CtsSystemIntentTestCases
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test android-support-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner android-support-test
 
 LOCAL_SDK_VERSION := test_current
 
diff --git a/tests/tests/systemui/Android.mk b/tests/tests/systemui/Android.mk
index 6ba1e77..073e829 100644
--- a/tests/tests/systemui/Android.mk
+++ b/tests/tests/systemui/Android.mk
@@ -29,7 +29,6 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
     android-support-test \
-    legacy-android-test \
     ub-uiautomator
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/tests/tests/telecom/Android.mk b/tests/tests/telecom/Android.mk
index 8a243eb..9a43d63 100644
--- a/tests/tests/telecom/Android.mk
+++ b/tests/tests/telecom/Android.mk
@@ -27,8 +27,7 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
 	compatibility-device-util \
 	ctstestrunner \
-	android-support-test \
-	legacy-android-test
+	android-support-test
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/telecom2/Android.mk b/tests/tests/telecom2/Android.mk
index 8e9c8a5d..f93f2b0 100644
--- a/tests/tests/telecom2/Android.mk
+++ b/tests/tests/telecom2/Android.mk
@@ -26,8 +26,7 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
 	compatibility-device-util \
-	ctstestrunner \
-	legacy-android-test
+	ctstestrunner
 
 src_dirs := src \
     ../telecom/src/android/telecom/cts/SelfManagedConnection.java \
diff --git a/tests/tests/telephony/Android.mk b/tests/tests/telephony/Android.mk
index 7bd88fe..2e350b0 100644
--- a/tests/tests/telephony/Android.mk
+++ b/tests/tests/telephony/Android.mk
@@ -26,8 +26,7 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
-    compatibility-device-util \
-    legacy-android-test
+    compatibility-device-util
 
 LOCAL_HOST_SHARED_LIBRARIES := compatibility-device-telephony-preconditions
 
@@ -45,6 +44,7 @@
 # uncomment when b/13250611 is fixed
 #LOCAL_SDK_VERSION := current
 LOCAL_JAVA_LIBRARIES += android.test.runner
+LOCAL_JAVA_LIBRARIES += android.test.base
 
 include $(BUILD_CTS_PACKAGE)
 include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/tests/telephony2/Android.mk b/tests/tests/telephony2/Android.mk
index ec72916..ee03500 100644
--- a/tests/tests/telephony2/Android.mk
+++ b/tests/tests/telephony2/Android.mk
@@ -24,8 +24,7 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
-    compatibility-device-util \
-    legacy-android-test
+    compatibility-device-util
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
@@ -35,5 +34,6 @@
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 
 LOCAL_JAVA_LIBRARIES += android.test.runner
+LOCAL_JAVA_LIBRARIES += android.test.base
 
 include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/theme/Android.mk b/tests/tests/theme/Android.mk
index 71d576d..155f3e3 100644
--- a/tests/tests/theme/Android.mk
+++ b/tests/tests/theme/Android.mk
@@ -24,7 +24,9 @@
 # When built, explicitly put it in the data partition.
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/transition/Android.mk b/tests/tests/transition/Android.mk
index cba0b45..0937fc1 100644
--- a/tests/tests/transition/Android.mk
+++ b/tests/tests/transition/Android.mk
@@ -31,8 +31,7 @@
     android-common \
     compatibility-device-util \
     ctstestrunner \
-    platform-test-annotations \
-    legacy-android-test
+    platform-test-annotations
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
diff --git a/tests/tests/uiautomation/Android.mk b/tests/tests/uiautomation/Android.mk
index eb6ed68..a886e5c 100644
--- a/tests/tests/uiautomation/Android.mk
+++ b/tests/tests/uiautomation/Android.mk
@@ -23,7 +23,7 @@
 # Tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner ub-uiautomator legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner ub-uiautomator
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/uidisolation/Android.mk b/tests/tests/uidisolation/Android.mk
index e9ee3e9..2fa27ad 100644
--- a/tests/tests/uidisolation/Android.mk
+++ b/tests/tests/uidisolation/Android.mk
@@ -24,9 +24,9 @@
 # Tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner ctstestserver legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner ctstestserver
 
-LOCAL_JAVA_LIBRARIES := org.apache.http.legacy
+LOCAL_JAVA_LIBRARIES := org.apache.http.legacy android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/uirendering/Android.mk b/tests/tests/uirendering/Android.mk
index 9cc07b9..f94b611 100644
--- a/tests/tests/uirendering/Android.mk
+++ b/tests/tests/uirendering/Android.mk
@@ -31,8 +31,7 @@
     ctsdeviceutillegacy \
     ctstestrunner \
     mockito-target-minus-junit4 \
-    android-support-test \
-    legacy-android-test
+    android-support-test
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/util/Android.mk b/tests/tests/util/Android.mk
index ed7a61c..0ad2452 100644
--- a/tests/tests/util/Android.mk
+++ b/tests/tests/util/Android.mk
@@ -27,8 +27,7 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     android-support-annotations \
     android-support-test \
-    ctstestrunner \
-    legacy-android-test
+    ctstestrunner
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/view/Android.mk b/tests/tests/view/Android.mk
index 533d98b..a678561 100644
--- a/tests/tests/view/Android.mk
+++ b/tests/tests/view/Android.mk
@@ -26,7 +26,7 @@
 
 LOCAL_MULTILIB := both
 
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     android-support-test \
@@ -35,8 +35,7 @@
     ctstestrunner \
     mockito-target-minus-junit4 \
     platform-test-annotations \
-    ub-uiautomator \
-    legacy-android-test
+    ub-uiautomator
 
 LOCAL_JNI_SHARED_LIBRARIES := libctsview_jni libnativehelper_compat_libc++
 
diff --git a/tests/tests/widget/Android.mk b/tests/tests/widget/Android.mk
index ec104d8..d18ec64 100644
--- a/tests/tests/widget/Android.mk
+++ b/tests/tests/widget/Android.mk
@@ -27,8 +27,7 @@
     android-common \
     compatibility-device-util \
     ctstestrunner \
-    platform-test-annotations \
-    legacy-android-test
+    platform-test-annotations
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
diff --git a/tests/tests/wrap/nowrap/Android.mk b/tests/tests/wrap/nowrap/Android.mk
index 35c0448..7309ee6 100644
--- a/tests/tests/wrap/nowrap/Android.mk
+++ b/tests/tests/wrap/nowrap/Android.mk
@@ -23,8 +23,8 @@
 LOCAL_PROGUARD_ENABLED := disabled
 LOCAL_STATIC_JAVA_LIBRARIES := \
 	compatibility-device-util \
-	android-support-test \
-	legacy-android-test
+	android-support-test
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 LOCAL_SRC_FILES := $(call all-java-files-under, ../src)
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 LOCAL_SDK_VERSION := current
diff --git a/tests/tests/wrap/wrap_debug/Android.mk b/tests/tests/wrap/wrap_debug/Android.mk
index 77b6d27..82dc819 100644
--- a/tests/tests/wrap/wrap_debug/Android.mk
+++ b/tests/tests/wrap/wrap_debug/Android.mk
@@ -23,8 +23,8 @@
 LOCAL_PROGUARD_ENABLED := disabled
 LOCAL_STATIC_JAVA_LIBRARIES := \
 	compatibility-device-util \
-	android-support-test \
-	legacy-android-test
+	android-support-test
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 LOCAL_SRC_FILES := $(call all-java-files-under, ../src)
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 LOCAL_SDK_VERSION := current
diff --git a/tests/tests/wrap/wrap_debug_malloc_debug/Android.mk b/tests/tests/wrap/wrap_debug_malloc_debug/Android.mk
index b58bd2c..5d73645 100644
--- a/tests/tests/wrap/wrap_debug_malloc_debug/Android.mk
+++ b/tests/tests/wrap/wrap_debug_malloc_debug/Android.mk
@@ -23,8 +23,8 @@
 LOCAL_PROGUARD_ENABLED := disabled
 LOCAL_STATIC_JAVA_LIBRARIES := \
 	compatibility-device-util \
-	android-support-test \
-	legacy-android-test
+	android-support-test
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 LOCAL_SRC_FILES := $(call all-java-files-under, ../src)
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 LOCAL_SDK_VERSION := current
diff --git a/tests/tests/wrap/wrap_nodebug/Android.mk b/tests/tests/wrap/wrap_nodebug/Android.mk
index 1d6e9c0..8f04630 100644
--- a/tests/tests/wrap/wrap_nodebug/Android.mk
+++ b/tests/tests/wrap/wrap_nodebug/Android.mk
@@ -23,8 +23,8 @@
 LOCAL_PROGUARD_ENABLED := disabled
 LOCAL_STATIC_JAVA_LIBRARIES := \
 	compatibility-device-util \
-	android-support-test \
-	legacy-android-test
+	android-support-test
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 LOCAL_SRC_FILES := $(call all-java-files-under, ../src)
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 LOCAL_SDK_VERSION := current
diff --git a/tests/vr/Android.mk b/tests/vr/Android.mk
index 74aebf1..11f984f 100644
--- a/tests/vr/Android.mk
+++ b/tests/vr/Android.mk
@@ -27,7 +27,9 @@
 # When built, explicitly put it in the data partition.
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_JNI_SHARED_LIBRARIES := libctsvrextensions_jni libnativehelper_compat_libc++
 
diff --git a/tools/cts-holo-generation/Android.mk b/tools/cts-holo-generation/Android.mk
index 43b346d..661284c 100644
--- a/tools/cts-holo-generation/Android.mk
+++ b/tools/cts-holo-generation/Android.mk
@@ -23,7 +23,9 @@
 LOCAL_DEX_PREOPT := false
 LOCAL_PROGUARD_ENABLED := disabled
 
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
+
+LOCAL_JAVA_LIBRARIES := android.test.runner.stubs
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tools/cts-preconditions/Android.mk b/tools/cts-preconditions/Android.mk
index 76bfaa8..e266481 100644
--- a/tools/cts-preconditions/Android.mk
+++ b/tools/cts-preconditions/Android.mk
@@ -27,8 +27,7 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     android-support-test \
-    compatibility-device-preconditions \
-    legacy-android-test
+    compatibility-device-preconditions
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)