system/bt
修订版 | 19d8c6e7c940d6d4ff74f72e44653f42115c00e3 (tree) |
---|---|
时间 | 2019-06-19 10:30:32 |
作者 | Martin Brabham <optedoblivion@goog...> |
Commiter | Martin Brabham |
Revert "DO NOT MERGE: btif: require pairing dialog for JustWorks SSP"
This reverts commit 9437cbc24014799738c85da8f416a647f8cbf3e2.
Reason for revert: Waiting for QT first SMR due to b/134461862
Bug: 134461862
Change-Id: I3fea0f2d10658d6e154a946eaaa9fbdeb4b49159
@@ -926,6 +926,7 @@ static void btif_dm_pin_req_evt(tBTA_DM_PIN_REQ* p_pin_req) { | ||
926 | 926 | static void btif_dm_ssp_cfm_req_evt(tBTA_DM_SP_CFM_REQ* p_ssp_cfm_req) { |
927 | 927 | bt_bdname_t bd_name; |
928 | 928 | uint32_t cod; |
929 | + bool is_incoming = !(pairing_cb.state == BT_BOND_STATE_BONDING); | |
929 | 930 | int dev_type; |
930 | 931 | |
931 | 932 | BTIF_TRACE_DEBUG("%s", __func__); |
@@ -970,6 +971,28 @@ static void btif_dm_ssp_cfm_req_evt(tBTA_DM_SP_CFM_REQ* p_ssp_cfm_req) { | ||
970 | 971 | |
971 | 972 | pairing_cb.is_ssp = true; |
972 | 973 | |
974 | + /* If JustWorks auto-accept */ | |
975 | + if (p_ssp_cfm_req->just_works) { | |
976 | + /* Pairing consent for JustWorks needed if: | |
977 | + * 1. Incoming (non-temporary) pairing is detected AND | |
978 | + * 2. local IO capabilities are DisplayYesNo AND | |
979 | + * 3. remote IO capabiltiies are DisplayOnly or NoInputNoOutput; | |
980 | + */ | |
981 | + if (is_incoming && pairing_cb.bond_type != BOND_TYPE_TEMPORARY && | |
982 | + ((p_ssp_cfm_req->loc_io_caps == HCI_IO_CAP_DISPLAY_YESNO) && | |
983 | + (p_ssp_cfm_req->rmt_io_caps == HCI_IO_CAP_DISPLAY_ONLY || | |
984 | + p_ssp_cfm_req->rmt_io_caps == HCI_IO_CAP_NO_IO))) { | |
985 | + BTIF_TRACE_EVENT( | |
986 | + "%s: User consent needed for incoming pairing request. loc_io_caps: " | |
987 | + "%d, rmt_io_caps: %d", | |
988 | + __func__, p_ssp_cfm_req->loc_io_caps, p_ssp_cfm_req->rmt_io_caps); | |
989 | + } else { | |
990 | + BTIF_TRACE_EVENT("%s: Auto-accept JustWorks pairing", __func__); | |
991 | + btif_dm_ssp_reply(&bd_addr, BT_SSP_VARIANT_CONSENT, true, 0); | |
992 | + return; | |
993 | + } | |
994 | + } | |
995 | + | |
973 | 996 | cod = devclass2uint(p_ssp_cfm_req->dev_class); |
974 | 997 | |
975 | 998 | if (cod == 0) { |