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

Commit 3c4fbafc authored by Rahul Arya's avatar Rahul Arya Committed by Gerrit Code Review
Browse files

Merge "Fix invalid conn_id in bta_dm"

parents 7511bdc1 142e28f4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4481,6 +4481,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) &&