Monitor interface added and update bpf interface map

Have BpfInterfaceMapUpdater to update bpf interface map: adding
the interface and index mapping to bpf interface map when interface
added.

Bug: 215095957
Test: atest FrameworkNetTests

Change-Id: I2189a50c4869cfc0c33fc6f0228f40ee9f3ac1d4
diff --git a/service-t/Sources.bp b/service-t/Sources.bp
index b261e16..3fd3d8c 100644
--- a/service-t/Sources.bp
+++ b/service-t/Sources.bp
@@ -26,6 +26,8 @@
     srcs: [
         "src/com/android/server/net/NetworkIdentity*.java",
         "src/com/android/server/net/NetworkStats*.java",
+        "src/com/android/server/net/BpfInterfaceMapUpdater.java",
+        "src/com/android/server/net/InterfaceMapValue.java",
     ],
     path: "src",
     visibility: [
@@ -97,3 +99,28 @@
         "//packages/modules/Connectivity:__subpackages__",
     ],
 }
+
+cc_library_shared {
+    name: "libcom_android_net_module_util_jni",
+    min_sdk_version: "30",
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+        "-Wthread-safety",
+    ],
+    srcs: [
+        "jni/onload.cpp",
+    ],
+    stl: "libc++_static",
+    static_libs: [
+        "libnet_utils_device_common_bpfjni",
+    ],
+    shared_libs: [
+        "liblog",
+        "libnativehelper",
+    ],
+    apex_available: [
+        "//apex_available:platform",
+    ],
+}