Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c74af94 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I902b2816,I284d421e

* changes:
  Add DISALLOW_AIRPLANE_MODE.
  Add DISALLOW_CONFIG_LOCATION_MODE.
parents edf829f4 5fe75dc2
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -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";
@@ -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";
+37 −0
Original line number Original line Diff line number Diff line
@@ -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.
@@ -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.
     *
     *
+6 −2
Original line number Original line Diff line number Diff line
@@ -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
    });
    });


    /**
    /**
@@ -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
    );
    );


    /**
    /**
@@ -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
    );
    );


    /**
    /**