summaryrefslogtreecommitdiffstats
path: root/core/java/android/util
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2012-08-01 14:34:46 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-01 14:34:47 -0700
commit6a916ed0c0f5c5c5ec53f11087265eb13fc34ff1 (patch)
tree0e15c44e6fabd36942e3aad022da9ab12e9936f5 /core/java/android/util
parent3a68038249c0908e7e16ca03f33a9e2edb22c639 (diff)
parentd96b585f5c40ee0d1232630ac0124d4610341577 (diff)
downloadframeworks_base-6a916ed0c0f5c5c5ec53f11087265eb13fc34ff1.zip
frameworks_base-6a916ed0c0f5c5c5ec53f11087265eb13fc34ff1.tar.gz
frameworks_base-6a916ed0c0f5c5c5ec53f11087265eb13fc34ff1.tar.bz2
Merge "Add trimToSize() to public API." into jb-mr1-dev
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;