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

Commit b21248d8 authored by Venkata Jagadeesh Garaga's avatar Venkata Jagadeesh Garaga Committed by Ted Wang
Browse files

Disable sniff for faulty remotes

Some remote supports sniff but when dut initiates sniff req,
remote wont respond and acl connection will be terminated
from soc with LMP responce time out

Tag: #compatibility
Bug: 163109241
Test: Manual
Change-Id: I77b5c0daf22c9f3adaf2a7b75c20bc8e27d8990c
Merged-In: I77b5c0daf22c9f3adaf2a7b75c20bc8e27d8990c
parent dc21e442
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -102,7 +102,12 @@ typedef enum {
  INTEROP_DISABLE_NAME_REQUEST,

  // Respond AVRCP profile version only 1.4 for some device.
  INTEROP_AVRCP_1_4_ONLY
  INTEROP_AVRCP_1_4_ONLY,

  // Disable sniff mode for headsets/car-kits
  // Some car kits supports sniff mode but when DUT initiates sniff req
  // Remote will go to bad state and its leads to LMP time out.
  INTEROP_DISABLE_SNIFF
} interop_feature_t;

// Check if a given |addr| matches a known interoperability workaround as
+1 −0
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) {
    CASE_RETURN_STR(INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL)
    CASE_RETURN_STR(INTEROP_DISABLE_NAME_REQUEST)
    CASE_RETURN_STR(INTEROP_AVRCP_1_4_ONLY)
    CASE_RETURN_STR(INTEROP_DISABLE_SNIFF)
  }

  return "UNKNOWN";
+2 −1
Original line number Diff line number Diff line
@@ -746,7 +746,8 @@ tBTM_STATUS BTM_SetLinkPolicy(const RawAddress& remote_bda,
                    *settings);
    }
    if ((*settings & HCI_ENABLE_SNIFF_MODE) &&
        (!HCI_SNIFF_MODE_SUPPORTED(localFeatures))) {
        ((!HCI_SNIFF_MODE_SUPPORTED(localFeatures)) ||
         interop_match_addr(INTEROP_DISABLE_SNIFF, &remote_bda))) {
      *settings &= (~HCI_ENABLE_SNIFF_MODE);
      BTM_TRACE_API("BTM_SetLinkPolicy sniff not supported (settings: 0x%04x)",
                    *settings);
+3 −1
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@
#include "btm_int.h"
#include "btm_int_types.h"
#include "btu.h"
#include "device/include/interop.h"
#include "hcidefs.h"
#include "hcimsgs.h"
#include "l2c_int.h"
@@ -177,7 +178,8 @@ tBTM_STATUS BTM_SetPowerMode(uint8_t pm_id, const RawAddress& remote_bda,
    /* check if the requested mode is supported */
    ind = mode - BTM_PM_MD_HOLD; /* make it base 0 */
    p_features = BTM_ReadLocalFeatures();
    if (!(p_features[btm_pm_mode_off[ind]] & btm_pm_mode_msk[ind])) {
    if (!(p_features[btm_pm_mode_off[ind]] & btm_pm_mode_msk[ind]) ||
            interop_match_addr(INTEROP_DISABLE_SNIFF, &remote_bda)) {
      LOG(ERROR) << __func__ << ": pm_id " << unsigned(pm_id) << " mode "
                 << unsigned(mode) << " is not supported for " << remote_bda;
      return BTM_MODE_UNSUPPORTED;