Loading bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ ndk::ScopedAStatus BluetoothAudioProvider::startSession( latency_modes_ = latencyModes; audio_config_ = std::make_unique<AudioConfiguration>(audio_config); stack_iface_ = host_if; is_binder_died = false; AIBinder_linkToDeath(stack_iface_->asBinder().get(), death_recipient_.get(), this); Loading @@ -59,8 +60,10 @@ ndk::ScopedAStatus BluetoothAudioProvider::endSession() { if (stack_iface_ != nullptr) { BluetoothAudioSessionReport::OnSessionEnded(session_type_); if (!is_binder_died) { AIBinder_unlinkToDeath(stack_iface_->asBinder().get(), death_recipient_.get(), this); } } else { LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_) << " has NO session"; Loading Loading @@ -147,6 +150,7 @@ void BluetoothAudioProvider::binderDiedCallbackAidl(void* ptr) { LOG(ERROR) << __func__ << ": Null AudioProvider HAL died"; return; } provider->is_binder_died = true; provider->endSession(); } Loading bluetooth/audio/aidl/default/BluetoothAudioProvider.h +1 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ class BluetoothAudioProvider : public BnBluetoothAudioProvider { std::unique_ptr<AudioConfiguration> audio_config_ = nullptr; SessionType session_type_; std::vector<LatencyMode> latency_modes_; bool is_binder_died = false; }; } // namespace audio Loading Loading
bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ ndk::ScopedAStatus BluetoothAudioProvider::startSession( latency_modes_ = latencyModes; audio_config_ = std::make_unique<AudioConfiguration>(audio_config); stack_iface_ = host_if; is_binder_died = false; AIBinder_linkToDeath(stack_iface_->asBinder().get(), death_recipient_.get(), this); Loading @@ -59,8 +60,10 @@ ndk::ScopedAStatus BluetoothAudioProvider::endSession() { if (stack_iface_ != nullptr) { BluetoothAudioSessionReport::OnSessionEnded(session_type_); if (!is_binder_died) { AIBinder_unlinkToDeath(stack_iface_->asBinder().get(), death_recipient_.get(), this); } } else { LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_) << " has NO session"; Loading Loading @@ -147,6 +150,7 @@ void BluetoothAudioProvider::binderDiedCallbackAidl(void* ptr) { LOG(ERROR) << __func__ << ": Null AudioProvider HAL died"; return; } provider->is_binder_died = true; provider->endSession(); } Loading
bluetooth/audio/aidl/default/BluetoothAudioProvider.h +1 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ class BluetoothAudioProvider : public BnBluetoothAudioProvider { std::unique_ptr<AudioConfiguration> audio_config_ = nullptr; SessionType session_type_; std::vector<LatencyMode> latency_modes_; bool is_binder_died = false; }; } // namespace audio Loading