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

Commit aa796320 authored by Himanshu Rawat's avatar Himanshu Rawat
Browse files

HOGP must not wait for BR/EDR security procedures

If BR/EDR encryption is pending at the time of HOGP connection, HOGP
does not proceed with the connection irrespective of whether the LE link
is encrypted or not. It continues to wait for non-existent LE security
procedures to complete.

Test: mmm packages/modules/Bluetooth
Test: Manual | Pair with dual mode device supporting HOGP
Flag: EXEMPT bugifx
Bug: 347241319
Change-Id: Id3098478c71259cb295be3e2c1d67635643e0df7
parent b68f783e
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -1074,11 +1074,6 @@ static void bta_hh_clear_service_cache(tBTA_HH_DEV_CB* p_cb) {
 ******************************************************************************/
void bta_hh_start_security(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* /* p_buf */) {
  log::verbose("addr:{}", p_cb->link_spec.addrt.bda);
  if (BTM_SecIsSecurityPending(p_cb->link_spec.addrt.bda)) {
    /* if security collision happened, wait for encryption done */
    p_cb->security_pending = true;
    return;
  }

  /* if link has been encrypted */
  if (BTM_IsEncrypted(p_cb->link_spec.addrt.bda, BT_TRANSPORT_LE)) {
@@ -1092,9 +1087,12 @@ void bta_hh_start_security(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* /* p_buf */
    p_cb->status = BTA_HH_ERR_AUTH_FAILED;
    BTM_SetEncryption(p_cb->link_spec.addrt.bda, BT_TRANSPORT_LE, bta_hh_le_encrypt_cback, NULL,
                      BTM_BLE_SEC_ENCRYPT);
  }
  } else if (BTM_SecIsSecurityPending(p_cb->link_spec.addrt.bda)) {
    /* if security collision happened, wait for encryption done */
    log::debug("addr:{} security collision", p_cb->link_spec.addrt.bda);
    p_cb->security_pending = true;
  } else {
    /* unbonded device, report security error here */
  else {
    log::debug("addr:{} not bonded", p_cb->link_spec.addrt.bda);
    p_cb->status = BTA_HH_ERR_AUTH_FAILED;
    bta_hh_clear_service_cache(p_cb);