summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2011-10-14 11:22:57 +0800
committerChih-Chung Chang <chihchung@google.com>2011-10-14 12:32:29 +0800
commitb289d441eb5af97ac8716479831b1a2c5fe2e878 (patch)
tree7af3d8380fa97036e1467376c9b284454837713e /src
parent85bc435c06ace72f5da72475e9b03b0ada9455e0 (diff)
downloadandroid_packages_apps_Gallery2-b289d441eb5af97ac8716479831b1a2c5fe2e878.tar.gz
android_packages_apps_Gallery2-b289d441eb5af97ac8716479831b1a2c5fe2e878.tar.bz2
android_packages_apps_Gallery2-b289d441eb5af97ac8716479831b1a2c5fe2e878.zip
Fix 5398768: Add requestCreateBitmapRegionDecoder for InputStream.
Change-Id: Ied273ffbabc134fdd930e6415fc175a6221eb662
Diffstat (limited to 'src')
-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;