Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09976b9c authored by Jeremy Wu's avatar Jeremy Wu Committed by Automerger Merge Worker
Browse files

Merge "Floss: prevent sequence checker crashes with |Start/StopAudioTicks|"...

Merge "Floss: prevent sequence checker crashes with |Start/StopAudioTicks|" into main am: 9a4cff38

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2921827



Change-Id: I4f9072abb5759503ff63a347cde92361c425ef33
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 62a5c91f 9a4cff38
Loading
Loading
Loading
Loading
+21 −3
Original line number Diff line number Diff line
@@ -268,8 +268,14 @@ bool SourceImpl::OnSuspendReq() {
  std::lock_guard<std::mutex> guard(audioSourceCallbacksMutex_);
  if (CodecManager::GetInstance()->GetCodecLocation() ==
      types::CodecLocation::HOST) {
    if (IS_FLAG_ENABLED(run_ble_audio_ticks_in_worker_thread)) {
      worker_thread_->DoInThread(
          FROM_HERE,
          base::BindOnce(&SourceImpl::StopAudioTicks, base::Unretained(this)));
    } else {
      StopAudioTicks();
    }
  }

  if (audioSourceCallbacks_ == nullptr) {
    LOG_ERROR("audioSourceCallbacks_ not set");
@@ -366,8 +372,14 @@ void SourceImpl::Stop() {

  if (CodecManager::GetInstance()->GetCodecLocation() ==
      types::CodecLocation::HOST) {
    if (IS_FLAG_ENABLED(run_ble_audio_ticks_in_worker_thread)) {
      worker_thread_->DoInThread(
          FROM_HERE,
          base::BindOnce(&SourceImpl::StopAudioTicks, base::Unretained(this)));
    } else {
      StopAudioTicks();
    }
  }

  std::lock_guard<std::mutex> guard(audioSourceCallbacksMutex_);
  audioSourceCallbacks_ = nullptr;
@@ -390,8 +402,14 @@ void SourceImpl::ConfirmStreamingRequest() {
      types::CodecLocation::HOST)
    return;

  if (IS_FLAG_ENABLED(run_ble_audio_ticks_in_worker_thread)) {
    worker_thread_->DoInThread(
        FROM_HERE,
        base::BindOnce(&SourceImpl::StartAudioTicks, base::Unretained(this)));
  } else {
    StartAudioTicks();
  }
}

void SourceImpl::SuspendedForReconfiguration() {
  if ((halSinkInterface_ == nullptr) ||