Add flag to test BpfNetMaps refactoring
Following CLs will switch previous codepath (JNI) and new codepath
(Java) for bpf map operations based on this flag.
Bug: 217624062
Test: atest BpfNetMapsTest
Change-Id: I74f10d5c97390993acea110f6528ef8980bb2aa4
diff --git a/service/src/com/android/server/ConnectivityService.java b/service/src/com/android/server/ConnectivityService.java
index ae1f808..66bbea0 100644
--- a/service/src/com/android/server/ConnectivityService.java
+++ b/service/src/com/android/server/ConnectivityService.java
@@ -1399,8 +1399,8 @@
* @param netd
* @return BpfNetMaps implementation.
*/
- public BpfNetMaps getBpfNetMaps(INetd netd) {
- return new BpfNetMaps(netd);
+ public BpfNetMaps getBpfNetMaps(Context context, INetd netd) {
+ return new BpfNetMaps(context, netd);
}
/**
@@ -1529,7 +1529,7 @@
mProxyTracker = mDeps.makeProxyTracker(mContext, mHandler);
mNetd = netd;
- mBpfNetMaps = mDeps.getBpfNetMaps(netd);
+ mBpfNetMaps = mDeps.getBpfNetMaps(mContext, netd);
mTelephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
mAppOpsManager = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE);
mLocationPermissionChecker = mDeps.makeLocationPermissionChecker(mContext);