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

Commit 54f5dd28 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

msg->features is always 0 (nullptr)

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ie276dd3fe61da889f5ea4e113266c782af806500
parent 94d310a0
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -607,12 +607,11 @@ void bta_dm_add_device(std::unique_ptr<tBTA_DM_API_ADD_DEVICE> msg) {
  if (msg->link_key_known) p_lc = &msg->link_key;
  if (msg->link_key_known) p_lc = &msg->link_key;


  if (bluetooth::shim::is_gd_security_enabled()) {
  if (bluetooth::shim::is_gd_security_enabled()) {
    bluetooth::shim::BTM_SecAddDevice(msg->bd_addr, p_dc, msg->bd_name,
    bluetooth::shim::BTM_SecAddDevice(msg->bd_addr, p_dc, msg->bd_name, nullptr,
                                      msg->features, p_lc, msg->key_type,
                                      p_lc, msg->key_type, msg->pin_length);
                                      msg->pin_length);
  } else {
  } else {
    auto add_result =
    auto add_result =
        BTM_SecAddDevice(msg->bd_addr, p_dc, msg->bd_name, msg->features, p_lc,
        BTM_SecAddDevice(msg->bd_addr, p_dc, msg->bd_name, nullptr, p_lc,
                         msg->key_type, msg->pin_length);
                         msg->key_type, msg->pin_length);
    if (!add_result) {
    if (!add_result) {
      LOG(ERROR) << "BTA_DM: Error adding device " << msg->bd_addr;
      LOG(ERROR) << "BTA_DM: Error adding device " << msg->bd_addr;
+0 −1
Original line number Original line Diff line number Diff line
@@ -241,7 +241,6 @@ void BTA_DmAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class,
  }
  }


  memset(msg->bd_name, 0, BD_NAME_LEN + 1);
  memset(msg->bd_name, 0, BD_NAME_LEN + 1);
  memset(msg->features, 0, sizeof(msg->features));
  msg->pin_length = pin_length;
  msg->pin_length = pin_length;


  do_in_main_thread(FROM_HERE,
  do_in_main_thread(FROM_HERE,
+0 −2
Original line number Original line Diff line number Diff line
@@ -127,8 +127,6 @@ typedef struct {
  bool link_key_known;
  bool link_key_known;
  bool dc_known;
  bool dc_known;
  BD_NAME bd_name;
  BD_NAME bd_name;
  uint8_t
      features[HCI_FEATURE_BYTES_PER_PAGE * (HCI_EXT_FEATURES_PAGE_MAX + 1)];
  uint8_t pin_length;
  uint8_t pin_length;
} tBTA_DM_API_ADD_DEVICE;
} tBTA_DM_API_ADD_DEVICE;