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

Commit ef3e5ab5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Use proper API and switch/case for bta search/discovery operations"

parents 38fa8caa 9b7a93f5
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -978,12 +978,23 @@ void bta_dm_discover(tBTA_DM_MSG* p_data) {
 * Description      Cancels an ongoing search or discovery for devices in case
 *                  of a Bluetooth disable
 *
 *
 * Returns          void
 *
 ******************************************************************************/
static void bta_dm_disable_search_and_disc(void) {
  if (bta_dm_search_cb.state != BTA_DM_SEARCH_IDLE) bta_dm_search_cancel();
  switch (bta_dm_search_get_state()) {
    case BTA_DM_SEARCH_IDLE:
      break;
    case BTA_DM_SEARCH_ACTIVE:
    case BTA_DM_SEARCH_CANCELLING:
    case BTA_DM_DISCOVER_ACTIVE:
    default:
      LOG_DEBUG(
          "Search state machine is not idle so issuing search cancel current "
          "state:%s",
          bta_dm_state_text(bta_dm_search_get_state()).c_str());
      bta_dm_search_cancel();
  }
}

/*******************************************************************************