Loading system/audio_hal_interface/aidl/client_interface_aidl.cc +6 −1 Original line number Diff line number Diff line Loading @@ -135,6 +135,8 @@ void BluetoothAudioClientInterface::FetchAudioProvider() { if (provider_ != nullptr) { log::warn("refetch"); } // Prevent other access to the AIDL if currently fetching new service std::lock_guard<std::mutex> guard(internal_mutex_); // Retry if audioserver restarts in the middle of fetching. // When audioserver restarts, IBluetoothAudioProviderFactory service is also // re-registered, so we need to re-fetch the service. Loading Loading @@ -164,7 +166,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() { toString(transport_->GetSessionType()), capabilities_.size()); aidl_retval = provider_factory->openProvider(transport_->GetSessionType(), &provider_); if (!aidl_retval.isOk()) { if (!aidl_retval.isOk() || provider_ == nullptr) { log::error("BluetoothAudioHal::openProvider failure: {}, retry number {}", aidl_retval.getDescription(), retry_no + 1); } else { Loading Loading @@ -220,6 +222,7 @@ void BluetoothAudioClientInterface::binderDiedCallbackAidl(void* ptr) { } bool BluetoothAudioClientInterface::UpdateAudioConfig(const AudioConfiguration& audio_config) { std::lock_guard<std::mutex> guard(internal_mutex_); bool is_software_session = (transport_->GetSessionType() == SessionType::A2DP_SOFTWARE_ENCODING_DATAPATH || transport_->GetSessionType() == SessionType::HEARING_AID_SOFTWARE_ENCODING_DATAPATH || Loading Loading @@ -603,6 +606,7 @@ BluetoothAudioClientInterface::GetLeAudioAseConfiguration( std::vector<std::optional<IBluetoothAudioProvider::LeAudioDeviceCapabilities>>>& remoteSourceAudioCapabilities, std::vector<IBluetoothAudioProvider::LeAudioConfigurationRequirement>& requirements) { std::lock_guard<std::mutex> guard(internal_mutex_); log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr"); std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting> configurations; Loading Loading @@ -670,6 +674,7 @@ BluetoothAudioClientInterface::getLeAudioBroadcastConfiguration( std::vector<std::optional<IBluetoothAudioProvider::LeAudioDeviceCapabilities>>>& remoteSinkAudioCapabilities, const IBluetoothAudioProvider::LeAudioBroadcastConfigurationRequirement& requirement) { std::lock_guard<std::mutex> guard(internal_mutex_); log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr"); IBluetoothAudioProvider::LeAudioBroadcastConfigurationSetting setting; Loading Loading
system/audio_hal_interface/aidl/client_interface_aidl.cc +6 −1 Original line number Diff line number Diff line Loading @@ -135,6 +135,8 @@ void BluetoothAudioClientInterface::FetchAudioProvider() { if (provider_ != nullptr) { log::warn("refetch"); } // Prevent other access to the AIDL if currently fetching new service std::lock_guard<std::mutex> guard(internal_mutex_); // Retry if audioserver restarts in the middle of fetching. // When audioserver restarts, IBluetoothAudioProviderFactory service is also // re-registered, so we need to re-fetch the service. Loading Loading @@ -164,7 +166,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() { toString(transport_->GetSessionType()), capabilities_.size()); aidl_retval = provider_factory->openProvider(transport_->GetSessionType(), &provider_); if (!aidl_retval.isOk()) { if (!aidl_retval.isOk() || provider_ == nullptr) { log::error("BluetoothAudioHal::openProvider failure: {}, retry number {}", aidl_retval.getDescription(), retry_no + 1); } else { Loading Loading @@ -220,6 +222,7 @@ void BluetoothAudioClientInterface::binderDiedCallbackAidl(void* ptr) { } bool BluetoothAudioClientInterface::UpdateAudioConfig(const AudioConfiguration& audio_config) { std::lock_guard<std::mutex> guard(internal_mutex_); bool is_software_session = (transport_->GetSessionType() == SessionType::A2DP_SOFTWARE_ENCODING_DATAPATH || transport_->GetSessionType() == SessionType::HEARING_AID_SOFTWARE_ENCODING_DATAPATH || Loading Loading @@ -603,6 +606,7 @@ BluetoothAudioClientInterface::GetLeAudioAseConfiguration( std::vector<std::optional<IBluetoothAudioProvider::LeAudioDeviceCapabilities>>>& remoteSourceAudioCapabilities, std::vector<IBluetoothAudioProvider::LeAudioConfigurationRequirement>& requirements) { std::lock_guard<std::mutex> guard(internal_mutex_); log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr"); std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting> configurations; Loading Loading @@ -670,6 +674,7 @@ BluetoothAudioClientInterface::getLeAudioBroadcastConfiguration( std::vector<std::optional<IBluetoothAudioProvider::LeAudioDeviceCapabilities>>>& remoteSinkAudioCapabilities, const IBluetoothAudioProvider::LeAudioBroadcastConfigurationRequirement& requirement) { std::lock_guard<std::mutex> guard(internal_mutex_); log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr"); IBluetoothAudioProvider::LeAudioBroadcastConfigurationSetting setting; Loading