diff options
| author | Owen Lin <owenlin@google.com> | 2011-09-06 23:51:36 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-06 23:51:36 -0700 |
| commit | c4800c4a8252c8db65e4815225c4a3b2cfa03706 (patch) | |
| tree | b0040ad58737ee1c82089f2076042754a8ec8c99 | |
| parent | 3f6d333221f1b522328ce589ba6d2dd46c375c76 (diff) | |
| parent | e7327d0566b182c522ca6dfa8e04c649d8f631a0 (diff) | |
| download | android_packages_apps_Gallery2-c4800c4a8252c8db65e4815225c4a3b2cfa03706.tar.gz android_packages_apps_Gallery2-c4800c4a8252c8db65e4815225c4a3b2cfa03706.tar.bz2 android_packages_apps_Gallery2-c4800c4a8252c8db65e4815225c4a3b2cfa03706.zip | |
Merge "Fix a no-thumbnail error message."
| -rw-r--r-- | src/com/android/gallery3d/app/PhotoDataAdapter.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/app/PhotoDataAdapter.java b/src/com/android/gallery3d/app/PhotoDataAdapter.java index 78afe7ee7..b976dec84 100644 --- a/src/com/android/gallery3d/app/PhotoDataAdapter.java +++ b/src/com/android/gallery3d/app/PhotoDataAdapter.java @@ -214,11 +214,12 @@ public class PhotoDataAdapter implements PhotoPage.Model { private void updateScreenNail(long version, Future<Bitmap> future) { ImageEntry entry = mImageCache.get(version); - if (entry == null || entry.screenNailTask == null) { + if (entry == null || entry.screenNailTask != future) { Bitmap screenNail = future.get(); if (screenNail != null) screenNail.recycle(); return; } + entry.screenNailTask = null; entry.screenNail = future.get(); @@ -240,11 +241,12 @@ public class PhotoDataAdapter implements PhotoPage.Model { private void updateFullImage(long version, Future<BitmapRegionDecoder> future) { ImageEntry entry = mImageCache.get(version); - if (entry == null || entry.fullImageTask == null) { + if (entry == null || entry.fullImageTask != future) { BitmapRegionDecoder fullImage = future.get(); if (fullImage != null) fullImage.recycle(); return; } + entry.fullImageTask = null; entry.fullImage = future.get(); if (entry.fullImage != null) { @@ -567,12 +569,14 @@ public class PhotoDataAdapter implements PhotoPage.Model { mVersion = version; } + @Override public void onFutureDone(Future<BitmapRegionDecoder> future) { mFuture = future; mMainHandler.sendMessage( mMainHandler.obtainMessage(MSG_RUN_OBJECT, this)); } + @Override public void run() { updateFullImage(mVersion, mFuture); } @@ -587,12 +591,14 @@ public class PhotoDataAdapter implements PhotoPage.Model { mVersion = version; } + @Override public void onFutureDone(Future<Bitmap> future) { mFuture = future; mMainHandler.sendMessage( mMainHandler.obtainMessage(MSG_RUN_OBJECT, this)); } + @Override public void run() { updateScreenNail(mVersion, mFuture); } |
