Add tests for stable API NetworkStack to presubmit

The API stable (system_29 at the moment) version of the NetworkStack
needs to be covered by unit tests in presubmit.

At the moment any difference between NetworkStackNext and
NetworkStack is dead code, so NetworkStackNextTests and
NetworkStackTests are identical.
This change renames NetworkStackTests to NetworkStackNextTests (because
NetworkStackTests historically used the "current", non-stable-API
version of the NetworkStack library), and adds tests for the stable API
version of the code as NetworkStackTests.

Test: atest NetworkStackTests NetworkStackApiStableTests
Change-Id: Iff9a94a7398791adbe856008bc4f9b6c131c3de7
diff --git a/tests/unit/Android.bp b/tests/unit/Android.bp
index 03bcf95..1b67041 100644
--- a/tests/unit/Android.bp
+++ b/tests/unit/Android.bp
@@ -14,18 +14,16 @@
 // limitations under the License.
 //
 
-android_test {
-    name: "NetworkStackTests",
+java_defaults {
+    name: "NetworkStackTestsDefaults",
     certificate: "platform",
     srcs: ["src/**/*.java", "src/**/*.kt"],
-    test_suites: ["device-tests"],
     resource_dirs: ["res"],
     static_libs: [
         "androidx.test.rules",
         "kotlin-reflect",
         "mockito-target-extended-minus-junit4",
         "net-tests-utils",
-        "NetworkStackApiCurrentLib",
         "testables",
     ],
     libs: [
@@ -42,6 +40,21 @@
     ],
 }
 
+android_test {
+    name: "NetworkStackNextTests",
+    srcs: [], // TODO: tests that only apply to the current, non-stable API can be added here
+    test_suites: ["device-tests"],
+    defaults: ["NetworkStackTestsDefaults"],
+    static_libs: ["NetworkStackApiCurrentLib"],
+}
+
+android_test {
+    name: "NetworkStackTests",
+    test_suites: ["device-tests"],
+    defaults: ["NetworkStackTestsDefaults"],
+    static_libs: ["NetworkStackApiStableLib"],
+}
+
 // Additional dependencies of libnetworkstackutilsjni that are not provided by the system when
 // running as a test application.
 // Using java_defaults as jni_libs does not support filegroups.