summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lee Shombert <shombert@google.com> 2024-12-11 15:04:18 -0800
committer Lee Shombert <shombert@google.com> 2024-12-11 15:04:18 -0800
commitcc3c93b46013654d4e0e29789a21a4bb392d057c (patch)
treef5a0934da5afa6b3ac472020639a3d44353d133f
parentbfb0a0892a14d35dcd022476a4dd4f95c7ff7647 (diff)
Make compat cache non-isolating
The following cache is no longer uid-isolating: * is_compat_change_enabled The cache constructor has been reflowed slightly to match the latest non-deprecated apis. Flag: EXEMPT bug-fix Bug: 379098894 Test: presubmit Change-Id: Ifae71807b4599e0ec7f787077c38e6a16f07f2d9
-rw-r--r--core/java/android/app/compat/ChangeIdStateCache.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/core/java/android/app/compat/ChangeIdStateCache.java b/core/java/android/app/compat/ChangeIdStateCache.java
index 7d21cbf955d9..258ce06bffc3 100644
--- a/core/java/android/app/compat/ChangeIdStateCache.java
+++ b/core/java/android/app/compat/ChangeIdStateCache.java
@@ -16,8 +16,6 @@
package android.app.compat;
-import static android.app.PropertyInvalidatedCache.createSystemCacheKey;
-
import android.annotation.NonNull;
import android.app.PropertyInvalidatedCache;
import android.content.Context;
@@ -34,7 +32,10 @@ import com.android.internal.compat.IPlatformCompat;
@android.ravenwood.annotation.RavenwoodKeepWholeClass
public final class ChangeIdStateCache
extends PropertyInvalidatedCache<ChangeIdStateQuery, Boolean> {
- private static final String CACHE_KEY = createSystemCacheKey("is_compat_change_enabled");
+
+ private static final String CACHE_MODULE = PropertyInvalidatedCache.MODULE_SYSTEM;
+ private static final String CACHE_API = "is_compat_change_enabled";
+
private static final int MAX_ENTRIES = 2048;
private static boolean sDisabled = getDefaultDisabled();
private volatile IPlatformCompat mPlatformCompat;
@@ -51,7 +52,12 @@ public final class ChangeIdStateCache
/** @hide */
public ChangeIdStateCache() {
- super(MAX_ENTRIES, CACHE_KEY);
+ super(new PropertyInvalidatedCache.Args(CACHE_MODULE)
+ .maxEntries(MAX_ENTRIES)
+ .isolateUids(false)
+ .cacheNulls(false)
+ .api(CACHE_API),
+ CACHE_API, null);
}
/**
@@ -72,7 +78,7 @@ public final class ChangeIdStateCache
*/
public static void invalidate() {
if (!sDisabled) {
- PropertyInvalidatedCache.invalidateCache(CACHE_KEY);
+ PropertyInvalidatedCache.invalidateCache(CACHE_MODULE, CACHE_API);
}
}