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

Commit a3af4f66 authored by Rahul Arya's avatar Rahul Arya Committed by Android (Google) Code Review
Browse files

Merge "Disable Database Hash read for Eero devices" into tm-qpr-dev

parents 3f99c21d ec38e6d7
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include "bta/hh/bta_hh_int.h"
#include "btif/include/btif_debug_conn.h"
#include "device/include/controller.h"
#include "device/include/interop.h"
#include "main/shim/dumpsys.h"
#include "osi/include/allocator.h"
#include "osi/include/log.h"
@@ -802,6 +803,18 @@ void bta_gattc_start_discover(tBTA_GATTC_CLCB* p_clcb,
        p_clcb->p_srcb->srvc_hdl_db_hash = false;
      }

      // Some LMP 5.2 devices also don't support robust caching. This workaround
      // conditionally disables the feature based on a combination of LMP
      // version and OUI prefix.
      if (lmp_version < 0x0c &&
          interop_match_addr(INTEROP_DISABLE_ROBUST_CACHING, &p_clcb->bda)) {
        LOG_WARN(
            "Device LMP version 0x%02x <= Bluetooth 5.2 and MAC addr on "
            "interop list, skipping robust caching",
            lmp_version);
        p_clcb->p_srcb->srvc_hdl_db_hash = false;
      }

      /* read db hash if db hash characteristic exists */
      if (bta_gattc_is_robust_caching_enabled() &&
          p_clcb->p_srcb->srvc_hdl_db_hash &&
+8 −1
Original line number Diff line number Diff line
@@ -118,7 +118,14 @@ typedef enum {
  INTEROP_SLC_SKIP_BIND_COMMAND,

  // Respond AVRCP profile version only 1.3 for some device.
  INTEROP_AVRCP_1_3_ONLY
  INTEROP_AVRCP_1_3_ONLY,

  // Some remote devices have LMP version in[5.0, 5.2] but do not support
  // robust
  // caching or correctly response with an error. We disable the
  // database hash
  // lookup for such devices.
  INTEROP_DISABLE_ROBUST_CACHING,
} interop_feature_t;

// Check if a given |addr| matches a known interoperability workaround as
+33 −0
Original line number Diff line number Diff line
@@ -195,6 +195,39 @@ static const interop_addr_entry_t interop_addr_database[] = {

    // BMW Carkit
    {{{0x00, 0x0a, 0x08, 0, 0, 0}}, 3, INTEROP_AVRCP_1_3_ONLY},

    // Eero Wi-Fi Router
    {{{0x08, 0x9b, 0xf1, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x20, 0xbe, 0xcd, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x30, 0x34, 0x22, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x3c, 0x5c, 0xf1, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x40, 0x47, 0x5e, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x50, 0x27, 0xa9, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x64, 0x97, 0x14, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x64, 0xc2, 0x69, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x68, 0x4a, 0x76, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x6c, 0xae, 0xf6, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x78, 0x76, 0x89, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x78, 0xd6, 0xd6, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x84, 0x70, 0xd7, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x98, 0xed, 0x7e, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x9c, 0x0b, 0x05, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x9c, 0x57, 0xbc, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0x9c, 0xa5, 0x70, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xa0, 0x8e, 0x24, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xac, 0xec, 0x85, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xb4, 0x20, 0x46, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xb4, 0xb9, 0xe6, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xc0, 0x36, 0x53, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xc4, 0xf1, 0x74, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xc8, 0xb8, 0x2f, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xc8, 0xe3, 0x06, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xd4, 0x05, 0xde, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xd4, 0x3f, 0x32, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xec, 0x74, 0x27, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xf0, 0x21, 0xe0, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xf0, 0xb6, 0x61, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
    {{{0xfc, 0x3f, 0xa6, 0, 0, 0}}, 3, INTEROP_DISABLE_ROBUST_CACHING},
};

typedef struct {
+2 −1
Original line number Diff line number Diff line
@@ -138,7 +138,8 @@ static const char* interop_feature_string_(const interop_feature_t feature) {
    CASE_RETURN_STR(INTEROP_DISABLE_SNIFF)
    CASE_RETURN_STR(INTEROP_DISABLE_AVDTP_SUSPEND)
    CASE_RETURN_STR(INTEROP_SLC_SKIP_BIND_COMMAND)
    CASE_RETURN_STR(INTEROP_AVRCP_1_3_ONLY);
    CASE_RETURN_STR(INTEROP_AVRCP_1_3_ONLY)
    CASE_RETURN_STR(INTEROP_DISABLE_ROBUST_CACHING);
  }

  return "UNKNOWN";