Merge "BTAudio: report session ended after cleaning up" am: 5ae008679d

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1371705

Change-Id: I949cda51cab15b437f9168caa6c5ae841cdf16e8
This commit is contained in:
Treehugger Robot
2020-07-24 18:51:42 +00:00
committed by Automerger Merge Worker

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_