Merge "BTAudio: report session ended after cleaning up"

This commit is contained in:
Treehugger Robot
2020-07-24 18:28:10 +00:00
committed by Gerrit Code Review

View File

@@ -90,14 +90,16 @@ void BluetoothAudioSession::OnSessionStarted(
// bluetooth_audio outputs
void BluetoothAudioSession::OnSessionEnded() {
std::lock_guard<std::recursive_mutex> guard(mutex_);
if (IsSessionReady()) {
ReportSessionStatus();
}
bool toggled = IsSessionReady();
LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_);
audio_config_ = (session_type_ == SessionType::A2DP_HARDWARE_OFFLOAD_DATAPATH
? kInvalidOffloadAudioConfiguration
: kInvalidSoftwareAudioConfiguration);
stack_iface_ = nullptr;
UpdateDataPath(nullptr);
if (toggled) {
ReportSessionStatus();
}
}
// invoking the registered session_changed_cb_