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

Commit a0a24e0d authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "A2DP: Clear remote suspend flag if local is also stopping"

parents 44fbfde9 1c32133f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ class A2dpTransport
  void StopRequest() override {
    if (btif_av_get_peer_sep() == AVDT_TSEP_SNK &&
        !btif_av_stream_started_ready()) {
      btif_av_clear_remote_suspend_flag();
      return;
    }
    LOG(INFO) << __func__ << ": handling";
+13 −10
Original line number Diff line number Diff line
@@ -3282,16 +3282,19 @@ uint8_t btif_av_get_peer_sep(void) {
}

void btif_av_clear_remote_suspend_flag(void) {
  auto clear_remote_suspend_flag = []() {
    BtifAvPeer* peer = btif_av_find_active_peer();
    if (peer == nullptr) {
      BTIF_TRACE_WARNING("%s: No active peer found", __func__);
      return;
    }

    BTIF_TRACE_DEBUG("%s: Peer %s : flags=%s are cleared", __func__,
                     peer->PeerAddress().ToString().c_str(),
                     peer->FlagsToString().c_str());
    peer->ClearFlags(BtifAvPeer::kFlagRemoteSuspend);
  };
  // switch to main thread to prevent a race condition of accessing peers
  do_in_main_thread(FROM_HERE, base::Bind(clear_remote_suspend_flag));
}

bool btif_av_is_peer_edr(const RawAddress& peer_address) {