Add updateFirewallRule API
To deprecated firewallSetUidRule netd binder and move the functionality to tethering (connectivity) mainline module, expose updateFirewallRule to support the caller outside the module. Currently the API are still call to netd. Will replace with the implementation inside tethering (connectivity) module. Bug: 209935649 Test: atest CtsHostsideNetworkTests Change-Id: I0b53c999e06c2378afec0eb491815ec398c91b0b
This commit is contained in:
parent
136f2d2d91
commit
e1561fa800
1 changed files with 91 additions and 6 deletions
|
|
@ -10610,4 +10610,16 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFirewallRule(final int chain, final int uid, final boolean allow) {
|
||||
enforceNetworkStackOrSettingsPermission();
|
||||
|
||||
try {
|
||||
mNetd.firewallSetUidRule(chain, uid,
|
||||
allow ? INetd.FIREWALL_RULE_ALLOW : INetd.FIREWALL_RULE_DENY);
|
||||
} catch (RemoteException | ServiceSpecificException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue