summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-03-13 21:52:28 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2025-03-13 21:52:28 -0700
commit98e0a4516cfc869eafcc2f3ec98690d524610003 (patch)
tree1f29c5b59cd108330f84301ec9ea0575c5d15e7a
parent15717f41d0b11a9a26b0e5288336a060d1854221 (diff)
parentd6d1665e8cc7397b8c7bac016f9af2c0f54da029 (diff)
Merge "IOP fix for not reading LE appearance characteristics" into main
-rw-r--r--system/conf/interop_database.conf5
-rw-r--r--system/device/include/interop.h10
-rw-r--r--system/device/src/interop.cc1
-rw-r--r--system/stack/btm/btm_ble_sec.cc12
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);
+ }
}
}
}