Merge "Check UID's process state before restricting its network."

This commit is contained in:
Sudheer Shanka
2020-10-12 23:31:17 +00:00
committed by Gerrit Code Review

View File

@@ -3867,7 +3867,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
// quick check: if this uid doesn't have INTERNET permission, it
// doesn't have network access anyway, so it is a waste to mess
// with it here.
if (hasInternetPermissionUL(uid)) {
if (hasInternetPermissionUL(uid) && !isUidForegroundOnRestrictPowerUL(uid)) {
uidRules.put(uid, FIREWALL_RULE_DENY);
}
}