summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-06-16 18:50:14 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-06-16 18:50:14 +0000
commit98b67dc463881d7bd8ae4ae2d4a125eca2a835c7 (patch)
tree03893018b6d72483fa1c96ed904b7409e1c8b002
parent53cf7f2bd89bd3bcdc1d3444c7d34c799e617d32 (diff)
parent20ca6f0075d0afb0d1e9027a4234cf7b756f1ee8 (diff)
downloadbase-98b67dc463881d7bd8ae4ae2d4a125eca2a835c7.tar.gz
Merge cherrypicks of [2420306, 2420248, 2420158, 2420321, 2420159, 2420160, 2420266, 2420284, 2420308, 2420342, 2420177, 2420195, 2420344, 2420345, 2420179, 2420324, 2420251, 2420269, 2420271, 2420325, 2420310, 2420220, 2420348, 2420291, 2420328, 2420330, 2420383, 2420331, 2420255, 2420296, 2420278, 2420229, 2420335] into nyc-mr1-volantis-releaseandroid-7.1.1_r49
Change-Id: Ia79882173cf270db830dc28c10fc77b43f57a811
-rw-r--r--media/java/android/media/MediaHTTPConnection.java11
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;