Merge "Close connection before retrying" into lmp-dev am: a8648ecebb am: 5181a7ab64

am: 4b78a79546

Change-Id: Iceb4edfd80a0a483d28f2624669eff9dd86bfcb8
This commit is contained in:
Marco Nelissen
2017-06-06 23:16:24 +00:00
committed by android-build-merger

View File

@@ -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;