Separate bpf and struct util from netlink util library
1. Separate bpf and struct libraries from netlink library.
2. Rename bpfmap jni library to respect its java side library.
3. Add README to explain the rules of adding shared jni library.
4. Also allow packages/modules/Connectivity to use bpf library.
Bug: 205088391
Test: atest TetheringTests
atest CtsTetheringTest
atest TetheringPrivilegedTests
atest ConnectivityCoverageTests
Change-Id: I6e668818bede63b241cd901c0967f401613ddaf6
diff --git a/staticlibs/Android.bp b/staticlibs/Android.bp
index 93084cc..68decf6 100644
--- a/staticlibs/Android.bp
+++ b/staticlibs/Android.bp
@@ -95,17 +95,37 @@
}
java_library {
- name: "net-utils-device-common-netlink",
- // TODO: Ipv6Utils and Struct stuff could be separated out of the netlink library into
- // an individual Struct library, and remove the net-utils-framework-common lib dependency.
- // But there is no need doing this at the moment.
+ name: "net-utils-device-common-bpf",
srcs: [
"device/com/android/net/module/util/BpfMap.java",
+ "device/com/android/net/module/util/JniUtil.java",
+ ],
+ sdk_version: "system_current",
+ min_sdk_version: "29",
+ visibility: [
+ "//frameworks/libs/net/common/tests:__subpackages__",
+ "//frameworks/libs/net/common/testutils:__subpackages__",
+ "//packages/modules/Connectivity:__subpackages__",
+ "//packages/modules/NetworkStack:__subpackages__",
+ ],
+ static_libs: [
+ "net-utils-device-common-struct",
+ ],
+ libs: [
+ "androidx.annotation_annotation",
+ ],
+ apex_available: [
+ "com.android.tethering",
+ "//apex_available:platform",
+ ],
+}
+
+java_library {
+ name: "net-utils-device-common-struct",
+ srcs: [
"device/com/android/net/module/util/HexDump.java",
"device/com/android/net/module/util/Ipv6Utils.java",
- "device/com/android/net/module/util/JniUtil.java",
"device/com/android/net/module/util/Struct.java",
- "device/com/android/net/module/util/netlink/*.java",
"device/com/android/net/module/util/structs/*.java",
],
sdk_version: "system_current",
@@ -128,6 +148,30 @@
}
java_library {
+ name: "net-utils-device-common-netlink",
+ srcs: [
+ "device/com/android/net/module/util/netlink/*.java",
+ ],
+ sdk_version: "system_current",
+ min_sdk_version: "29",
+ visibility: [
+ "//frameworks/libs/net/common/testutils:__subpackages__",
+ "//packages/modules/Connectivity:__subpackages__",
+ "//packages/modules/NetworkStack:__subpackages__",
+ ],
+ static_libs: [
+ "net-utils-device-common-struct",
+ ],
+ libs: [
+ "androidx.annotation_annotation",
+ ],
+ apex_available: [
+ "com.android.tethering",
+ "//apex_available:platform",
+ ],
+}
+
+java_library {
// TODO : this target should probably be folded into net-utils-device-common
name: "net-utils-device-common-ip",
srcs: [