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

Commit 217a81a9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fail fast"

parents 7256b7d0 7db2e26f
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -2733,6 +2733,16 @@ void btm_sec_rmt_host_support_feat_evt(uint8_t* p) {
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)) {
    BTM_TRACE_EVENT("%s: Device security mode is SC only.",
                    "To continue need to know remote features.", __func__);

    // ACL calls back to btm_sec_set_peer_sec_caps after it gets data
    p_dev_rec->remote_features_needed = true;
    return;
  }

  tBTM_SP_IO_REQ evt_data;
  uint8_t err_code = 0;
  bool is_orig = true;
@@ -2753,15 +2763,6 @@ void btm_io_capabilities_req(const RawAddress& p) {
  BTM_TRACE_DEBUG("%s:Security mode: %d, Num Read Remote Feat pages: %d",
                  __func__, btm_cb.security_mode, p_dev_rec->num_read_pages);

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

    p_dev_rec->remote_features_needed = true;
    return;
  }

  p_dev_rec->sm4 |= BTM_SM4_TRUE;

  BTM_TRACE_EVENT("%s: State: %s  Flags: 0x%04x  p_cur_service: 0x%08x",