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

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

legacy: Const-ify btif_get_default_local_name am: e9ce61ec

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1948941

Change-Id: Ifdd9038d0d843d9e7c5ffad66c6e2f4611c19eaa
parents 9b7019a7 e9ce61ec
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ void BTA_EnableTestMode(void) {
}

/** This function sets the Bluetooth name of local device */
void BTA_DmSetDeviceName(char* p_name) {
void BTA_DmSetDeviceName(const char* p_name) {
  std::vector<uint8_t> name(BD_NAME_LEN + 1);
  strlcpy((char*)name.data(), p_name, BD_NAME_LEN + 1);

+1 −1
Original line number Diff line number Diff line
@@ -675,7 +675,7 @@ extern void BTA_EnableTestMode(void);
 * Returns          void
 *
 ******************************************************************************/
extern void BTA_DmSetDeviceName(char* p_name);
extern void BTA_DmSetDeviceName(const char* p_name);

/*******************************************************************************
 *
+1 −1
Original line number Diff line number Diff line
@@ -703,7 +703,7 @@ void btif_set_adapter_property(bt_property_t* property) {

      BTIF_TRACE_EVENT("set property name : %s", (char*)bd_name);

      BTA_DmSetDeviceName((char*)bd_name);
      BTA_DmSetDeviceName((const char*)bd_name);

      btif_core_storage_adapter_write(property);
    } break;
+3 −3
Original line number Diff line number Diff line
@@ -233,7 +233,7 @@ static void btif_dm_ble_key_nc_req_evt(tBTA_DM_SP_KEY_NOTIF* p_notif_req);
static void btif_dm_ble_oob_req_evt(tBTA_DM_SP_RMT_OOB* req_oob_type);
static void btif_dm_ble_sc_oob_req_evt(tBTA_DM_SP_RMT_OOB* req_oob_type);

static char* btif_get_default_local_name();
static const char* btif_get_default_local_name();

static void btif_stats_add_bond_event(const RawAddress& bd_addr,
                                      bt_bond_function_t function,
@@ -1519,7 +1519,7 @@ void BTIF_dm_enable() {
  status = btif_storage_get_adapter_property(&prop);
  if (status == BT_STATUS_SUCCESS) {
    /* A name exists in the storage. Make this the device name */
    BTA_DmSetDeviceName((char*)prop.val);
    BTA_DmSetDeviceName((const char*)prop.val);
  } else {
    /* Storage does not have a name yet.
     * Use the default name and write it to the chip
@@ -3053,7 +3053,7 @@ void btif_dm_on_disable() {
 ******************************************************************************/
void btif_dm_read_energy_info() { BTA_DmBleGetEnergyInfo(bta_energy_info_cb); }

static char* btif_get_default_local_name() {
static const char* btif_get_default_local_name() {
  if (btif_default_local_name[0] == '\0') {
    int max_len = sizeof(btif_default_local_name) - 1;
    if (BTM_DEF_LOCAL_NAME[0] != '\0') {
+1 −1
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ void BTA_DmSetBlePrefConnParams(const RawAddress& bd_addr,
      bd_addr, min_conn_int, max_conn_int, peripheral_latency,
      supervision_tout);
}
void BTA_DmSetDeviceName(char* p_name) {
void BTA_DmSetDeviceName(const char* p_name) {
  mock_function_count_map[__func__]++;
  test::mock::bta_dm_api::BTA_DmSetDeviceName(p_name);
}
Loading