Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c859c0b authored by Shalaj Jain's avatar Shalaj Jain Committed by Steve Kondik
Browse files

frameworks/base: Handle Out of Memory Exception when creating video thumbnails.



Adds code to handle an out of memory exception when generating the thumbnail
from a recently recorded video clip.

Change-Id: Ifcbe007272ffef85744fca1414ea5eacccd0154c
CRs-Fixed: 277571
Signed-off-by: default avatarShalaj Jain <shalajj@codeaurora.org>
parent 1ec97cd7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -161,6 +161,8 @@ public class ThumbnailUtils {
        try {
            retriever.setDataSource(filePath);
            bitmap = retriever.getFrameAtTime(-1);
        } catch (OutOfMemoryError e) {
                Log.e(TAG, "Got OOM error", e);
        } catch (IllegalArgumentException ex) {
            // Assume this is a corrupt video file
        } catch (RuntimeException ex) {