From: Ajay Panicker Date: Thu, 23 Jun 2016 20:29:34 +0000 (-0700) Subject: Close output stream before getting response X-Git-Tag: android-7.1.2_r17~66^2~2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e026ad5004a084c95b86a061924c692546a10395;p=android-x86%2Fpackages-apps-Bluetooth.git 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 --- diff --git a/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java b/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java index 49ec6dcb..1688c706 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java +++ b/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java @@ -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(); }