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
This commit is contained in:
Motomu Utsumi
2022-07-22 03:47:35 +00:00
parent 6bcb3c290c
commit f688eeb10a
6 changed files with 39 additions and 14 deletions

View File

@@ -1399,8 +1399,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
* @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 @@ public class ConnectivityService extends IConnectivityManager.Stub
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);