Merge "Adding a new user restriction DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI"

This commit is contained in:
Stephanie Bak
2021-11-29 20:08:38 +00:00
committed by Android (Google) Code Review
3 changed files with 26 additions and 1 deletions

View File

@@ -32393,6 +32393,7 @@ package android.os {
field public static final String DISALLOW_SET_WALLPAPER = "no_set_wallpaper";
field public static final String DISALLOW_SHARE_INTO_MANAGED_PROFILE = "no_sharing_into_profile";
field public static final String DISALLOW_SHARE_LOCATION = "no_share_location";
field public static final String DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI = "no_sharing_admin_configured_wifi";
field public static final String DISALLOW_SMS = "no_sms";
field public static final String DISALLOW_SYSTEM_ERROR_DIALOGS = "no_system_error_dialogs";
field public static final String DISALLOW_UNIFIED_PASSWORD = "no_unified_password";

View File

@@ -307,6 +307,25 @@ public class UserManager {
*/
public static final String DISALLOW_WIFI_TETHERING = "no_wifi_tethering";
/**
* Specifies if users are disallowed from sharing Wi-Fi for admin configured networks.
*
* <p>Device owner and profile owner can set this restriction.
* When it is set by any of these owners, it prevents all users from
* sharing Wi-Fi for networks configured by these owners.
* Other networks not configured by these owners are not affected.
*
* <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_SHARING_ADMIN_CONFIGURED_WIFI =
"no_sharing_admin_configured_wifi";
/**
* Specifies if a user is disallowed from changing the device
* language. The default value is <code>false</code>.
@@ -1478,6 +1497,9 @@ public class UserManager {
DISALLOW_CAMERA_TOGGLE,
KEY_RESTRICTIONS_PENDING,
DISALLOW_BIOMETRIC,
DISALLOW_CHANGE_WIFI_STATE,
DISALLOW_WIFI_TETHERING,
DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI,
})
@Retention(RetentionPolicy.SOURCE)
public @interface UserRestrictionKey {}

View File

@@ -142,7 +142,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_SHARING_ADMIN_CONFIGURED_WIFI
});
public static final Set<String> DEPRECATED_USER_RESTRICTIONS = Sets.newArraySet(