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

Commit ba1a73b2 authored by More Kuo's avatar More Kuo
Browse files

Notify remote name failed for LE device

When cancel discovery for LE device in BTA_DM_DISCOVER_ACTIVE state,
there is no notification to indicate the remote name request of LE
device is cancelled and change the search state back to
BTA_DM_SEARCH_IDLE state. Call btm_inq_rmt_name_failed_cancelled()
to notify in this situation.

Bug: 146840780
Test: Manual
Change-Id: I4ab2a2f413e4ac19765476039f4127ce045e84d9
parent 728f3045
Loading
Loading
Loading
Loading
+10 −11
Original line number Diff line number Diff line
@@ -915,10 +915,9 @@ tBTM_STATUS BTM_CancelRemoteDeviceName(void) {
  /* Make sure there is not already one in progress */
  if (p_inq->remname_active) {
    if (BTM_UseLeLink(p_inq->remname_bda)) {
      if (btm_ble_cancel_remote_name(p_inq->remname_bda))
        return (BTM_CMD_STARTED);
      else
        return (BTM_UNKNOWN_ADDR);
      /* Cancel remote name request for LE device, and process remote name
       * callback. */
      btm_inq_rmt_name_failed_cancelled();
    } else
      btsnd_hcic_rmt_name_req_cancel(p_inq->remname_bda);
    return (BTM_CMD_STARTED);
@@ -2091,22 +2090,22 @@ void btm_process_remote_name(const RawAddress* bda, BD_NAME bdn,
}

void btm_inq_remote_name_timer_timeout(UNUSED_ATTR void* data) {
  btm_inq_rmt_name_failed();
  btm_inq_rmt_name_failed_cancelled();
}

/*******************************************************************************
 *
 * Function         btm_inq_rmt_name_failed
 * Function         btm_inq_rmt_name_failed_cancelled
 *
 * Description      This function is if timeout expires while getting remote
 *                  name.  This is done for devices that incorrectly do not
 *                  report operation failure
 * Description      This function is if timeout expires or request is cancelled
 *                  while getting remote name.  This is done for devices that
 *                  incorrectly do not report operation failure
 *
 * Returns          void
 *
 ******************************************************************************/
void btm_inq_rmt_name_failed(void) {
  BTM_TRACE_ERROR("btm_inq_rmt_name_failed()  remname_active=%d",
void btm_inq_rmt_name_failed_cancelled(void) {
  BTM_TRACE_ERROR("btm_inq_rmt_name_failed_cancelled()  remname_active=%d",
                  btm_cb.btm_inq_vars.remname_active);

  if (btm_cb.btm_inq_vars.remname_active)
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ extern tBTM_STATUS btm_initiate_rem_name(const RawAddress& remote_bda,

extern void btm_process_remote_name(const RawAddress* bda, BD_NAME name,
                                    uint16_t evt_len, uint8_t hci_status);
extern void btm_inq_rmt_name_failed(void);
extern void btm_inq_rmt_name_failed_cancelled(void);
extern void btm_inq_remote_name_timer_timeout(void* data);

/* Inquiry related functions */