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

Commit 77f97d7e authored by Andre Eisenbach's avatar Andre Eisenbach Committed by Matthew Xie
Browse files

LE: Avoid LE connection to a non-LE device

During device inquiry, an LE connection to a non-LE device may be
triggered to discover the remote connection parameters. This fix adds
device type checking to prevent LE connections to non-LE devices.

Change-Id: I9e34642e7503b1c87a8eb06ec854843f7be263b2
parent 6d5c7e48
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -2654,6 +2654,10 @@ static void bta_dm_service_search_remname_cback (BD_ADDR bd_addr, DEV_CLASS dc,
static void bta_dm_remname_cback (tBTM_REMOTE_DEV_NAME *p_remote_name)
{
    tBTA_DM_REM_NAME * p_msg;
#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
    tBT_DEVICE_TYPE dev_type;
    tBLE_ADDR_TYPE  addr_type;
#endif

    APPL_TRACE_DEBUG2("bta_dm_remname_cback len = %d name=<%s>", p_remote_name->length,
                      p_remote_name->remote_bd_name);
@@ -2665,6 +2669,8 @@ static void bta_dm_remname_cback (tBTM_REMOTE_DEV_NAME *p_remote_name)

    BTM_SecDeleteRmtNameNotifyCallback(&bta_dm_service_search_remname_cback);
#if BLE_INCLUDED == TRUE
    BTM_ReadDevInfo(p_remote_name->remote_bd_name, &dev_type, &addr_type);
    if (dev_type == BT_DEVICE_TYPE_BLE)
        GAP_BleReadPeerPrefConnParams (bta_dm_search_cb.peer_bdaddr);
#endif
    if ((p_msg = (tBTA_DM_REM_NAME *) GKI_getbuf(sizeof(tBTA_DM_REM_NAME))) != NULL)