Loading core/java/android/app/PropertyInvalidatedCache.java +2 −17 Original line number Diff line number Diff line Loading @@ -1405,17 +1405,6 @@ public class PropertyInvalidatedCache<Query, Result> { return isDisabled(); } /** * Return the number of entries in the cache. This is used for testing and has package-only * visibility. * @hide */ public int size() { synchronized (mLock) { return mCache.size(); } } /** * Returns a list of caches alive at the current time. */ Loading Loading @@ -1623,12 +1612,8 @@ public class PropertyInvalidatedCache<Query, Result> { * @hide */ public static void onTrimMemory() { ArrayList<PropertyInvalidatedCache> activeCaches; synchronized (sGlobalLock) { activeCaches = getActiveCaches(); } for (int i = 0; i < activeCaches.size(); i++) { activeCaches.get(i).clear(); for (PropertyInvalidatedCache pic : getActiveCaches()) { pic.clear(); } } } core/java/android/app/TEST_MAPPING +0 −17 Original line number Diff line number Diff line Loading @@ -175,23 +175,6 @@ "file_patterns": [ "(/|^)KeyguardManager.java" ] }, { "name": "FrameworksCoreTests", "options": [ { "exclude-annotation": "androidx.test.filters.FlakyTest" }, { "exclude-annotation": "org.junit.Ignore" }, { "include-filter": "android.app.PropertyInvalidatedCacheTest" } ], "file_patterns": [ "(/|^)PropertyInvalidatedCache.java" ] } ], "presubmit-large": [ Loading core/tests/coretests/src/android/app/PropertyInvalidatedCacheTests.java +0 −16 Original line number Diff line number Diff line Loading @@ -368,20 +368,4 @@ public class PropertyInvalidatedCacheTests { PropertyInvalidatedCache.MODULE_BLUETOOTH, "getState"); assertEquals(n1, "cache_key.bluetooth.get_state"); } @Test public void testOnTrimMemory() { TestCache cache = new TestCache(MODULE, "trimMemoryTest"); // The cache is not active until it has been invalidated once. cache.invalidateCache(); // Populate the cache with six entries. for (int i = 0; i < 6; i++) { cache.query(i); } // The maximum number of entries in TestCache is 4, so even though six entries were // created, only four are retained. assertEquals(4, cache.size()); PropertyInvalidatedCache.onTrimMemory(); assertEquals(0, cache.size()); } } Loading
core/java/android/app/PropertyInvalidatedCache.java +2 −17 Original line number Diff line number Diff line Loading @@ -1405,17 +1405,6 @@ public class PropertyInvalidatedCache<Query, Result> { return isDisabled(); } /** * Return the number of entries in the cache. This is used for testing and has package-only * visibility. * @hide */ public int size() { synchronized (mLock) { return mCache.size(); } } /** * Returns a list of caches alive at the current time. */ Loading Loading @@ -1623,12 +1612,8 @@ public class PropertyInvalidatedCache<Query, Result> { * @hide */ public static void onTrimMemory() { ArrayList<PropertyInvalidatedCache> activeCaches; synchronized (sGlobalLock) { activeCaches = getActiveCaches(); } for (int i = 0; i < activeCaches.size(); i++) { activeCaches.get(i).clear(); for (PropertyInvalidatedCache pic : getActiveCaches()) { pic.clear(); } } }
core/java/android/app/TEST_MAPPING +0 −17 Original line number Diff line number Diff line Loading @@ -175,23 +175,6 @@ "file_patterns": [ "(/|^)KeyguardManager.java" ] }, { "name": "FrameworksCoreTests", "options": [ { "exclude-annotation": "androidx.test.filters.FlakyTest" }, { "exclude-annotation": "org.junit.Ignore" }, { "include-filter": "android.app.PropertyInvalidatedCacheTest" } ], "file_patterns": [ "(/|^)PropertyInvalidatedCache.java" ] } ], "presubmit-large": [ Loading
core/tests/coretests/src/android/app/PropertyInvalidatedCacheTests.java +0 −16 Original line number Diff line number Diff line Loading @@ -368,20 +368,4 @@ public class PropertyInvalidatedCacheTests { PropertyInvalidatedCache.MODULE_BLUETOOTH, "getState"); assertEquals(n1, "cache_key.bluetooth.get_state"); } @Test public void testOnTrimMemory() { TestCache cache = new TestCache(MODULE, "trimMemoryTest"); // The cache is not active until it has been invalidated once. cache.invalidateCache(); // Populate the cache with six entries. for (int i = 0; i < 6; i++) { cache.query(i); } // The maximum number of entries in TestCache is 4, so even though six entries were // created, only four are retained. assertEquals(4, cache.size()); PropertyInvalidatedCache.onTrimMemory(); assertEquals(0, cache.size()); } }