diff options
| author | Andre Eisenbach <eisenbach@google.com> | 2015-10-29 15:48:06 -0700 |
|---|---|---|
| committer | The Android Automerger <android-build@google.com> | 2015-10-29 19:25:06 -0700 |
| commit | eb6b3644a1a45d959783ea3109fcda975cbe7105 (patch) | |
| tree | 486e4bd1e8eec598c6d8c77ab2ae0b044429872e /stack/btm | |
| parent | 4f7c4f67320bbb35c85b478d2ac7aa29d732acca (diff) | |
| download | android_system_bt-eb6b3644a1a45d959783ea3109fcda975cbe7105.tar.gz android_system_bt-eb6b3644a1a45d959783ea3109fcda975cbe7105.tar.bz2 android_system_bt-eb6b3644a1a45d959783ea3109fcda975cbe7105.zip | |
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
Diffstat (limited to 'stack/btm')
| -rw-r--r-- | stack/btm/btm_acl.c | 20 | ||||
| -rw-r--r-- | stack/btm/btm_ble_gap.c | 3 |
2 files changed, 13 insertions, 10 deletions
diff --git a/stack/btm/btm_acl.c b/stack/btm/btm_acl.c index 05f665bc3..b09f91bb4 100644 --- a/stack/btm/btm_acl.c +++ b/stack/btm/btm_acl.c @@ -268,8 +268,8 @@ void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, BD_NAME bdn, if (transport == BT_TRANSPORT_BR_EDR) { 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); #if (BLE_INCLUDED == TRUE) @@ -911,21 +911,25 @@ void btm_read_remote_version_complete (UINT8 *p) UINT16 handle; int xx; BTM_TRACE_DEBUG ("btm_read_remote_version_complete"); + 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 */ - for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_acl_cb++) + /* Look up the connection by handle and copy features */ + 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_UINT16 (p_acl_cb->manufacturer, 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; } } } diff --git a/stack/btm/btm_ble_gap.c b/stack/btm/btm_ble_gap.c index f841148a4..3b85fbbe8 100644 --- a/stack/btm/btm_ble_gap.c +++ b/stack/btm/btm_ble_gap.c @@ -3215,8 +3215,7 @@ void btm_ble_read_remote_features_complete(UINT8 *p) 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); - /*notify link up here */ - l2cble_notify_le_connection (p_acl_cb->remote_addr); + btsnd_hcic_rmt_ver_req (p_acl_cb->hci_handle); break; } } |
