diff options
author | Michael Chan <mchan@android.com> | 2010-05-04 12:45:29 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-05-04 12:45:29 -0700 |
commit | d4869a99df6d9975c47dfbb6c5a9b0f69ece3149 (patch) | |
tree | 0ec5550c5212022be366a51f73f96dcdb926da49 /src | |
parent | b458ec285f60fd36de42c3a3079188f2ef692b9f (diff) | |
parent | d17eb48e9c87e02cbcb42899915dbfc921075231 (diff) | |
download | packages_apps_Settings-d4869a99df6d9975c47dfbb6c5a9b0f69ece3149.zip packages_apps_Settings-d4869a99df6d9975c47dfbb6c5a9b0f69ece3149.tar.gz packages_apps_Settings-d4869a99df6d9975c47dfbb6c5a9b0f69ece3149.tar.bz2 |
am d17eb48e: am 1308453b: b/2652059 Fixed the broken BT connects/disconnects after unpair
Merge commit 'd17eb48e9c87e02cbcb42899915dbfc921075231' into kraken
* commit 'd17eb48e9c87e02cbcb42899915dbfc921075231':
b/2652059 Fixed the broken BT connects/disconnects after unpair
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/bluetooth/CachedBluetoothDevice.java | 26 |
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(); } |