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

Commit 6268eca1 authored by Venkata Jagadeesh Garaga's avatar Venkata Jagadeesh Garaga Committed by Jakub Pawlowski
Browse files

GAP: Use proper page scan rep mode for connection

Issue: Page time out seen when user initiated pairing from LE scan response

Steps to reproduce
==================
Steps:
1. Turn on BT
2. inquiry any dual mode device
3. Initiate pairing (only LE scan response received but br/edr
   inquiry response not received)

Actual Result:
Remote name request or create connection got page timeout some times

Expected result:
Remote name request and create connection should be successful

Root Cause:
If user finds only LE scan response for dual mode  devices, then stack
treats it as dual mode based on br/edr not supported bit. If pairing
initiated from LE scan response, then stack initiates RNR and ACL connection
on br/edr transport with wrong page scan response from LE inquiry database,
it leads to page time out.

Fix:
Use page scan response from inquiry data base if br/edr inquiry response
received, else use default page scan response R1 in RNR and create connection.

Test: Follow steps above
Bug: 154286616
Change-Id: I281ebc6d0e67d88c30328cb67df7f28793f354c1
parent a6102c7d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1671,7 +1671,7 @@ void btm_ble_update_inq_result(tINQ_DB_ENT* p_i, uint8_t addr_type,
  tBTM_INQUIRY_VAR_ST* p_inq = &btm_cb.btm_inq_vars;

  /* Save the info */
  p_cur->inq_result_type = BTM_INQ_RESULT_BLE;
  p_cur->inq_result_type |= BTM_INQ_RESULT_BLE;
  p_cur->ble_addr_type = addr_type;
  p_cur->rssi = rssi;
  p_cur->ble_primary_phy = primary_phy;
+2 −2
Original line number Diff line number Diff line
@@ -1666,7 +1666,7 @@ void btm_process_inq_results(uint8_t* p, uint8_t hci_evt_len,
      if (p_i->inq_count != p_inq->inq_counter)
        p_inq->inq_cmpl_info.num_resp++; /* A new response was found */

      p_cur->inq_result_type = BTM_INQ_RESULT_BR;
      p_cur->inq_result_type |= BTM_INQ_RESULT_BR;
      if (p_i->inq_count != p_inq->inq_counter) {
        p_cur->device_type = BT_DEVICE_TYPE_BREDR;
        p_i->scan_rsp = false;
@@ -1891,7 +1891,7 @@ tBTM_STATUS btm_initiate_rem_name(const RawAddress& remote_bda, uint8_t origin,

      /* If the database entry exists for the device, use its clock offset */
      tINQ_DB_ENT* p_i = btm_inq_db_find(remote_bda);
      if (p_i) {
      if (p_i && (p_i->inq_info.results.inq_result_type & BTM_INQ_RESULT_BR)) {
        tBTM_INQ_INFO* p_cur = &p_i->inq_info;
        btsnd_hcic_rmt_name_req(
            remote_bda, p_cur->results.page_scan_rep_mode,
+2 −1
Original line number Diff line number Diff line
@@ -2241,7 +2241,8 @@ bool l2cu_create_conn_after_switch(tL2C_LCB* p_lcb) {

  /* Check with the BT manager if details about remote device are known */
  p_inq_info = BTM_InqDbRead(p_lcb->remote_bd_addr);
  if (p_inq_info != NULL) {
  if ((p_inq_info != NULL) &&
      (p_inq_info->results.inq_result_type & BTM_INQ_RESULT_BR)) {
    page_scan_rep_mode = p_inq_info->results.page_scan_rep_mode;
    page_scan_mode = p_inq_info->results.page_scan_mode;
    clock_offset = (uint16_t)(p_inq_info->results.clock_offset);