Prepare for removal of legacy-test from default targets

In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

Bug: 30188076
Test: make checkbuild
Change-Id: I8b29b7d78c97c648d3c98067ac7b050b0a106369
diff --git a/tests/Android.mk b/tests/Android.mk
index 655ec16..dc3cbba 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -8,7 +8,11 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_INSTRUMENTATION_FOR := DownloadProvider
 LOCAL_JAVA_LIBRARIES := android.test.runner
-LOCAL_STATIC_JAVA_LIBRARIES := mockwebserver dexmaker mockito-target
+LOCAL_STATIC_JAVA_LIBRARIES := \
+    mockwebserver \
+    dexmaker \
+    mockito-target \
+    legacy-android-test
 LOCAL_PACKAGE_NAME := DownloadProviderTests
 LOCAL_CERTIFICATE := media
 
diff --git a/tests/permission/Android.mk b/tests/permission/Android.mk
index 41ceabc..62f4d02 100644
--- a/tests/permission/Android.mk
+++ b/tests/permission/Android.mk
@@ -8,6 +8,7 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
 LOCAL_PACKAGE_NAME := DownloadProviderPermissionTests
 
 include $(BUILD_PACKAGE)
diff --git a/tests/public_api_access/Android.mk b/tests/public_api_access/Android.mk
index 6c6db1f..66f2f10 100644
--- a/tests/public_api_access/Android.mk
+++ b/tests/public_api_access/Android.mk
@@ -8,6 +8,7 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
 LOCAL_PACKAGE_NAME := DownloadPublicApiAccessTests
 
 include $(BUILD_PACKAGE)