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

Commit 3d451cf6 authored by Andre Eisenbach's avatar Andre Eisenbach
Browse files

Serialize remote version query over LE

Some devices (ex. Nexus Player remote) do not take well to having the
remote version queried while a remote feature request is also sent and
subsequently fail encryption.

This patch serializes the query of the remote version and requires both
remote features and the remote version to be read before calling a
connection established.

Bug: 25357767
Change-Id: Ie70eea241b47b81778d8e0df47f3a8f376316932
parent 0b807371
Loading
Loading
Loading
Loading
+12 −8
Original line number Original line Diff line number Diff line
@@ -268,8 +268,8 @@ void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, BD_NAME bdn,
            if (transport == BT_TRANSPORT_BR_EDR)
            if (transport == BT_TRANSPORT_BR_EDR)
            {
            {
                btsnd_hcic_read_rmt_clk_offset (p->hci_handle);
                btsnd_hcic_read_rmt_clk_offset (p->hci_handle);
            }
                btsnd_hcic_rmt_ver_req (p->hci_handle);
                btsnd_hcic_rmt_ver_req (p->hci_handle);
            }
            p_dev_rec = btm_find_dev_by_handle (hci_handle);
            p_dev_rec = btm_find_dev_by_handle (hci_handle);


#if (BLE_INCLUDED == TRUE)
#if (BLE_INCLUDED == TRUE)
@@ -911,21 +911,25 @@ void btm_read_remote_version_complete (UINT8 *p)
    UINT16            handle;
    UINT16            handle;
    int               xx;
    int               xx;
    BTM_TRACE_DEBUG ("btm_read_remote_version_complete");
    BTM_TRACE_DEBUG ("btm_read_remote_version_complete");

    STREAM_TO_UINT8  (status, p);
    STREAM_TO_UINT8  (status, p);
    if (status == HCI_SUCCESS)
    {
    STREAM_TO_UINT16 (handle, p);
    STREAM_TO_UINT16 (handle, p);


    /* Look up the connection by handle and copy features */
    /* Look up the connection by handle and copy features */
    for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_acl_cb++)
    for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_acl_cb++)
    {
    {
        if ((p_acl_cb->in_use) && (p_acl_cb->hci_handle == handle))
        if ((p_acl_cb->in_use) && (p_acl_cb->hci_handle == handle))
        {
            if (status == HCI_SUCCESS)
            {
            {
                STREAM_TO_UINT8  (p_acl_cb->lmp_version, p);
                STREAM_TO_UINT8  (p_acl_cb->lmp_version, p);
                STREAM_TO_UINT16 (p_acl_cb->manufacturer, p);
                STREAM_TO_UINT16 (p_acl_cb->manufacturer, p);
                STREAM_TO_UINT16 (p_acl_cb->lmp_subversion, p);
                STREAM_TO_UINT16 (p_acl_cb->lmp_subversion, p);
                break;
            }
            }

            if (p_acl_cb->transport == BT_TRANSPORT_LE)
                l2cble_notify_le_connection (p_acl_cb->remote_addr);
            break;
        }
        }
    }
    }
}
}
+1 −2
Original line number Original line Diff line number Diff line
@@ -3202,8 +3202,7 @@ void btm_ble_read_remote_features_complete(UINT8 *p)
            if ((p_acl_cb->in_use) && (p_acl_cb->hci_handle == handle))
            if ((p_acl_cb->in_use) && (p_acl_cb->hci_handle == handle))
            {
            {
                STREAM_TO_ARRAY(p_acl_cb->peer_le_features, p, BD_FEATURES_LEN);
                STREAM_TO_ARRAY(p_acl_cb->peer_le_features, p, BD_FEATURES_LEN);
                /*notify link up here */
                btsnd_hcic_rmt_ver_req (p_acl_cb->hci_handle);
                l2cble_notify_le_connection (p_acl_cb->remote_addr);
                break;
                break;
            }
            }
        }
        }
+1 −0
Original line number Original line Diff line number Diff line
@@ -190,6 +190,7 @@ void smp_send_app_cback(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
                            (const bt_bdaddr_t *)&p_cb->pairing_bda))
                            (const bt_bdaddr_t *)&p_cb->pairing_bda))
                    {
                    {
                        p_cb->loc_auth_req &= ~SMP_KP_SUPPORT_BIT;
                        p_cb->loc_auth_req &= ~SMP_KP_SUPPORT_BIT;
                        p_cb->loc_auth_req &= ~SMP_SC_SUPPORT_BIT;
                        p_cb->local_i_key &= ~SMP_SEC_KEY_TYPE_LK;
                        p_cb->local_i_key &= ~SMP_SEC_KEY_TYPE_LK;
                        p_cb->local_r_key &= ~SMP_SEC_KEY_TYPE_LK;
                        p_cb->local_r_key &= ~SMP_SEC_KEY_TYPE_LK;
                    }
                    }