summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-01-15 04:30:47 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-01-15 04:30:47 -0800
commitf1ebf3cf7e9407261c0e060ef1adb73b2d911f81 (patch)
tree1a44f44474e2254daf1b3a79cfdedd25bcae7123 /src/com
parenta4c041200a72c4da7fa90284c1ea930fb11217f1 (diff)
parent184fbe8646e6ddb438db2911a2dd506fc6f20176 (diff)
downloadandroid_packages_apps_Gallery2-f1ebf3cf7e9407261c0e060ef1adb73b2d911f81.tar.gz
android_packages_apps_Gallery2-f1ebf3cf7e9407261c0e060ef1adb73b2d911f81.tar.bz2
android_packages_apps_Gallery2-f1ebf3cf7e9407261c0e060ef1adb73b2d911f81.zip
Merge "Gallery2: Fix can't show the thumbnails when the storage full"
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/gallery3d/data/ImageCacheService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/data/ImageCacheService.java b/src/com/android/gallery3d/data/ImageCacheService.java
index 1c7cb8c5e..129c113a6 100644
--- a/src/com/android/gallery3d/data/ImageCacheService.java
+++ b/src/com/android/gallery3d/data/ImageCacheService.java
@@ -62,6 +62,9 @@ public class ImageCacheService {
LookupRequest request = new LookupRequest();
request.key = cacheKey;
request.buffer = buffer.data;
+ if (mCache == null) {
+ return false;
+ }
synchronized (mCache) {
if (!mCache.lookup(request)) return false;
}
@@ -83,6 +86,9 @@ public class ImageCacheService {
ByteBuffer buffer = ByteBuffer.allocate(key.length + value.length);
buffer.put(key);
buffer.put(value);
+ if (mCache == null) {
+ return;
+ }
synchronized (mCache) {
try {
mCache.insert(cacheKey, buffer.array());
@@ -95,6 +101,9 @@ public class ImageCacheService {
public void clearImageData(Path path, long timeModified, int type) {
byte[] key = makeKey(path, timeModified, type);
long cacheKey = Utils.crc64Long(key);
+ if (mCache == null) {
+ return;
+ }
synchronized (mCache) {
try {
mCache.clearEntry(cacheKey);