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

Commit fe41a6e4 authored by Stephanie Bak's avatar Stephanie Bak Committed by Android (Google) Code Review
Browse files

Merge "Adding a new user restriction DISALLOW_CHANGE_WIFI_STATE"

parents 31c5dc35 983a1dda
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -32164,6 +32164,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_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";
    field public static final String DISALLOW_CONFIG_CELL_BROADCASTS = "no_config_cell_broadcasts";
+18 −0
Original line number Diff line number Diff line
@@ -269,6 +269,24 @@ public class UserManager {
     */
    public static final String DISALLOW_CONFIG_WIFI = "no_config_wifi";

    /**
     * Specifies if a user is disallowed from enabling/disabling Wi-Fi.
     *
     * <p>This restriction can only be set by a device owner,
     * a profile owner of an organization-owned managed profile on the parent profile.
     * When it is set by any of these owners, it applies globally - i.e., it disables airplane mode
     * from changing Wi-Fi state.
     *
     * <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_CHANGE_WIFI_STATE = "no_change_wifi_state";

    /**
     * Specifies if a user is disallowed from changing the device
     * language. The default value is <code>false</code>.
+6 −3
Original line number Diff line number Diff line
@@ -140,7 +140,8 @@ public class UserRestrictionsUtils {
            UserManager.DISALLOW_PRINTING,
            UserManager.DISALLOW_CONFIG_PRIVATE_DNS,
            UserManager.DISALLOW_MICROPHONE_TOGGLE,
            UserManager.DISALLOW_CAMERA_TOGGLE
            UserManager.DISALLOW_CAMERA_TOGGLE,
            UserManager.DISALLOW_CHANGE_WIFI_STATE
    });

    public static final Set<String> DEPRECATED_USER_RESTRICTIONS = Sets.newArraySet(
@@ -184,7 +185,8 @@ public class UserRestrictionsUtils {
            UserManager.DISALLOW_USER_SWITCH,
            UserManager.DISALLOW_CONFIG_PRIVATE_DNS,
            UserManager.DISALLOW_MICROPHONE_TOGGLE,
            UserManager.DISALLOW_CAMERA_TOGGLE
            UserManager.DISALLOW_CAMERA_TOGGLE,
            UserManager.DISALLOW_CHANGE_WIFI_STATE
    );

    /**
@@ -219,7 +221,8 @@ public class UserRestrictionsUtils {
            Sets.newArraySet(
                    UserManager.DISALLOW_AIRPLANE_MODE,
                    UserManager.DISALLOW_CONFIG_DATE_TIME,
                    UserManager.DISALLOW_CONFIG_PRIVATE_DNS
                    UserManager.DISALLOW_CONFIG_PRIVATE_DNS,
                    UserManager.DISALLOW_CHANGE_WIFI_STATE
    );

    /**