From 802956ec9b22464ed327c0c2cbc59f6b6a309c88 Mon Sep 17 00:00:00 2001 From: Ganesh Ganapathi Batta Date: Thu, 14 Jun 2012 00:05:06 -0700 Subject: [PATCH] Add dev to cached dev list if entry is missing before auto connect Fix for BLTH01482218 Change-Id: I7d5cfad3eff872b5eb0b0c71804f25f3c3334557 --- .../settings/bluetooth/LocalBluetoothProfileManager.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java index e832ab5b6c..191cf70bc5 100755 --- a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java +++ b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java @@ -333,12 +333,14 @@ final class LocalBluetoothProfileManager { BluetoothProfile.PRIORITY_AUTO_CONNECT) { Log.d(TAG,"handleAutoConnect for device"); CachedBluetoothDevice cacheDevice = mDeviceManager.findDevice(device); - if (null != cacheDevice) { - cacheDevice.connectInt(profile); - break; - } - else - Log.e(TAG,"Bluetooth cache devices mismatch with actual"); + if (null == cacheDevice) + { + Log.w(TAG,"Dev not found in cached dev list. Adding the dev to cached list"); + cacheDevice = mDeviceManager.addDevice(mLocalAdapter, + LocalBluetoothProfileManager.this, device); + } + cacheDevice.connectInt(profile); + break; } } } -- 2.11.0