Fix wrong variable in AccountManagerService's TokenCache

// mAccountEvictors.put(k.account, tokenEvictor);
// should be:
mAccountEvictors.put(k.account, accountEvictor);

This error in putToken() method causes the confusion of mAccountEvictors,
and may causes the evict() method does not clean up the cache data correctly.

Change-Id: I9435c206a6fa4d90177bbbe8816004365a213d1b
Signed-off-by: Haohua Li <lihaohua90@gmail.com>
This commit is contained in:
Haohua Li
2020-03-24 21:59:29 +08:00
parent 31145f453b
commit f3880fdc67

View File

@@ -148,7 +148,7 @@ import java.util.Objects;
accountEvictor = new Evictor();
}
accountEvictor.add(k);
mAccountEvictors.put(k.account, tokenEvictor);
mAccountEvictors.put(k.account, accountEvictor);
// Only cache the token once we can remove it directly or by account.
put(k, v);