Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3be12f4 authored by Andreas Gampe's avatar Andreas Gampe Committed by android-build-merger
Browse files

Merge "Accounts: Fix TokenCache maps access" am: b06de789 am: c3119140

am: 77a7a499

Change-Id: I3f3296c7e2ff046caf9da60a86f5ef063aa993f7
parents 9af1cd0b 77a7a499
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ import java.util.Objects;
                 * This is recursive, but it won't spiral out of control because LruCache is
                 * thread safe and the Evictor can only be removed once.
                 */
                Evictor evictor = mTokenEvictors.remove(oldVal.token);
                Evictor evictor = mTokenEvictors.remove(new Pair<>(k.account.type, oldVal.token));
                if (evictor != null) {
                    evictor.evict();
                }
@@ -134,12 +134,13 @@ import java.util.Objects;

        public void putToken(Key k, Value v) {
            // Prepare for removal by token string.
            Evictor tokenEvictor = mTokenEvictors.get(v.token);
            Pair<String, String> mapKey = new Pair<>(k.account.type, v.token);
            Evictor tokenEvictor = mTokenEvictors.get(mapKey);
            if (tokenEvictor == null) {
                tokenEvictor = new Evictor();
            }
            tokenEvictor.add(k);
            mTokenEvictors.put(new Pair<>(k.account.type, v.token), tokenEvictor);
            mTokenEvictors.put(mapKey, tokenEvictor);

            // Prepare for removal by associated account.
            Evictor accountEvictor = mAccountEvictors.get(k.account);