RESTRICT AUTOMERGE: Autocork package invalidations

Bug: 140788621
Test: m; strace -s512 -f -p 1 2>&1 | grep 'cache_key'
Change-Id: Iceaabee5ea8eac42934c1cc4914cdf43d2f11f58
This commit is contained in:
Daniel Colascione
2020-03-19 13:59:15 -07:00
parent f0e88b2f2c
commit d59e2a9045

View File

@@ -8036,13 +8036,16 @@ public abstract class PackageManager {
sApplicationInfoCache.disableLocal(); sApplicationInfoCache.disableLocal();
} }
private static final PropertyInvalidatedCache.AutoCorker sCacheAutoCorker =
new PropertyInvalidatedCache.AutoCorker(PermissionManager.CACHE_KEY_PACKAGE_INFO);
/** /**
* Invalidate caches of package and permission information system-wide. * Invalidate caches of package and permission information system-wide.
* *
* @hide * @hide
*/ */
public static void invalidatePackageInfoCache() { public static void invalidatePackageInfoCache() {
PropertyInvalidatedCache.invalidateCache(PermissionManager.CACHE_KEY_PACKAGE_INFO); sCacheAutoCorker.autoCork();
} }
// Some of the flags don't affect the query result, but let's be conservative and cache // Some of the flags don't affect the query result, but let's be conservative and cache