Merge "Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
eb04adf4bc
@@ -829,6 +829,94 @@ public class ConnectivityManager {
|
||||
})
|
||||
public @interface PrivateDnsMode {}
|
||||
|
||||
/**
|
||||
* Flag to indicate that an app is not subject to any restrictions that could result in its
|
||||
* network access blocked.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final int BLOCKED_REASON_NONE = 0;
|
||||
|
||||
/**
|
||||
* Flag to indicate that an app is subject to Battery saver restrictions that would
|
||||
* result in its network access being blocked.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final int BLOCKED_REASON_BATTERY_SAVER = 1 << 0;
|
||||
|
||||
/**
|
||||
* Flag to indicate that an app is subject to Doze restrictions that would
|
||||
* result in its network access being blocked.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final int BLOCKED_REASON_DOZE = 1 << 1;
|
||||
|
||||
/**
|
||||
* Flag to indicate that an app is subject to App Standby restrictions that would
|
||||
* result in its network access being blocked.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final int BLOCKED_REASON_APP_STANDBY = 1 << 2;
|
||||
|
||||
/**
|
||||
* Flag to indicate that an app is subject to Restricted mode restrictions that would
|
||||
* result in its network access being blocked.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final int BLOCKED_REASON_RESTRICTED_MODE = 1 << 3;
|
||||
|
||||
/**
|
||||
* Flag to indicate that an app is subject to Data saver restrictions that would
|
||||
* result in its metered network access being blocked.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final int BLOCKED_METERED_REASON_DATA_SAVER = 1 << 16;
|
||||
|
||||
/**
|
||||
* Flag to indicate that an app is subject to user restrictions that would
|
||||
* result in its metered network access being blocked.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final int BLOCKED_METERED_REASON_USER_RESTRICTED = 1 << 17;
|
||||
|
||||
/**
|
||||
* Flag to indicate that an app is subject to Device admin restrictions that would
|
||||
* result in its metered network access being blocked.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final int BLOCKED_METERED_REASON_ADMIN_DISABLED = 1 << 18;
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef(flag = true, prefix = {"BLOCKED_"}, value = {
|
||||
BLOCKED_REASON_NONE,
|
||||
BLOCKED_REASON_BATTERY_SAVER,
|
||||
BLOCKED_REASON_DOZE,
|
||||
BLOCKED_REASON_APP_STANDBY,
|
||||
BLOCKED_REASON_RESTRICTED_MODE,
|
||||
BLOCKED_METERED_REASON_DATA_SAVER,
|
||||
BLOCKED_METERED_REASON_USER_RESTRICTED,
|
||||
BLOCKED_METERED_REASON_ADMIN_DISABLED,
|
||||
})
|
||||
public @interface BlockedReason {}
|
||||
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
|
||||
private final IConnectivityManager mService;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user