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

Commit 006d6bb9 authored by Lee Shombert's avatar Lee Shombert
Browse files

Bump the max size of four binder caches

This change increases the maximum size of selected binder caches.
This table lists the module, the API, the old cache size, and the new
cache size.  Note that the new cache size is only needed during
system boot: the steady-state cache size is much smaller.

 * IPackageManager      getPackagesForUid      32    1024
 * IPlatformCompat      isChangeEnabledBy_X    64    2048
 * IPackageManager      getApplicationInfo     32    2048
 * IPackageManager      getPackageInfo         64    2048

The IPlatformCompat cache is a single cache for two different APIs:
isChangeEnabledByPackageName() and isChangeEnabledByUid().

Flag: EXEMPT bug_fix
Bug: 346346313
Test: Boot the phone and observe the number of caches that have
      overflowed.
Change-Id: I8c7e2718b4356826000921618bcc6564ac5dd789
parent 2af3c050
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1128,7 +1128,7 @@ public class ApplicationPackageManager extends PackageManager {
    private static final PropertyInvalidatedCache<Integer, GetPackagesForUidResult>
            mGetPackagesForUidCache =
            new PropertyInvalidatedCache<Integer, GetPackagesForUidResult>(
                32, CACHE_KEY_PACKAGES_FOR_UID_PROPERTY) {
                1024, CACHE_KEY_PACKAGES_FOR_UID_PROPERTY) {
                @Override
                public GetPackagesForUidResult recompute(Integer uid) {
                    try {
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ import com.android.internal.compat.IPlatformCompat;
public final class ChangeIdStateCache
        extends PropertyInvalidatedCache<ChangeIdStateQuery, Boolean> {
    private static final String CACHE_KEY = "cache_key.is_compat_change_enabled";
    private static final int MAX_ENTRIES = 64;
    private static final int MAX_ENTRIES = 2048;
    private static boolean sDisabled = false;
    private volatile IPlatformCompat mPlatformCompat;

+2 −2
Original line number Diff line number Diff line
@@ -11436,7 +11436,7 @@ public abstract class PackageManager {
    private static final PropertyInvalidatedCache<ApplicationInfoQuery, ApplicationInfo>
            sApplicationInfoCache =
            new PropertyInvalidatedCache<ApplicationInfoQuery, ApplicationInfo>(
                    32, PermissionManager.CACHE_KEY_PACKAGE_INFO,
                    2048, PermissionManager.CACHE_KEY_PACKAGE_INFO,
                    "getApplicationInfo") {
                @Override
                public ApplicationInfo recompute(ApplicationInfoQuery query) {
@@ -11537,7 +11537,7 @@ public abstract class PackageManager {
    private static final PropertyInvalidatedCache<PackageInfoQuery, PackageInfo>
            sPackageInfoCache =
            new PropertyInvalidatedCache<PackageInfoQuery, PackageInfo>(
                    64, PermissionManager.CACHE_KEY_PACKAGE_INFO,
                    2048, PermissionManager.CACHE_KEY_PACKAGE_INFO,
                    "getPackageInfo") {
                @Override
                public PackageInfo recompute(PackageInfoQuery query) {