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(); } } };