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

Commit 5181a7ab 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

Change-Id: I744fdb979aa2803b53d3ff6f4e3e72f6f1160d74
parents 1cc9ec47 a8648ece
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -131,7 +131,13 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {


    private void teardownConnection() {
    private void teardownConnection() {
        if (mConnection != null) {
        if (mConnection != null) {
            if (mInputStream != null) {
                try {
                    mInputStream.close();
                } catch (IOException e) {
                }
                mInputStream = null;
                mInputStream = null;
            }


            mConnection.disconnect();
            mConnection.disconnect();
            mConnection = null;
            mConnection = null;
@@ -292,8 +298,7 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {
            mCurrentOffset = offset;
            mCurrentOffset = offset;
        } catch (IOException e) {
        } catch (IOException e) {
            mTotalSize = -1;
            mTotalSize = -1;
            mInputStream = null;
            teardownConnection();
            mConnection = null;
            mCurrentOffset = -1;
            mCurrentOffset = -1;


            throw e;
            throw e;