Loading system/bta/hh/bta_hh_utils.cc +6 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #if (BTA_HH_INCLUDED == TRUE) #include "bta_hh_int.h" #include "device/include/interop.h" #include "osi/include/osi.h" /* if SSR max latency is not defined by remote device, set the default value Loading Loading @@ -393,6 +394,11 @@ tBTA_HH_STATUS bta_hh_read_ssr_param(const RawAddress& bd_addr, if (ssr_max_latency > BTA_HH_SSR_MAX_LATENCY_DEF) ssr_max_latency = BTA_HH_SSR_MAX_LATENCY_DEF; if (interop_match_addr(INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL, &bd_addr)) { if (ssr_max_latency > 18 /* slots * 0.625ms */) ssr_max_latency = 18; } *p_max_ssr_lat = ssr_max_latency; } else *p_max_ssr_lat = p_cb->kdev[i].dscp_info.ssr_max_latency; Loading system/btif/src/btif_dm.cc +23 −0 Original line number Diff line number Diff line Loading @@ -926,6 +926,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__); Loading Loading @@ -970,6 +971,28 @@ 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 needed if: * 1. Incoming (non-temporary) pairing is detected AND * 2. local IO capabilities are DisplayYesNo AND * 3. remote IO capabiltiies are DisplayOnly or NoInputNoOutput; */ 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; } } cod = devclass2uint(p_ssp_cfm_req->dev_class); if (cod == 0) { Loading system/device/include/interop.h +5 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,11 @@ typedef enum { // Disable role switch for headsets/car-kits. // Some car kits allow role switch but when the Phone initiates role switch, // the Remote device will go into bad state that will lead to LMP time out. INTEROP_DISABLE_ROLE_SWITCH INTEROP_DISABLE_ROLE_SWITCH, // Set a very low initial sniff subrating for HID devices that do not // set their own sniff interval. INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL, } interop_feature_t; // Check if a given |addr| matches a known interoperability workaround as Loading system/device/include/interop_database.h +4 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,10 @@ static const interop_addr_entry_t interop_addr_database[] = { // AirPods 2 - unacceptably loud volume {{{0x94, 0x16, 0x25, 0, 0, 0}}, 3, INTEROP_DISABLE_ABSOLUTE_VOLUME}, // Nintendo Switch Pro Controller - does not set sniff interval dynamically. // Requires custom HID report command to change mode. {{{0x98, 0xB6, 0xE9, 0, 0, 0}}, 3, INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL}, }; typedef struct { Loading system/device/src/interop.cc +1 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) { CASE_RETURN_STR(INTEROP_DISABLE_AVDTP_RECONFIGURE) CASE_RETURN_STR(INTEROP_DYNAMIC_ROLE_SWITCH) CASE_RETURN_STR(INTEROP_DISABLE_ROLE_SWITCH) CASE_RETURN_STR(INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL) } return "UNKNOWN"; Loading Loading
system/bta/hh/bta_hh_utils.cc +6 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #if (BTA_HH_INCLUDED == TRUE) #include "bta_hh_int.h" #include "device/include/interop.h" #include "osi/include/osi.h" /* if SSR max latency is not defined by remote device, set the default value Loading Loading @@ -393,6 +394,11 @@ tBTA_HH_STATUS bta_hh_read_ssr_param(const RawAddress& bd_addr, if (ssr_max_latency > BTA_HH_SSR_MAX_LATENCY_DEF) ssr_max_latency = BTA_HH_SSR_MAX_LATENCY_DEF; if (interop_match_addr(INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL, &bd_addr)) { if (ssr_max_latency > 18 /* slots * 0.625ms */) ssr_max_latency = 18; } *p_max_ssr_lat = ssr_max_latency; } else *p_max_ssr_lat = p_cb->kdev[i].dscp_info.ssr_max_latency; Loading
system/btif/src/btif_dm.cc +23 −0 Original line number Diff line number Diff line Loading @@ -926,6 +926,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__); Loading Loading @@ -970,6 +971,28 @@ 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 needed if: * 1. Incoming (non-temporary) pairing is detected AND * 2. local IO capabilities are DisplayYesNo AND * 3. remote IO capabiltiies are DisplayOnly or NoInputNoOutput; */ 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; } } cod = devclass2uint(p_ssp_cfm_req->dev_class); if (cod == 0) { Loading
system/device/include/interop.h +5 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,11 @@ typedef enum { // Disable role switch for headsets/car-kits. // Some car kits allow role switch but when the Phone initiates role switch, // the Remote device will go into bad state that will lead to LMP time out. INTEROP_DISABLE_ROLE_SWITCH INTEROP_DISABLE_ROLE_SWITCH, // Set a very low initial sniff subrating for HID devices that do not // set their own sniff interval. INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL, } interop_feature_t; // Check if a given |addr| matches a known interoperability workaround as Loading
system/device/include/interop_database.h +4 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,10 @@ static const interop_addr_entry_t interop_addr_database[] = { // AirPods 2 - unacceptably loud volume {{{0x94, 0x16, 0x25, 0, 0, 0}}, 3, INTEROP_DISABLE_ABSOLUTE_VOLUME}, // Nintendo Switch Pro Controller - does not set sniff interval dynamically. // Requires custom HID report command to change mode. {{{0x98, 0xB6, 0xE9, 0, 0, 0}}, 3, INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL}, }; typedef struct { Loading
system/device/src/interop.cc +1 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) { CASE_RETURN_STR(INTEROP_DISABLE_AVDTP_RECONFIGURE) CASE_RETURN_STR(INTEROP_DYNAMIC_ROLE_SWITCH) CASE_RETURN_STR(INTEROP_DISABLE_ROLE_SWITCH) CASE_RETURN_STR(INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL) } return "UNKNOWN"; Loading