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

Commit c979c465 authored by Tetiana Meronyk's avatar Tetiana Meronyk
Browse files

Add restriction to prevent a user being made an admin

Bug: 261700461
Test: manual
Change-Id: I075c5d92665db13cdc4a575daf88848f5a4f5161
parent 1d66400e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -33245,6 +33245,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";
+18 −0
Original line number Diff line number Diff line
@@ -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.
     *
+1 −0
Original line number Diff line number Diff line
@@ -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,