Merge "Close connection before retrying" into lmp-dev am: a8648ecebb
am: 5181a7ab64
Change-Id: I34a176a0da235836eaa9e44b843ec5d5654b8db9
This commit is contained in:
@@ -131,7 +131,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;
|
||||
@@ -292,8 +298,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