Merge "Add getUidFirewallRule to ConnectivityManager"
This commit is contained in:
@@ -6035,6 +6035,30 @@ public class ConnectivityManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get firewall rule of specified firewall chain on specified uid.
|
||||
*
|
||||
* @param chain target chain.
|
||||
* @param uid target uid
|
||||
* @return either FIREWALL_RULE_ALLOW or FIREWALL_RULE_DENY
|
||||
* @throws UnsupportedOperationException if called on pre-T devices.
|
||||
* @throws ServiceSpecificException in case of failure, with an error code indicating the
|
||||
* cause of the failure.
|
||||
* @hide
|
||||
*/
|
||||
@RequiresPermission(anyOf = {
|
||||
android.Manifest.permission.NETWORK_SETTINGS,
|
||||
android.Manifest.permission.NETWORK_STACK,
|
||||
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK
|
||||
})
|
||||
public int getUidFirewallRule(@FirewallChain final int chain, final int uid) {
|
||||
try {
|
||||
return mService.getUidFirewallRule(chain, uid);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the specified firewall chain.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user