summaryrefslogtreecommitdiffstats
path: root/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java
diff options
context:
space:
mode:
authorAjay Panicker <apanicke@google.com>2016-06-23 13:29:34 -0700
committerAjay Panicker <apanicke@google.com>2016-06-23 13:32:42 -0700
commite026ad5004a084c95b86a061924c692546a10395 (patch)
tree54ee62c27b203c786be7afbbe857b5f4aa556f6a /src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java
parent303ef0bd1343806adba9b00e39ca05b7c9e50a4f (diff)
downloadandroid_packages_apps_Bluetooth-e026ad5004a084c95b86a061924c692546a10395.tar.gz
android_packages_apps_Bluetooth-e026ad5004a084c95b86a061924c692546a10395.tar.bz2
android_packages_apps_Bluetooth-e026ad5004a084c95b86a061924c692546a10395.zip
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
Diffstat (limited to 'src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java')
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java b/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java
index 49ec6dcba..1688c7063 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();
}