Skip to content
Commit 9ac40f1c authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Only use cacheLock when it's needed

When reading from cache, we can avoid synchronization on dbLock if we 
only read from cache (no db access).

When doing updates to db and cache, we should hold cacheLock only when 
updating the cache.

This change improves locking in the following methods:
 - getAccountVisibilityFromCache
 - saveAuthTokenToDatabase
 - getAccountsFromCacheLocked no longer allows outside locking. The 
   method was renamed to getAccountsFromCache and now self-manages locks
 - writeAuthTokenIntoCacheLocked
 - readAuthTokenInternal

Test: AccountManagerServiceTest
Bug: 36485175
Bug: 35262596
Change-Id: I9aca45c31716c4f0e0fd9f07859e88a7f5ba6922
parent 76d77937
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment