• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/bt


Commit MetaInfo

Revisión1d0646a39652572728109c71bd4640eab721ca8c (tree)
Tiempo2019-06-19 10:30:38
AutorTreeHugger Robot <treehugger-gerrit@goog...>
CommiterAndroid (Google) Code Review

Log Message

Merge "Revert "DO NOT MERGE: btif: require pairing dialog for JustWorks SSP"" into qt-dev

Cambiar Resumen

Diferencia incremental

--- a/btif/src/btif_dm.cc
+++ b/btif/src/btif_dm.cc
@@ -926,6 +926,7 @@ static void btif_dm_pin_req_evt(tBTA_DM_PIN_REQ* p_pin_req) {
926926 static void btif_dm_ssp_cfm_req_evt(tBTA_DM_SP_CFM_REQ* p_ssp_cfm_req) {
927927 bt_bdname_t bd_name;
928928 uint32_t cod;
929+ bool is_incoming = !(pairing_cb.state == BT_BOND_STATE_BONDING);
929930 int dev_type;
930931
931932 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) {
970971
971972 pairing_cb.is_ssp = true;
972973
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+
973996 cod = devclass2uint(p_ssp_cfm_req->dev_class);
974997
975998 if (cod == 0) {