From 5d29dac8065e75b040aeb29401630fd65fedb9fc Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Fri, 25 Feb 2011 17:25:28 -0800 Subject: [PATCH] React to LruCache.entryEvicted renamed to LruCache.entryRemoved Change-Id: Iab20ce0386ee4dabc8490dbde5cd2208626c293c http://b/3461302 --- src/com/android/email/provider/ContentCache.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/android/email/provider/ContentCache.java b/src/com/android/email/provider/ContentCache.java index 91cbf4fd4..8f5978371 100644 --- a/src/com/android/email/provider/ContentCache.java +++ b/src/com/android/email/provider/ContentCache.java @@ -390,10 +390,11 @@ public final class ContentCache { mName = name; mLruCache = new LruCache(maxSize) { @Override - protected void entryEvicted(String key, Cursor cursor) { + protected void entryRemoved( + boolean evicted, String key, Cursor oldValue, Cursor newValue) { // Close this cursor if it's no longer being used - if (!sActiveCursors.contains(cursor)) { - cursor.close(); + if (evicted && !sActiveCursors.contains(oldValue)) { + oldValue.close(); } } };