diff options
Diffstat (limited to 'system')
25 files changed, 71 insertions, 187 deletions
diff --git a/system/bta/dm/bta_dm_disc.cc b/system/bta/dm/bta_dm_disc.cc index b3f010e86e..79d3421361 100644 --- a/system/bta/dm/bta_dm_disc.cc +++ b/system/bta/dm/bta_dm_disc.cc @@ -152,8 +152,7 @@ gatt_interface_t& get_gatt_interface() { return *gatt_interface; } void bta_dm_disc_gatt_cancel_open(const RawAddress& bd_addr) { get_gatt_interface().BTA_GATTC_CancelOpen(0, bd_addr, false); - if (com::android::bluetooth::flags::cancel_open_discovery_client() && - bta_dm_discovery_cb.client_if != BTA_GATTS_INVALID_IF) { + if (bta_dm_discovery_cb.client_if != BTA_GATTS_INVALID_IF) { get_gatt_interface().BTA_GATTC_CancelOpen(bta_dm_discovery_cb.client_if, bd_addr, true); } } @@ -559,11 +558,7 @@ static void bta_dm_gatt_disc_complete(tCONN_ID conn_id, tGATT_STATUS status) { } else { log::info("Discovery complete for invalid conn ID. Will pick up next job"); - if (com::android::bluetooth::flags::cancel_open_discovery_client()) { - bta_dm_close_gatt_conn(bta_dm_discovery_cb.conn_id); - } else { - bta_dm_discovery_cb.conn_id = GATT_INVALID_CONN_ID; - } + bta_dm_close_gatt_conn(bta_dm_discovery_cb.conn_id); if (bta_dm_discovery_cb.transports & BT_TRANSPORT_BR_EDR) { log::info("classic discovery still pending {}", bta_dm_discovery_cb.peer_bdaddr); return; diff --git a/system/gd/common/audit_log.cc b/system/gd/common/audit_log.cc index e83c2894f8..2e112a0c34 100644 --- a/system/gd/common/audit_log.cc +++ b/system/gd/common/audit_log.cc @@ -16,6 +16,8 @@ #include "common/audit_log.h" +#include <format> + #ifdef __ANDROID__ #include <log/log_event_list.h> #endif // __ANDROID__ @@ -43,8 +45,8 @@ void LogConnectionAdminAuditEvent([[maybe_unused]] const char* action, android_log_event_list(SEC_TAG_BLUETOOTH_CONNECTION) << address.ToRedactedStringForLogging() - << /* success */ int32_t(status == hci::ErrorCode::SUCCESS) << action << ": " - << ErrorCodeText(status) << LOG_ID_SECURITY; + << /* success */ int32_t(status == hci::ErrorCode::SUCCESS) + << std::format("{}: {}", action, ErrorCodeText(status)) << LOG_ID_SECURITY; #endif /* defined(__ANDROID__) && !defined (FUZZ_TARGET) */ } diff --git a/system/gd/hal/snoop_logger.h b/system/gd/hal/snoop_logger.h index b009add89c..b0783442b3 100644 --- a/system/gd/hal/snoop_logger.h +++ b/system/gd/hal/snoop_logger.h @@ -17,6 +17,7 @@ #pragma once #include <bluetooth/log.h> +#include <com_android_bluetooth_flags.h> #include <fstream> #include <string> @@ -195,6 +196,13 @@ public: }; SnoopLogger(os::Handler* handler); + ~SnoopLogger() { + if (!com::android::bluetooth::flags::same_handler_for_all_modules()) { + GetHandler()->Clear(); + GetHandler()->WaitUntilStopped(std::chrono::milliseconds(2000)); + delete GetHandler(); + } + } // Returns the maximum number of packets per file // Changes to this value is only effective after restarting Bluetooth diff --git a/system/gd/hci/acl_manager.cc b/system/gd/hci/acl_manager.cc index 26b0ce70eb..280cc237b4 100644 --- a/system/gd/hci/acl_manager.cc +++ b/system/gd/hci/acl_manager.cc @@ -260,16 +260,6 @@ void AclManager::CreateLeConnection(AddressWithType address_with_type, bool is_d CallOn(pimpl_->le_impl_, &le_impl::create_le_connection, address_with_type, true, is_direct); } -void AclManager::SetLeSuggestedDefaultDataParameters(uint16_t octets, uint16_t time) { - CallOn(pimpl_->le_impl_, &le_impl::set_le_suggested_default_data_parameters, octets, time); -} - -void AclManager::LeSetDefaultSubrate(uint16_t subrate_min, uint16_t subrate_max, - uint16_t max_latency, uint16_t cont_num, uint16_t sup_tout) { - CallOn(pimpl_->le_impl_, &le_impl::LeSetDefaultSubrate, subrate_min, subrate_max, max_latency, - cont_num, sup_tout); -} - void AclManager::SetPrivacyPolicyForInitiatorAddress( LeAddressManager::AddressPolicy address_policy, AddressWithType fixed_address, std::chrono::milliseconds minimum_rotation_time, diff --git a/system/gd/hci/acl_manager.h b/system/gd/hci/acl_manager.h index 2b3d523b1f..f38f1ff689 100644 --- a/system/gd/hci/acl_manager.h +++ b/system/gd/hci/acl_manager.h @@ -86,12 +86,6 @@ public: // Generates OnLeConnectSuccess if connected, or OnLeConnectFail otherwise virtual void CreateLeConnection(AddressWithType address_with_type, bool is_direct); - // Ask the controller for specific data parameters - virtual void SetLeSuggestedDefaultDataParameters(uint16_t octets, uint16_t time); - - virtual void LeSetDefaultSubrate(uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, - uint16_t cont_num, uint16_t sup_tout); - virtual void SetPrivacyPolicyForInitiatorAddress(LeAddressManager::AddressPolicy address_policy, AddressWithType fixed_address, std::chrono::milliseconds minimum_rotation_time, diff --git a/system/gd/hci/acl_manager/le_impl.h b/system/gd/hci/acl_manager/le_impl.h index ce93f46e7e..ef5bfb0d7d 100644 --- a/system/gd/hci/acl_manager/le_impl.h +++ b/system/gd/hci/acl_manager/le_impl.h @@ -1149,25 +1149,6 @@ public: remove_device_from_accept_list(address_with_type); } - void set_le_suggested_default_data_parameters(uint16_t length, uint16_t time) { - auto packet = LeWriteSuggestedDefaultDataLengthBuilder::Create(length, time); - le_acl_connection_interface_->EnqueueCommand( - std::move(packet), handler_->BindOnce([](CommandCompleteView /* complete */) {})); - } - - void LeSetDefaultSubrate(uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, - uint16_t cont_num, uint16_t sup_tout) { - le_acl_connection_interface_->EnqueueCommand( - LeSetDefaultSubrateBuilder::Create(subrate_min, subrate_max, max_latency, cont_num, - sup_tout), - handler_->BindOnce([](CommandCompleteView complete) { - auto complete_view = LeSetDefaultSubrateCompleteView::Create(complete); - log::assert_that(complete_view.IsValid(), "assert failed: complete_view.IsValid()"); - ErrorCode status = complete_view.GetStatus(); - log::assert_that(status == ErrorCode::SUCCESS, "Status = {}", ErrorCodeText(status)); - })); - } - void clear_resolving_list() { le_address_manager_->ClearResolvingList(); } void set_privacy_policy_for_initiator_address(LeAddressManager::AddressPolicy address_policy, diff --git a/system/gd/hci/acl_manager/le_impl_test.cc b/system/gd/hci/acl_manager/le_impl_test.cc index 66bc16bbd8..274b6827c9 100644 --- a/system/gd/hci/acl_manager/le_impl_test.cc +++ b/system/gd/hci/acl_manager/le_impl_test.cc @@ -1475,29 +1475,6 @@ TEST_F(LeImplTest, cancel_connect) { ASSERT_TRUE(le_impl_->create_connection_timeout_alarms_.empty()); } -TEST_F(LeImplTest, set_le_suggested_default_data_parameters) { - le_impl_->set_le_suggested_default_data_parameters(kLength, kTime); - sync_handler(); - auto view = CreateLeConnectionManagementCommandView<LeWriteSuggestedDefaultDataLengthView>( - hci_layer_->GetCommand()); - ASSERT_TRUE(view.IsValid()); - ASSERT_EQ(kLength, view.GetTxOctets()); - ASSERT_EQ(kTime, view.GetTxTime()); -} - -TEST_F(LeImplTest, LeSetDefaultSubrate) { - le_impl_->LeSetDefaultSubrate(kIntervalMin, kIntervalMax, kLatency, kContinuationNumber, - kTimeout); - sync_handler(); - auto view = CreateAclCommandView<LeSetDefaultSubrateView>(hci_layer_->GetCommand()); - ASSERT_TRUE(view.IsValid()); - ASSERT_EQ(kIntervalMin, view.GetSubrateMin()); - ASSERT_EQ(kIntervalMax, view.GetSubrateMax()); - ASSERT_EQ(kLatency, view.GetMaxLatency()); - ASSERT_EQ(kContinuationNumber, view.GetContinuationNumber()); - ASSERT_EQ(kTimeout, view.GetSupervisionTimeout()); -} - enum class ConnectionCompleteType { CONNECTION_COMPLETE, ENHANCED_CONNECTION_COMPLETE }; class LeImplTestParameterizedByConnectionCompleteEventType diff --git a/system/gd/metrics/counter_metrics.h b/system/gd/metrics/counter_metrics.h index 88c7711f92..2f25f03ed0 100644 --- a/system/gd/metrics/counter_metrics.h +++ b/system/gd/metrics/counter_metrics.h @@ -15,6 +15,8 @@ */ #pragma once +#include <com_android_bluetooth_flags.h> + #include <unordered_map> #include "module.h" @@ -26,6 +28,13 @@ namespace metrics { class CounterMetrics : public bluetooth::Module { public: CounterMetrics(os::Handler* handler) : Module(handler) {} + ~CounterMetrics() { + if (!com::android::bluetooth::flags::same_handler_for_all_modules()) { + GetHandler()->Clear(); + GetHandler()->WaitUntilStopped(std::chrono::milliseconds(2000)); + delete GetHandler(); + } + } bool CacheCount(int32_t key, int64_t value); virtual bool Count(int32_t key, int64_t count); diff --git a/system/gd/storage/storage_module.cc b/system/gd/storage/storage_module.cc index 5e3459e109..5a81a5cf94 100644 --- a/system/gd/storage/storage_module.cc +++ b/system/gd/storage/storage_module.cc @@ -90,6 +90,13 @@ StorageModule::StorageModule(os::Handler* handler, std::string config_file_path, StorageModule::~StorageModule() { std::lock_guard<std::recursive_mutex> lock(mutex_); + + if (!com::android::bluetooth::flags::same_handler_for_all_modules()) { + GetHandler()->Clear(); + GetHandler()->WaitUntilStopped(std::chrono::milliseconds(2000)); + delete GetHandler(); + } + pimpl_.reset(); } diff --git a/system/main/shim/acl.cc b/system/main/shim/acl.cc index b2f0e23975..b01bd1f92d 100644 --- a/system/main/shim/acl.cc +++ b/system/main/shim/acl.cc @@ -969,11 +969,6 @@ struct shim::Acl::impl { maximum_latency, minimum_remote_timeout, minimum_local_timeout); } - void LeSetDefaultSubrate(uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, - uint16_t cont_num, uint16_t sup_tout) { - GetAclManager()->LeSetDefaultSubrate(subrate_min, subrate_max, max_latency, cont_num, sup_tout); - } - void LeSubrateRequest(HciHandle handle, uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, uint16_t cont_num, uint16_t sup_tout) { if (IsLeAcl(handle)) { @@ -1573,12 +1568,6 @@ void shim::Acl::UpdateConnectionParameters(uint16_t handle, uint16_t conn_int_mi conn_int_max, conn_latency, conn_timeout, min_ce_len, max_ce_len); } -void shim::Acl::LeSetDefaultSubrate(uint16_t subrate_min, uint16_t subrate_max, - uint16_t max_latency, uint16_t cont_num, uint16_t sup_tout) { - handler_->CallOn(pimpl_.get(), &Acl::impl::LeSetDefaultSubrate, subrate_min, subrate_max, - max_latency, cont_num, sup_tout); -} - void shim::Acl::LeSubrateRequest(uint16_t hci_handle, uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, uint16_t cont_num, uint16_t sup_tout) { handler_->CallOn(pimpl_.get(), &Acl::impl::LeSubrateRequest, hci_handle, subrate_min, subrate_max, diff --git a/system/main/shim/acl.h b/system/main/shim/acl.h index bbe15d0acf..8253faf013 100644 --- a/system/main/shim/acl.h +++ b/system/main/shim/acl.h @@ -80,8 +80,6 @@ public: void RemoveFromAddressResolution(const hci::AddressWithType& address_with_type); void ClearAddressResolution(); - void LeSetDefaultSubrate(uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, - uint16_t cont_num, uint16_t sup_tout); void LeSubrateRequest(uint16_t hci_handle, uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, uint16_t cont_num, uint16_t sup_tout); diff --git a/system/main/shim/acl_api.cc b/system/main/shim/acl_api.cc index 56e63e1977..0868f40f2c 100644 --- a/system/main/shim/acl_api.cc +++ b/system/main/shim/acl_api.cc @@ -166,12 +166,6 @@ void bluetooth::shim::ACL_ClearAddressResolution() { void bluetooth::shim::ACL_ClearFilterAcceptList() { Stack::GetInstance()->GetAcl()->ClearFilterAcceptList(); } -void bluetooth::shim::ACL_LeSetDefaultSubrate(uint16_t subrate_min, uint16_t subrate_max, - uint16_t max_latency, uint16_t cont_num, - uint16_t sup_tout) { - Stack::GetInstance()->GetAcl()->LeSetDefaultSubrate(subrate_min, subrate_max, max_latency, - cont_num, sup_tout); -} void bluetooth::shim::ACL_LeSubrateRequest(uint16_t hci_handle, uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, diff --git a/system/main/shim/acl_api.h b/system/main/shim/acl_api.h index 6b28988ca6..b0bac16e02 100644 --- a/system/main/shim/acl_api.h +++ b/system/main/shim/acl_api.h @@ -49,8 +49,6 @@ void ACL_AddToAddressResolution(const tBLE_BD_ADDR& legacy_address_with_type, void ACL_RemoveFromAddressResolution(const tBLE_BD_ADDR& legacy_address_with_type); void ACL_ClearAddressResolution(); void ACL_ClearFilterAcceptList(); -void ACL_LeSetDefaultSubrate(uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, - uint16_t cont_num, uint16_t sup_tout); void ACL_SendConnectionParameterUpdateRequest(uint16_t handle, uint16_t conn_int_min, uint16_t conn_int_max, uint16_t conn_latency, uint16_t conn_timeout, uint16_t min_ce_len, diff --git a/system/main/shim/stack.cc b/system/main/shim/stack.cc index 4560a6180f..b7b93d3690 100644 --- a/system/main/shim/stack.cc +++ b/system/main/shim/stack.cc @@ -67,9 +67,9 @@ namespace shim { struct Stack::impl { Acl* acl_ = nullptr; - metrics::CounterMetrics* counter_metrics_ = nullptr; - storage::StorageModule* storage_ = nullptr; - hal::SnoopLogger* snoop_logger_ = nullptr; + std::shared_ptr<metrics::CounterMetrics> counter_metrics_ = nullptr; + std::shared_ptr<storage::StorageModule> storage_ = nullptr; + std::shared_ptr<hal::SnoopLogger> snoop_logger_ = nullptr; }; Stack::Stack() { pimpl_ = std::make_shared<Stack::impl>(); } @@ -89,9 +89,16 @@ void Stack::StartEverything() { stack_thread_ = new os::Thread("gd_stack_thread", os::Thread::Priority::REAL_TIME); stack_handler_ = new os::Handler(stack_thread_); - pimpl_->counter_metrics_ = new metrics::CounterMetrics(new Handler(stack_thread_)); - pimpl_->storage_ = new storage::StorageModule(new Handler(stack_thread_)); - pimpl_->snoop_logger_ = new hal::SnoopLogger(new Handler(stack_thread_)); + if (com::android::bluetooth::flags::same_handler_for_all_modules()) { + pimpl_->counter_metrics_ = std::make_shared<metrics::CounterMetrics>(stack_handler_); + pimpl_->storage_ = std::make_shared<storage::StorageModule>(stack_handler_); + pimpl_->snoop_logger_ = std::make_shared<hal::SnoopLogger>(stack_handler_); + } else { + pimpl_->counter_metrics_ = + std::make_shared<metrics::CounterMetrics>(new Handler(stack_thread_)); + pimpl_->storage_ = std::make_shared<storage::StorageModule>(new Handler(stack_thread_)); + pimpl_->snoop_logger_ = std::make_shared<hal::SnoopLogger>(new Handler(stack_thread_)); + } #if TARGET_FLOSS modules.add<sysprops::SyspropsModule>(); @@ -220,19 +227,19 @@ Acl* Stack::GetAcl() const { metrics::CounterMetrics* Stack::GetCounterMetrics() const { std::lock_guard<std::recursive_mutex> lock(mutex_); log::assert_that(is_running_, "assert failed: is_running_"); - return pimpl_->counter_metrics_; + return pimpl_->counter_metrics_.get(); } storage::StorageModule* Stack::GetStorage() const { std::lock_guard<std::recursive_mutex> lock(mutex_); log::assert_that(is_running_, "assert failed: is_running_"); - return pimpl_->storage_; + return pimpl_->storage_.get(); } hal::SnoopLogger* Stack::GetSnoopLogger() const { std::lock_guard<std::recursive_mutex> lock(mutex_); log::assert_that(is_running_, "assert failed: is_running_"); - return pimpl_->snoop_logger_; + return pimpl_->snoop_logger_.get(); } os::Handler* Stack::GetHandler() { @@ -268,9 +275,15 @@ void Stack::handle_start_up(ModuleList* modules, std::promise<void> promise) { void Stack::handle_shut_down(std::promise<void> promise) { registry_.StopAll(); + pimpl_->snoop_logger_->Stop(); pimpl_->storage_->Stop(); pimpl_->counter_metrics_->Stop(); + + pimpl_->snoop_logger_.reset(); + pimpl_->storage_.reset(); + pimpl_->counter_metrics_.reset(); + promise.set_value(); } diff --git a/system/stack/btm/btm_ble_sec.cc b/system/stack/btm/btm_ble_sec.cc index cef553c79e..679e937eef 100644 --- a/system/stack/btm/btm_ble_sec.cc +++ b/system/stack/btm/btm_ble_sec.cc @@ -1662,6 +1662,13 @@ static bool btm_ble_complete_evt_ignore(const tBTM_SEC_DEV_REC* p_dev_rec, p_dev_rec->bd_addr); l2cu_start_post_bond_timer(p_dev_rec->ble_hci_handle); return true; + } else if (com::android::bluetooth::flags::le_peripheral_enc_failure() && + !p_dev_rec->role_central) { + log::warn("Peripheral encryption request failed for the bonded device {} with reason {}", + p_dev_rec->bd_addr, smp_status_text(p_data->complt.reason)); + btm_sec_disconnect(p_dev_rec->ble_hci_handle, HCI_ERR_AUTH_FAILURE, + smp_status_text(p_data->complt.reason)); + return true; } } @@ -1702,6 +1709,11 @@ static void btm_ble_complete_evt(const RawAddress& bd_addr, tBTM_SEC_DEV_REC* p_ } BTM_BLE_SEC_CALLBACK(BTM_LE_COMPLT_EVT, bd_addr, p_data); + p_dev_rec = btm_find_dev(bd_addr); // BTM_LE_COMPLT_EVT event may have removed the device + if (p_dev_rec == nullptr) { + log::warn("Device record removed {}", bd_addr); + return; + } log::verbose("before update sec_level=0x{:x} sec_flags=0x{:x}", p_data->complt.sec_level, p_dev_rec->sec_rec.sec_flags); diff --git a/system/stack/btm/btm_sec.cc b/system/stack/btm/btm_sec.cc index 3c07ce8a58..4595794cab 100644 --- a/system/stack/btm/btm_sec.cc +++ b/system/stack/btm/btm_sec.cc @@ -3129,12 +3129,12 @@ void btm_sec_auth_complete(uint16_t handle, tHCI_STATUS status) { p_dev_rec->sec_rec.security_required &= ~BTM_SEC_OUT_AUTHENTICATE; if (status != HCI_SUCCESS) { - if ((status != HCI_ERR_PEER_USER) && (status != HCI_ERR_CONN_CAUSE_LOCAL_HOST)) { + if (status != HCI_ERR_PEER_USER && status != HCI_ERR_CONN_CAUSE_LOCAL_HOST) { btm_sec_send_hci_disconnect( p_dev_rec, HCI_ERR_PEER_USER, p_dev_rec->hci_handle, "stack::btm::btm_sec::btm_sec_auth_retry Auth fail while bonding"); } - } else { + } else if (!com::android::bluetooth::flags::immediate_encryption_after_pairing()) { BTM_LogHistory(kBtmLogTag, p_dev_rec->bd_addr, "Bonding completed", hci_error_code_text(status)); @@ -3159,6 +3159,11 @@ void btm_sec_auth_complete(uint16_t handle, tHCI_STATUS status) { } l2cu_start_post_bond_timer(p_dev_rec->hci_handle); + } else { + BTM_LogHistory(kBtmLogTag, p_dev_rec->bd_addr, "Bonding completed", + hci_error_code_text(status)); + BTM_SetEncryption(p_dev_rec->bd_addr, BT_TRANSPORT_BR_EDR, NULL, NULL, BTM_BLE_SEC_NONE); + l2cu_start_post_bond_timer(p_dev_rec->hci_handle); } return; diff --git a/system/stack/include/l2cap_interface.h b/system/stack/include/l2cap_interface.h index b1551d2a80..19f85d4d2e 100644 --- a/system/stack/include/l2cap_interface.h +++ b/system/stack/include/l2cap_interface.h @@ -871,21 +871,6 @@ public: virtual void L2CA_SetEcosystemBaseInterval(uint32_t base_interval) = 0; /******************************************************************************* - * - * Function L2CA_SetDefaultSubrate - * - * Description BLE Set Default Subrate. - * - * Parameters: Subrate parameters - * - * Return value: void - * - ******************************************************************************/ - virtual void L2CA_SetDefaultSubrate(uint16_t subrate_min, uint16_t subrate_max, - uint16_t max_latency, uint16_t cont_num, - uint16_t timeout) = 0; - - /******************************************************************************* ** ** Function L2CA_SetMediaStreamChannel ** diff --git a/system/stack/l2cap/internal/l2c_api.h b/system/stack/l2cap/internal/l2c_api.h index dd1dbf52e6..989eccf50e 100644 --- a/system/stack/l2cap/internal/l2c_api.h +++ b/system/stack/l2cap/internal/l2c_api.h @@ -719,20 +719,6 @@ void L2CA_SetEcosystemBaseInterval(uint32_t base_interval); /******************************************************************************* * - * Function L2CA_SetDefaultSubrate - * - * Description BLE Set Default Subrate. - * - * Parameters: Subrate parameters - * - * Return value: void - * - ******************************************************************************/ -void L2CA_SetDefaultSubrate(uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, - uint16_t cont_num, uint16_t timeout); - -/******************************************************************************* - * * Function L2CA_SubrateRequest * * Description BLE Subrate request. diff --git a/system/stack/l2cap/l2c_api.h b/system/stack/l2cap/l2c_api.h index 1ff09ffaf5..f9eab67d55 100644 --- a/system/stack/l2cap/l2c_api.h +++ b/system/stack/l2cap/l2c_api.h @@ -73,8 +73,6 @@ public: uint8_t* p_chnl_mask) override; [[nodiscard]] bool L2CA_SetAclPriority(const RawAddress& bd_addr, tL2CAP_PRIORITY priority) override; - void L2CA_SetDefaultSubrate(uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, - uint16_t cont_num, uint16_t timeout) override; void L2CA_AdjustConnectionIntervals(uint16_t* min_interval, uint16_t* max_interval, uint16_t floor_interval) override; void L2CA_SetEcosystemBaseInterval(uint32_t base_interval) override; diff --git a/system/stack/l2cap/l2c_ble_conn_params.cc b/system/stack/l2cap/l2c_ble_conn_params.cc index 49eeb06155..392b1f5a74 100644 --- a/system/stack/l2cap/l2c_ble_conn_params.cc +++ b/system/stack/l2cap/l2c_ble_conn_params.cc @@ -510,26 +510,6 @@ static void l2cble_start_subrate_change(tL2C_LCB* p_lcb) { /******************************************************************************* * - * Function L2CA_SetDefaultSubrate - * - * Description BLE Set Default Subrate - * - * Parameters: Subrate parameters - * - * Return value: void - * - ******************************************************************************/ -void L2CA_SetDefaultSubrate(uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, - uint16_t cont_num, uint16_t timeout) { - log::verbose("subrate_min={}, subrate_max={}, max_latency={}, cont_num={}, timeout={}", - subrate_min, subrate_max, max_latency, cont_num, timeout); - - bluetooth::shim::ACL_LeSetDefaultSubrate(subrate_min, subrate_max, max_latency, cont_num, - timeout); -} - -/******************************************************************************* - * * Function L2CA_SubrateRequest * * Description BLE Subrate request. diff --git a/system/stack/l2cap/l2cap_api.cc b/system/stack/l2cap/l2cap_api.cc index 0752c995c0..e9ccaeaf2a 100644 --- a/system/stack/l2cap/l2cap_api.cc +++ b/system/stack/l2cap/l2cap_api.cc @@ -234,13 +234,6 @@ void bluetooth::stack::l2cap::Impl::L2CA_SetEcosystemBaseInterval(uint32_t base_ return ::L2CA_IsLinkEstablished(bd_addr, transport); } -void bluetooth::stack::l2cap::Impl::L2CA_SetDefaultSubrate(uint16_t subrate_min, - uint16_t subrate_max, - uint16_t max_latency, uint16_t cont_num, - uint16_t timeout) { - ::L2CA_SetDefaultSubrate(subrate_min, subrate_max, max_latency, cont_num, timeout); -} - [[nodiscard]] bool bluetooth::stack::l2cap::Impl::L2CA_SubrateRequest( const RawAddress& rem_bda, uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, uint16_t cont_num, uint16_t timeout) { diff --git a/system/test/mock/mock_main_shim_acl.cc b/system/test/mock/mock_main_shim_acl.cc index a98e809ad0..5f58860347 100644 --- a/system/test/mock/mock_main_shim_acl.cc +++ b/system/test/mock/mock_main_shim_acl.cc @@ -129,12 +129,6 @@ void shim::Acl::DisconnectLe(uint16_t /* handle */, tHCI_STATUS /* reason */, inc_func_call_count(__func__); } -void shim::Acl::LeSetDefaultSubrate(uint16_t /* subrate_min */, uint16_t /* subrate_max */, - uint16_t /* max_latency */, uint16_t /* cont_num */, - uint16_t /* sup_tout */) { - inc_func_call_count(__func__); -} - void shim::Acl::LeSubrateRequest(uint16_t /* hci_handle */, uint16_t /* subrate_min */, uint16_t /* subrate_max */, uint16_t /* max_latency */, uint16_t /* cont_num */, uint16_t /* sup_tout */) { diff --git a/system/test/mock/mock_main_shim_acl_api.cc b/system/test/mock/mock_main_shim_acl_api.cc index 3d257f1a5a..e3a3c9d63b 100644 --- a/system/test/mock/mock_main_shim_acl_api.cc +++ b/system/test/mock/mock_main_shim_acl_api.cc @@ -73,12 +73,6 @@ void bluetooth::shim::ACL_RemoveFromAddressResolution( inc_func_call_count(__func__); } void bluetooth::shim::ACL_ClearAddressResolution() { inc_func_call_count(__func__); } -void bluetooth::shim::ACL_LeSetDefaultSubrate(uint16_t /* subrate_min */, - uint16_t /* subrate_max */, - uint16_t /* max_latency */, uint16_t /* cont_num */, - uint16_t /* sup_tout */) { - inc_func_call_count(__func__); -} void bluetooth::shim::ACL_LeSubrateRequest(uint16_t /* hci_handle */, uint16_t /* subrate_min */, uint16_t /* subrate_max */, uint16_t /* max_latency */, uint16_t /* cont_num */, uint16_t /* sup_tout */) { diff --git a/system/test/mock/mock_main_shim_acl_api.h b/system/test/mock/mock_main_shim_acl_api.h index ab891673e3..29e27dbad3 100644 --- a/system/test/mock/mock_main_shim_acl_api.h +++ b/system/test/mock/mock_main_shim_acl_api.h @@ -84,21 +84,6 @@ struct ACL_ClearFilterAcceptList { }; extern struct ACL_ClearFilterAcceptList ACL_ClearFilterAcceptList; -// Name: ACL_LeSetDefaultSubrate -// Params: -// Return: void -struct ACL_LeSetDefaultSubrate { - std::function<void(uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, - uint16_t cont_num, uint16_t sup_tout)> - body{[](uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, - uint16_t cont_num, uint16_t sup_tout) {}}; - void operator()(uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, - uint16_t cont_num, uint16_t sup_tout) { - body(subrate_min, subrate_max, max_latency, cont_num, sup_tout); - } -}; -extern struct ACL_LeSetDefaultSubrate ACL_LeSetDefaultSubrate; - // Name: ACL_LeSubrateRequest // Params: // Return: void diff --git a/system/test/mock/mock_stack_l2cap_interface.h b/system/test/mock/mock_stack_l2cap_interface.h index a5cd536777..b2fc3e0ae9 100644 --- a/system/test/mock/mock_stack_l2cap_interface.h +++ b/system/test/mock/mock_stack_l2cap_interface.h @@ -64,9 +64,6 @@ public: MOCK_METHOD(bool, L2CA_GetPeerFeatures, (const RawAddress& bd_addr, uint32_t* p_ext_feat, uint8_t* p_chnl_mask)); MOCK_METHOD(bool, L2CA_SetAclPriority, (const RawAddress& bd_addr, tL2CAP_PRIORITY priority)); - MOCK_METHOD(void, L2CA_SetDefaultSubrate, - (uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, uint16_t cont_num, - uint16_t timeout)); MOCK_METHOD(void, L2CA_AdjustConnectionIntervals, (uint16_t* min_interval, uint16_t* max_interval, uint16_t floor_interval)); MOCK_METHOD(void, L2CA_SetEcosystemBaseInterval, (uint32_t base_interval)); |