diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-15 19:15:47 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-15 19:15:47 +0000 |
commit | 1ad9820f297decc0b0e9671d8d616bb1634db3c4 (patch) | |
tree | deaec1501e638e6ec1790d8c6704f1662c2c3deb | |
parent | 856e318f93052fb934391c291c07d769663d9a1b (diff) | |
parent | 6f357fd589e115a74aae25b1ac325af6121cdadf (diff) | |
download | base-android-7.1.2_r28.tar.gz |
Merge cherrypicks of [2413468, 2413357, 2413489, 2413431, 2413506, 2413398, 2413399, 2413319, 2413507, 2413508, 2413371, 2413410, 2413432, 2413358, 2413490, 2413359, 2413360, 2413320, 2413509, 2413491, 2414061, 2413372, 2413492, 2413433, 2413469, 2413411, 2414062, 2413373, 2413374, 2413470, 2413400, 2414063, 2414064, 2413447, 2413434, 2414101, 2413412] into nyc-mr2-releaseandroid-7.1.2_r28
Change-Id: I7c3d4ab6cac4cc3f95bec81ce08956f0689364fa
-rw-r--r-- | media/java/android/media/MediaHTTPConnection.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/media/java/android/media/MediaHTTPConnection.java b/media/java/android/media/MediaHTTPConnection.java index d6bf421ffa9f..dda5ce6fd083 100644 --- a/media/java/android/media/MediaHTTPConnection.java +++ b/media/java/android/media/MediaHTTPConnection.java @@ -135,7 +135,13 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub { private void teardownConnection() { if (mConnection != null) { - mInputStream = null; + if (mInputStream != null) { + try { + mInputStream.close(); + } catch (IOException e) { + } + mInputStream = null; + } mConnection.disconnect(); mConnection = null; @@ -297,8 +303,7 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub { mCurrentOffset = offset; } catch (IOException e) { mTotalSize = -1; - mInputStream = null; - mConnection = null; + teardownConnection(); mCurrentOffset = -1; throw e; |