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

Commit d8e09737 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

This if is always true

In previous line, if p_dev_rec->sm4 & BTM_SM4_UPGRADE is true, then we
still have BTM_SUCCESS; if we invoke btm_cb.api.p_sp_callback, then OOB
data status is set in btif_dm_set_oob_for_io_req, unless the stack is
not running.

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I14a0dc1d1c6ef62d0bbd4095073bd02c3aa08fdb
parent 2a510cb3
Loading
Loading
Loading
Loading
+25 −28
Original line number Diff line number Diff line
@@ -2848,7 +2848,6 @@ void btm_io_capabilities_req(const RawAddress& p) {
                                              (tBTM_SP_EVT_DATA*)&evt_data);
  }

  if ((callback_rc == BTM_SUCCESS) || (BTM_OOB_UNKNOWN != evt_data.oob_data)) {
  if ((btm_cb.pairing_flags & BTM_PAIR_FLAGS_WE_STARTED_DD)) {
    evt_data.auth_req =
        (BTM_AUTH_DD_BOND | (evt_data.auth_req & BTM_AUTH_YN_BIT));
@@ -2858,9 +2857,8 @@ void btm_io_capabilities_req(const RawAddress& p) {
    /* At this moment we know that both sides are SC capable, device in */
    /* SC only mode requires MITM for any service so let's set MITM bit */
    evt_data.auth_req |= BTM_AUTH_YN_BIT;
      BTM_TRACE_DEBUG(
          "%s: for device in \"SC only\" mode set auth_req to 0x%02x", __func__,
          evt_data.auth_req);
    BTM_TRACE_DEBUG("%s: for device in \"SC only\" mode set auth_req to 0x%02x",
                    __func__, evt_data.auth_req);
  }

  /* if the user does not indicate "reply later" by setting the oob_data to
@@ -2870,14 +2868,13 @@ void btm_io_capabilities_req(const RawAddress& p) {
  btm_cb.devcb.loc_auth_req = evt_data.auth_req;
  btm_cb.devcb.loc_io_caps = evt_data.io_cap;

    BTM_TRACE_EVENT("%s: State: %s  IO_CAP:%d oob_data:%d auth_req:%d",
                    __func__, btm_pair_state_descr(btm_cb.pairing_state),
                    evt_data.io_cap, evt_data.oob_data, evt_data.auth_req);
  BTM_TRACE_EVENT("%s: State: %s  IO_CAP:%d oob_data:%d auth_req:%d", __func__,
                  btm_pair_state_descr(btm_cb.pairing_state), evt_data.io_cap,
                  evt_data.oob_data, evt_data.auth_req);

  btsnd_hcic_io_cap_req_reply(evt_data.bd_addr, evt_data.io_cap,
                              evt_data.oob_data, evt_data.auth_req);
}
}

/*******************************************************************************
 *