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

Commit a5269823 authored by Rahul Sabnis's avatar Rahul Sabnis Committed by Android Build Coastguard Worker
Browse files

Revert "Revert "Make SDP and inquiry request dequeue and execute..."

Revert submission 19019716

Reason for revert: b/237352700
Reverted Changes:
I8e37ac142:Revert "Queue discovery and device inquiry while b...
Ic8642a39f:Revert "Make SDP and inquiry request dequeue and e...
I06eb6d806:Revert "Immediately execute instead of queueing re...

Bug: 237352700
Test: Manual
Change-Id: I52e9d3828cbd785dfb816541cf19e7b7a8f2bff8
(cherry picked from commit 21e82985)
Merged-In: I52e9d3828cbd785dfb816541cf19e7b7a8f2bff8
parent dd8e4cac
Loading
Loading
Loading
Loading
+3 −12
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_search_cancel_cmpl();
    bta_dm_execute_queued_request();
    return;
  }

@@ -1295,6 +1295,7 @@ 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;
  }

@@ -1305,6 +1306,7 @@ 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;
  }

@@ -1515,17 +1517,6 @@ 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
+2 −1
Original line number Diff line number Diff line
@@ -106,6 +106,8 @@ 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();
@@ -115,7 +117,6 @@ 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:
+0 −1
Original line number Diff line number Diff line
@@ -538,7 +538,6 @@ 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_search_cancel_cmpl();
          bta_dm_execute_queued_request();
          break;
      }
      break;
+0 −2
Original line number Diff line number Diff line
@@ -538,7 +538,6 @@ 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();
  }
}

@@ -1445,7 +1444,6 @@ 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