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

Commit 68d8d15a authored by Adam Bookatz's avatar Adam Bookatz
Browse files

Clarify "enabled" in UserManager

Further documentation is added to clarify the commonly confused notion
of a disabled profile.

Test: none (just javadoc)
Change-Id: I0db87722748b8226174cecebbe5b1836501e2726
parent e27fe837
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -112,6 +112,12 @@ public class UserInfo implements Parcelable {
    /**
     * Indicates that this user is disabled.
     *
     * <p> This is currently used to indicate that a Managed Profile, when created via
     * DevicePolicyManager, has not yet been provisioned; once the DPC provisions it, a DPM call
     * will manually set it to enabled.
     *
     * <p>Users that are slated for deletion are also generally set to disabled.
     *
     * <p>Note: If an ephemeral user is disabled, it shouldn't be later re-enabled. Ephemeral users
     * are disabled as their removal is in progress to indicate that they shouldn't be re-entered.
     */
@@ -398,6 +404,7 @@ public class UserInfo implements Parcelable {
        return UserManager.isUserTypePrivateProfile(userType);
    }

    /** See {@link #FLAG_DISABLED}*/
    @UnsupportedAppUsage
    public boolean isEnabled() {
        return (flags & FLAG_DISABLED) != FLAG_DISABLED;
+4 −1
Original line number Diff line number Diff line
@@ -4641,6 +4641,9 @@ public class UserManager {
     * Sets the user as enabled, if such an user exists.
     *
     * <p>Note that the default is true, it's only that managed profiles might not be enabled.
     * (Managed profiles created by DevicePolicyManager will start out disabled, and DPM will later
     * toggle them to enabled once they are provisioned. This is the primary purpose of the
     * {@link UserInfo#FLAG_DISABLED} flag.)
     * Also ephemeral users can be disabled to indicate that their removal is in progress and they
     * shouldn't be re-entered. Therefore ephemeral users should not be re-enabled once disabled.
     *
@@ -5192,7 +5195,7 @@ public class UserManager {

    /**
     * Returns list of the profiles of userId including userId itself.
     * Note that this returns only enabled.
     * Note that this returns only {@link UserInfo#isEnabled() enabled} profiles.
     * <p>Note that this includes all profile types (not including Restricted profiles).
     *
     * <p>Requires {@link android.Manifest.permission#MANAGE_USERS} or