Merge "Interop fix to not read PPCP for devices that report incompatible values." into main
diff --git a/system/bta/dm/bta_dm_disc.cc b/system/bta/dm/bta_dm_disc.cc
index f22870f..455309e 100644
--- a/system/bta/dm/bta_dm_disc.cc
+++ b/system/bta/dm/bta_dm_disc.cc
@@ -31,8 +31,10 @@
#include "bta/dm/bta_dm_disc_int.h"
#include "bta/include/bta_gatt_api.h"
+#include "btif/include/btif_storage.h"
#include "common/circular_buffer.h"
#include "common/strings.h"
+#include "device/include/interop.h"
#include "internal_include/bt_target.h"
#include "main/shim/dumpsys.h"
#include "os/logging/log_adapter.h"
@@ -276,8 +278,17 @@
bta_dm_discovery_cb.service_search_cbacks.on_service_discovery_results(r.bd_addr, r.uuids,
r.result);
} else {
+ char remote_name[BD_NAME_LEN] = "";
bta_dm_discovery_cb.transports &= ~BT_TRANSPORT_LE;
- GAP_BleReadPeerPrefConnParams(bta_dm_discovery_cb.peer_bdaddr);
+ if (btif_storage_get_stored_remote_name(bta_dm_discovery_cb.peer_bdaddr, remote_name) &&
+ interop_match_name(INTEROP_DISABLE_LE_CONN_PREFERRED_PARAMS, remote_name)) {
+ // Some devices provide PPCP values that are incompatible with the device-side firmware.
+ log::info("disable PPCP read: interop matched name {} address {}", remote_name,
+ bta_dm_discovery_cb.peer_bdaddr);
+ } else {
+ log::info("reading PPCP");
+ GAP_BleReadPeerPrefConnParams(bta_dm_discovery_cb.peer_bdaddr);
+ }
bta_dm_discovery_cb.service_search_cbacks.on_gatt_results(bta_dm_discovery_cb.peer_bdaddr,
disc_result.gatt_uuids,
diff --git a/system/conf/interop_database.conf b/system/conf/interop_database.conf
index ba5c679..c7827c4 100644
--- a/system/conf/interop_database.conf
+++ b/system/conf/interop_database.conf
@@ -194,6 +194,9 @@
[INTEROP_DISABLE_LE_CONN_PREFERRED_PARAMS]
BSMBB09DS = Name_Based
ELECOM = Name_Based
+Dexcom = Name_Based
+DXCM = Name_Based
+DX0 = Name_Based
# Disable role switch for headsets/car-kits
# Some car kits allow role switch but when DUT initiates role switch
diff --git a/system/device/test/interop_test.cc b/system/device/test/interop_test.cc
index e0c44b1..c27801f 100644
--- a/system/device/test/interop_test.cc
+++ b/system/device/test/interop_test.cc
@@ -365,6 +365,9 @@
"Targus BT Laser Notebook Mouse"));
EXPECT_TRUE(interop_match_name(INTEROP_REMOVE_HID_DIG_DESCRIPTOR, "Motorola Keyboard KZ500"));
EXPECT_TRUE(interop_match_name(INTEROP_DISABLE_LE_CONN_PREFERRED_PARAMS, "BSMBB09DS"));
+ EXPECT_TRUE(interop_match_name(INTEROP_DISABLE_LE_CONN_PREFERRED_PARAMS, "DXCMog"));
+ EXPECT_TRUE(interop_match_name(INTEROP_DISABLE_LE_CONN_PREFERRED_PARAMS, "Dexcom 123"));
+ EXPECT_TRUE(interop_match_name(INTEROP_DISABLE_LE_CONN_PREFERRED_PARAMS, "DX01ab"));
EXPECT_TRUE(interop_match_name(INTEROP_DISABLE_AAC_CODEC, "abramtek M1"));
EXPECT_TRUE(interop_match_name(INTEROP_DISABLE_AAC_VBR_CODEC, "Audi_MMI_2781"));
EXPECT_TRUE(interop_match_name(INTEROP_DISABLE_AVDTP_RECONFIGURE, "KMM-BT51*HD"));