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

Commit be2a8f87 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Use explicit state bta_dm_gattc_callback::BTA_GATTC_CLOSE_EVT am: a4fd77a2

parents e6b71f10 a4fd77a2
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -4561,13 +4561,19 @@ static void bta_dm_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC* p_data) {
        }
      }

      switch (bta_dm_search_get_state()) {
        case BTA_DM_SEARCH_IDLE:
        case BTA_DM_SEARCH_ACTIVE:
          break;

        case BTA_DM_SEARCH_CANCELLING:
        case BTA_DM_DISCOVER_ACTIVE:
          /* in case of disconnect before search is completed */
      if ((bta_dm_search_get_state() != BTA_DM_SEARCH_IDLE) &&
          (bta_dm_search_get_state() != BTA_DM_SEARCH_ACTIVE) &&
          p_data->close.remote_bda == bta_dm_search_cb.peer_bdaddr) {
          if (p_data->close.remote_bda == bta_dm_search_cb.peer_bdaddr) {
            bta_dm_gatt_disc_complete((uint16_t)GATT_INVALID_CONN_ID,
                                      (tGATT_STATUS)GATT_ERROR);
          }
      }
      break;

    default: