diff options
| author | 2025-02-04 07:55:54 -0800 | |
|---|---|---|
| committer | 2025-02-06 14:14:02 -0800 | |
| commit | e6751e09f53d04d3a62e1ff5609d20f9c5a166ad (patch) | |
| tree | b0d961b35bdfc73022bfe3a7910a7050c5d262a2 /libs/androidfw/misc.cpp | |
| parent | 24b592ab80da5a8aa43831b68ddd3c9debbfd90c (diff) | |
PM caches now cache nulls
PackageManager caches for getPackagesForUid(), getApplicationInfo(),
and getPackageInfo() now cache null results. That is, if PM returns
null for a query, that null result is cached against the query.
AppsFilterImpl invalidates the caches to cover the situation in which
an application gains visibility and is now able to query package info.
The corresponding AppsFilterImplTest is updated to disable the caches
for the duration of the tests.
This change also makes invalidateGetPackagesForUidCache() faster by
going directly to the static cache. This avoids the search for the
nonce handler that corresponds to the property string.
The cache declarations are refactored slightly to use the new Args()
constructor.
The name of the cache for getPackagesForUid() has been shortened to
"get_packages_for_uid" instead of the full property name.
Manually verified via dumpsys cacheinfo that the cache keys have not
changed and that the respective invalidations did not change
unexpectedly.
Flag: EXEMPT bug-fix
Bug: 382719639
Test: atest
* com.android.server.pm.PackageManagerTests
* android.content.pm.cts.PackageManagerTest
* CtsAppEnumerationTestCases
Change-Id: I444379873a17ac9e8cdf4ce5a6ea5b4e59274a65
Diffstat (limited to 'libs/androidfw/misc.cpp')
0 files changed, 0 insertions, 0 deletions