Fix ConcurrentAccessException in unit tests
The ContentCache is now an LRU cache. This means we must NOT access the cache while using any iterator over the cache. In this case, we were calling get() using an iterator of cache keys. Change-Id: I2d1feabff7474b6f2a230b98f97df067ab7ccd9c
This commit is contained in:
parent
978e75ee90
commit
f1b510462f
@ -662,8 +662,7 @@ public final class ContentCache extends LinkedHashMap<String, Cursor> {
|
|||||||
}
|
}
|
||||||
mStats.mInvalidateCount++;
|
mStats.mInvalidateCount++;
|
||||||
// Close all cached cursors that are no longer in use
|
// Close all cached cursors that are no longer in use
|
||||||
for (String id: keySet()) {
|
for (Cursor c: values()) {
|
||||||
Cursor c = get(id);
|
|
||||||
if (!sActiveCursors.contains(c)) {
|
if (!sActiveCursors.contains(c)) {
|
||||||
c.close();
|
c.close();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user