diff options
author | Elliott Hughes <enh@google.com> | 2014-04-11 17:41:44 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-11 17:41:44 +0000 |
commit | 70bba904fc50f44cb4a695cf76e423534c835cf6 (patch) | |
tree | 228373394258ef7e57b742f9ea714b1cf354d88c | |
parent | 1ea1857de9c98199015f0188678a12a82a6248d4 (diff) | |
parent | b093e485bbd790cc4d9678451c8cce4d361c2cf2 (diff) | |
download | frameworks_base-70bba904fc50f44cb4a695cf76e423534c835cf6.zip frameworks_base-70bba904fc50f44cb4a695cf76e423534c835cf6.tar.gz frameworks_base-70bba904fc50f44cb4a695cf76e423534c835cf6.tar.bz2 |
am b093e485: Merge "generateProjectThumbnail can fail to close output stream"
* commit 'b093e485bbd790cc4d9678451c8cce4d361c2cf2':
generateProjectThumbnail can fail to close output stream
-rw-r--r-- | media/java/android/media/videoeditor/VideoEditorImpl.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/media/java/android/media/videoeditor/VideoEditorImpl.java b/media/java/android/media/videoeditor/VideoEditorImpl.java index 2446c2f..fbf2eab 100644 --- a/media/java/android/media/videoeditor/VideoEditorImpl.java +++ b/media/java/android/media/videoeditor/VideoEditorImpl.java @@ -47,6 +47,8 @@ import android.os.Debug; import android.os.SystemProperties; import android.os.Environment; +import libcore.io.IoUtils; + /** * The VideoEditor implementation {@hide} */ @@ -1859,15 +1861,15 @@ public class VideoEditorImpl implements VideoEditor { } } + FileOutputStream stream = null; try { - FileOutputStream stream = new FileOutputStream(mProjectPath + "/" - + THUMBNAIL_FILENAME); + stream = new FileOutputStream(mProjectPath + "/" + THUMBNAIL_FILENAME); projectBitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream); stream.flush(); - stream.close(); } catch (IOException e) { throw new IllegalArgumentException ("Error creating project thumbnail"); } finally { + IoUtils.closeQuietly(stream); projectBitmap.recycle(); } } |