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

Commit 44c347ad authored by Liejun Tao's avatar Liejun Tao Committed by Jaikumar Ganesh
Browse files

Modify the Rfcomm retry logic

In BluetoothOppTransfer where we check mRetry and e.getMessage()
if mRetry is false and e is not "Invalid exchange", the transfer is stuck

Change-Id: Ie7a4da215c9e74e167db9fa29c6e113a7a7a2c77
parent d318d6a1
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -720,14 +720,14 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
                    // again, but we need to retry. There is no good way to
                    // inform this socket asking it to retry apart from a blind
                    // delayed retry.
                    if (mRetry) {
                        BluetoothOppPreference.getInstance(mContext)
                                .removeChannel(device, OPUSH_UUID16);
                        markConnectionFailed(btSocket);
                    } else if (e.getMessage().equals(SOCKET_LINK_KEY_ERROR)) {
                    if (!mRetry && e.getMessage().equals(SOCKET_LINK_KEY_ERROR)) {
                        Message msg = mSessionHandler.obtainMessage(SOCKET_ERROR_RETRY,
                                channel, -1, device);
                        mSessionHandler.sendMessageDelayed(msg, 2500);
                    } else {
                        BluetoothOppPreference.getInstance(mContext)
                                .removeChannel(device, OPUSH_UUID16);
                        markConnectionFailed(btSocket);
                    }
                }
            }