}
ack = true;
}
+ } else {
+ // We were started remotely
+ if (btif_av_is_a2dp_offload_enabled()) {
+ btif_av_stream_start_offload();
+ }
}
/* media task is autostarted upon a2dp audiopath connection */
// If remote tries to start A2DP when DUT is A2DP Source, then Suspend.
// If A2DP is Sink and call is active, then disconnect the AVDTP channel.
- if (peer_.IsSink() && !peer_.CheckFlags(BtifAvPeer::kFlagPendingStart)) {
+ bool should_suspend = false;
+ if (peer_.IsSink() && !peer_.CheckFlags(BtifAvPeer::kFlagPendingStart |
+ BtifAvPeer::kFlagRemoteSuspend)) {
BTIF_TRACE_WARNING("%s: Peer %s : trigger Suspend as remote initiated",
__PRETTY_FUNCTION__,
peer_.PeerAddress().ToString().c_str());
- btif_av_source_dispatch_sm_event(peer_.PeerAddress(),
- BTIF_AV_SUSPEND_STREAM_REQ_EVT);
+ should_suspend = true;
}
// If peer is A2DP Source, we do not want to ACK commands on UIPC
btif_a2dp_on_started(peer_.PeerAddress(), nullptr, true);
// Pending start flag will be cleared when exit current state
}
+
+ if (should_suspend) {
+ btif_av_source_dispatch_sm_event(peer_.PeerAddress(),
+ BTIF_AV_SUSPEND_STREAM_REQ_EVT);
+ }
peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateStarted);
} break;