diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/bta/gatt/bta_gattc_utils.cc | 2 | ||||
-rw-r--r-- | system/gd/hci/acl_manager/round_robin_scheduler.cc | 10 | ||||
-rw-r--r-- | system/gd/hci/acl_manager/round_robin_scheduler_test.cc | 3 |
3 files changed, 4 insertions, 11 deletions
diff --git a/system/bta/gatt/bta_gattc_utils.cc b/system/bta/gatt/bta_gattc_utils.cc index 23b150b829..1541f391ca 100644 --- a/system/bta/gatt/bta_gattc_utils.cc +++ b/system/bta/gatt/bta_gattc_utils.cc @@ -142,7 +142,7 @@ tBTA_GATTC_CLCB* bta_gattc_find_clcb_by_cif(uint8_t client_if, const RawAddress& tBTA_GATTC_CLCB* bta_gattc_find_clcb_by_conn_id(tCONN_ID conn_id) { if (com::android::bluetooth::flags::gatt_client_dynamic_allocation()) { for (auto& p_clcb : bta_gattc_cb.clcb_set) { - if (p_clcb->in_use && p_clcb->bta_conn_id == conn_id) { + if (p_clcb != NULL && p_clcb->in_use && p_clcb->bta_conn_id == conn_id) { return p_clcb.get(); } } diff --git a/system/gd/hci/acl_manager/round_robin_scheduler.cc b/system/gd/hci/acl_manager/round_robin_scheduler.cc index ad0e6dc621..89897a82e5 100644 --- a/system/gd/hci/acl_manager/round_robin_scheduler.cc +++ b/system/gd/hci/acl_manager/round_robin_scheduler.cc @@ -17,7 +17,6 @@ #include "hci/acl_manager/round_robin_scheduler.h" #include <bluetooth/log.h> -#include <com_android_bluetooth_flags.h> #include <memory> #include <utility> @@ -65,10 +64,8 @@ void RoundRobinScheduler::Unregister(uint16_t handle) { log::assert_that(acl_queue_handlers_.count(handle) == 1, "assert failed: acl_queue_handlers_.count(handle) == 1"); - if (com::android::bluetooth::flags::drop_acl_fragment_on_disconnect()) { - // Drop the pending fragments and recalculate number_of_sent_packets_ - drop_packet_fragments(handle); - } + // Drop the pending fragments and recalculate number_of_sent_packets_ + drop_packet_fragments(handle); auto& acl_queue_handler = acl_queue_handlers_.find(handle)->second; log::info("unregistering acl_queue handle={}, sent_packets={}", handle, @@ -94,8 +91,7 @@ void RoundRobinScheduler::Unregister(uint16_t handle) { starting_point_ = acl_queue_handlers_.begin(); // Restart sending packets if we got acl credits - if (com::android::bluetooth::flags::drop_acl_fragment_on_disconnect() && - credits_reclaimed_from_zero) { + if (credits_reclaimed_from_zero) { start_round_robin(); } } diff --git a/system/gd/hci/acl_manager/round_robin_scheduler_test.cc b/system/gd/hci/acl_manager/round_robin_scheduler_test.cc index 25bd2aff80..b990332c9e 100644 --- a/system/gd/hci/acl_manager/round_robin_scheduler_test.cc +++ b/system/gd/hci/acl_manager/round_robin_scheduler_test.cc @@ -16,7 +16,6 @@ #include "hci/acl_manager/round_robin_scheduler.h" -#include <com_android_bluetooth_flags.h> #include <gtest/gtest.h> #include "common/bidi_queue.h" @@ -422,8 +421,6 @@ TEST_F(RoundRobinSchedulerTest, receive_le_credit_when_next_fragment_is_classic) } TEST_F(RoundRobinSchedulerTest, unregister_reclaim_credits) { - com::android::bluetooth::flags::provider_->drop_acl_fragment_on_disconnect(true); - uint16_t handle = 0x01; auto connection_queue = std::make_shared<AclConnection::Queue>(20); auto new_connection_queue = std::make_shared<AclConnection::Queue>(20); |