system/bt
Revision | 4d0c625609ece690e705502134f2770c14cf89d0 (tree) |
---|---|
Time | 2019-06-19 12:30:12 |
Author | Andre Eisenbach <eisenbach@goog...> |
Commiter | android-build-merger |
Limit sniff mode for Nintendo Pro Controller to 11.25ms
am: 85d56a8d38
Change-Id: Ic6398eb054f7bc20c7ab4dc2ee1e603c683c9044
@@ -21,6 +21,7 @@ | ||
21 | 21 | #if (BTA_HH_INCLUDED == TRUE) |
22 | 22 | |
23 | 23 | #include "bta_hh_int.h" |
24 | +#include "device/include/interop.h" | |
24 | 25 | #include "osi/include/osi.h" |
25 | 26 | |
26 | 27 | /* if SSR max latency is not defined by remote device, set the default value |
@@ -393,6 +394,11 @@ tBTA_HH_STATUS bta_hh_read_ssr_param(const RawAddress& bd_addr, | ||
393 | 394 | if (ssr_max_latency > BTA_HH_SSR_MAX_LATENCY_DEF) |
394 | 395 | ssr_max_latency = BTA_HH_SSR_MAX_LATENCY_DEF; |
395 | 396 | |
397 | + if (interop_match_addr(INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL, | |
398 | + &bd_addr)) { | |
399 | + if (ssr_max_latency > 18 /* slots * 0.625ms */) ssr_max_latency = 18; | |
400 | + } | |
401 | + | |
396 | 402 | *p_max_ssr_lat = ssr_max_latency; |
397 | 403 | } else |
398 | 404 | *p_max_ssr_lat = p_cb->kdev[i].dscp_info.ssr_max_latency; |
@@ -89,7 +89,11 @@ typedef enum { | ||
89 | 89 | // Disable role switch for headsets/car-kits. |
90 | 90 | // Some car kits allow role switch but when the Phone initiates role switch, |
91 | 91 | // the Remote device will go into bad state that will lead to LMP time out. |
92 | - INTEROP_DISABLE_ROLE_SWITCH | |
92 | + INTEROP_DISABLE_ROLE_SWITCH, | |
93 | + | |
94 | + // Set a very low initial sniff subrating for HID devices that do not | |
95 | + // set their own sniff interval. | |
96 | + INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL, | |
93 | 97 | } interop_feature_t; |
94 | 98 | |
95 | 99 | // Check if a given |addr| matches a known interoperability workaround as |
@@ -143,6 +143,10 @@ static const interop_addr_entry_t interop_addr_database[] = { | ||
143 | 143 | |
144 | 144 | // AirPods 2 - unacceptably loud volume |
145 | 145 | {{{0x94, 0x16, 0x25, 0, 0, 0}}, 3, INTEROP_DISABLE_ABSOLUTE_VOLUME}, |
146 | + | |
147 | + // Nintendo Switch Pro Controller - does not set sniff interval dynamically. | |
148 | + // Requires custom HID report command to change mode. | |
149 | + {{{0x98, 0xB6, 0xE9, 0, 0, 0}}, 3, INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL}, | |
146 | 150 | }; |
147 | 151 | |
148 | 152 | typedef struct { |
@@ -128,6 +128,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) { | ||
128 | 128 | CASE_RETURN_STR(INTEROP_DISABLE_AVDTP_RECONFIGURE) |
129 | 129 | CASE_RETURN_STR(INTEROP_DYNAMIC_ROLE_SWITCH) |
130 | 130 | CASE_RETURN_STR(INTEROP_DISABLE_ROLE_SWITCH) |
131 | + CASE_RETURN_STR(INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL) | |
131 | 132 | } |
132 | 133 | |
133 | 134 | return "UNKNOWN"; |