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

Commit fc6d66f5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Make SDP and inquiry request dequeue and execute more comprehensive and...

Merge "Make SDP and inquiry request dequeue and execute more comprehensive and cancelDiscovery now removes all queued inquiry requests." am: a7cfb95d

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1829012

Change-Id: I8350acbe8ff78621dba2818cc48a33ff8593d99f
parents 6507a6ac a7cfb95d
Loading
Loading
Loading
Loading
+3 −12
Original line number Diff line number Diff line
@@ -988,7 +988,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;
  }

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

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

@@ -1507,17 +1509,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
@@ -104,6 +104,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();
@@ -113,7 +115,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
@@ -546,7 +546,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
@@ -485,7 +485,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();
  }
}

@@ -1351,7 +1350,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();

        // Send one empty UUID to Java to unblock pairing intent when SDP failed
        // or no UUID is discovered
Loading