summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-12-13 11:46:10 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-12-13 11:46:10 +0000
commitd8760dac7e0778de86ebfd9936cd89278e96256a (patch)
tree1f46ac267798ece21fcec103157bbfae23d1ef9c
parent18970cbd2c85f5497969366e801dbfb6fde619ba (diff)
parentf788f9c2d9dc0f51605c312fb9e61f390f76c1b6 (diff)
Merge "Allow profile owners to call removeAccount"
-rw-r--r--services/core/java/com/android/server/accounts/AccountManagerService.java9
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,