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

Commit 0f22d8a2 authored by Ajay Panicker's avatar Ajay Panicker
Browse files

Close output stream before getting response

If the output stream is still open after finishing the sending of
a file, a CONTINUE response code is received instead of an OK code.

Bug: 29583227
Change-Id: I1b2515e8fe5eec208bbbe1df17f96cc20c5ea884
parent fa1d151a
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -496,6 +496,10 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession {
                handleSendException(e.toString());
            } finally {
                try {
                    if (outputStream != null) {
                      outputStream.close();
                    }

                    // Close InputStream and remove SendFileInfo from map
                    BluetoothOppUtility.closeSendFileInfo(mInfo.mUri);
                    if (!error) {
@@ -524,9 +528,6 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession {
                    if (inputStream != null) {
                        inputStream.close();
                    }
                    if (outputStream != null) {
                        outputStream.close();
                    }
                    if (putOperation != null) {
                        putOperation.close();
                    }