diff options
| author | 2017-12-08 15:16:46 +0000 | |
|---|---|---|
| committer | 2017-12-08 16:15:37 +0000 | |
| commit | f788f9c2d9dc0f51605c312fb9e61f390f76c1b6 (patch) | |
| tree | 10e0b5d1c5fc13d20b51f52d6bbc74b1f0d9e9b7 | |
| parent | a044c1d27e9380d649b6b9dadfb582136be5fa79 (diff) | |
Allow profile owners to call removeAccount
Bug: 65280359
Test: Profile owner can call AccountManager.removeAccount
Change-Id: I2710586ad8b26e3f01f1f6d76cf0ba61ee1525f1
| -rw-r--r-- | services/core/java/com/android/server/accounts/AccountManagerService.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java index 0d4f5cb81b49..0ffc77923f1a 100644 --- a/services/core/java/com/android/server/accounts/AccountManagerService.java +++ b/services/core/java/com/android/server/accounts/AccountManagerService.java @@ -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, |