diff options
author | 2025-03-12 20:59:29 -0700 | |
---|---|---|
committer | 2025-03-12 20:59:29 -0700 | |
commit | d6d1665e8cc7397b8c7bac016f9af2c0f54da029 (patch) | |
tree | d7886a46c49f1d1530ed57d0cee0d3f4ba9dc40d | |
parent | 35b4f4274b37a419772851f0b6f0ea05fd2ec2a3 (diff) |
IOP fix for not reading LE appearance characteristics
Some devices don't respond to GATT Read by UUID requests for LE Appearance characteristics. This causes ATT transaction blockage and disconnection due to ATT transaction timeout.
Test: mmm packages/modules/Bluetooth
Flag: EXEMPT IOP fix
Bug: 402213061
Change-Id: Ib8cc3fbf32ccd0c1291314b65e56abe523acfdd6
-rw-r--r-- | system/conf/interop_database.conf | 5 | ||||
-rw-r--r-- | system/device/include/interop.h | 10 | ||||
-rw-r--r-- | system/device/src/interop.cc | 1 | ||||
-rw-r--r-- | system/stack/btm/btm_ble_sec.cc | 12 |
4 files changed, 23 insertions, 5 deletions
diff --git a/system/conf/interop_database.conf b/system/conf/interop_database.conf index ecf3da0b07..d921db421d 100644 --- a/system/conf/interop_database.conf +++ b/system/conf/interop_database.conf @@ -895,3 +895,8 @@ BSK10 = Name_Based [INTEROP_DISABLE_HF_PROFILE] JBL Flip 5 = Name_Based JBL Flip 6 = Name_Based + +# Some devices don't respond to LE appearance read request. +[INTEROP_DISABLE_READ_LE_APPEARANCE] +L1_L = Name_Based +L1_R = Name_Based diff --git a/system/device/include/interop.h b/system/device/include/interop.h index 22233bcd65..d72315d1b0 100644 --- a/system/device/include/interop.h +++ b/system/device/include/interop.h @@ -358,16 +358,20 @@ typedef enum { // Peer can request proper latency based on its power state later. INTEROP_HID_PREF_CONN_ZERO_LATENCY, - // Some HOGP devices have the report map longer than the maximum GATT attribute value length (512 - // bytes). + // Some HOGP devices have the report map longer than the maximum GATT + // attribute value length (512 bytes). INTEROP_HOGP_LONG_REPORT, - // Some HOGP devices requires MTU exchange be part of the initial setup to function. + // Some HOGP devices requires MTU exchange be part of the initial setup to + // function. INTEROP_HOGP_FORCE_MTU_EXCHANGE, // Some devices claim to support HFP in EIR but does not actually support it. INTEROP_DISABLE_HF_PROFILE, + // Some devices don't respond to LE appearance read request. + INTEROP_DISABLE_READ_LE_APPEARANCE, + END_OF_INTEROP_LIST } interop_feature_t; diff --git a/system/device/src/interop.cc b/system/device/src/interop.cc index 60d90cf6d6..44313664ed 100644 --- a/system/device/src/interop.cc +++ b/system/device/src/interop.cc @@ -392,6 +392,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) { CASE_RETURN_STR(INTEROP_HOGP_LONG_REPORT); CASE_RETURN_STR(INTEROP_HOGP_FORCE_MTU_EXCHANGE); CASE_RETURN_STR(INTEROP_DISABLE_HF_PROFILE); + CASE_RETURN_STR(INTEROP_DISABLE_READ_LE_APPEARANCE); } return UNKNOWN_INTEROP_FEATURE; } diff --git a/system/stack/btm/btm_ble_sec.cc b/system/stack/btm/btm_ble_sec.cc index b7db7fa130..cef553c79e 100644 --- a/system/stack/btm/btm_ble_sec.cc +++ b/system/stack/btm/btm_ble_sec.cc @@ -1621,8 +1621,16 @@ void btm_ble_connection_established(const RawAddress& bda) { !p_dev_rec->sec_rec.is_le_link_key_known())) { // Unknown device if (p_dev_rec->dev_class == kDevClassEmpty || p_dev_rec->dev_class == kDevClassUnclassified) { - // Class of device not known, read appearance characteristic - btm_ble_read_remote_cod(bda); + // Class of device not known, read appearance characteristic ... + // Unless it is one of those devices which don't respond to this request + BD_NAME remote_name = {}; + if (p_dev_rec->sec_rec.is_name_known() && BTM_GetRemoteDeviceName(bda, remote_name) && + interop_match_name(INTEROP_DISABLE_READ_LE_APPEARANCE, (const char*)remote_name)) { + log::warn("Name {} matches IOP database, not reading appearance for {}", + (const char*)remote_name, bda); + } else { + btm_ble_read_remote_cod(bda); + } } } } |