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

Commit a8648ece authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Close connection before retrying" into lmp-dev

parents 4911af2b 46132afe
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -130,7 +130,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;
@@ -291,8 +297,7 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {
            mCurrentOffset = offset;
        } catch (IOException e) {
            mTotalSize = -1;
            mInputStream = null;
            mConnection = null;
            teardownConnection();
            mCurrentOffset = -1;

            throw e;