diff options
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/BitmapManager.java | 14 | ||||
-rw-r--r-- | src/com/android/camera/CropImage.java | 5 | ||||
-rwxr-xr-x | src/com/android/camera/ImageManager.java | 15 | ||||
-rw-r--r-- | src/com/android/camera/Util.java | 5 |
4 files changed, 21 insertions, 18 deletions
diff --git a/src/com/android/camera/BitmapManager.java b/src/com/android/camera/BitmapManager.java index 4d17ec3..22d5bb3 100644 --- a/src/com/android/camera/BitmapManager.java +++ b/src/com/android/camera/BitmapManager.java @@ -229,15 +229,23 @@ public class BitmapManager { */ public Bitmap decodeFileDescriptor(FileDescriptor fd, BitmapFactory.Options options) { + if (options.mCancel) { + return null; + } + // Does the global switch turn on? - if (!canDecode() || options.mCancel) { - return null; + if (!canDecode()) { + // This is a bug, and we should fix the caller. + Util.debugWhere(TAG, "canDecode() == false"); + return null; } // Can current thread decode? Thread thread = Thread.currentThread(); if (!canThreadDecoding(thread)) { - return null; + // This is a bug, and we should fix the caller. + Util.debugWhere(TAG, "canThreadDecoding() == false"); + return null; } setDecodingOptions(thread, options); diff --git a/src/com/android/camera/CropImage.java b/src/com/android/camera/CropImage.java index fc3e360..616a851 100644 --- a/src/com/android/camera/CropImage.java +++ b/src/com/android/camera/CropImage.java @@ -102,6 +102,11 @@ public class CropImage extends Activity { MenuHelper.showStorageToast(this); + BitmapManager bitmapManager = BitmapManager.instance(); + bitmapManager.setCheckResourceLock(false); + bitmapManager.allowAllDecoding(); + bitmapManager.allowThreadDecoding(Thread.currentThread()); + try { Intent intent = getIntent(); Bundle extras = intent.getExtras(); diff --git a/src/com/android/camera/ImageManager.java b/src/com/android/camera/ImageManager.java index 05b197e..8a4b055 100755 --- a/src/com/android/camera/ImageManager.java +++ b/src/com/android/camera/ImageManager.java @@ -111,21 +111,6 @@ public class ImageManager { } } - public static void debugWhere(String tag, String msg) { - Exception ex = new Exception(); - if (msg != null) { - Log.v(tag, msg); - } - boolean first = true; - for (StackTraceElement s : ex.getStackTrace()) { - if (first) { - first = false; - } else { - Log.v(tag, s.toString()); - } - } - } - public static DataLocation getDefaultDataLocation() { return DataLocation.EXTERNAL; } diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java index 5f5c624..2b7e756 100644 --- a/src/com/android/camera/Util.java +++ b/src/com/android/camera/Util.java @@ -355,4 +355,9 @@ public class Util { return null; } } + + public static void debugWhere(String tag, String msg) { + Exception ex = new Exception(); + Log.d(tag, msg, ex); + } } |