Use bpf map based isUidNetworkingBlocked on V+
NetworkPolicyManager#isUidNetworkingBlocked does not know about some firewall chains status(e.g. FIREWALL_CHAIN_OEM_DENY_1) So BpfNetMaps#isUidNetworkingBlocked is more correct but there could be some behavior difference. To avoid breaking devices and have longer verification time, this CL updates to use BpfNetMaps#isUidNetworkingBlocked only on V+ devices. Bug: 328732146 Test: TH Change-Id: I60f84a5fff90386103692841dead465652249446
This commit is contained in:
parent
cb448f5c78
commit
9b272fa53a
1 changed files with 26 additions and 1 deletions
|
|
@ -2235,7 +2235,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
final long ident = Binder.clearCallingIdentity();
|
||||
try {
|
||||
final boolean metered = nc == null ? true : nc.isMetered();
|
||||
return mPolicyManager.isUidNetworkingBlocked(uid, metered);
|
||||
if (mDeps.isAtLeastV()) {
|
||||
return mBpfNetMaps.isUidNetworkingBlocked(uid, metered);
|
||||
} else {
|
||||
return mPolicyManager.isUidNetworkingBlocked(uid, metered);
|
||||
}
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(ident);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue