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

Commit 6ab7fc68 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes I14a0dc1d,If34b5018,Icdba6206 am: b94233ed

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1405271

Change-Id: Ie306002144c20e1608636881c527726a60c9fb70
parents 7ba602e1 b94233ed
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -2034,9 +2034,7 @@ static uint8_t bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) {
      if (btm_local_io_caps != BTM_IO_CAP_NONE) {
        /* translate auth_req */
        btif_dm_set_oob_for_io_req(&p_data->io_req.oob_data);
        btif_dm_proc_io_req(p_data->io_req.bd_addr, &p_data->io_req.io_cap,
                            &p_data->io_req.oob_data, &p_data->io_req.auth_req,
                            p_data->io_req.is_orig);
        btif_dm_proc_io_req(&p_data->io_req.auth_req, p_data->io_req.is_orig);
      }
      APPL_TRACE_EVENT("io mitm: %d oob_data:%d", p_data->io_req.auth_req,
                       p_data->io_req.oob_data);
+1 −3
Original line number Diff line number Diff line
@@ -43,9 +43,7 @@ void btif_dm_on_disable(void);
/**
 * Callout for handling io_capabilities request
 */
void btif_dm_proc_io_req(const RawAddress& bd_addr, tBTM_IO_CAP* p_io_cap,
                         tBTM_OOB_DATA* p_oob_data, tBTM_AUTH_REQ* p_auth_req,
                         bool is_orig);
void btif_dm_proc_io_req(tBTM_AUTH_REQ* p_auth_req, bool is_orig);
/**
 * Callout for handling io_capabilities response
 */
+1 −4
Original line number Diff line number Diff line
@@ -2148,10 +2148,7 @@ void btif_dm_enable_service(tBTA_SERVICE_ID service_id, bool enable) {
  return;
}

void btif_dm_proc_io_req(UNUSED_ATTR const RawAddress& bd_addr,
                         UNUSED_ATTR tBTM_IO_CAP* p_io_cap,
                         UNUSED_ATTR tBTM_OOB_DATA* p_oob_data,
                         tBTM_AUTH_REQ* p_auth_req, bool is_orig) {
void btif_dm_proc_io_req(tBTM_AUTH_REQ* p_auth_req, bool is_orig) {
  uint8_t yes_no_bit = BTA_AUTH_SP_YES & *p_auth_req;
  /* if local initiated:
  **      1. set DD + MITM
+25 −31
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);
}
}

/*******************************************************************************
 *
@@ -4340,9 +4337,6 @@ static void btm_sec_pairing_timeout(UNUSED_ATTR void* data) {
      break;

    case BTM_PAIR_STATE_WAIT_LOCAL_IOCAPS:
      if (btm_cb.pairing_flags & BTM_PAIR_FLAGS_WE_STARTED_DD)
        auth_req |= BTM_AUTH_DD_BOND;

      btsnd_hcic_io_cap_req_reply(p_cb->pairing_bda, btm_cb.devcb.loc_io_caps,
                                  BTM_OOB_NONE, auth_req);
      btm_sec_change_pairing_state(BTM_PAIR_STATE_IDLE);