From b172cd5d232bd650d6efbb7d8b5e4cf9c213952f Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Thu, 10 Dec 2009 01:59:19 -0800 Subject: [PATCH] Fix desk dock getting stuck after unpairing. Note: This is a workaround. The read problem is that we are making a call to Bluez when it is not ready yet. The interface has not been registered, so dbus call should fail. We need to fix this properly. Dr No: Eastham Bug: 2317784 --- .../android/settings/bluetooth/CachedBluetoothDevice.java | 6 ++++++ .../settings/bluetooth/CachedBluetoothDeviceManager.java | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java index 53c1253aa53..ca72d8a6958 100644 --- a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java +++ b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java @@ -383,6 +383,12 @@ public class CachedBluetoothDevice implements Comparable connectWithoutResettingTimer(); } + /*package*/ void onBondingDockConnect() { + // Don't connect just set the timer. + // TODO(): Fix the actual problem + mConnectAttempted = SystemClock.elapsedRealtime(); + } + private void connectWithoutResettingTimer() { // Try to initialize the profiles if there were not. if (mProfiles.size() == 0) { diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java b/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java index c3dfc208bf8..7906d79fc63 100644 --- a/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java +++ b/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java @@ -186,7 +186,11 @@ public class CachedBluetoothDeviceManager { if (bondState == BluetoothDevice.BOND_BONDED) { // Auto-connect after pairing - cachedDevice.connect(); + if (!device.isBluetoothDock()) { + cachedDevice.connect(); + } else { + cachedDevice.onBondingDockConnect(); + } } }