diff options
author | Pradeep Panigrahi <pradeepp@codeaurora.org> | 2013-08-29 09:33:24 +0530 |
---|---|---|
committer | Andre Eisenbach <eisenbach@google.com> | 2015-06-23 11:24:14 -0700 |
commit | ae8997b870d52d6701813e6f3ff9d87a5a083bf3 (patch) | |
tree | bb286d47abcded3e23e8ef2a5c178f1e1f880f81 /src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java | |
parent | fbe0089395f9f81c1143cffe0674d0e406dfb983 (diff) | |
download | android_packages_apps_Bluetooth-ae8997b870d52d6701813e6f3ff9d87a5a083bf3.tar.gz android_packages_apps_Bluetooth-ae8997b870d52d6701813e6f3ff9d87a5a083bf3.tar.bz2 android_packages_apps_Bluetooth-ae8997b870d52d6701813e6f3ff9d87a5a083bf3.zip |
Mark proper file transfer status upon OBEX response timeout
Use Case:
1) Pair with remote dongle and send a file over OPP.
2) Reset dongle such that there is obex response timeout.
Failure:
File transfer status is not marked a failed and hence cannot be retried
Fix:
This patch will handle the scenario of obex timeout which occurs due
to cancelling the transfer in between and trying sending again.
Bug: 21896912
Change-Id: Ide1a64e5874bda2c5cf71531f5971bc8bebf5e9f
Diffstat (limited to 'src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java')
-rw-r--r-- | src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java b/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java index 7cf6bd0b5..f8e0ca8e5 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java +++ b/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java @@ -535,6 +535,13 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession { } } catch (IOException e) { Log.e(TAG, "Error when closing stream after send"); + + // Socket has been closed due to the response timeout in the framework, + // mark the transfer as failure. + if (position != fileInfo.mLength) { + status = BluetoothShare.STATUS_FORBIDDEN; + Constants.updateShareStatus(mContext1, mInfo.mId, status); + } } } return status; |