Loading system/bta/le_audio/client.cc +2 −1 Original line number Diff line number Diff line Loading @@ -788,7 +788,8 @@ class LeAudioClientImpl : public LeAudioClient { uint16_t acl_handle = BTM_GetHCIConnHandle(leAudioDevice->address_, BT_TRANSPORT_LE); if (acl_handle != HCI_INVALID_HANDLE) { acl_disconnect_from_handle(acl_handle, HCI_ERR_PEER_USER); acl_disconnect_from_handle(acl_handle, HCI_ERR_PEER_USER, "bta::le_audio::client disconnect"); return; } } Loading system/bta/test/common/btm_api_mock.cc +3 −2 Original line number Diff line number Diff line Loading @@ -89,7 +89,8 @@ uint16_t BTM_GetHCIConnHandle(RawAddress const& bd_addr, return btm_interface->GetHCIConnHandle(bd_addr, transport); } void acl_disconnect_from_handle(uint16_t handle, tHCI_STATUS reason) { void acl_disconnect_from_handle(uint16_t handle, tHCI_STATUS reason, std::string comment) { LOG_ASSERT(btm_interface) << "Mock btm interface not set!"; return btm_interface->AclDisconnectFromHandle(handle, reason); } system/main/shim/acl.cc +17 −11 Original line number Diff line number Diff line Loading @@ -844,7 +844,8 @@ struct shim::legacy::Acl::impl { handle_to_classic_connection_map_[handle]->SetConnectionEncryption(enable); } void disconnect_classic(uint16_t handle, tHCI_STATUS reason) { void disconnect_classic(uint16_t handle, tHCI_STATUS reason, std::string comment) { auto connection = handle_to_classic_connection_map_.find(handle); if (connection != handle_to_classic_connection_map_.end()) { auto remote_address = connection->second->GetRemoteAddress(); Loading @@ -854,15 +855,16 @@ struct shim::legacy::Acl::impl { PRIVATE_ADDRESS(remote_address), handle); BTM_LogHistory(kBtmLogTag, ToRawAddress(remote_address), "Disconnection initiated", base::StringPrintf("classic reason:%s", hci_status_code_text(reason).c_str())); base::StringPrintf("classic reason:%s comment:%s", hci_status_code_text(reason).c_str(), comment.c_str())); } else { LOG_WARN("Unable to disconnect unknown classic connection handle:0x%04x", handle); } } void disconnect_le(uint16_t handle, tHCI_STATUS reason) { void disconnect_le(uint16_t handle, tHCI_STATUS reason, std::string comment) { auto connection = handle_to_le_connection_map_.find(handle); if (connection != handle_to_le_connection_map_.end()) { auto remote_address_with_type = Loading @@ -874,8 +876,9 @@ struct shim::legacy::Acl::impl { BTM_LogHistory(kBtmLogTag, ToLegacyAddressWithType(remote_address_with_type), "Disconnection initiated", base::StringPrintf("Le reason:%s", hci_status_code_text(reason).c_str())); base::StringPrintf("Le reason:%s comment:%s", hci_status_code_text(reason).c_str(), comment.c_str())); } else { LOG_WARN("Unable to disconnect unknown le connection handle:0x%04x", handle); Loading Loading @@ -1485,13 +1488,16 @@ void shim::legacy::Acl::OnLeConnectFail(hci::AddressWithType address_with_type, base::StringPrintf("le reason:%s", hci::ErrorCodeText(reason).c_str())); } void shim::legacy::Acl::DisconnectClassic(uint16_t handle, tHCI_STATUS reason) { handler_->CallOn(pimpl_.get(), &Acl::impl::disconnect_classic, handle, reason); void shim::legacy::Acl::DisconnectClassic(uint16_t handle, tHCI_STATUS reason, std::string comment) { handler_->CallOn(pimpl_.get(), &Acl::impl::disconnect_classic, handle, reason, comment); } void shim::legacy::Acl::DisconnectLe(uint16_t handle, tHCI_STATUS reason) { handler_->CallOn(pimpl_.get(), &Acl::impl::disconnect_le, handle, reason); void shim::legacy::Acl::DisconnectLe(uint16_t handle, tHCI_STATUS reason, std::string comment) { handler_->CallOn(pimpl_.get(), &Acl::impl::disconnect_le, handle, reason, comment); } bool shim::legacy::Acl::HoldMode(uint16_t hci_handle, uint16_t max_interval, Loading system/main/shim/acl.h +4 −2 Original line number Diff line number Diff line Loading @@ -72,8 +72,10 @@ class Acl : public hci::acl_manager::ConnectionCallbacks, std::promise<bool> promise) override; void IgnoreLeConnectionFrom( const hci::AddressWithType& address_with_type) override; void DisconnectClassic(uint16_t handle, tHCI_REASON reason) override; void DisconnectLe(uint16_t handle, tHCI_REASON reason) override; void DisconnectClassic(uint16_t handle, tHCI_REASON reason, std::string comment) override; void DisconnectLe(uint16_t handle, tHCI_REASON reason, std::string comment) override; // Address Resolution List void AddToAddressResolution(const hci::AddressWithType& address_with_type, Loading system/main/shim/acl_api.cc +4 −3 Original line number Diff line number Diff line Loading @@ -85,10 +85,11 @@ void bluetooth::shim::ACL_ConfigureLePrivacy(bool is_le_privacy_enabled) { } void bluetooth::shim::ACL_Disconnect(uint16_t handle, bool is_classic, tHCI_STATUS reason) { tHCI_STATUS reason, std::string comment) { (is_classic) ? Stack::GetInstance()->GetAcl()->DisconnectClassic(handle, reason) : Stack::GetInstance()->GetAcl()->DisconnectLe(handle, reason); ? Stack::GetInstance()->GetAcl()->DisconnectClassic(handle, reason, comment) : Stack::GetInstance()->GetAcl()->DisconnectLe(handle, reason, comment); } void bluetooth::shim::ACL_Shutdown() { Loading Loading
system/bta/le_audio/client.cc +2 −1 Original line number Diff line number Diff line Loading @@ -788,7 +788,8 @@ class LeAudioClientImpl : public LeAudioClient { uint16_t acl_handle = BTM_GetHCIConnHandle(leAudioDevice->address_, BT_TRANSPORT_LE); if (acl_handle != HCI_INVALID_HANDLE) { acl_disconnect_from_handle(acl_handle, HCI_ERR_PEER_USER); acl_disconnect_from_handle(acl_handle, HCI_ERR_PEER_USER, "bta::le_audio::client disconnect"); return; } } Loading
system/bta/test/common/btm_api_mock.cc +3 −2 Original line number Diff line number Diff line Loading @@ -89,7 +89,8 @@ uint16_t BTM_GetHCIConnHandle(RawAddress const& bd_addr, return btm_interface->GetHCIConnHandle(bd_addr, transport); } void acl_disconnect_from_handle(uint16_t handle, tHCI_STATUS reason) { void acl_disconnect_from_handle(uint16_t handle, tHCI_STATUS reason, std::string comment) { LOG_ASSERT(btm_interface) << "Mock btm interface not set!"; return btm_interface->AclDisconnectFromHandle(handle, reason); }
system/main/shim/acl.cc +17 −11 Original line number Diff line number Diff line Loading @@ -844,7 +844,8 @@ struct shim::legacy::Acl::impl { handle_to_classic_connection_map_[handle]->SetConnectionEncryption(enable); } void disconnect_classic(uint16_t handle, tHCI_STATUS reason) { void disconnect_classic(uint16_t handle, tHCI_STATUS reason, std::string comment) { auto connection = handle_to_classic_connection_map_.find(handle); if (connection != handle_to_classic_connection_map_.end()) { auto remote_address = connection->second->GetRemoteAddress(); Loading @@ -854,15 +855,16 @@ struct shim::legacy::Acl::impl { PRIVATE_ADDRESS(remote_address), handle); BTM_LogHistory(kBtmLogTag, ToRawAddress(remote_address), "Disconnection initiated", base::StringPrintf("classic reason:%s", hci_status_code_text(reason).c_str())); base::StringPrintf("classic reason:%s comment:%s", hci_status_code_text(reason).c_str(), comment.c_str())); } else { LOG_WARN("Unable to disconnect unknown classic connection handle:0x%04x", handle); } } void disconnect_le(uint16_t handle, tHCI_STATUS reason) { void disconnect_le(uint16_t handle, tHCI_STATUS reason, std::string comment) { auto connection = handle_to_le_connection_map_.find(handle); if (connection != handle_to_le_connection_map_.end()) { auto remote_address_with_type = Loading @@ -874,8 +876,9 @@ struct shim::legacy::Acl::impl { BTM_LogHistory(kBtmLogTag, ToLegacyAddressWithType(remote_address_with_type), "Disconnection initiated", base::StringPrintf("Le reason:%s", hci_status_code_text(reason).c_str())); base::StringPrintf("Le reason:%s comment:%s", hci_status_code_text(reason).c_str(), comment.c_str())); } else { LOG_WARN("Unable to disconnect unknown le connection handle:0x%04x", handle); Loading Loading @@ -1485,13 +1488,16 @@ void shim::legacy::Acl::OnLeConnectFail(hci::AddressWithType address_with_type, base::StringPrintf("le reason:%s", hci::ErrorCodeText(reason).c_str())); } void shim::legacy::Acl::DisconnectClassic(uint16_t handle, tHCI_STATUS reason) { handler_->CallOn(pimpl_.get(), &Acl::impl::disconnect_classic, handle, reason); void shim::legacy::Acl::DisconnectClassic(uint16_t handle, tHCI_STATUS reason, std::string comment) { handler_->CallOn(pimpl_.get(), &Acl::impl::disconnect_classic, handle, reason, comment); } void shim::legacy::Acl::DisconnectLe(uint16_t handle, tHCI_STATUS reason) { handler_->CallOn(pimpl_.get(), &Acl::impl::disconnect_le, handle, reason); void shim::legacy::Acl::DisconnectLe(uint16_t handle, tHCI_STATUS reason, std::string comment) { handler_->CallOn(pimpl_.get(), &Acl::impl::disconnect_le, handle, reason, comment); } bool shim::legacy::Acl::HoldMode(uint16_t hci_handle, uint16_t max_interval, Loading
system/main/shim/acl.h +4 −2 Original line number Diff line number Diff line Loading @@ -72,8 +72,10 @@ class Acl : public hci::acl_manager::ConnectionCallbacks, std::promise<bool> promise) override; void IgnoreLeConnectionFrom( const hci::AddressWithType& address_with_type) override; void DisconnectClassic(uint16_t handle, tHCI_REASON reason) override; void DisconnectLe(uint16_t handle, tHCI_REASON reason) override; void DisconnectClassic(uint16_t handle, tHCI_REASON reason, std::string comment) override; void DisconnectLe(uint16_t handle, tHCI_REASON reason, std::string comment) override; // Address Resolution List void AddToAddressResolution(const hci::AddressWithType& address_with_type, Loading
system/main/shim/acl_api.cc +4 −3 Original line number Diff line number Diff line Loading @@ -85,10 +85,11 @@ void bluetooth::shim::ACL_ConfigureLePrivacy(bool is_le_privacy_enabled) { } void bluetooth::shim::ACL_Disconnect(uint16_t handle, bool is_classic, tHCI_STATUS reason) { tHCI_STATUS reason, std::string comment) { (is_classic) ? Stack::GetInstance()->GetAcl()->DisconnectClassic(handle, reason) : Stack::GetInstance()->GetAcl()->DisconnectLe(handle, reason); ? Stack::GetInstance()->GetAcl()->DisconnectClassic(handle, reason, comment) : Stack::GetInstance()->GetAcl()->DisconnectLe(handle, reason, comment); } void bluetooth::shim::ACL_Shutdown() { Loading