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

Commit 82cdbf09 authored by Lee Shombert's avatar Lee Shombert
Browse files

Allow PIC caches to cache nulls

Null-caching is opt-in; PIC caches that opt in should not be gated by
a system-wide flag.

Flag: EXEMPT bug-fix
Bug: 372923336
Test: atest
 * FrameworksCoreTests:PropertyInvalidatedCacheTests
 * FrameworksCoreTests:IpcDataCacheTest
 * CtsOsTestCases:IpcDataCacheTest
Change-Id: I87cad00378b9a665dd467753cdcfd38d4e6fb831
parent bfb0a089
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1356,7 +1356,7 @@ public class PropertyInvalidatedCache<Query, Result> {
            @Nullable QueryHandler<Query, Result> computer) {
        mPropertyName = createPropertyName(args.mModule, args.mApi);
        mCacheName = cacheName;
        mCacheNullResults = args.mCacheNulls && Flags.picCacheNulls();
        mCacheNullResults = args.mCacheNulls;
        mNonce = getNonceHandler(mPropertyName);
        mMaxEntries = args.mMaxEntries;
        mCache = new CacheMap<>(args.mIsolateUids, args.mTestMode);
+0 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.app;

import static android.app.Flags.FLAG_PIC_CACHE_NULLS;
import static android.app.Flags.FLAG_PIC_ISOLATE_CACHE_BY_UID;
import static android.app.PropertyInvalidatedCache.NONCE_UNSET;
import static android.app.PropertyInvalidatedCache.MODULE_BLUETOOTH;
@@ -711,7 +710,6 @@ public class PropertyInvalidatedCacheTests {
        }
    }

    @RequiresFlagsEnabled(FLAG_PIC_CACHE_NULLS)
    @Test
    public void testCachingNulls() {
        TestCache cache = new TestCache(new Args(MODULE_TEST)
+0 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.os;

import static android.app.Flags.FLAG_PIC_CACHE_NULLS;
import static android.app.Flags.FLAG_PIC_ISOLATE_CACHE_BY_UID;

import static org.junit.Assert.assertEquals;
@@ -511,7 +510,6 @@ public class IpcDataCacheTest {
        IpcDataCache.setTestMode(true);
    }

    @RequiresFlagsEnabled(FLAG_PIC_CACHE_NULLS)
    @Test
    public void testCachingNulls() {
        IpcDataCache.Config c =