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

Commit 0fd84ef2 authored by David Duarte's avatar David Duarte
Browse files

Remove unused dut_mode from bluetooth interface

Bug: 263885771
Test: TreeHugger
Change-Id: I2dbbdacafb9ef760710b5b5ba83e23d8a18c2087
parent 0645c96b
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -685,10 +685,6 @@ static void callback_thread_event(bt_cb_thread_evt event) {
  }
  }
}
}


static void dut_mode_recv_callback(uint16_t opcode, uint8_t* buf, uint8_t len) {

}

static void energy_info_recv_callback(bt_activity_energy_info* p_energy_info,
static void energy_info_recv_callback(bt_activity_energy_info* p_energy_info,
                                      bt_uid_traffic_t* uid_data) {
                                      bt_uid_traffic_t* uid_data) {
  CallbackEnv sCallbackEnv(__func__);
  CallbackEnv sCallbackEnv(__func__);
@@ -732,7 +728,6 @@ static bt_callbacks_t sBluetoothCallbacks = {sizeof(sBluetoothCallbacks),
                                             le_address_associate_callback,
                                             le_address_associate_callback,
                                             acl_state_changed_callback,
                                             acl_state_changed_callback,
                                             callback_thread_event,
                                             callback_thread_event,
                                             dut_mode_recv_callback,
                                             energy_info_recv_callback,
                                             energy_info_recv_callback,
                                             link_quality_report_callback,
                                             link_quality_report_callback,
                                             generate_local_oob_data_callback,
                                             generate_local_oob_data_callback,
+0 −6
Original line number Original line Diff line number Diff line
@@ -54,12 +54,6 @@ void BTA_dm_init() {
  bta_sys_cust_eir_register(bta_dm_eir_update_cust_uuid);
  bta_sys_cust_eir_register(bta_dm_eir_update_cust_uuid);
}
}


/** Enables bluetooth device under test mode */
void BTA_EnableTestMode(void) {
  do_in_main_thread(FROM_HERE,
                    base::Bind(base::IgnoreResult(BTM_EnableTestMode)));
}

/** This function sets the Bluetooth name of local device */
/** This function sets the Bluetooth name of local device */
void BTA_DmSetDeviceName(const char* p_name) {
void BTA_DmSetDeviceName(const char* p_name) {
  std::vector<uint8_t> name(BD_NAME_LEN + 1);
  std::vector<uint8_t> name(BD_NAME_LEN + 1);
+0 −12
Original line number Original line Diff line number Diff line
@@ -717,18 +717,6 @@ enum {


void BTA_dm_init();
void BTA_dm_init();


/*******************************************************************************
 *
 * Function         BTA_EnableTestMode
 *
 * Description      Enables bluetooth device under test mode
 *
 *
 * Returns          tBTA_STATUS
 *
 ******************************************************************************/
extern void BTA_EnableTestMode(void);

/*******************************************************************************
/*******************************************************************************
 *
 *
 * Function         BTA_DmSetDeviceName
 * Function         BTA_DmSetDeviceName
+0 −21
Original line number Original line Diff line number Diff line
@@ -329,27 +329,6 @@ bt_status_t btif_dm_get_adapter_property(bt_property_t* prop);
 ******************************************************************************/
 ******************************************************************************/
void btif_dm_get_remote_services(const RawAddress remote_addr, int transport);
void btif_dm_get_remote_services(const RawAddress remote_addr, int transport);


/*******************************************************************************
 *
 * Function         btif_dut_mode_configure
 *
 * Description      Configure Test Mode - 'enable' to 1 puts the device in test
 *                  mode and 0 exits test mode
 *
 ******************************************************************************/
void btif_dut_mode_configure(uint8_t enable);

bool btif_is_dut_mode();

/*******************************************************************************
 *
 * Function         btif_dut_mode_send
 *
 * Description     Sends a HCI Vendor specific command to the controller
 *
 ******************************************************************************/
void btif_dut_mode_send(uint16_t opcode, uint8_t* buf, uint8_t len);

/*******************************************************************************
/*******************************************************************************
 *
 *
 * Function         btif_dm_read_energy_info
 * Function         btif_dm_read_energy_info
+0 −28
Original line number Original line Diff line number Diff line
@@ -875,32 +875,6 @@ static const void* get_profile_interface(const char* profile_id) {
  return NULL;
  return NULL;
}
}


int dut_mode_configure(uint8_t enable) {
  if (!interface_ready()) return BT_STATUS_NOT_READY;
  if (!stack_manager_get_interface()->get_stack_is_running())
    return BT_STATUS_NOT_READY;

  do_in_main_thread(FROM_HERE, base::BindOnce(btif_dut_mode_configure, enable));
  return BT_STATUS_SUCCESS;
}

int dut_mode_send(uint16_t opcode, uint8_t* buf, uint8_t len) {
  if (!interface_ready()) return BT_STATUS_NOT_READY;
  if (!btif_is_dut_mode()) return BT_STATUS_FAIL;

  uint8_t* copy = (uint8_t*)osi_calloc(len);
  memcpy(copy, buf, len);

  do_in_main_thread(FROM_HERE,
                    base::BindOnce(
                        [](uint16_t opcode, uint8_t* buf, uint8_t len) {
                          btif_dut_mode_send(opcode, buf, len);
                          osi_free(buf);
                        },
                        opcode, copy, len));
  return BT_STATUS_SUCCESS;
}

static bt_os_callouts_t* wakelock_os_callouts_saved = nullptr;
static bt_os_callouts_t* wakelock_os_callouts_saved = nullptr;


static int acquire_wake_lock_cb(const char* lock_name) {
static int acquire_wake_lock_cb(const char* lock_name) {
@@ -1092,8 +1066,6 @@ EXPORT_SYMBOL bt_interface_t bluetoothInterface = {
    .pin_reply = pin_reply,
    .pin_reply = pin_reply,
    .ssp_reply = ssp_reply,
    .ssp_reply = ssp_reply,
    .get_profile_interface = get_profile_interface,
    .get_profile_interface = get_profile_interface,
    .dut_mode_configure = dut_mode_configure,
    .dut_mode_send = dut_mode_send,
    .set_os_callouts = set_os_callouts,
    .set_os_callouts = set_os_callouts,
    .read_energy_info = read_energy_info,
    .read_energy_info = read_energy_info,
    .dump = dump,
    .dump = dump,
Loading