Use Bpf map based isUidRestrictedOnMeteredNetworks on V+
Bug: 328732146 Test: BpfNetMapsTest Change-Id: I2d3820bf4dd82649941eef2995ad237276937ba9
This commit is contained in:
parent
eb92054f91
commit
e55bcd578b
1 changed files with 81 additions and 0 deletions
|
|
@ -7951,6 +7951,13 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
// Policy already enforced.
|
||||
return;
|
||||
}
|
||||
if (mDeps.isAtLeastV()) {
|
||||
if (mBpfNetMaps.isUidRestrictedOnMeteredNetworks(uid)) {
|
||||
// If UID is restricted, don't allow them to bring up metered APNs.
|
||||
networkCapabilities.addCapability(NET_CAPABILITY_NOT_METERED);
|
||||
}
|
||||
return;
|
||||
}
|
||||
final long ident = Binder.clearCallingIdentity();
|
||||
try {
|
||||
if (mPolicyManager.isUidRestrictedOnMeteredNetworks(uid)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue