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

Commit 9e816e7c authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6944374 from 32e7ea5d to sc-release

Change-Id: Icb0d85646ae1111f5ab5d21e68ff3ec0c9a73eb4
parents 9b5c8be7 32e7ea5d
Loading
Loading
Loading
Loading
+3 −4
Original line number 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 (bluetooth::shim::is_gd_security_enabled()) {
    bluetooth::shim::BTM_SecAddDevice(msg->bd_addr, p_dc, msg->bd_name,
                                      msg->features, p_lc, msg->key_type,
                                      msg->pin_length);
    bluetooth::shim::BTM_SecAddDevice(msg->bd_addr, p_dc, msg->bd_name, nullptr,
                                      p_lc, msg->key_type, msg->pin_length);
  } else {
    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);
    if (!add_result) {
      LOG(ERROR) << "BTA_DM: Error adding device " << msg->bd_addr;
+0 −1
Original line number 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->features, 0, sizeof(msg->features));
  msg->pin_length = pin_length;

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

+1 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ typedef struct {
  }

 public:
  bool is_encrypted = false;
  uint8_t link_role;
  uint8_t lmp_version;
  uint8_t switch_role_failed_attempts;
+3 −4
Original line number Diff line number Diff line
@@ -576,10 +576,7 @@ tBTM_STATUS BTM_SwitchRole(const RawAddress& remote_bd_addr, uint8_t new_role) {
  }
  /* some devices do not support switch while encryption is on */
  else {
    tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(remote_bd_addr);
    if ((p_dev_rec != NULL) &&
        ((p_dev_rec->sec_flags & BTM_SEC_ENCRYPTED) != 0) &&
        !BTM_EPR_AVAILABLE(p_acl)) {
    if (p_acl->is_encrypted && !BTM_EPR_AVAILABLE(p_acl)) {
      /* bypass turning off encryption if change link key is already doing it */
      p_acl->set_encryption_off();
      p_acl->set_switch_role_encryption_off();
@@ -617,6 +614,8 @@ void btm_acl_encrypt_change(uint16_t handle, uint8_t status,
  else
    return;

  p->is_encrypted = encr_enable;

  /* Process Role Switch if active */
  if (p->is_switch_role_encryption_off()) {
    /* if encryption turn off failed we still will try to switch role */
Loading