summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2011-10-13 21:40:53 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-10-13 21:40:53 -0700
commit5d393ac4b272131104b1ffe9a04e84022e63c0f0 (patch)
treea2c0af961f09faa5dfb9dda482cce258df4a30b8
parent8c4db782ebc7b8132b474844589936f547b09368 (diff)
parentb289d441eb5af97ac8716479831b1a2c5fe2e878 (diff)
downloadandroid_packages_apps_Gallery2-5d393ac4b272131104b1ffe9a04e84022e63c0f0.tar.gz
android_packages_apps_Gallery2-5d393ac4b272131104b1ffe9a04e84022e63c0f0.tar.bz2
android_packages_apps_Gallery2-5d393ac4b272131104b1ffe9a04e84022e63c0f0.zip
am b289d441: Fix 5398768: Add requestCreateBitmapRegionDecoder for InputStream.
* commit 'b289d441eb5af97ac8716479831b1a2c5fe2e878': Fix 5398768: Add requestCreateBitmapRegionDecoder for InputStream.
-rw-r--r--src/com/android/gallery3d/data/DecodeUtils.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/data/DecodeUtils.java b/src/com/android/gallery3d/data/DecodeUtils.java
index 29b2aa738..b205576cd 100644
--- a/src/com/android/gallery3d/data/DecodeUtils.java
+++ b/src/com/android/gallery3d/data/DecodeUtils.java
@@ -33,6 +33,7 @@ import android.os.ParcelFileDescriptor;
import java.io.FileDescriptor;
import java.io.FileInputStream;
+import java.io.InputStream;
public class DecodeUtils {
private static final String TAG = "DecodeService";
@@ -192,6 +193,18 @@ public class DecodeUtils {
}
public static BitmapRegionDecoder requestCreateBitmapRegionDecoder(
+ JobContext jc, InputStream is, boolean shareable) {
+ try {
+ return BitmapRegionDecoder.newInstance(is, shareable);
+ } catch (Throwable t) {
+ // We often cancel the creating of bitmap region decoder,
+ // so just log one line.
+ Log.w(TAG, "requestCreateBitmapRegionDecoder: " + t);
+ return null;
+ }
+ }
+
+ public static BitmapRegionDecoder requestCreateBitmapRegionDecoder(
JobContext jc, Uri uri, ContentResolver resolver,
boolean shareable) {
ParcelFileDescriptor pfd = null;