Merge "Close connection before retrying" into lmp-dev am: a8648ecebb am: 5181a7ab64 am: 4b78a79546 am: 6d5bc9a3c2 am: 3272cf26c1 am: e18e8c4113 am: 69b6a382a3 am: ce5c72e887 am: 4d9e6150f3 am: d7fe3ea6a8 am: db9d2588b8
am: 9e4e6c4b7c
Change-Id: I1d028759fecc34081daf0be653a1b729e0e048ac
This commit is contained in:
@@ -136,7 +136,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;
|
||||
@@ -298,8 +304,7 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {
|
||||
mCurrentOffset = offset;
|
||||
} catch (IOException e) {
|
||||
mTotalSize = -1;
|
||||
mInputStream = null;
|
||||
mConnection = null;
|
||||
teardownConnection();
|
||||
mCurrentOffset = -1;
|
||||
|
||||
throw e;
|
||||
|
||||
Reference in New Issue
Block a user