• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


Commit MetaInfo

Révision1308453b16c2ca85a456bd4bb7f3c71c916bd83e (tree)
l'heure2010-05-04 15:06:51
AuteurMichael Chan <mchan@andr...>
CommiterMichael Chan

Message de Log

b/2652059 Fixed the broken BT connects/disconnects after unpair

The unpair command was stuck in the queue.

Change-Id: I803cb10adcfaedbe6fd202e0db463593880e4280

Change Summary

Modification

--- a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
+++ b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
@@ -749,7 +749,33 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
749749 public void onBondingStateChanged(int bondState) {
750750 if (bondState == BluetoothDevice.BOND_NONE) {
751751 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();
752777 }
778+
753779 refresh();
754780 }
755781