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

Commit 34fc8865 authored by Zach Johnson's avatar Zach Johnson
Browse files

bta_dm_enable is guaranteed mutually exclusive

this error case cannot happen, due to the stack
management running in a blockable context

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I5070497a3e400fa0990502a6fe354361e4838feb
parent 475b4ce7
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -248,17 +248,6 @@ static uint8_t btm_local_io_caps;

/** Initialises the BT device manager */
void bta_dm_enable(tBTA_DM_SEC_CBACK* p_sec_cback) {
  /* if already in use, return an error */
  if (bta_dm_cb.is_bta_dm_active) {
    tBTA_DM_SEC enable_event;
    APPL_TRACE_WARNING("%s Device already started by another application",
                       __func__);
    memset(&enable_event, 0, sizeof(tBTA_DM_SEC));
    enable_event.enable.status = BTA_FAILURE;
    if (p_sec_cback != NULL) p_sec_cback(BTA_DM_ENABLE_EVT, &enable_event);
    return;
  }

  /* make sure security callback is saved - if no callback, do not erase the
  previous one,
  it could be an error recovery mechanism */