From 0e592733ecbde2b7e7f2aa92001656dfbcae9641 Mon Sep 17 00:00:00 2001 From: Benjamin Franz Date: Mon, 22 Feb 2016 13:41:53 +0000 Subject: [PATCH] Use UserAccounts handed into accountExistsCacheLocked Use the object we get handed rather than obtaining the one for the calling user. We're previously clearing the caller, so the calling user might not be the same as the one we used to obtain accounts object. Bug: 27285299 Change-Id: Ie384bca83779593f6569bccea3c2851083ace31d --- .../java/com/android/server/accounts/AccountManagerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java index 163b9be2374b1..37f2425fb7ae3 100644 --- a/services/core/java/com/android/server/accounts/AccountManagerService.java +++ b/services/core/java/com/android/server/accounts/AccountManagerService.java @@ -1734,7 +1734,7 @@ public class AccountManagerService private boolean accountExistsCacheLocked(UserAccounts accounts, Account account) { if (accounts.accountCache.containsKey(account.type)) { - for (Account acc : getUserAccountsForCaller().accountCache.get(account.type)) { + for (Account acc : accounts.accountCache.get(account.type)) { if (acc.name.equals(account.name)) { return true; }