summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jakub Pawlowski <jpawlowski@google.com> 2025-01-27 15:18:01 +0100
committer Jakub Pawłowski <jpawlowski@google.com> 2025-01-27 22:59:58 -0800
commitd455f29e67a46f3097dbf438efd59dff1b8751be (patch)
treead8f81059d1b10e5162bb8e807575ca136c8f650
parent1de32735cbb9d5ddff07666373497b7e3bbf3d00 (diff)
Remove bta_dm_discover_both flag
Bug: 339217881 Test: mma -j32 Bug: none Change-Id: I8e8dfe9024d9f76fbec9e0da28b7c8723f331986
-rw-r--r--flags/bta_dm.aconfig7
-rw-r--r--system/bta/dm/bta_dm_disc.cc5
-rw-r--r--system/bta/test/bta_disc_test.cc56
-rw-r--r--system/btif/src/btif_dm.cc3
4 files changed, 4 insertions, 67 deletions
diff --git a/flags/bta_dm.aconfig b/flags/bta_dm.aconfig
index d91f3168b7..287a0f0187 100644
--- a/flags/bta_dm.aconfig
+++ b/flags/bta_dm.aconfig
@@ -9,13 +9,6 @@ flag {
}
flag {
- name: "bta_dm_discover_both"
- namespace: "bluetooth"
- description: "perform both LE and Classic service discovery simulteanously on capable devices"
- bug: "339217881"
-}
-
-flag {
name: "cancel_open_discovery_client"
namespace: "bluetooth"
description: "Cancel connection from discovery client correctly"
diff --git a/system/bta/dm/bta_dm_disc.cc b/system/bta/dm/bta_dm_disc.cc
index e9c6ba5e77..c3977454f5 100644
--- a/system/bta/dm/bta_dm_disc.cc
+++ b/system/bta/dm/bta_dm_disc.cc
@@ -511,7 +511,7 @@ static void bta_dm_gatt_disc_complete(tCONN_ID conn_id, tGATT_STATUS status) {
log::verbose("conn_id = {}, status = {}, sdp_pending = {}, le_pending = {}", conn_id, status,
sdp_pending, le_pending);
- if (com::android::bluetooth::flags::bta_dm_discover_both() && sdp_pending && !le_pending) {
+ if (sdp_pending && !le_pending) {
/* LE Service discovery finished, and services were reported, but SDP is not
* finished yet. gatt_close_timer closed the connection, and we received
* this callback because of disconnection */
@@ -784,8 +784,7 @@ static void bta_dm_disc_sm_execute(tBTA_DM_DISC_EVT event, std::unique_ptr<tBTA_
"bad message type: {}", msg->index());
auto req = std::get<tBTA_DM_API_DISCOVER>(*msg);
- if (com::android::bluetooth::flags::bta_dm_discover_both() &&
- is_same_device(req.bd_addr, bta_dm_discovery_cb.peer_bdaddr)) {
+ if (is_same_device(req.bd_addr, bta_dm_discovery_cb.peer_bdaddr)) {
bta_dm_discover_services(std::get<tBTA_DM_API_DISCOVER>(*msg));
} else {
bta_dm_queue_disc(std::get<tBTA_DM_API_DISCOVER>(*msg));
diff --git a/system/bta/test/bta_disc_test.cc b/system/bta/test/bta_disc_test.cc
index 58421f2962..3a1dbc9882 100644
--- a/system/bta/test/bta_disc_test.cc
+++ b/system/bta/test/bta_disc_test.cc
@@ -219,61 +219,7 @@ int gatt_service_cb_both_call_cnt = 0;
/* This test exercises the usual service discovery flow when bonding to
* dual-mode, CTKD capable device on LE transport.
*/
-TEST_F_WITH_FLAGS(BtaInitializedTest, bta_dm_disc_both_transports_flag_disabled,
- REQUIRES_FLAGS_DISABLED(ACONFIG_FLAG(TEST_BT, bta_dm_discover_both))) {
- bta_dm_disc_start(true);
-
- std::promise<void> gatt_triggered;
- int gatt_call_cnt = 0;
- base::RepeatingCallback<void(const RawAddress&)> gatt_performer =
- base::BindLambdaForTesting([&](const RawAddress& /*bd_addr*/) {
- gatt_call_cnt++;
- gatt_triggered.set_value();
- });
- bta_dm_disc_override_gatt_performer_for_testing(gatt_performer);
-
- int sdp_call_cnt = 0;
- base::RepeatingCallback<void(tBTA_DM_SDP_STATE*)> sdp_performer =
- base::BindLambdaForTesting([&](tBTA_DM_SDP_STATE* /*sdp_state*/) { sdp_call_cnt++; });
- bta_dm_disc_override_sdp_performer_for_testing(sdp_performer);
-
- gatt_service_cb_both_call_cnt = 0;
- service_cb_both_call_cnt = 0;
-
- bta_dm_disc_start_service_discovery(
- {[](RawAddress, std::vector<bluetooth::Uuid>&, bool) {}, nullptr,
- [](RawAddress /*addr*/, const std::vector<bluetooth::Uuid>&, tBTA_STATUS) {
- service_cb_both_call_cnt++;
- }},
- kRawAddress, BT_TRANSPORT_BR_EDR);
- EXPECT_EQ(sdp_call_cnt, 1);
-
- bta_dm_disc_start_service_discovery(
- {[](RawAddress, std::vector<bluetooth::Uuid>&, bool) { gatt_service_cb_both_call_cnt++; },
- nullptr, [](RawAddress /*addr*/, const std::vector<bluetooth::Uuid>&, tBTA_STATUS) {}},
- kRawAddress, BT_TRANSPORT_LE);
-
- // GATT discovery is queued, until SDP finishes
- EXPECT_EQ(gatt_call_cnt, 0);
-
- bta_dm_sdp_finished(kRawAddress, BTA_SUCCESS, {}, {});
- EXPECT_EQ(service_cb_both_call_cnt, 1);
-
- // SDP finished, wait until GATT is triggered.
- EXPECT_EQ(std::future_status::ready,
- gatt_triggered.get_future().wait_for(std::chrono::seconds(1)));
- bta_dm_gatt_finished(kRawAddress, BTA_SUCCESS);
- EXPECT_EQ(gatt_service_cb_both_call_cnt, 1);
-
- bta_dm_disc_override_sdp_performer_for_testing({});
- bta_dm_disc_override_gatt_performer_for_testing({});
-}
-
-/* This test exercises the usual service discovery flow when bonding to
- * dual-mode, CTKD capable device on LE transport.
- */
-TEST_F_WITH_FLAGS(BtaInitializedTest, bta_dm_disc_both_transports_flag_enabled,
- REQUIRES_FLAGS_ENABLED(ACONFIG_FLAG(TEST_BT, bta_dm_discover_both))) {
+TEST_F(BtaInitializedTest, bta_dm_disc_both_transports) {
bta_dm_disc_start(true);
int gatt_call_cnt = 0;
diff --git a/system/btif/src/btif_dm.cc b/system/btif/src/btif_dm.cc
index a023c22970..637a95ccf4 100644
--- a/system/btif/src/btif_dm.cc
+++ b/system/btif/src/btif_dm.cc
@@ -1817,8 +1817,7 @@ static void btif_on_gatt_results(RawAddress bd_addr, std::vector<bluetooth::Uuid
* send them with rest of SDP results in on_service_discovery_results */
return;
} else {
- if (pairing_cb.sdp_over_classic == btif_dm_pairing_cb_t::ServiceDiscoveryState::SCHEDULED &&
- com::android::bluetooth::flags::bta_dm_discover_both()) {
+ if (pairing_cb.sdp_over_classic == btif_dm_pairing_cb_t::ServiceDiscoveryState::SCHEDULED) {
/* Don't report services yet, they will be reported together once SDP
* finishes. */
log::info("will report services later, with SDP results {}", bd_addr);