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

Commit 0e6e31ae authored by Srinu Jella's avatar Srinu Jella Committed by Ajay Panicker
Browse files

HBS1098 Paring failure after connection with Car-Audio

Use Case: HBS1100 Paring failure after connection with Car-Audio

Steps:
1. Establish connection with Volkswagen CK, and then playback music
2. Try to pair with HBS-1100

Failure: DUT going for temporary pairing with HBS1100 when request received
while remote name is not present

Root Cause: As auth_req is not handled properly in bta_dm_pinname_cback during
RNR, auth_req variable got reset and DUT is going for temporary pairing.

Fix: local and remote auth_req and local and remote IO capabilities stored and
retained in call backs properly.

Test: Manually tested

Fixes: 35735338

Change-Id: I83382aac9fc1197d7fb31feedbd0fe3b35de87e8
parent 3ebdc420
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2280,6 +2280,12 @@ static void bta_dm_pinname_cback(void* p_data) {

    /* 1 additional event data fields for this event */
    sec_event.cfm_req.just_works = bta_dm_cb.just_works;
    /* retrieve the loc and rmt caps */
    sec_event.cfm_req.loc_io_caps = bta_dm_cb.loc_io_caps;
    sec_event.cfm_req.rmt_io_caps = bta_dm_cb.rmt_io_caps;
    sec_event.cfm_req.loc_auth_req = bta_dm_cb.loc_auth_req;
    sec_event.cfm_req.rmt_auth_req = bta_dm_cb.rmt_auth_req;

  } else {
    /* Retrieved saved device class and bd_addr */
    sec_event.pin_req.bd_addr = bta_dm_cb.pin_bd_addr;
@@ -2497,6 +2503,11 @@ static uint8_t bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) {
        if (p_data->cfm_req.bd_name[0] == 0) {
          bta_dm_cb.pin_evt = pin_evt;
          bta_dm_cb.pin_bd_addr = p_data->cfm_req.bd_addr;
          bta_dm_cb.rmt_io_caps = sec_event.cfm_req.rmt_io_caps;
          bta_dm_cb.loc_io_caps = sec_event.cfm_req.loc_io_caps;
          bta_dm_cb.rmt_auth_req = sec_event.cfm_req.rmt_auth_req;
          bta_dm_cb.loc_auth_req = sec_event.cfm_req.loc_auth_req;

          BTA_COPY_DEVICE_CLASS(bta_dm_cb.pin_dev_class,
                                p_data->cfm_req.dev_class);
          if ((BTM_ReadRemoteDeviceName(
+4 −0
Original line number Diff line number Diff line
@@ -314,6 +314,10 @@ typedef struct {
  RawAddress pin_bd_addr;
  DEV_CLASS pin_dev_class;
  tBTA_DM_SEC_EVT pin_evt;
  tBTA_IO_CAP loc_io_caps;    /* IO Capabilities of local device */
  tBTA_IO_CAP rmt_io_caps;    /* IO Capabilities of remote device */
  tBTA_AUTH_REQ loc_auth_req; /* Authentication required for local device */
  tBTA_AUTH_REQ rmt_auth_req;
  uint32_t num_val; /* the numeric value for comparison. If just_works, do not
                       show this number to UI */
  bool just_works;  /* true, if "Just Works" association model */
+4 −0
Original line number Diff line number Diff line
@@ -949,6 +949,10 @@ static void btif_dm_ssp_cfm_req_evt(tBTA_DM_SP_CFM_REQ* p_ssp_cfm_req) {
   */
  bond_state_changed(BT_STATUS_SUCCESS, bd_addr, BT_BOND_STATE_BONDING);

  BTIF_TRACE_EVENT("%s: just_works:%d, loc_auth_req=%d, rmt_auth_req=%d",
                   __func__, p_ssp_cfm_req->just_works,
                   p_ssp_cfm_req->loc_auth_req, p_ssp_cfm_req->rmt_auth_req);

  /* if just_works and bonding bit is not set treat this as temporary */
  if (p_ssp_cfm_req->just_works &&
      !(p_ssp_cfm_req->loc_auth_req & BTM_AUTH_BONDS) &&