Merge "Rename updateFirewallRule to setUidFirewallRule"

This commit is contained in:
Treehugger Robot
2022-03-29 03:41:02 +00:00
committed by Gerrit Code Review

View File

@@ -1528,7 +1528,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
if (updateFirewallUidRuleLocked(chain, uid, rule)) {
final ConnectivityManager cm = mContext.getSystemService(ConnectivityManager.class);
try {
cm.updateFirewallRule(chain, uid, isFirewallRuleAllow(chain, rule));
cm.setUidFirewallRule(chain, uid, rule);
} catch (RuntimeException e) {
throw new IllegalStateException(e);
}
@@ -1601,14 +1601,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
}
}
// There are only two type of firewall rule: FIREWALL_RULE_ALLOW or FIREWALL_RULE_DENY.
private boolean isFirewallRuleAllow(int chain, int rule) {
if (rule == NetworkPolicyManager.FIREWALL_RULE_DEFAULT) {
return getFirewallType(chain) == FIREWALL_DENYLIST;
}
return rule == INetd.FIREWALL_RULE_ALLOW;
}
private void enforceSystemUid() {
final int uid = mDeps.getCallingUid();
if (uid != Process.SYSTEM_UID) {