OSDN Git Service

Fix to ensure that we are able to pair with a device that was just unpaired. The...
authorKausik Sinnaswamy <kausik@broadcom.com>
Mon, 14 May 2012 11:59:22 +0000 (17:29 +0530)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Tue, 17 Jul 2012 05:07:04 +0000 (22:07 -0700)
Change-Id: Iaad0e21794b0b6e47d12c837ef36e026b6ece655

src/com/android/bluetooth/btservice/BondStateMachine.java

index 70cfac6..ee11ea3 100755 (executable)
@@ -154,6 +154,11 @@ final class BondStateMachine extends StateMachine {
                         /* this is either none/bonded, remove and transition */
                         result = !mDevices.remove(dev);
                         if (mDevices.isEmpty()) {
+                            // Whenever mDevices is empty, then we need to
+                            // set result=false. Else, we will end up adding
+                            // the device to the list again. This prevents us
+                            // from pairing with a device that we just unpaired
+                            result = false;
                             transitionTo(mStableState);
                         }
                     }