React to LruCache.entryEvicted renamed to LruCache.entryRemoved
Change-Id: Iab20ce0386ee4dabc8490dbde5cd2208626c293c http://b/3461302
This commit is contained in:
parent
b7fa0f5baf
commit
5d29dac806
@ -390,10 +390,11 @@ public final class ContentCache {
|
|||||||
mName = name;
|
mName = name;
|
||||||
mLruCache = new LruCache<String, Cursor>(maxSize) {
|
mLruCache = new LruCache<String, Cursor>(maxSize) {
|
||||||
@Override
|
@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
|
// Close this cursor if it's no longer being used
|
||||||
if (!sActiveCursors.contains(cursor)) {
|
if (evicted && !sActiveCursors.contains(oldValue)) {
|
||||||
cursor.close();
|
oldValue.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user