Move attach*Filter() and addArpEntry() methods to NetworkStack
The SocketUtils.attach*Filter and SocketUtils.addArpEntry methods
were added there because they could not be added as JNI inside
the NetworkStack. This was not possible because on Go devices,
the NetworkStack was a jar library. But now, Go also uses an APK.
Hence, move these methods to the NetworkStack.
Change-Id: I1d88a0f0be23f2b15d5103fa092b9bf982329d7c
Fix: 129433183
Test: atest NetworkStackTests FrameworksNetTests
diff --git a/Android.bp b/Android.bp
index 57a3db5..262e6f6 100644
--- a/Android.bp
+++ b/Android.bp
@@ -49,6 +49,27 @@
manifest: "AndroidManifestBase.xml",
}
+cc_library_shared {
+ name: "libnetworkstackutilsjni",
+ srcs: [
+ "jni/network_stack_utils_jni.cpp"
+ ],
+
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ "libnativehelper",
+ ],
+ static_libs: [
+ "libpcap",
+ ],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ ],
+}
+
java_defaults {
name: "NetworkStackAppCommon",
defaults: ["NetworkStackCommon"],
@@ -56,6 +77,7 @@
static_libs: [
"NetworkStackBase",
],
+ jni_libs: ["libnetworkstackutilsjni"],
// Resources already included in NetworkStackBase
resource_dirs: [],
jarjar_rules: "jarjar-rules-shared.txt",