am f0dbf00d: Merge "Handle OutOfMemoryError when decoding images in ThumbnailUtils"
* commit 'f0dbf00d37c349e8c615045876d6bc89b6bb8c54': Handle OutOfMemoryError when decoding images in ThumbnailUtils
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user