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

Skip to content
Commit e725b3e9 authored by Adam Bookatz's avatar Adam Bookatz
Browse files

UserProperties won't be cached for wrong callers

UserManager.getUserProperties() will return different results depending
on the callingUid, since different callers have different permissions.
If a process is fetching the UserProperties on behalf of a different
caller (i.e. where the callingUid doesn't match the process), then
caching the result will be wrong, since that cached copy only applied to
that particular callingUid, which the cache doesn't take into account.

In this cl, we make the cache take into account not only the userId
being queried, but also the callingUid that is querying it.

We also switch the old unusued mechanism to the new @CachedProperty
static caching mechanism.

Bug: 369198539
Bug: 367997317
Flag: android.multiuser.cache_user_properties_correctly_read_only
Test: Manual confirmation that callingUids are properly cached too
Test: Made sure we have a good hit frequency by
      enabling PropertyInvalidatedCache DEBUG and monitoring
      adb logcat  | grep PropertyInvalidatedCache | grep user_properties
Change-Id: I5a6f136f68afe84c2406e3d2c20c222eff8f381f
parent b13bf71c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment