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

Commit 9c9396f8 authored by Pradeep Panigrahi's avatar Pradeep Panigrahi Committed by Andre Eisenbach
Browse files

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
parent e1d1e72f
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -535,6 +535,13 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession {
                    }
                    }
                } catch (IOException e) {
                } catch (IOException e) {
                    Log.e(TAG, "Error when closing stream after send");
                    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;
            return status;