[NETD-TC#14] Add traffic controller JNI to tethering module
This CL provides native methods to access BPF maps via a native library.
Bug: 202086915
Test: m; flash; boot;
Change-Id: I2e5d03d0c2e31ba11996d1b28ead9b552397fe29
diff --git a/service/src/com/android/server/BpfNetMaps.java b/service/src/com/android/server/BpfNetMaps.java
index bc63eef..a6909c0 100644
--- a/service/src/com/android/server/BpfNetMaps.java
+++ b/service/src/com/android/server/BpfNetMaps.java
@@ -28,6 +28,11 @@
public class BpfNetMaps {
private static final String TAG = "BpfNetMaps";
+ static {
+ System.loadLibrary("traffic_controller_jni");
+ native_init();
+ }
+
/**
* Add naughty app bandwidth rule for specific app
*
@@ -239,6 +244,7 @@
return -err;
}
+ private static native void native_init();
private native int native_addNaughtyApp(int uid);
private native int native_removeNaughtyApp(int uid);
private native int native_addNiceApp(int uid);