Merge "Add restriction to prevent a user being made an admin"

This commit is contained in:
Tetiana Meronyk
2023-01-17 18:51:47 +00:00
committed by Android (Google) Code Review
3 changed files with 20 additions and 0 deletions

View File

@@ -33243,6 +33243,7 @@ package android.os {
field public static final String DISALLOW_DEBUGGING_FEATURES = "no_debugging_features";
field public static final String DISALLOW_FACTORY_RESET = "no_factory_reset";
field public static final String DISALLOW_FUN = "no_fun";
field public static final String DISALLOW_GRANT_ADMIN = "no_grant_admin";
field public static final String DISALLOW_INSTALL_APPS = "no_install_apps";
field public static final String DISALLOW_INSTALL_UNKNOWN_SOURCES = "no_install_unknown_sources";
field public static final String DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY = "no_install_unknown_sources_globally";

View File

@@ -322,6 +322,24 @@ public class UserManager {
*/
public static final String DISALLOW_WIFI_TETHERING = "no_wifi_tethering";
/**
* Specifies if a user is disallowed from being granted admin privileges.
*
* <p>This restriction limits ability of other admin users to grant admin
* privileges to selected user.
*
* <p>This restriction has no effect in a mode that does not allow multiple admins.
*
* <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_GRANT_ADMIN = "no_grant_admin";
/**
* Specifies if users are disallowed from sharing Wi-Fi for admin configured networks.
*

View File

@@ -145,6 +145,7 @@ public class UserRestrictionsUtils {
UserManager.DISALLOW_CAMERA_TOGGLE,
UserManager.DISALLOW_CHANGE_WIFI_STATE,
UserManager.DISALLOW_WIFI_TETHERING,
UserManager.DISALLOW_GRANT_ADMIN,
UserManager.DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI,
UserManager.DISALLOW_WIFI_DIRECT,
UserManager.DISALLOW_ADD_WIFI_CONFIG,