Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b78a795 authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

Merge "Close connection before retrying" into lmp-dev am: a8648ece

am: 5181a7ab

Change-Id: I34a176a0da235836eaa9e44b843ec5d5654b8db9
parents 8965cd6a 5181a7ab
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -131,7 +131,13 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {

    private void teardownConnection() {
        if (mConnection != 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;