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

Commit 8f86ad27 authored by Rahul Sabnis's avatar Rahul Sabnis
Browse files

Revert "Make SDP and inquiry request dequeue and execute more comprehensive and"

This reverts commit 6b77ebbf.

Tag: #feature
Bug: 230277335
Test: Manual
Ignore-AOSP-First: Need to land change for Android T

Change-Id: Ic8642a39f97cab2045b57c1da6a019e0f43c87fc
parent 6af646f9
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -996,7 +996,7 @@ static bool bta_dm_read_remote_device_name(const RawAddress& bd_addr,
void bta_dm_inq_cmpl(uint8_t num) {
  if (bta_dm_search_get_state() == BTA_DM_SEARCH_CANCELLING) {
    bta_dm_search_set_state(BTA_DM_SEARCH_IDLE);
    bta_dm_execute_queued_request();
    bta_dm_search_cancel_cmpl();
    return;
  }

@@ -1295,7 +1295,6 @@ void bta_dm_search_cmpl() {
  /* no BLE connection, i.e. Classic service discovery end */
  if (conn_id == GATT_INVALID_CONN_ID) {
    bta_dm_search_cb.p_search_cback(BTA_DM_DISC_CMPL_EVT, nullptr);
    bta_dm_execute_queued_request();
    return;
  }

@@ -1306,7 +1305,6 @@ void bta_dm_search_cmpl() {
  if (count == 0) {
    LOG_INFO("Empty GATT database - no BLE services discovered");
    bta_dm_search_cb.p_search_cback(BTA_DM_DISC_CMPL_EVT, nullptr);
    bta_dm_execute_queued_request();
    return;
  }

@@ -1517,6 +1515,17 @@ void bta_dm_search_clear_queue() {
  fixed_queue_flush(bta_dm_search_cb.pending_discovery_queue, osi_free);
}

/*******************************************************************************
 *
 * Function         bta_dm_search_cancel_cmpl
 *
 * Description      Search cancel is complete
 *
 * Returns          void
 *
 ******************************************************************************/
void bta_dm_search_cancel_cmpl() { bta_dm_execute_queued_request(); }

/*******************************************************************************
 *
 * Function         bta_dm_search_cancel_notify
+1 −2
Original line number Diff line number Diff line
@@ -106,8 +106,6 @@ void BTA_DmSearch(tBTA_DM_SEARCH_CBACK* p_cback, bool is_bonding_or_sdp) {
 *
 ******************************************************************************/
void BTA_DmSearchCancel(void) {
  bta_dm_search_clear_queue();

  switch (bta_dm_search_get_state()) {
    case BTA_DM_SEARCH_IDLE:
      bta_dm_search_cancel_notify();
@@ -117,6 +115,7 @@ void BTA_DmSearchCancel(void) {
      bta_dm_search_cancel();
      break;
    case BTA_DM_SEARCH_CANCELLING:
      bta_dm_search_clear_queue();
      bta_dm_search_cancel_notify();
      break;
    case BTA_DM_DISCOVER_ACTIVE:
+1 −0
Original line number Diff line number Diff line
@@ -538,6 +538,7 @@ extern void bta_dm_queue_disc(tBTA_DM_MSG* p_data);
extern void bta_dm_execute_queued_request();
extern bool bta_dm_is_search_request_queued();
extern void bta_dm_search_clear_queue();
extern void bta_dm_search_cancel_cmpl();
extern void bta_dm_search_cancel_notify();
extern void bta_dm_disc_rmt_name(tBTA_DM_MSG* p_data);
extern tBTA_DM_PEER_DEVICE* bta_dm_find_peer_device(
+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ bool bta_dm_search_sm_execute(BT_HDR_RIGID* p_msg) {
          bta_dm_search_set_state(BTA_DM_SEARCH_IDLE);
          bta_dm_free_sdp_db();
          bta_dm_search_cancel_notify();
          bta_dm_execute_queued_request();
          bta_dm_search_cancel_cmpl();
          break;
      }
      break;
+2 −0
Original line number Diff line number Diff line
@@ -537,6 +537,7 @@ static void bond_state_changed(bt_status_t status, const RawAddress& bd_addr,
    pairing_cb.bd_addr = bd_addr;
  } else {
    pairing_cb = {};
    bta_dm_execute_queued_request();
  }
}

@@ -1436,6 +1437,7 @@ static void btif_dm_search_services_evt(tBTA_DM_SEARCH_EVT event,
        // Both SDP and bonding are done, clear pairing control block in case
        // it is not already cleared
        pairing_cb = {};
        bta_dm_execute_queued_request();
      }

      if (p_data->disc_res.num_uuids != 0) {
Loading