diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2015-02-13 02:40:19 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-02-13 02:40:19 -0800 |
commit | dec290216cb509d084e8d93db8481c4896aa8626 (patch) | |
tree | cef5e0bc10c33b4fe1749bf48cbc6f3c148b8b9e /src | |
parent | 005feabdc6f124da8c37c0aa72216abac9f2b5f2 (diff) | |
parent | b4445260a8923d72593aafe5540dfb16ff674221 (diff) | |
download | android_packages_apps_Gallery2-dec290216cb509d084e8d93db8481c4896aa8626.tar.gz android_packages_apps_Gallery2-dec290216cb509d084e8d93db8481c4896aa8626.tar.bz2 android_packages_apps_Gallery2-dec290216cb509d084e8d93db8481c4896aa8626.zip |
Merge "Gallery2: request thumb if fail to get region decoder"
Diffstat (limited to 'src')
-rwxr-xr-x | src/com/android/gallery3d/app/SinglePhotoDataAdapter.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/app/SinglePhotoDataAdapter.java b/src/com/android/gallery3d/app/SinglePhotoDataAdapter.java index fe39e4e3d..8134756f8 100755 --- a/src/com/android/gallery3d/app/SinglePhotoDataAdapter.java +++ b/src/com/android/gallery3d/app/SinglePhotoDataAdapter.java @@ -89,7 +89,16 @@ public class SinglePhotoDataAdapter extends TileImageViewAdapter @Override public void onFutureDone(Future<BitmapRegionDecoder> future) { BitmapRegionDecoder decoder = future.get(); - if (decoder == null) return; + // cannot get large bitmap, then try to get thumb bitmap + if (decoder == null) { + if (mTask != null && !mTask.isCancelled()) { + Log.w(TAG, "fail to get region decoder, try to request thumb image"); + mHasFullImage = false; + pause(); + resume(); + } + return; + } int width = decoder.getWidth(); int height = decoder.getHeight(); BitmapFactory.Options options = new BitmapFactory.Options(); @@ -136,7 +145,6 @@ public class SinglePhotoDataAdapter extends TileImageViewAdapter Bitmap backup = future.get(); if (backup == null) { mLoadingState = LOADING_FAIL; - return; } else { mLoadingState = LOADING_COMPLETE; } |