Add dev to cached dev list if entry is missing before auto connect

Fix for BLTH01482218

Change-Id: I7d5cfad3eff872b5eb0b0c71804f25f3c3334557
This commit is contained in:
Ganesh Ganapathi Batta
2012-06-14 00:05:06 -07:00
committed by Matthew Xie
parent dbe1a24d35
commit 802956ec9b

View File

@@ -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;
}
}
}