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

Commit f788f9c2 authored by Alex Chau's avatar Alex Chau
Browse files

Allow profile owners to call removeAccount

Bug: 65280359
Test: Profile owner can call AccountManager.removeAccount
Change-Id: I2710586ad8b26e3f01f1f6d76cf0ba61ee1525f1
parent a044c1d2
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -2118,13 +2118,14 @@ public class AccountManagerService
                            userId));
        }
        /*
         * Only the system or authenticator should be allowed to remove accounts for that
         * authenticator.  This will let users remove accounts (via Settings in the system) but not
         * arbitrary applications (like competing authenticators).
         * Only the system, authenticator or profile owner should be allowed to remove accounts for
         * that authenticator.  This will let users remove accounts (via Settings in the system) but
         * not arbitrary applications (like competing authenticators).
         */
        UserHandle user = UserHandle.of(userId);
        if (!isAccountManagedByCaller(account.type, callingUid, user.getIdentifier())
                && !isSystemUid(callingUid)) {
                && !isSystemUid(callingUid)
                && !isProfileOwner(callingUid)) {
            String msg = String.format(
                    "uid %s cannot remove accounts of type: %s",
                    callingUid,