Add shared jarjar rule for tethering tests

Also jarjar com.android.net.module.util* to
com.android.networkstack.tethering.util*.

Bug: 171670016
Test: atest TetheringCoverageTests
Change-Id: I3bde9ad3c41adf36da99bd944303d88ce992201c
diff --git a/Tethering/tests/Android.bp b/Tethering/tests/Android.bp
new file mode 100644
index 0000000..cb0a20b
--- /dev/null
+++ b/Tethering/tests/Android.bp
@@ -0,0 +1,23 @@
+//
+// Copyright (C) 2020 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+filegroup {
+    name: "TetheringTestsJarJarRules",
+    srcs: ["jarjar-rules.txt"],
+    visibility: [
+        "//frameworks/base/packages/Tethering/tests:__subpackages__",
+    ]
+}
diff --git a/Tethering/tests/integration/Android.bp b/Tethering/tests/integration/Android.bp
index 02bab9b..5765c01 100644
--- a/Tethering/tests/integration/Android.bp
+++ b/Tethering/tests/integration/Android.bp
@@ -79,6 +79,7 @@
         // For NetworkStackUtils included in NetworkStackBase
         "libnetworkstackutilsjni",
     ],
+    jarjar_rules: ":TetheringTestsJarJarRules",
     compile_multilib: "both",
     manifest: "AndroidManifest_coverage.xml",
-}
\ No newline at end of file
+}
diff --git a/Tethering/tests/unit/jarjar-rules.txt b/Tethering/tests/jarjar-rules.txt
similarity index 90%
rename from Tethering/tests/unit/jarjar-rules.txt
rename to Tethering/tests/jarjar-rules.txt
index 7ed8963..c99ff7f 100644
--- a/Tethering/tests/unit/jarjar-rules.txt
+++ b/Tethering/tests/jarjar-rules.txt
@@ -10,7 +10,10 @@
 
 rule android.util.LocalLog* com.android.networkstack.tethering.util.LocalLog@1
 
+# Classes from net-utils-framework-common
+rule com.android.net.module.util.** com.android.networkstack.tethering.util.@1
+
 # TODO: either stop using frameworks-base-testutils or remove the unit test classes it contains.
 # TestableLooper from "testables" can be used instead of TestLooper from frameworks-base-testutils.
 zap android.os.test.TestLooperTest*
-zap com.android.test.filters.SelectTestTests*
\ No newline at end of file
+zap com.android.test.filters.SelectTestTests*
diff --git a/Tethering/tests/unit/Android.bp b/Tethering/tests/unit/Android.bp
index 45c7b65..3589725 100644
--- a/Tethering/tests/unit/Android.bp
+++ b/Tethering/tests/unit/Android.bp
@@ -67,7 +67,6 @@
         "libdexmakerjvmtiagent",
         "libstaticjvmtiagent",
     ],
-    jarjar_rules: "jarjar-rules.txt",
 }
 
 // Library containing the unit tests. This is used by the coverage test target to pull in the
@@ -88,6 +87,7 @@
         "device-tests",
         "mts",
     ],
+    jarjar_rules: ":TetheringTestsJarJarRules",
     defaults: ["TetheringTestsDefaults"],
     compile_multilib: "both",
 }