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

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

Merge "Adding new user restrictions - DISALLOW_WIFI_DIRECT, DISALLOW_ADD_WIFI_CONFIG"

parents 9f360735 04191437
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -32503,6 +32503,7 @@ package android.os {
    field public static final String ALLOW_PARENT_PROFILE_APP_LINKING = "allow_parent_profile_app_linking";
    field @Deprecated public static final String DISALLOW_ADD_MANAGED_PROFILE = "no_add_managed_profile";
    field public static final String DISALLOW_ADD_USER = "no_add_user";
    field public static final String DISALLOW_ADD_WIFI_CONFIG = "no_add_wifi_config";
    field public static final String DISALLOW_ADJUST_VOLUME = "no_adjust_volume";
    field public static final String DISALLOW_AIRPLANE_MODE = "no_airplane_mode";
    field public static final String DISALLOW_AMBIENT_DISPLAY = "no_ambient_display";
@@ -32558,6 +32559,7 @@ package android.os {
    field public static final String DISALLOW_UNMUTE_MICROPHONE = "no_unmute_microphone";
    field public static final String DISALLOW_USB_FILE_TRANSFER = "no_usb_file_transfer";
    field public static final String DISALLOW_USER_SWITCH = "no_user_switch";
    field public static final String DISALLOW_WIFI_DIRECT = "no_wifi_direct";
    field public static final String DISALLOW_WIFI_TETHERING = "no_wifi_tethering";
    field public static final String ENSURE_VERIFY_APPS = "ensure_verify_apps";
    field public static final String KEY_RESTRICTIONS_PENDING = "restrictions_pending";
+39 −0
Original line number Diff line number Diff line
@@ -326,6 +326,43 @@ public class UserManager {
    public static final String DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI =
            "no_sharing_admin_configured_wifi";

    /**
     * Specifies if a user is disallowed from using Wi-Fi Direct.
     *
     * <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 prevents all users from using
     * Wi-Fi Direct.
     *
     * <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_WIFI_DIRECT = "no_wifi_direct";

    /**
     * Specifies if a user is disallowed from adding a new Wi-Fi configuration.
     *
     * <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 prevents all users from adding
     * a new Wi-Fi configuration. This does not limit the owner and carrier's ability
     * to add a new configuration.
     *
     * <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_ADD_WIFI_CONFIG = "no_add_wifi_config";

    /**
     * Specifies if a user is disallowed from changing the device
     * language. The default value is <code>false</code>.
@@ -1500,6 +1537,8 @@ public class UserManager {
            DISALLOW_CHANGE_WIFI_STATE,
            DISALLOW_WIFI_TETHERING,
            DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI,
            DISALLOW_WIFI_DIRECT,
            DISALLOW_ADD_WIFI_CONFIG,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface UserRestrictionKey {}
+9 −4
Original line number Diff line number Diff line
@@ -143,8 +143,9 @@ public class UserRestrictionsUtils {
            UserManager.DISALLOW_CAMERA_TOGGLE,
            UserManager.DISALLOW_CHANGE_WIFI_STATE,
            UserManager.DISALLOW_WIFI_TETHERING,
            UserManager.DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI

            UserManager.DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI,
            UserManager.DISALLOW_WIFI_DIRECT,
            UserManager.DISALLOW_ADD_WIFI_CONFIG
    });

    public static final Set<String> DEPRECATED_USER_RESTRICTIONS = Sets.newArraySet(
@@ -190,7 +191,9 @@ public class UserRestrictionsUtils {
            UserManager.DISALLOW_MICROPHONE_TOGGLE,
            UserManager.DISALLOW_CAMERA_TOGGLE,
            UserManager.DISALLOW_CHANGE_WIFI_STATE,
            UserManager.DISALLOW_WIFI_TETHERING
            UserManager.DISALLOW_WIFI_TETHERING,
            UserManager.DISALLOW_WIFI_DIRECT,
            UserManager.DISALLOW_ADD_WIFI_CONFIG
    );

    /**
@@ -227,7 +230,9 @@ public class UserRestrictionsUtils {
                    UserManager.DISALLOW_CONFIG_DATE_TIME,
                    UserManager.DISALLOW_CONFIG_PRIVATE_DNS,
                    UserManager.DISALLOW_CHANGE_WIFI_STATE,
                    UserManager.DISALLOW_WIFI_TETHERING
                    UserManager.DISALLOW_WIFI_TETHERING,
                    UserManager.DISALLOW_WIFI_DIRECT,
                    UserManager.DISALLOW_ADD_WIFI_CONFIG
    );

    /**