Merge "Add replaceFirewallChain API"
This commit is contained in:
@@ -5696,4 +5696,28 @@ public class ConnectivityManager {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces the contents of the specified UID-based firewall chain.
|
||||
*
|
||||
* @param chain target chain to replace.
|
||||
* @param uids The list of UIDs to be placed into chain.
|
||||
* @throws IllegalStateException if replace firewall chain failed.
|
||||
* @throws IllegalArgumentException if {@code chain} is not a valid chain.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = MODULE_LIBRARIES)
|
||||
@RequiresPermission(anyOf = {
|
||||
android.Manifest.permission.NETWORK_SETTINGS,
|
||||
android.Manifest.permission.NETWORK_STACK,
|
||||
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK
|
||||
})
|
||||
public void replaceFirewallChain(@FirewallChain final int chain, @NonNull final int[] uids) {
|
||||
Objects.requireNonNull(uids);
|
||||
try {
|
||||
mService.replaceFirewallChain(chain, uids);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user