Add blocked reason for OEM deny firewall chains
FIREWALL_CHAIN_OEM_DENY_x chains were added by aosp/2114533 but corresponding blocked reasons were not added. Upcoming aosp/3027488 updates CS to generate blocked reasons based on bpf map contents. Without blocked reasons for oem deny chains, onBlockedStatusChanged callback will have inconsistency from the actual network blocked status. This CL adds BLOCKED_REASON_OEM_DENY for FIREWALL_CHAIN_OEM_DENY_x chains Bug: 328732146 Test: TH Change-Id: I3793aa0e231d32fea5eb202ed69e170f74d66b02
This commit is contained in:
parent
35abc9c1a2
commit
9e75aad888
3 changed files with 25 additions and 0 deletions
|
|
@ -91,3 +91,11 @@ flag {
|
|||
description: "Flag for metered network firewall chain API"
|
||||
bug: "332628891"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "blocked_reason_oem_deny_chains"
|
||||
is_exported: true
|
||||
namespace: "android_core_networking"
|
||||
description: "Flag for oem deny chains blocked reasons API"
|
||||
bug: "328732146"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ package android.net {
|
|||
field public static final int BLOCKED_REASON_LOCKDOWN_VPN = 16; // 0x10
|
||||
field public static final int BLOCKED_REASON_LOW_POWER_STANDBY = 32; // 0x20
|
||||
field public static final int BLOCKED_REASON_NONE = 0; // 0x0
|
||||
field @FlaggedApi("com.android.net.flags.blocked_reason_oem_deny_chains") public static final int BLOCKED_REASON_OEM_DENY = 128; // 0x80
|
||||
field public static final int BLOCKED_REASON_RESTRICTED_MODE = 8; // 0x8
|
||||
field @FlaggedApi("com.android.net.flags.basic_background_restrictions_enabled") public static final int FIREWALL_CHAIN_BACKGROUND = 6; // 0x6
|
||||
field public static final int FIREWALL_CHAIN_DOZABLE = 1; // 0x1
|
||||
|
|
|
|||
|
|
@ -130,6 +130,8 @@ public class ConnectivityManager {
|
|||
"com.android.net.flags.basic_background_restrictions_enabled";
|
||||
static final String METERED_NETWORK_FIREWALL_CHAINS =
|
||||
"com.android.net.flags.metered_network_firewall_chains";
|
||||
static final String BLOCKED_REASON_OEM_DENY_CHAINS =
|
||||
"com.android.net.flags.blocked_reason_oem_deny_chains";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -912,6 +914,19 @@ public class ConnectivityManager {
|
|||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final int BLOCKED_REASON_APP_BACKGROUND = 1 << 6;
|
||||
|
||||
/**
|
||||
* Flag to indicate that an app is subject to OEM-specific application restrictions that would
|
||||
* result in its network access being blocked.
|
||||
*
|
||||
* @see #FIREWALL_CHAIN_OEM_DENY_1
|
||||
* @see #FIREWALL_CHAIN_OEM_DENY_2
|
||||
* @see #FIREWALL_CHAIN_OEM_DENY_3
|
||||
* @hide
|
||||
*/
|
||||
@FlaggedApi(Flags.BLOCKED_REASON_OEM_DENY_CHAINS)
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final int BLOCKED_REASON_OEM_DENY = 1 << 7;
|
||||
|
||||
/**
|
||||
* Flag to indicate that an app is subject to Data saver restrictions that would
|
||||
* result in its metered network access being blocked.
|
||||
|
|
@ -952,6 +967,7 @@ public class ConnectivityManager {
|
|||
BLOCKED_REASON_LOCKDOWN_VPN,
|
||||
BLOCKED_REASON_LOW_POWER_STANDBY,
|
||||
BLOCKED_REASON_APP_BACKGROUND,
|
||||
BLOCKED_REASON_OEM_DENY,
|
||||
BLOCKED_METERED_REASON_DATA_SAVER,
|
||||
BLOCKED_METERED_REASON_USER_RESTRICTED,
|
||||
BLOCKED_METERED_REASON_ADMIN_DISABLED,
|
||||
|
|
|
|||
Loading…
Reference in a new issue