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

Commit 7fc3c848 authored by Nikhil Kumar's avatar Nikhil Kumar
Browse files

Expand DISALLOW_GRANT_ADMIN restriction

Expand the functionality of DISALLOW_GRANT_ADMIN to include the following:

If applied to a user without admin privileges, it functions as before (prevents them from gaining admin rights).
If applied to a user with existing admin privileges, it additionally won't let the user give admin access to other users.

Test: only java doc change
Bug: 341695742
Flags: only java doc change
Change-Id: I33b7000690af45407f3f52d41132da92dacdedba
parent d59e10ca
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -368,17 +368,18 @@ public class UserManager {
    public static final String DISALLOW_WIFI_TETHERING = "no_wifi_tethering";

    /**
     * Specifies if a user is disallowed from being granted admin privileges.
     * Restricts a user's ability to possess or grant admin privileges.
     *
     * <p>This restriction limits ability of other admin users to grant admin
     * privileges to selected user.
     * <p>When set to <code>true</code>, this prevents the user from:
     *     <ul>
     *         <li>Becoming an admin</li>
     *         <li>Giving other users admin privileges</li>
     *     </ul>
     *
     * <p>This restriction has no effect in a mode that does not allow multiple admins.
     * <p>This restriction is only effective in environments where multiple admins are allowed.
     *
     * <p>The default value is <code>false</code>.
     * <p>Key for user restrictions. Type: Boolean. Default: <code>false</code>.
     *
     * <p>Key for user restrictions.
     * <p>Type: Boolean
     * @see DevicePolicyManager#addUserRestriction(ComponentName, String)
     * @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
     * @see #getUserRestrictions()