Merge "Replace NetworkPolicyManagerInternal#isUidRestrictedOnMeteredNetworks()"
This commit is contained in:
@@ -5714,9 +5714,14 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
// Policy already enforced.
|
// Policy already enforced.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mPolicyManagerInternal.isUidRestrictedOnMeteredNetworks(uid)) {
|
final long ident = Binder.clearCallingIdentity();
|
||||||
// If UID is restricted, don't allow them to bring up metered APNs.
|
try {
|
||||||
networkCapabilities.addCapability(NET_CAPABILITY_NOT_METERED);
|
if (mPolicyManager.isUidRestrictedOnMeteredNetworks(uid)) {
|
||||||
|
// If UID is restricted, don't allow them to bring up metered APNs.
|
||||||
|
networkCapabilities.addCapability(NET_CAPABILITY_NOT_METERED);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
Binder.restoreCallingIdentity(ident);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user