packages/apps/Settings
Révision | 1308453b16c2ca85a456bd4bb7f3c71c916bd83e (tree) |
---|---|
l'heure | 2010-05-04 15:06:51 |
Auteur | Michael Chan <mchan@andr...> |
Commiter | Michael Chan |
b/2652059 Fixed the broken BT connects/disconnects after unpair
The unpair command was stuck in the queue.
Change-Id: I803cb10adcfaedbe6fd202e0db463593880e4280
@@ -749,7 +749,33 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> | ||
749 | 749 | public void onBondingStateChanged(int bondState) { |
750 | 750 | if (bondState == BluetoothDevice.BOND_NONE) { |
751 | 751 | mProfiles.clear(); |
752 | + | |
753 | + BluetoothJob job = workQueue.peek(); | |
754 | + if (job == null) { | |
755 | + return; | |
756 | + } | |
757 | + | |
758 | + // Remove the first item and process the next one | |
759 | + if (job.command == BluetoothCommand.REMOVE_BOND | |
760 | + && job.cachedDevice.mDevice.equals(mDevice)) { | |
761 | + workQueue.poll(); // dequeue | |
762 | + } else { | |
763 | + // Unexpected job | |
764 | + if (D) { | |
765 | + Log.d(TAG, "job.command = " + job.command); | |
766 | + Log.d(TAG, "mDevice:" + mDevice + " != head:" + job.toString()); | |
767 | + } | |
768 | + | |
769 | + // Check to see if we need to remove the stale items from the queue | |
770 | + if (!pruneQueue(null)) { | |
771 | + // nothing in the queue was modify. Just ignore the notification and return. | |
772 | + return; | |
773 | + } | |
774 | + } | |
775 | + | |
776 | + processCommands(); | |
752 | 777 | } |
778 | + | |
753 | 779 | refresh(); |
754 | 780 | } |
755 | 781 |