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

Commit 196d365b authored by Tetiana Meronyk's avatar Tetiana Meronyk Committed by Android Build Coastguard Worker
Browse files

Revert "Disable multiuser toggle on COPE device and add explanat..."

Revert submission 25262217-fix_mu_for_cope

Reason for revert: This issue requires a different approach to the solution.

Reverted changes: /q/submissionid:25262217-fix_mu_for_cope
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:dc85914ab2050586512b7867bfc27816ddb025c8)
Merged-In: Ic16676a15278b944ab2a3a6535032c37e5ece624
Change-Id: Ic16676a15278b944ab2a3a6535032c37e5ece624
parent ddeb99ae
Loading
Loading
Loading
Loading
+0 −26
Original line number Diff line number Diff line
@@ -293,32 +293,6 @@ public class RestrictedLockUtilsInternal extends RestrictedLockUtils {
        return null;
    }

    /**
     * Checks whether add user is disabled on the device
     *
     * @param context {@link Context} for the calling user.
     *
     *
     * @param userId User to check enforced admin status for.
     *
     * @return EnforcedAdmin Object containing the enforced admin component and admin user details,
     * or {@code null} If adding user is not disabled.
     */
    public static EnforcedAdmin checkIfAddUserDisallowed(Context context, int userId) {
        final UserManager um = UserManager.get(context);
        if (!um.hasUserRestriction(UserManager.DISALLOW_ADD_USER, UserHandle.of(userId))) {
            // Restriction is not enforced.
            return null;
        }
        EnforcedAdmin enforcedAdmin = checkIfRestrictionEnforced(context,
                UserManager.DISALLOW_ADD_USER, userId);
        if (enforcedAdmin != null) {
            return enforcedAdmin;
        }
        return EnforcedAdmin.createDefaultEnforcedAdminWithRestriction(
                UserManager.DISALLOW_ADD_USER);
    }

    /**
     * Check if an application is suspended.
     *