• 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

Revision4d0c625609ece690e705502134f2770c14cf89d0 (tree)
Time2019-06-19 12:30:12
AuthorAndre Eisenbach <eisenbach@goog...>
Commiterandroid-build-merger

Log Message

Limit sniff mode for Nintendo Pro Controller to 11.25ms
am: 85d56a8d38

Change-Id: Ic6398eb054f7bc20c7ab4dc2ee1e603c683c9044

Change Summary

Incremental Difference

--- a/bta/hh/bta_hh_utils.cc
+++ b/bta/hh/bta_hh_utils.cc
@@ -21,6 +21,7 @@
2121 #if (BTA_HH_INCLUDED == TRUE)
2222
2323 #include "bta_hh_int.h"
24+#include "device/include/interop.h"
2425 #include "osi/include/osi.h"
2526
2627 /* 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,
393394 if (ssr_max_latency > BTA_HH_SSR_MAX_LATENCY_DEF)
394395 ssr_max_latency = BTA_HH_SSR_MAX_LATENCY_DEF;
395396
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+
396402 *p_max_ssr_lat = ssr_max_latency;
397403 } else
398404 *p_max_ssr_lat = p_cb->kdev[i].dscp_info.ssr_max_latency;
--- a/device/include/interop.h
+++ b/device/include/interop.h
@@ -89,7 +89,11 @@ typedef enum {
8989 // Disable role switch for headsets/car-kits.
9090 // Some car kits allow role switch but when the Phone initiates role switch,
9191 // 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,
9397 } interop_feature_t;
9498
9599 // Check if a given |addr| matches a known interoperability workaround as
--- a/device/include/interop_database.h
+++ b/device/include/interop_database.h
@@ -143,6 +143,10 @@ static const interop_addr_entry_t interop_addr_database[] = {
143143
144144 // AirPods 2 - unacceptably loud volume
145145 {{{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},
146150 };
147151
148152 typedef struct {
--- a/device/src/interop.cc
+++ b/device/src/interop.cc
@@ -128,6 +128,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) {
128128 CASE_RETURN_STR(INTEROP_DISABLE_AVDTP_RECONFIGURE)
129129 CASE_RETURN_STR(INTEROP_DYNAMIC_ROLE_SWITCH)
130130 CASE_RETURN_STR(INTEROP_DISABLE_ROLE_SWITCH)
131+ CASE_RETURN_STR(INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL)
131132 }
132133
133134 return "UNKNOWN";