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

Commit 18bb7f35 authored by Zach Johnson's avatar Zach Johnson
Browse files

tBTA_DM_ENABLE status is always successful

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ic12e70c50f1eb70b355f561532bfac0b6e2ffac8
parent 34fc8865
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2439,8 +2439,6 @@ static uint8_t bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) {
static void bta_dm_local_name_cback(UNUSED_ATTR void* p_name) {
  tBTA_DM_SEC sec_event;

  sec_event.enable.status = BTA_SUCCESS;

  if (bta_dm_cb.p_sec_cback)
    bta_dm_cb.p_sec_cback(BTA_DM_ENABLE_EVT, &sec_event);
}
+0 −4
Original line number Diff line number Diff line
@@ -372,9 +372,6 @@ typedef uint8_t tBTA_SIG_STRENGTH_MASK;
#define BTA_DM_BLE_SC_OOB_REQ_EVT 29 /* SMP SC OOB request event */
typedef uint8_t tBTA_DM_SEC_EVT;

/* Structure associated with BTA_DM_ENABLE_EVT */
typedef struct { tBTA_STATUS status; } tBTA_DM_ENABLE;

/* Structure associated with BTA_DM_PIN_REQ_EVT */
typedef struct {
  /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in
@@ -610,7 +607,6 @@ typedef struct {

/* Union of all security callback structures */
typedef union {
  tBTA_DM_ENABLE enable;          /* BTA enabled */
  tBTA_DM_PIN_REQ pin_req;        /* PIN request. */
  tBTA_DM_AUTH_CMPL auth_cmpl;    /* Authentication complete indication. */
  tBTA_DM_LINK_UP link_up;        /* ACL connection down event */
+1 −1
Original line number Diff line number Diff line
@@ -203,7 +203,7 @@ int btif_is_enabled(void);
/**
 * BTIF_Events
 */
void btif_enable_bluetooth_evt(tBTA_STATUS status);
void btif_enable_bluetooth_evt();
void btif_disable_bluetooth_evt(void);
void btif_adapter_properties_evt(bt_status_t status, uint32_t num_props,
                                 bt_property_t* p_props);
+11 −23
Original line number Diff line number Diff line
@@ -340,9 +340,7 @@ bt_status_t btif_init_bluetooth() {
 *
 ******************************************************************************/

void btif_enable_bluetooth_evt(tBTA_STATUS status) {
  LOG_INFO("%s entered: status %d", __func__, status);

void btif_enable_bluetooth_evt() {
  /* Fetch the local BD ADDR */
  RawAddress local_bd_addr = *controller_get_interface()->get_address();

@@ -367,7 +365,6 @@ void btif_enable_bluetooth_evt(tBTA_STATUS status) {
  }

  /* callback to HAL */
  if (status == BTA_SUCCESS) {
  uid_set = uid_set_create();

  btif_dm_init(uid_set);
@@ -386,15 +383,6 @@ void btif_enable_bluetooth_evt(tBTA_STATUS status) {
#endif

  future_ready(stack_manager_get_hack_future(), FUTURE_SUCCESS);
  } else {
    /* cleanup rfcomm & l2cap api */
    btif_sock_cleanup();

    btif_pan_cleanup();

    future_ready(stack_manager_get_hack_future(), FUTURE_FAIL);
  }

  LOG_INFO("%s finished", __func__);
}

+1 −1
Original line number Diff line number Diff line
@@ -1715,7 +1715,7 @@ static void btif_dm_upstreams_evt(uint16_t event, char* p_param) {
      */
      btif_storage_load_bonded_devices();
      bluetooth::bqr::EnableBtQualityReport(true);
      btif_enable_bluetooth_evt(p_data->enable.status);
      btif_enable_bluetooth_evt();
    } break;

    case BTA_DM_DISABLE_EVT: