diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-16 18:46:22 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-16 18:46:22 +0000 |
commit | 3e957ed2e47703061f8f8a4b2e9c1f4265dbb963 (patch) | |
tree | 03893018b6d72483fa1c96ed904b7409e1c8b002 | |
parent | e0fc667639b727c439ed3b0c72efdf76879e8c20 (diff) | |
parent | 37a17274fdceb236e1d2f57df043825eb21b7478 (diff) | |
download | base-3e957ed2e47703061f8f8a4b2e9c1f4265dbb963.tar.gz |
Merge cherrypicks of [2420241, 2420242, 2420222, 2420190, 2420097, 2420079, 2420098, 2420099, 2420100, 2420153, 2420120, 2420208, 2420281, 2420209, 2420282, 2420301, 2420192, 2420302, 2420193, 2420211, 2420264, 2420247, 2420157, 2420265, 2420216, 2420307, 2420217, 2420250, 2420341, 2420219, 2420326, 2420180, 2420254] into nyc-mr1-security-a-releaseandroid-7.1.1_r47
Change-Id: I22125245d36f5490654aaa415324c6e69cd0892a
-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; |