am 8a0103df: am 802956ec: Add dev to cached dev list if entry is missing before auto connect

* commit '8a0103df4ef5425ca63071ab0b8db4b3cf00dbd2':
  Add dev to cached dev list if entry is missing before auto connect
This commit is contained in:
Ganesh Ganapathi Batta
2012-08-01 00:46:40 -07:00
committed by Android Git Automerger

View File

@@ -333,12 +333,14 @@ final class LocalBluetoothProfileManager {
BluetoothProfile.PRIORITY_AUTO_CONNECT) { BluetoothProfile.PRIORITY_AUTO_CONNECT) {
Log.d(TAG,"handleAutoConnect for device"); Log.d(TAG,"handleAutoConnect for device");
CachedBluetoothDevice cacheDevice = mDeviceManager.findDevice(device); CachedBluetoothDevice cacheDevice = mDeviceManager.findDevice(device);
if (null != cacheDevice) { if (null == cacheDevice)
cacheDevice.connectInt(profile); {
break; Log.w(TAG,"Dev not found in cached dev list. Adding the dev to cached list");
} cacheDevice = mDeviceManager.addDevice(mLocalAdapter,
else LocalBluetoothProfileManager.this, device);
Log.e(TAG,"Bluetooth cache devices mismatch with actual"); }
cacheDevice.connectInt(profile);
break;
} }
} }
} }