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: I1275a0721d2f4598dcdc83e292c188ce36c37fc6
diff --git a/tests2/Android.mk b/tests2/Android.mk
index c341f2c..4209f0e 100644
--- a/tests2/Android.mk
+++ b/tests2/Android.mk
@@ -22,7 +22,8 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ContactsProviderTestUtils \
     android-support-test \
-    mockito-target-minus-junit4
+    mockito-target-minus-junit4 \
+    legacy-android-test
 
 LOCAL_JAVA_LIBRARIES := android.test.runner