summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Chan <mchan@android.com>2010-05-04 12:36:27 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-05-04 12:36:27 -0700
commitd17eb48e9c87e02cbcb42899915dbfc921075231 (patch)
treef18fa9e2d0b5b00ac11c744513fe50bb4645814b /src
parenta359fb77d41ab3ac00a1020b42fa2e898904c1af (diff)
parent1308453b16c2ca85a456bd4bb7f3c71c916bd83e (diff)
downloadpackages_apps_Settings-d17eb48e9c87e02cbcb42899915dbfc921075231.zip
packages_apps_Settings-d17eb48e9c87e02cbcb42899915dbfc921075231.tar.gz
packages_apps_Settings-d17eb48e9c87e02cbcb42899915dbfc921075231.tar.bz2
am 1308453b: b/2652059 Fixed the broken BT connects/disconnects after unpair
Merge commit '1308453b16c2ca85a456bd4bb7f3c71c916bd83e' into froyo-plus-aosp * commit '1308453b16c2ca85a456bd4bb7f3c71c916bd83e': b/2652059 Fixed the broken BT connects/disconnects after unpair
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/bluetooth/CachedBluetoothDevice.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
index acc8551..c724c33 100644
--- 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>
public void onBondingStateChanged(int bondState) {
if (bondState == BluetoothDevice.BOND_NONE) {
mProfiles.clear();
+
+ BluetoothJob job = workQueue.peek();
+ if (job == null) {
+ return;
+ }
+
+ // Remove the first item and process the next one
+ if (job.command == BluetoothCommand.REMOVE_BOND
+ && job.cachedDevice.mDevice.equals(mDevice)) {
+ workQueue.poll(); // dequeue
+ } else {
+ // Unexpected job
+ if (D) {
+ Log.d(TAG, "job.command = " + job.command);
+ Log.d(TAG, "mDevice:" + mDevice + " != head:" + job.toString());
+ }
+
+ // Check to see if we need to remove the stale items from the queue
+ if (!pruneQueue(null)) {
+ // nothing in the queue was modify. Just ignore the notification and return.
+ return;
+ }
+ }
+
+ processCommands();
}
+
refresh();
}