Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 802956ec authored by Ganesh Ganapathi Batta's avatar Ganesh Ganapathi Batta Committed by Matthew Xie
Browse files

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

Fix for BLTH01482218

Change-Id: I7d5cfad3eff872b5eb0b0c71804f25f3c3334557
parent dbe1a24d
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -333,13 +333,15 @@ final class LocalBluetoothProfileManager {
                      BluetoothProfile.PRIORITY_AUTO_CONNECT) {
                  Log.d(TAG,"handleAutoConnect for device");
                  CachedBluetoothDevice cacheDevice = mDeviceManager.findDevice(device);
                  if (null != cacheDevice) {
                  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;
            }
                  else
                    Log.e(TAG,"Bluetooth cache devices mismatch with actual");
            }
        }
    }