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

Commit c9606c5f authored by Pradeep Panigrahi's avatar Pradeep Panigrahi
Browse files

Bluetooth: Mark proper file transfer status upon OBEX response timeout

This patch will handle the scenario of obex timeout which occurs due
to cancelling the transfer in between and trying sending again.

Change-Id: I92a269be6cd7e972ddc98b10f036b19e7aebbbe5
parent 4b0e3ffd
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -397,6 +397,7 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession {
            ContentValues updateValues;
            ContentResolverUpdateThread uiUpdateThread = null;
            HeaderSet reply;
            int position = 0;
            reply = new HeaderSet();
            HeaderSet request;
            request = new HeaderSet();
@@ -449,7 +450,6 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession {
                }

                if (!error) {
                    long position = 0;
                    int readLength = 0;
                    boolean okToProceed = false;
                    long timestamp = 0;
@@ -636,6 +636,13 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession {
                    }
                } catch (IOException e) {
                    Log.e(TAG, "Error when closing stream after send");
                    /* Socket is been closed due to the response timeout in the framework
                     * Hence, mark the transfer as failure
                     */
                    if (position != fileInfo.mLength) {
                       status = BluetoothShare.STATUS_FORBIDDEN;
                       Constants.updateShareStatus(mContext1, mInfo.mId, status);
                    }
                }
            }
            return status;