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

Commit 0150647b authored by Martin Brabham's avatar Martin Brabham Committed by android-build-merger
Browse files

JustWorks: Auto-accept only incoming temporary pairing. am: 7194f1ff

am: b60dd0bd

Change-Id: I89a7a2650b3c4814a28c13a287722485d0b6eba7
parents 68dba96b b60dd0bd
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -915,6 +915,7 @@ static void btif_dm_pin_req_evt(tBTA_DM_PIN_REQ* p_pin_req) {
static void btif_dm_ssp_cfm_req_evt(tBTA_DM_SP_CFM_REQ* p_ssp_cfm_req) {
  bt_bdname_t bd_name;
  uint32_t cod;
  bool is_incoming = !(pairing_cb.state == BT_BOND_STATE_BONDING);
  int dev_type;

  BTIF_TRACE_DEBUG("%s", __func__);
@@ -947,6 +948,19 @@ static void btif_dm_ssp_cfm_req_evt(tBTA_DM_SP_CFM_REQ* p_ssp_cfm_req) {

  pairing_cb.is_ssp = true;

  /* If JustWorks auto-accept */
  if (p_ssp_cfm_req->just_works) {
    /* Pairing consent for JustWorks NOT needed if:
     * 1. Incoming temporary pairing is detected
     */
    if (is_incoming && pairing_cb.bond_type == BOND_TYPE_TEMPORARY) {
      BTIF_TRACE_EVENT(
          "%s: Auto-accept JustWorks pairing for temporary incoming", __func__);
      btif_dm_ssp_reply(&bd_addr, BT_SSP_VARIANT_CONSENT, true, 0);
      return;
    }
  }

  cod = devclass2uint(p_ssp_cfm_req->dev_class);

  if (cod == 0) {