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

Commit 4c08b1a0 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Introduce dev_rec->remote_feature_received

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I8921fa9fa8dbb0feb1deea9ea01ac020d0bd235c
parent 8e57f4c0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -874,7 +874,7 @@ void btm_process_remote_ext_features(tACL_CONN* p_acl_cb,

  if (req_pend) {
    /* Request for remaining Security Features (if any) */
    l2cu_resubmit_pending_sec_req(&p_dev_rec->bd_addr);
    l2cu_resubmit_pending_sec_req(&p_acl_cb->remote_addr);
  }
}

@@ -2557,6 +2557,7 @@ void btm_ble_refresh_local_resolvable_private_addr(
 ******************************************************************************/
void btm_sec_set_peer_sec_caps(bool ssp_supported, bool sc_supported,
                               tBTM_SEC_DEV_REC* p_dev_rec) {
  p_dev_rec->remote_feature_received = true;
  if ((btm_cb.security_mode == BTM_SEC_MODE_SP ||
       btm_cb.security_mode == BTM_SEC_MODE_SC) &&
      ssp_supported) {
+1 −10
Original line number Diff line number Diff line
@@ -279,16 +279,7 @@ bool btm_dev_support_role_switch(const RawAddress& bd_addr) {
    return true;
  }

  /* If the feature field is all zero, we never received them */
  bool feature_empty = true;
  for (int xx = 0; xx < BD_FEATURES_LEN; xx++) {
    if (p_dev_rec->feature_pages[0][xx] != 0x00) {
      feature_empty = false; /* at least one is != 0 */
      break;
    }
  }

  if (feature_empty) {
  if (!p_dev_rec->remote_feature_received) {
    BTM_TRACE_DEBUG(
        "%s Unknown peer capabilities, assuming peer supports role switch",
        __func__);
+1 −1
Original line number Diff line number Diff line
@@ -2398,7 +2398,7 @@ void btm_io_capabilities_req(const RawAddress& p) {
  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_or_alloc_dev(p);

  if ((btm_cb.security_mode == BTM_SEC_MODE_SC) &&
      (p_dev_rec->num_read_pages == 0)) {
      (!p_dev_rec->remote_feature_received)) {
    BTM_TRACE_EVENT("%s: Device security mode is SC only.",
                    "To continue need to know remote features.", __func__);

+1 −0
Original line number Diff line number Diff line
@@ -323,6 +323,7 @@ typedef struct {
  /* "Secure Connections Only" mode and it receives */
  /* HCI_IO_CAPABILITY_REQUEST_EVT from the peer before */
  /* it knows peer's support for Secure Connections */
  bool remote_feature_received = false;

  uint16_t ble_hci_handle; /* use in DUMO connection */
  uint16_t get_ble_hci_handle() const { return ble_hci_handle; }