Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5779d27 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Android (Google) Code Review
Browse files

Merge "Add supervision timeout workaround for Nexus Remote" into oc-dev

parents 869ef97e 0e6fae4a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@
#include "btm_api.h"
#include "btm_ble_api.h"
#include "btm_int.h"
#include "device/include/interop.h"
#include "osi/include/log.h"
#include "srvc_api.h"
#include "stack/include/l2c_api.h"
@@ -1480,6 +1481,12 @@ void read_pref_conn_params_cb(uint16_t conn_id, tGATT_STATUS status,
  if (tout == BTM_BLE_CONN_PARAM_UNDEF) tout = BTM_BLE_CONN_TIMEOUT_DEF;

  tBTA_HH_DEV_CB* p_dev_cb = (tBTA_HH_DEV_CB*)data;

  if (interop_match_addr(INTEROP_HID_PREF_CONN_SUP_TIMEOUT_3S,
                         (bt_bdaddr_t*)&p_dev_cb->addr) == true) {
    if (tout < 300) tout = 300;
  }

  BTM_BleSetPrefConnParams(p_dev_cb->addr, min, max, latency, tout);
  L2CA_UpdateBleConnParams(p_dev_cb->addr, min, max, latency, tout);
}
+5 −1
Original line number Diff line number Diff line
@@ -65,7 +65,11 @@ typedef enum {

  // Disable 3Mbps packets and use only 2Mbps packets for ACL links when
  // streaming audio.
  INTEROP_2MBPS_LINK_ONLY
  INTEROP_2MBPS_LINK_ONLY,

  // Do not use supervision timeout value received from preferred connection
  // parameters, use 3s instead. Use with HID only.
  INTEROP_HID_PREF_CONN_SUP_TIMEOUT_3S
} interop_feature_t;

// Check if a given |addr| matches a known interoperability workaround as
+7 −0
Original line number Diff line number Diff line
@@ -42,6 +42,13 @@ static const interop_addr_entry_t interop_addr_database[] = {
    {{{0xac, 0x9e, 0x17, 0, 0, 0}}, 3, INTEROP_DISABLE_LE_SECURE_CONNECTIONS},
    {{{0xf0, 0x79, 0x59, 0, 0, 0}}, 3, INTEROP_DISABLE_LE_SECURE_CONNECTIONS},

    {{{0x08, 0x62, 0x66, 0, 0, 0}}, 3, INTEROP_HID_PREF_CONN_SUP_TIMEOUT_3S},
    {{{0x38, 0x2c, 0x4a, 0xc9, 0, 0}}, 4, INTEROP_HID_PREF_CONN_SUP_TIMEOUT_3S},
    {{{0x38, 0x2c, 0x4a, 0xe6, 0, 0}}, 4, INTEROP_HID_PREF_CONN_SUP_TIMEOUT_3S},
    {{{0x54, 0xa0, 0x50, 0xd9, 0, 0}}, 4, INTEROP_HID_PREF_CONN_SUP_TIMEOUT_3S},
    {{{0xac, 0x9e, 0x17, 0, 0, 0}}, 3, INTEROP_HID_PREF_CONN_SUP_TIMEOUT_3S},
    {{{0xf0, 0x79, 0x59, 0, 0, 0}}, 3, INTEROP_HID_PREF_CONN_SUP_TIMEOUT_3S},

    // Ausdom M05 - unacceptably loud volume
    {{{0xa0, 0xe9, 0xdb, 0, 0, 0}}, 3, INTEROP_DISABLE_ABSOLUTE_VOLUME},

+1 −0
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) {
    CASE_RETURN_STR(INTEROP_DISABLE_AUTO_PAIRING)
    CASE_RETURN_STR(INTEROP_KEYBOARD_REQUIRES_FIXED_PIN)
    CASE_RETURN_STR(INTEROP_2MBPS_LINK_ONLY)
    CASE_RETURN_STR(INTEROP_HID_PREF_CONN_SUP_TIMEOUT_3S)
  }

  return "UNKNOWN";