Loading core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -32238,6 +32238,7 @@ package android.os { field public static final String DISALLOW_BLUETOOTH = "no_bluetooth"; field public static final String DISALLOW_BLUETOOTH_SHARING = "no_bluetooth_sharing"; field public static final String DISALLOW_CAMERA_TOGGLE = "disallow_camera_toggle"; field public static final String DISALLOW_CELLULAR_2G = "no_cellular_2g"; field public static final String DISALLOW_CHANGE_WIFI_STATE = "no_change_wifi_state"; field public static final String DISALLOW_CONFIG_BLUETOOTH = "no_config_bluetooth"; field public static final String DISALLOW_CONFIG_BRIGHTNESS = "no_config_brightness"; core/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -13553,6 +13553,7 @@ package android.telephony { field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED"; field public static final int ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G = 3; // 0x3 field public static final int ALLOWED_NETWORK_TYPES_REASON_POWER = 1; // 0x1 field public static final int ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS = 4; // 0x4 field public static final int CALL_WAITING_STATUS_DISABLED = 2; // 0x2 field public static final int CALL_WAITING_STATUS_ENABLED = 1; // 0x1 field public static final int CALL_WAITING_STATUS_FDN_CHECK_FAILURE = 5; // 0x5 core/java/android/os/UserManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -1484,6 +1484,22 @@ public class UserManager { */ public static final String KEY_RESTRICTIONS_PENDING = "restrictions_pending"; /** * Specifies if a user is not allowed to use 2g networks. * * <p>This restriction can only be set by a device owner or a profile owner of an * organization-owned managed profile on the parent profile. * In all cases, the setting applies globally on the device and will prevent the device from * scanning for or connecting to 2g networks, except in the case of an emergency. * * <p>The default value is <code>false</code>. * * @see DevicePolicyManager#addUserRestriction(ComponentName, String) * @see DevicePolicyManager#clearUserRestriction(ComponentName, String) * @see #getUserRestrictions() */ public static final String DISALLOW_CELLULAR_2G = "no_cellular_2g"; /** * List of key values that can be passed into the various user restriction related methods * in {@link UserManager} & {@link DevicePolicyManager}. Loading Loading @@ -1565,6 +1581,7 @@ public class UserManager { DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI, DISALLOW_WIFI_DIRECT, DISALLOW_ADD_WIFI_CONFIG, DISALLOW_CELLULAR_2G, }) @Retention(RetentionPolicy.SOURCE) public @interface UserRestrictionKey {} Loading services/core/java/com/android/server/pm/UserRestrictionsUtils.java +6 −3 Original line number Diff line number Diff line Loading @@ -147,7 +147,8 @@ public class UserRestrictionsUtils { UserManager.DISALLOW_WIFI_TETHERING, UserManager.DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI, UserManager.DISALLOW_WIFI_DIRECT, UserManager.DISALLOW_ADD_WIFI_CONFIG UserManager.DISALLOW_ADD_WIFI_CONFIG, UserManager.DISALLOW_CELLULAR_2G }); public static final Set<String> DEPRECATED_USER_RESTRICTIONS = Sets.newArraySet( Loading Loading @@ -195,7 +196,8 @@ public class UserRestrictionsUtils { UserManager.DISALLOW_CHANGE_WIFI_STATE, UserManager.DISALLOW_WIFI_TETHERING, UserManager.DISALLOW_WIFI_DIRECT, UserManager.DISALLOW_ADD_WIFI_CONFIG UserManager.DISALLOW_ADD_WIFI_CONFIG, UserManager.DISALLOW_CELLULAR_2G ); /** Loading Loading @@ -234,7 +236,8 @@ public class UserRestrictionsUtils { UserManager.DISALLOW_CHANGE_WIFI_STATE, UserManager.DISALLOW_WIFI_TETHERING, UserManager.DISALLOW_WIFI_DIRECT, UserManager.DISALLOW_ADD_WIFI_CONFIG UserManager.DISALLOW_ADD_WIFI_CONFIG, UserManager.DISALLOW_CELLULAR_2G ); /** Loading telephony/java/android/telephony/TelephonyManager.java +12 −1 Original line number Diff line number Diff line Loading @@ -9358,7 +9358,8 @@ public class TelephonyManager { ALLOWED_NETWORK_TYPES_REASON_USER, ALLOWED_NETWORK_TYPES_REASON_POWER, ALLOWED_NETWORK_TYPES_REASON_CARRIER, ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G, ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS, }) @Retention(RetentionPolicy.SOURCE) public @interface AllowedNetworkTypesReason { Loading Loading @@ -9396,6 +9397,15 @@ public class TelephonyManager { @SystemApi public static final int ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G = 3; /** * To indicate allowed network type change is requested by an update to the * {@link android.os.UserManager.DISALLOW_CELLULAR_2G} user restriction. * * @hide */ @SystemApi public static final int ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS = 4; /** * Set the allowed network types of the device and provide the reason triggering the allowed * network change. Loading Loading @@ -9488,6 +9498,7 @@ public class TelephonyManager { case TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_POWER: case TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_CARRIER: case TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G: case ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS: return true; } return false; Loading Loading
core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -32238,6 +32238,7 @@ package android.os { field public static final String DISALLOW_BLUETOOTH = "no_bluetooth"; field public static final String DISALLOW_BLUETOOTH_SHARING = "no_bluetooth_sharing"; field public static final String DISALLOW_CAMERA_TOGGLE = "disallow_camera_toggle"; field public static final String DISALLOW_CELLULAR_2G = "no_cellular_2g"; field public static final String DISALLOW_CHANGE_WIFI_STATE = "no_change_wifi_state"; field public static final String DISALLOW_CONFIG_BLUETOOTH = "no_config_bluetooth"; field public static final String DISALLOW_CONFIG_BRIGHTNESS = "no_config_brightness";
core/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -13553,6 +13553,7 @@ package android.telephony { field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED"; field public static final int ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G = 3; // 0x3 field public static final int ALLOWED_NETWORK_TYPES_REASON_POWER = 1; // 0x1 field public static final int ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS = 4; // 0x4 field public static final int CALL_WAITING_STATUS_DISABLED = 2; // 0x2 field public static final int CALL_WAITING_STATUS_ENABLED = 1; // 0x1 field public static final int CALL_WAITING_STATUS_FDN_CHECK_FAILURE = 5; // 0x5
core/java/android/os/UserManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -1484,6 +1484,22 @@ public class UserManager { */ public static final String KEY_RESTRICTIONS_PENDING = "restrictions_pending"; /** * Specifies if a user is not allowed to use 2g networks. * * <p>This restriction can only be set by a device owner or a profile owner of an * organization-owned managed profile on the parent profile. * In all cases, the setting applies globally on the device and will prevent the device from * scanning for or connecting to 2g networks, except in the case of an emergency. * * <p>The default value is <code>false</code>. * * @see DevicePolicyManager#addUserRestriction(ComponentName, String) * @see DevicePolicyManager#clearUserRestriction(ComponentName, String) * @see #getUserRestrictions() */ public static final String DISALLOW_CELLULAR_2G = "no_cellular_2g"; /** * List of key values that can be passed into the various user restriction related methods * in {@link UserManager} & {@link DevicePolicyManager}. Loading Loading @@ -1565,6 +1581,7 @@ public class UserManager { DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI, DISALLOW_WIFI_DIRECT, DISALLOW_ADD_WIFI_CONFIG, DISALLOW_CELLULAR_2G, }) @Retention(RetentionPolicy.SOURCE) public @interface UserRestrictionKey {} Loading
services/core/java/com/android/server/pm/UserRestrictionsUtils.java +6 −3 Original line number Diff line number Diff line Loading @@ -147,7 +147,8 @@ public class UserRestrictionsUtils { UserManager.DISALLOW_WIFI_TETHERING, UserManager.DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI, UserManager.DISALLOW_WIFI_DIRECT, UserManager.DISALLOW_ADD_WIFI_CONFIG UserManager.DISALLOW_ADD_WIFI_CONFIG, UserManager.DISALLOW_CELLULAR_2G }); public static final Set<String> DEPRECATED_USER_RESTRICTIONS = Sets.newArraySet( Loading Loading @@ -195,7 +196,8 @@ public class UserRestrictionsUtils { UserManager.DISALLOW_CHANGE_WIFI_STATE, UserManager.DISALLOW_WIFI_TETHERING, UserManager.DISALLOW_WIFI_DIRECT, UserManager.DISALLOW_ADD_WIFI_CONFIG UserManager.DISALLOW_ADD_WIFI_CONFIG, UserManager.DISALLOW_CELLULAR_2G ); /** Loading Loading @@ -234,7 +236,8 @@ public class UserRestrictionsUtils { UserManager.DISALLOW_CHANGE_WIFI_STATE, UserManager.DISALLOW_WIFI_TETHERING, UserManager.DISALLOW_WIFI_DIRECT, UserManager.DISALLOW_ADD_WIFI_CONFIG UserManager.DISALLOW_ADD_WIFI_CONFIG, UserManager.DISALLOW_CELLULAR_2G ); /** Loading
telephony/java/android/telephony/TelephonyManager.java +12 −1 Original line number Diff line number Diff line Loading @@ -9358,7 +9358,8 @@ public class TelephonyManager { ALLOWED_NETWORK_TYPES_REASON_USER, ALLOWED_NETWORK_TYPES_REASON_POWER, ALLOWED_NETWORK_TYPES_REASON_CARRIER, ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G, ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS, }) @Retention(RetentionPolicy.SOURCE) public @interface AllowedNetworkTypesReason { Loading Loading @@ -9396,6 +9397,15 @@ public class TelephonyManager { @SystemApi public static final int ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G = 3; /** * To indicate allowed network type change is requested by an update to the * {@link android.os.UserManager.DISALLOW_CELLULAR_2G} user restriction. * * @hide */ @SystemApi public static final int ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS = 4; /** * Set the allowed network types of the device and provide the reason triggering the allowed * network change. Loading Loading @@ -9488,6 +9498,7 @@ public class TelephonyManager { case TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_POWER: case TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_CARRIER: case TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G: case ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS: return true; } return false; Loading