Add setFirewallChainEnabled API

To deprecated firewallEnableChildChain netd binder and move the
functionality to tethering (connectivity) mainline module, expose
setFirewallChainEnabled 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: I9b64c9d12260521489a87fbeae5afbee2a8ea8f6
This commit is contained in:
markchien 2022-01-13 23:43:53 +08:00
commit 98a6f95d0f

View file

@ -10622,4 +10622,16 @@ public class ConnectivityService extends IConnectivityManager.Stub
throw new IllegalStateException(e);
}
}
@Override
public void setFirewallChainEnabled(final int chain, final boolean enable) {
enforceNetworkStackOrSettingsPermission();
try {
mNetd.firewallEnableChildChain(chain, enable);
} catch (RemoteException | ServiceSpecificException e) {
throw new IllegalStateException(e);
}
}
}