Loading core/java/android/app/PropertyInvalidatedCache.java +6 −3 Original line number Diff line number Diff line Loading @@ -206,6 +206,10 @@ public abstract class PropertyInvalidatedCache<Query, Result> { private static final String TAG = "PropertyInvalidatedCache"; private static final boolean DEBUG = false; private static final boolean VERIFY = false; // If this is true, dumpsys will dump the cache entries along with cache statistics. // Most of the time this causes dumpsys to fail because the output stream is too // large. Only set it to true in development images. private static final boolean DETAILED = false; // Per-Cache performance counters. As some cache instances are declared static, @GuardedBy("mLock") Loading Loading @@ -912,14 +916,13 @@ public abstract class PropertyInvalidatedCache<Query, Result> { " Current Size: %d, Max Size: %d, HW Mark: %d, Overflows: %d", mCache.size(), mMaxEntries, mHighWaterMark, mMissOverflow)); pw.println(String.format(" Enabled: %s", mDisabled ? "false" : "true")); pw.println(""); Set<Map.Entry<Query, Result>> cacheEntries = mCache.entrySet(); if (cacheEntries.size() == 0) { pw.println(""); if (!DETAILED || cacheEntries.size() == 0) { return; } pw.println(""); pw.println(" Contents:"); for (Map.Entry<Query, Result> entry : cacheEntries) { String key = Objects.toString(entry.getKey()); Loading core/java/android/permission/PermissionManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -609,7 +609,7 @@ public final class PermissionManager { /** @hide */ private static final PropertyInvalidatedCache<PermissionQuery, Integer> sPermissionCache = new PropertyInvalidatedCache<PermissionQuery, Integer>( 16, CACHE_KEY_PACKAGE_INFO, "checkPermission") { 2048, CACHE_KEY_PACKAGE_INFO, "checkPermission") { @Override protected Integer recompute(PermissionQuery query) { return checkPermissionUncached(query.permission, query.pid, query.uid); Loading services/core/java/com/android/server/pm/permission/PermissionManagerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -378,8 +378,9 @@ public class PermissionManagerService extends IPermissionManager.Stub { @NonNull Injector injector) { mInjector = injector; // The package info cache is the cache for package and permission information. // Disable the package info and package permission caches locally but leave the // checkPermission cache active. mInjector.invalidatePackageInfoCache(); mInjector.disablePermissionCache(); mInjector.disablePackageNamePermissionCache(); mContext = context; Loading Loading
core/java/android/app/PropertyInvalidatedCache.java +6 −3 Original line number Diff line number Diff line Loading @@ -206,6 +206,10 @@ public abstract class PropertyInvalidatedCache<Query, Result> { private static final String TAG = "PropertyInvalidatedCache"; private static final boolean DEBUG = false; private static final boolean VERIFY = false; // If this is true, dumpsys will dump the cache entries along with cache statistics. // Most of the time this causes dumpsys to fail because the output stream is too // large. Only set it to true in development images. private static final boolean DETAILED = false; // Per-Cache performance counters. As some cache instances are declared static, @GuardedBy("mLock") Loading Loading @@ -912,14 +916,13 @@ public abstract class PropertyInvalidatedCache<Query, Result> { " Current Size: %d, Max Size: %d, HW Mark: %d, Overflows: %d", mCache.size(), mMaxEntries, mHighWaterMark, mMissOverflow)); pw.println(String.format(" Enabled: %s", mDisabled ? "false" : "true")); pw.println(""); Set<Map.Entry<Query, Result>> cacheEntries = mCache.entrySet(); if (cacheEntries.size() == 0) { pw.println(""); if (!DETAILED || cacheEntries.size() == 0) { return; } pw.println(""); pw.println(" Contents:"); for (Map.Entry<Query, Result> entry : cacheEntries) { String key = Objects.toString(entry.getKey()); Loading
core/java/android/permission/PermissionManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -609,7 +609,7 @@ public final class PermissionManager { /** @hide */ private static final PropertyInvalidatedCache<PermissionQuery, Integer> sPermissionCache = new PropertyInvalidatedCache<PermissionQuery, Integer>( 16, CACHE_KEY_PACKAGE_INFO, "checkPermission") { 2048, CACHE_KEY_PACKAGE_INFO, "checkPermission") { @Override protected Integer recompute(PermissionQuery query) { return checkPermissionUncached(query.permission, query.pid, query.uid); Loading
services/core/java/com/android/server/pm/permission/PermissionManagerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -378,8 +378,9 @@ public class PermissionManagerService extends IPermissionManager.Stub { @NonNull Injector injector) { mInjector = injector; // The package info cache is the cache for package and permission information. // Disable the package info and package permission caches locally but leave the // checkPermission cache active. mInjector.invalidatePackageInfoCache(); mInjector.disablePermissionCache(); mInjector.disablePackageNamePermissionCache(); mContext = context; Loading