diff options
author | Brad Fitzpatrick <bradfitz@android.com> | 2011-03-30 08:20:58 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-03-30 08:20:58 -0700 |
commit | 0ddcc8bc60ffa00e103f420f95b7f8a7c77639b6 (patch) | |
tree | a06c75e6e39dcf955d281a29527ff890819ec594 /media | |
parent | f68098534e42b33cd4588bb2d2ba34ab579e11aa (diff) | |
parent | b618b2ef8722964730d09a86a06a85ca34df6de4 (diff) | |
download | frameworks_base-0ddcc8bc60ffa00e103f420f95b7f8a7c77639b6.zip frameworks_base-0ddcc8bc60ffa00e103f420f95b7f8a7c77639b6.tar.gz frameworks_base-0ddcc8bc60ffa00e103f420f95b7f8a7c77639b6.tar.bz2 |
am b618b2ef: am f0dbf00d: Merge "Handle OutOfMemoryError when decoding images in ThumbnailUtils"
* commit 'b618b2ef8722964730d09a86a06a85ca34df6de4':
Handle OutOfMemoryError when decoding images in ThumbnailUtils
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/ThumbnailUtils.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/media/java/android/media/ThumbnailUtils.java b/media/java/android/media/ThumbnailUtils.java index 7fdf448..7c181ee 100644 --- a/media/java/android/media/ThumbnailUtils.java +++ b/media/java/android/media/ThumbnailUtils.java @@ -83,7 +83,7 @@ public class ThumbnailUtils { * * @param filePath the path of image file * @param kind could be MINI_KIND or MICRO_KIND - * @return Bitmap + * @return Bitmap, or null on failures * * @hide This method is only used by media framework and media provider internally. */ @@ -123,6 +123,8 @@ public class ThumbnailUtils { bitmap = BitmapFactory.decodeFileDescriptor(fd, null, options); } catch (IOException ex) { Log.e(TAG, "", ex); + } catch (OutOfMemoryError oom) { + Log.e(TAG, "Unable to decode file " + filePath + ". OutOfMemoryError.", oom); } } |