summaryrefslogtreecommitdiffstats
path: root/core/java/android/util
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2012-07-27 17:00:24 -0700
committerJeff Sharkey <jsharkey@android.com>2012-08-01 14:20:04 -0700
commitd96b585f5c40ee0d1232630ac0124d4610341577 (patch)
treeb2deb4092e90fed434f55053c03646f84a833e94 /core/java/android/util
parent24d19fb6ab94cc5fd23f1c9a1d7916948a7fd571 (diff)
downloadframeworks_base-d96b585f5c40ee0d1232630ac0124d4610341577.zip
frameworks_base-d96b585f5c40ee0d1232630ac0124d4610341577.tar.gz
frameworks_base-d96b585f5c40ee0d1232630ac0124d4610341577.tar.bz2
Add trimToSize() to public API.
Bug: 6602490 Bug: http://code.google.com/p/android/issues/detail?id=35349 Change-Id: Ib3bc7fee05bb0edc375ebee1c40a1d7bd82e2a17
Diffstat (limited to 'core/java/android/util')
-rw-r--r--core/java/android/util/LruCache.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/java/android/util/LruCache.java b/core/java/android/util/LruCache.java
index 51e373c..dd504c1 100644
--- a/core/java/android/util/LruCache.java
+++ b/core/java/android/util/LruCache.java
@@ -186,10 +186,13 @@ public class LruCache<K, V> {
}
/**
+ * Remove the eldest entries until the total of remaining entries is at or
+ * below the requested size.
+ *
* @param maxSize the maximum size of the cache before returning. May be -1
- * to evict even 0-sized elements.
+ * to evict even 0-sized elements.
*/
- private void trimToSize(int maxSize) {
+ public void trimToSize(int maxSize) {
while (true) {
K key;
V value;