Migrate netlink-client to net-utils-device-common-netlink.
Move netlink stuff to frameworks/libs/net/common/device, and build the
source files as an individual libraray. NetworkStack module just depends
on the net-utils-device-common-netlink.
Besides, also fix the incorrect format detected by checkstyle_hook script
such as missing java doc and make some public function as private, rename
the variable and etc.
Bug: 192535368
Test: atest NetworkStaticlibTests
Change-Id: I00e7f30be1bc9ebc2e24d7cd53efc403d6ba3daa
diff --git a/staticlibs/Android.bp b/staticlibs/Android.bp
index 1371c8c..4e7a9da 100644
--- a/staticlibs/Android.bp
+++ b/staticlibs/Android.bp
@@ -34,7 +34,10 @@
java_library {
name: "net-utils-device-common",
srcs: [
- "device/com/android/net/module/util/**/*.java",
+ "device/com/android/net/module/util/DeviceConfigUtils.java",
+ "device/com/android/net/module/util/FdEventsReader.java",
+ "device/com/android/net/module/util/HexDump.java",
+ "device/com/android/net/module/util/PacketReader.java",
// This library is used by system modules, for which the system health impact of Kotlin
// has not yet been evaluated. Annotations may need jarjar'ing.
// "src_devicecommon/**/*.kt",
@@ -91,6 +94,37 @@
}
java_library {
+ name: "net-utils-device-common-netlink",
+ // TODO: Ipv6Utils and Struct stuff could be separated out of th 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.
+ srcs: [
+ "device/com/android/net/module/util/HexDump.java",
+ "device/com/android/net/module/util/Ipv6Utils.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",
+ min_sdk_version: "29",
+ visibility: [
+ "//frameworks/libs/net/common/testutils:__subpackages__",
+ "//packages/modules/Connectivity:__subpackages__",
+ "//packages/modules/NetworkStack:__subpackages__",
+ ],
+ static_libs: [
+ "net-utils-framework-common",
+ ],
+ libs: [
+ "androidx.annotation_annotation",
+ ],
+ apex_available: [
+ "com.android.tethering",
+ "//apex_available:platform",
+ ],
+}
+
+java_library {
name: "net-utils-framework-common",
srcs: [
":net-utils-framework-common-srcs",