Create a service-connectivity-pre-jarjar library

This is needed for FrameworksNetTests because it inculdes
service-connectivity. Without this library, the service-connectivity
is already jarjar-ed which will cause the util classes couldn't be
found when running the tests. So let the tests inculde the pre-jarjar
version and service-connectivity applies the jarjar to this library.

Bug: 177046265
Test: FrameworksNetTests
Change-Id: I1acd95ff9bec99b918646e8ec3a57f3ef156e2ca
Merged-In: I1acd95ff9bec99b918646e8ec3a57f3ef156e2ca
diff --git a/service/Android.bp b/service/Android.bp
index e65b7b4..2fb9f72 100644
--- a/service/Android.bp
+++ b/service/Android.bp
@@ -50,12 +50,11 @@
 }
 
 java_library {
-    name: "service-connectivity",
+    name: "service-connectivity-pre-jarjar",
     srcs: [
+        ":framework-connectivity-shared-srcs",
         ":connectivity-service-srcs",
     ],
-    installable: true,
-    jarjar_rules: "jarjar-rules.txt",
     libs: [
         "android.net.ipsec.ike",
         "services.core",
@@ -73,3 +72,16 @@
         "com.android.tethering",
     ],
 }
+
+java_library {
+    name: "service-connectivity",
+    installable: true,
+    static_libs:[
+        "service-connectivity-pre-jarjar",
+    ],
+    jarjar_rules: "jarjar-rules.txt",
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.tethering",
+    ],
+}