Loading api/current.txt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -32275,6 +32275,7 @@ package android.os { field public static final java.lang.String DISALLOW_ADD_MANAGED_PROFILE = "no_add_managed_profile"; field public static final java.lang.String DISALLOW_ADD_MANAGED_PROFILE = "no_add_managed_profile"; field public static final java.lang.String DISALLOW_ADD_USER = "no_add_user"; field public static final java.lang.String DISALLOW_ADD_USER = "no_add_user"; field public static final java.lang.String DISALLOW_ADJUST_VOLUME = "no_adjust_volume"; field public static final java.lang.String DISALLOW_ADJUST_VOLUME = "no_adjust_volume"; field public static final java.lang.String DISALLOW_AIRPLANE_MODE = "no_airplane_mode"; field public static final java.lang.String DISALLOW_APPS_CONTROL = "no_control_apps"; field public static final java.lang.String DISALLOW_APPS_CONTROL = "no_control_apps"; field public static final java.lang.String DISALLOW_AUTOFILL = "no_autofill"; field public static final java.lang.String DISALLOW_AUTOFILL = "no_autofill"; field public static final java.lang.String DISALLOW_BLUETOOTH = "no_bluetooth"; field public static final java.lang.String DISALLOW_BLUETOOTH = "no_bluetooth"; Loading @@ -32284,6 +32285,7 @@ package android.os { field public static final java.lang.String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials"; field public static final java.lang.String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials"; field public static final java.lang.String DISALLOW_CONFIG_DATE_TIME = "no_config_date_time"; field public static final java.lang.String DISALLOW_CONFIG_DATE_TIME = "no_config_date_time"; field public static final java.lang.String DISALLOW_CONFIG_LOCALE = "no_config_locale"; field public static final java.lang.String DISALLOW_CONFIG_LOCALE = "no_config_locale"; field public static final java.lang.String DISALLOW_CONFIG_LOCATION_MODE = "no_config_location_mode"; field public static final java.lang.String DISALLOW_CONFIG_MOBILE_NETWORKS = "no_config_mobile_networks"; field public static final java.lang.String DISALLOW_CONFIG_MOBILE_NETWORKS = "no_config_mobile_networks"; field public static final java.lang.String DISALLOW_CONFIG_TETHERING = "no_config_tethering"; field public static final java.lang.String DISALLOW_CONFIG_TETHERING = "no_config_tethering"; field public static final java.lang.String DISALLOW_CONFIG_VPN = "no_config_vpn"; field public static final java.lang.String DISALLOW_CONFIG_VPN = "no_config_vpn"; core/java/android/os/UserManager.java +37 −0 Original line number Original line Diff line number Diff line Loading @@ -193,6 +193,21 @@ public class UserManager { */ */ public static final String DISALLOW_SHARE_LOCATION = "no_share_location"; public static final String DISALLOW_SHARE_LOCATION = "no_share_location"; /** * Specifies if airplane mode is disallowed on the device. * * <p> This restriction can only be set by the device owner and the profile owner on the * primary user and it applies globally - i.e. it disables airplane mode on the entire device. * <p>The default value is <code>false</code>. * * <p>Key for user restrictions. * <p>Type: Boolean * @see DevicePolicyManager#addUserRestriction(ComponentName, String) * @see DevicePolicyManager#clearUserRestriction(ComponentName, String) * @see #getUserRestrictions() */ public static final String DISALLOW_AIRPLANE_MODE = "no_airplane_mode"; /** /** * Specifies if a user is disallowed from enabling the * Specifies if a user is disallowed from enabling the * "Unknown Sources" setting, that allows installation of apps from unknown sources. * "Unknown Sources" setting, that allows installation of apps from unknown sources. Loading Loading @@ -334,6 +349,28 @@ public class UserManager { */ */ public static final String DISALLOW_CONFIG_VPN = "no_config_vpn"; public static final String DISALLOW_CONFIG_VPN = "no_config_vpn"; /** * Specifies if a user is disallowed from configuring location mode. Device owner and profile * owners can set this restriction and it only applies on the managed user. * * <p>In a managed profile, location sharing is forced off when it's off on primary user, so * user can still turn off location sharing on managed profile when the restriction is set by * profile owner on managed profile. * * <p>This user restriction is different from {@link #DISALLOW_SHARE_LOCATION}, * as the device owner or profile owner can still enable or disable location mode via * {@link DevicePolicyManager#setSecureSetting} when this restriction is on. * * <p>The default value is <code>false</code>. * * <p>Key for user restrictions. * <p>Type: Boolean * @see DevicePolicyManager#addUserRestriction(ComponentName, String) * @see DevicePolicyManager#clearUserRestriction(ComponentName, String) * @see #getUserRestrictions() */ public static final String DISALLOW_CONFIG_LOCATION_MODE = "no_config_location_mode"; /** /** * Specifies if date, time and timezone configuring is disallowed. * Specifies if date, time and timezone configuring is disallowed. * * Loading services/core/java/com/android/server/pm/UserRestrictionsUtils.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -115,6 +115,8 @@ public class UserRestrictionsUtils { UserManager.DISALLOW_AUTOFILL, UserManager.DISALLOW_AUTOFILL, UserManager.DISALLOW_USER_SWITCH, UserManager.DISALLOW_USER_SWITCH, UserManager.DISALLOW_UNIFIED_PASSWORD, UserManager.DISALLOW_UNIFIED_PASSWORD, UserManager.DISALLOW_CONFIG_LOCATION_MODE, UserManager.DISALLOW_AIRPLANE_MODE }); }); /** /** Loading Loading @@ -142,7 +144,8 @@ public class UserRestrictionsUtils { UserManager.DISALLOW_FUN, UserManager.DISALLOW_FUN, UserManager.DISALLOW_SAFE_BOOT, UserManager.DISALLOW_SAFE_BOOT, UserManager.DISALLOW_CREATE_WINDOWS, UserManager.DISALLOW_CREATE_WINDOWS, UserManager.DISALLOW_DATA_ROAMING UserManager.DISALLOW_DATA_ROAMING, UserManager.DISALLOW_AIRPLANE_MODE ); ); /** /** Loading Loading @@ -197,7 +200,8 @@ public class UserRestrictionsUtils { * Special user restrictions that are always applied to all users no matter who sets them. * Special user restrictions that are always applied to all users no matter who sets them. */ */ private static final Set<String> PROFILE_GLOBAL_RESTRICTIONS = Sets.newArraySet( private static final Set<String> PROFILE_GLOBAL_RESTRICTIONS = Sets.newArraySet( UserManager.ENSURE_VERIFY_APPS UserManager.ENSURE_VERIFY_APPS, UserManager.DISALLOW_AIRPLANE_MODE ); ); /** /** Loading Loading
api/current.txt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -32275,6 +32275,7 @@ package android.os { field public static final java.lang.String DISALLOW_ADD_MANAGED_PROFILE = "no_add_managed_profile"; field public static final java.lang.String DISALLOW_ADD_MANAGED_PROFILE = "no_add_managed_profile"; field public static final java.lang.String DISALLOW_ADD_USER = "no_add_user"; field public static final java.lang.String DISALLOW_ADD_USER = "no_add_user"; field public static final java.lang.String DISALLOW_ADJUST_VOLUME = "no_adjust_volume"; field public static final java.lang.String DISALLOW_ADJUST_VOLUME = "no_adjust_volume"; field public static final java.lang.String DISALLOW_AIRPLANE_MODE = "no_airplane_mode"; field public static final java.lang.String DISALLOW_APPS_CONTROL = "no_control_apps"; field public static final java.lang.String DISALLOW_APPS_CONTROL = "no_control_apps"; field public static final java.lang.String DISALLOW_AUTOFILL = "no_autofill"; field public static final java.lang.String DISALLOW_AUTOFILL = "no_autofill"; field public static final java.lang.String DISALLOW_BLUETOOTH = "no_bluetooth"; field public static final java.lang.String DISALLOW_BLUETOOTH = "no_bluetooth"; Loading @@ -32284,6 +32285,7 @@ package android.os { field public static final java.lang.String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials"; field public static final java.lang.String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials"; field public static final java.lang.String DISALLOW_CONFIG_DATE_TIME = "no_config_date_time"; field public static final java.lang.String DISALLOW_CONFIG_DATE_TIME = "no_config_date_time"; field public static final java.lang.String DISALLOW_CONFIG_LOCALE = "no_config_locale"; field public static final java.lang.String DISALLOW_CONFIG_LOCALE = "no_config_locale"; field public static final java.lang.String DISALLOW_CONFIG_LOCATION_MODE = "no_config_location_mode"; field public static final java.lang.String DISALLOW_CONFIG_MOBILE_NETWORKS = "no_config_mobile_networks"; field public static final java.lang.String DISALLOW_CONFIG_MOBILE_NETWORKS = "no_config_mobile_networks"; field public static final java.lang.String DISALLOW_CONFIG_TETHERING = "no_config_tethering"; field public static final java.lang.String DISALLOW_CONFIG_TETHERING = "no_config_tethering"; field public static final java.lang.String DISALLOW_CONFIG_VPN = "no_config_vpn"; field public static final java.lang.String DISALLOW_CONFIG_VPN = "no_config_vpn";
core/java/android/os/UserManager.java +37 −0 Original line number Original line Diff line number Diff line Loading @@ -193,6 +193,21 @@ public class UserManager { */ */ public static final String DISALLOW_SHARE_LOCATION = "no_share_location"; public static final String DISALLOW_SHARE_LOCATION = "no_share_location"; /** * Specifies if airplane mode is disallowed on the device. * * <p> This restriction can only be set by the device owner and the profile owner on the * primary user and it applies globally - i.e. it disables airplane mode on the entire device. * <p>The default value is <code>false</code>. * * <p>Key for user restrictions. * <p>Type: Boolean * @see DevicePolicyManager#addUserRestriction(ComponentName, String) * @see DevicePolicyManager#clearUserRestriction(ComponentName, String) * @see #getUserRestrictions() */ public static final String DISALLOW_AIRPLANE_MODE = "no_airplane_mode"; /** /** * Specifies if a user is disallowed from enabling the * Specifies if a user is disallowed from enabling the * "Unknown Sources" setting, that allows installation of apps from unknown sources. * "Unknown Sources" setting, that allows installation of apps from unknown sources. Loading Loading @@ -334,6 +349,28 @@ public class UserManager { */ */ public static final String DISALLOW_CONFIG_VPN = "no_config_vpn"; public static final String DISALLOW_CONFIG_VPN = "no_config_vpn"; /** * Specifies if a user is disallowed from configuring location mode. Device owner and profile * owners can set this restriction and it only applies on the managed user. * * <p>In a managed profile, location sharing is forced off when it's off on primary user, so * user can still turn off location sharing on managed profile when the restriction is set by * profile owner on managed profile. * * <p>This user restriction is different from {@link #DISALLOW_SHARE_LOCATION}, * as the device owner or profile owner can still enable or disable location mode via * {@link DevicePolicyManager#setSecureSetting} when this restriction is on. * * <p>The default value is <code>false</code>. * * <p>Key for user restrictions. * <p>Type: Boolean * @see DevicePolicyManager#addUserRestriction(ComponentName, String) * @see DevicePolicyManager#clearUserRestriction(ComponentName, String) * @see #getUserRestrictions() */ public static final String DISALLOW_CONFIG_LOCATION_MODE = "no_config_location_mode"; /** /** * Specifies if date, time and timezone configuring is disallowed. * Specifies if date, time and timezone configuring is disallowed. * * Loading
services/core/java/com/android/server/pm/UserRestrictionsUtils.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -115,6 +115,8 @@ public class UserRestrictionsUtils { UserManager.DISALLOW_AUTOFILL, UserManager.DISALLOW_AUTOFILL, UserManager.DISALLOW_USER_SWITCH, UserManager.DISALLOW_USER_SWITCH, UserManager.DISALLOW_UNIFIED_PASSWORD, UserManager.DISALLOW_UNIFIED_PASSWORD, UserManager.DISALLOW_CONFIG_LOCATION_MODE, UserManager.DISALLOW_AIRPLANE_MODE }); }); /** /** Loading Loading @@ -142,7 +144,8 @@ public class UserRestrictionsUtils { UserManager.DISALLOW_FUN, UserManager.DISALLOW_FUN, UserManager.DISALLOW_SAFE_BOOT, UserManager.DISALLOW_SAFE_BOOT, UserManager.DISALLOW_CREATE_WINDOWS, UserManager.DISALLOW_CREATE_WINDOWS, UserManager.DISALLOW_DATA_ROAMING UserManager.DISALLOW_DATA_ROAMING, UserManager.DISALLOW_AIRPLANE_MODE ); ); /** /** Loading Loading @@ -197,7 +200,8 @@ public class UserRestrictionsUtils { * Special user restrictions that are always applied to all users no matter who sets them. * Special user restrictions that are always applied to all users no matter who sets them. */ */ private static final Set<String> PROFILE_GLOBAL_RESTRICTIONS = Sets.newArraySet( private static final Set<String> PROFILE_GLOBAL_RESTRICTIONS = Sets.newArraySet( UserManager.ENSURE_VERIFY_APPS UserManager.ENSURE_VERIFY_APPS, UserManager.DISALLOW_AIRPLANE_MODE ); ); /** /** Loading