From 10996a7b72c1d668dba1317427327fc272f89e32 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Sun, 10 Jan 2021 10:45:58 -0800 Subject: [PATCH] Remove unnecessary stack/acl/btm_acl::btm_pm_is_le_link Towards meaningful code Bug: 163134718 Tag: #refactor Test: gd/cert/run Change-Id: Ic5569a10bad4de55ccba1821e0433ef053b033ad --- stack/acl/acl.h | 1 - stack/acl/btm_acl.cc | 11 ----------- stack/acl/btm_pm.cc | 4 ---- stack/include/acl_api.h | 1 - 4 files changed, 17 deletions(-) diff --git a/stack/acl/acl.h b/stack/acl/acl.h index d174cbf50..10c18c55f 100644 --- a/stack/acl/acl.h +++ b/stack/acl/acl.h @@ -368,7 +368,6 @@ struct controller_t; ****************************************************/ struct sACL_CB { private: - friend bool btm_pm_is_le_link(const RawAddress& remote_bda); friend int btm_pm_find_acl_ind(const RawAddress& remote_bda); friend tBTM_PM_MCB* acl_power_mode_from_handle(uint16_t hci_handle); friend tBTM_STATUS BTM_SetPowerMode(uint8_t pm_id, diff --git a/stack/acl/btm_acl.cc b/stack/acl/btm_acl.cc index 391126518..743929620 100644 --- a/stack/acl/btm_acl.cc +++ b/stack/acl/btm_acl.cc @@ -2493,17 +2493,6 @@ int btm_pm_find_acl_ind(const RawAddress& remote_bda) { return xx; } -bool btm_pm_is_le_link(const RawAddress& remote_bda) { - const tACL_CONN* p_acl = &btm_cb.acl_cb_.acl_db[0]; - for (uint8_t xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_acl++) { - if (p_acl->in_use && p_acl->remote_addr == remote_bda && - p_acl->is_transport_ble()) { - return true; - } - } - return false; -} - /******************************************************************************* * * Function btm_ble_refresh_local_resolvable_private_addr diff --git a/stack/acl/btm_pm.cc b/stack/acl/btm_pm.cc index 6da7ee1db..ac92a8a82 100644 --- a/stack/acl/btm_pm.cc +++ b/stack/acl/btm_pm.cc @@ -205,10 +205,6 @@ tBTM_STATUS BTM_SetPowerMode(uint8_t pm_id, const RawAddress& remote_bda, int acl_ind = btm_pm_find_acl_ind(remote_bda); if (acl_ind == MAX_L2CAP_LINKS) { - if (btm_pm_is_le_link(remote_bda)) { - LOG_ERROR("Setting power mode on le link is unsupported"); - return BTM_MODE_UNSUPPORTED; - } LOG_ERROR("br_edr acl addr:%s is unknown", PRIVATE_ADDRESS(remote_bda)); return BTM_UNKNOWN_ADDR; } diff --git a/stack/include/acl_api.h b/stack/include/acl_api.h index df7fbe462..dac414d46 100644 --- a/stack/include/acl_api.h +++ b/stack/include/acl_api.h @@ -273,7 +273,6 @@ bool BTM_IsBleConnection(uint16_t hci_handle); const RawAddress acl_address_from_handle(uint16_t hci_handle); tBTM_PM_MCB* acl_power_mode_from_handle(uint16_t hci_handle); int btm_pm_find_acl_ind(const RawAddress& remote_bda); -bool btm_pm_is_le_link(const RawAddress& remote_bda); void btm_ble_refresh_local_resolvable_private_addr( const RawAddress& pseudo_addr, const RawAddress& local_rpa); -- 2.11.0