Loading system/bta/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -657,6 +657,7 @@ cc_test { ], srcs: [ ":TestCommonMockFunctions", ":TestMockStackBtmInterface", ":TestStubOsi", "gatt/database.cc", "gatt/database_builder.cc", Loading Loading @@ -1239,6 +1240,7 @@ cc_test { ], srcs: [ ":TestCommonMockFunctions", ":TestMockStackBtmInterface", ":TestStubOsi", "gatt/database.cc", "gatt/database_builder.cc", Loading system/bta/le_audio/devices.cc +3 −2 Original line number Diff line number Diff line Loading @@ -32,8 +32,8 @@ #include "le_audio_log_history.h" #include "le_audio_utils.h" #include "main/shim/entry.h" #include "os/log.h" #include "osi/include/properties.h" #include "stack/include/btm_client_interface.h" using bluetooth::hci::kIsoCigPhy1M; using bluetooth::hci::kIsoCigPhy2M; Loading Loading @@ -884,8 +884,9 @@ uint8_t LeAudioDevice::GetSupportedAudioChannelCounts(uint8_t direction) const { uint8_t LeAudioDevice::GetPhyBitmask(void) const { uint8_t phy_bitfield = kIsoCigPhy1M; if (BTM_IsPhy2mSupported(address_, BT_TRANSPORT_LE)) if (get_btm_client_interface().peer.BTM_IsPhy2mSupported(address_, BT_TRANSPORT_LE)) { phy_bitfield |= kIsoCigPhy2M; } return phy_bitfield; } Loading system/bta/test/common/btm_api_mock.cc +6 −6 Original line number Diff line number Diff line Loading @@ -22,7 +22,9 @@ #include <optional> #include "bt_octets.h" #include "btm_api.h" #include "stack/include/btm_ble_sec_api.h" #include "test/mock/mock_stack_btm_interface.h" #include "types/raw_address.h" using namespace bluetooth; Loading @@ -32,6 +34,10 @@ static bluetooth::manager::MockBtmInterface* btm_interface = nullptr; void bluetooth::manager::SetMockBtmInterface( MockBtmInterface* mock_btm_interface) { btm_interface = mock_btm_interface; mock_btm_client_interface.peer.BTM_IsPhy2mSupported = [](const RawAddress& remote_bda, tBT_TRANSPORT transport) { return btm_interface->IsPhy2mSupported(remote_bda, transport); }; } bool BTM_IsLinkKeyKnown(const RawAddress& bd_addr, tBT_TRANSPORT transport) { Loading @@ -51,12 +57,6 @@ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr, p_ref_data, sec_act); } bool BTM_IsPhy2mSupported(const RawAddress& remote_bda, tBT_TRANSPORT transport) { log::assert_that(btm_interface != nullptr, "Mock btm interface not set!"); return btm_interface->IsPhy2mSupported(remote_bda, transport); } uint8_t BTM_GetPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport) { log::assert_that(btm_interface != nullptr, "Mock btm interface not set!"); return btm_interface->GetPeerSCA(remote_bda, transport); Loading Loading
system/bta/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -657,6 +657,7 @@ cc_test { ], srcs: [ ":TestCommonMockFunctions", ":TestMockStackBtmInterface", ":TestStubOsi", "gatt/database.cc", "gatt/database_builder.cc", Loading Loading @@ -1239,6 +1240,7 @@ cc_test { ], srcs: [ ":TestCommonMockFunctions", ":TestMockStackBtmInterface", ":TestStubOsi", "gatt/database.cc", "gatt/database_builder.cc", Loading
system/bta/le_audio/devices.cc +3 −2 Original line number Diff line number Diff line Loading @@ -32,8 +32,8 @@ #include "le_audio_log_history.h" #include "le_audio_utils.h" #include "main/shim/entry.h" #include "os/log.h" #include "osi/include/properties.h" #include "stack/include/btm_client_interface.h" using bluetooth::hci::kIsoCigPhy1M; using bluetooth::hci::kIsoCigPhy2M; Loading Loading @@ -884,8 +884,9 @@ uint8_t LeAudioDevice::GetSupportedAudioChannelCounts(uint8_t direction) const { uint8_t LeAudioDevice::GetPhyBitmask(void) const { uint8_t phy_bitfield = kIsoCigPhy1M; if (BTM_IsPhy2mSupported(address_, BT_TRANSPORT_LE)) if (get_btm_client_interface().peer.BTM_IsPhy2mSupported(address_, BT_TRANSPORT_LE)) { phy_bitfield |= kIsoCigPhy2M; } return phy_bitfield; } Loading
system/bta/test/common/btm_api_mock.cc +6 −6 Original line number Diff line number Diff line Loading @@ -22,7 +22,9 @@ #include <optional> #include "bt_octets.h" #include "btm_api.h" #include "stack/include/btm_ble_sec_api.h" #include "test/mock/mock_stack_btm_interface.h" #include "types/raw_address.h" using namespace bluetooth; Loading @@ -32,6 +34,10 @@ static bluetooth::manager::MockBtmInterface* btm_interface = nullptr; void bluetooth::manager::SetMockBtmInterface( MockBtmInterface* mock_btm_interface) { btm_interface = mock_btm_interface; mock_btm_client_interface.peer.BTM_IsPhy2mSupported = [](const RawAddress& remote_bda, tBT_TRANSPORT transport) { return btm_interface->IsPhy2mSupported(remote_bda, transport); }; } bool BTM_IsLinkKeyKnown(const RawAddress& bd_addr, tBT_TRANSPORT transport) { Loading @@ -51,12 +57,6 @@ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr, p_ref_data, sec_act); } bool BTM_IsPhy2mSupported(const RawAddress& remote_bda, tBT_TRANSPORT transport) { log::assert_that(btm_interface != nullptr, "Mock btm interface not set!"); return btm_interface->IsPhy2mSupported(remote_bda, transport); } uint8_t BTM_GetPeerSCA(const RawAddress& remote_bda, tBT_TRANSPORT transport) { log::assert_that(btm_interface != nullptr, "Mock btm interface not set!"); return btm_interface->GetPeerSCA(remote_bda, transport); Loading