OSDN Git Service

Modify the Rfcomm retry logic
authorLiejun Tao <L.J.Tao@motorola.com>
Wed, 15 Jun 2011 21:58:21 +0000 (16:58 -0500)
committerJaikumar Ganesh <jaikumar@google.com>
Thu, 16 Jun 2011 01:17:13 +0000 (18:17 -0700)
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

src/com/android/bluetooth/opp/BluetoothOppTransfer.java

index 97a357c..78dd4f5 100644 (file)
@@ -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);
                     }
                 }
             }