summaryrefslogtreecommitdiff
path: root/src/com/android/bitmap/DecodeTask.java
diff options
context:
space:
mode:
authorJames Kung <kingkung@google.com>2014-01-14 14:34:42 -0800
committerJames Kung <kingkung@google.com>2014-01-14 14:42:50 -0800
commita07e0af0f1997ce3d40df6a8a9f44cb0b2e4c07f (patch)
tree602af3541d05d2b34357cde74a8454ae57bd2570 /src/com/android/bitmap/DecodeTask.java
parentad6ca3f895022ded1a11f3eedc50d70ea90cd4da (diff)
downloadbitmap-a07e0af0f1997ce3d40df6a8a9f44cb0b2e4c07f.tar.gz
Store null results in the cache
Change-Id: I034fa56a8c646a65781236fe832c0f54d9f86984
Diffstat (limited to 'src/com/android/bitmap/DecodeTask.java')
-rw-r--r--src/com/android/bitmap/DecodeTask.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/bitmap/DecodeTask.java b/src/com/android/bitmap/DecodeTask.java
index 03b8445..e227446 100644
--- a/src/com/android/bitmap/DecodeTask.java
+++ b/src/com/android/bitmap/DecodeTask.java
@@ -439,9 +439,11 @@ public class DecodeTask extends AsyncTask<Void, Void, ReusableBitmap> {
} catch (IOException ignored) {
}
}
+
+ // Put result in cache, regardless of null. The cache will handle null results.
+ mCache.put(mKey, result);
if (result != null) {
result.acquireReference();
- mCache.put(mKey, result);
if (DEBUG) {
Log.d(TAG, "placed result in cache: key=" + mKey + " bmp="
+ result + " cancelled=" + isCancelled());