btif/src/btif_dm.cc
/* If JustWorks auto-accept */
if (p_ssp_cfm_req->just_works) {
/* Pairing consent for JustWorks NOT needed if:
* 1. Incoming temporary pairing is detected
* 2. local IO capabilities are DisplayYesNo AND
* 3. remote IO capabiltiies are DisplayOnly or NoInputNoOutput;
* add
*/
if (is_incoming && pairing_cb.bond_type == BOND_TYPE_TEMPORARY &&
((p_ssp_cfm_req->loc_io_caps == HCI_IO_CAP_DISPLAY_YESNO) &&
(p_ssp_cfm_req->rmt_io_caps == HCI_IO_CAP_DISPLAY_ONLY ||
p_ssp_cfm_req->rmt_io_caps == HCI_IO_CAP_NO_IO))) {
BTIF_TRACE_EVENT(
"%s: User consent needed for incoming pairing request. loc_io_caps: "
"%d, rmt_io_caps: %d",
__func__, p_ssp_cfm_req->loc_io_caps, p_ssp_cfm_req->rmt_io_caps);
} else {
BTIF_TRACE_EVENT("%s: Auto-accept JustWorks pairing", __func__);
btif_dm_ssp_reply(&bd_addr, BT_SSP_VARIANT_CONSENT, true, 0);
return;
}
}
```