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
This commit is contained in:
Benjamin Franz
2016-02-22 13:41:53 +00:00
parent fa272e5c92
commit 0e592733ec

View File

@@ -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;
}