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

Commit 142e28f4 authored by Rahul Arya's avatar Rahul Arya
Browse files

Fix invalid conn_id in bta_dm

Test: QA
Bug: 263050668
Change-Id: Ifab4c958d45087857745668d43d53651aea1a58c
parent 2c49f29d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4430,6 +4430,13 @@ static void bta_dm_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC* p_data) {
    case BTA_GATTC_CLOSE_EVT:
      LOG_INFO("BTA_GATTC_CLOSE_EVT reason = %d", p_data->close.reason);

      if (p_data->close.remote_bda == bta_dm_search_cb.peer_bdaddr) {
        if (bluetooth::common::init_flags::
                bta_dm_clear_conn_id_on_client_close_is_enabled()) {
          bta_dm_search_cb.conn_id = GATT_INVALID_CONN_ID;
        }
      }

      /* in case of disconnect before search is completed */
      if ((bta_dm_search_cb.state != BTA_DM_SEARCH_IDLE) &&
          (bta_dm_search_cb.state != BTA_DM_SEARCH_ACTIVE) &&