Spin off DnsPacket into separate library
- Packages that don't need the entire 'net-utils-framework-common'
library can depend on this lightweight library.
- This library does not depend on 'framework-annotations' which
was a problem for the mainline modularization team in allowing
other libs to depend on it.
- Spins off the DnsRecord parsing logic into its own class so that
custom DNS resolvers can re-use it.
Test: atest NetworkStaticLibTests
Bug: 193442330
Change-Id: I27d6ee4591d8ab126b7df31f0df8377794fa50f1
diff --git a/staticlibs/Android.bp b/staticlibs/Android.bp
index e8918c6..0585c09 100644
--- a/staticlibs/Android.bp
+++ b/staticlibs/Android.bp
@@ -84,6 +84,19 @@
],
}
+java_library {
+ name: "net-utils-dnspacket-common",
+ srcs: [
+ "framework/**/DnsPacket.java",
+ "framework/**/DnsPacketUtils.java",
+ ],
+ sdk_version: "module_current",
+ visibility: [
+ "//packages/services/Iwlan:__subpackages__",
+ ],
+ libs: ["framework-annotations-lib"],
+}
+
filegroup {
name: "net-utils-framework-common-srcs",
srcs: ["framework/**/*.java"],
@@ -91,7 +104,6 @@
visibility: [
"//frameworks/base",
"//packages/modules/Connectivity:__subpackages__",
- "//frameworks/base/packages/Connectivity/framework",
],
}