Update AccountManagerService side logic for .getAccountsByTypeForPackage
with null type.
Bug: 37987384
Test: manual, APCT
Change-Id: I4d5f735736f1b1d7bbf778aee2ec813071c34f19
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index b3fff29..ec4dc64 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -4428,6 +4428,10 @@
&& (type != null && !isAccountManagedByCaller(type, callingUid, userId))) {
return EMPTY_ACCOUNT_ARRAY;
}
+ if (!UserHandle.isSameApp(callingUid, Process.SYSTEM_UID) && type == null) {
+ return getAccountsAsUserForPackage(type, userId,
+ packageName, packageUid, opPackageName, false /* includeUserManagedNotVisible */);
+ }
return getAccountsAsUserForPackage(type, userId,
packageName, packageUid, opPackageName, true /* includeUserManagedNotVisible */);
}