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

Commit ae894841 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Send ACK for A2DP_CTRL_CMD_SUSPEND even if audio was no streaming

The A2DP_CTRL_CMD_SUSPEND command from the Audio HAL could be received
even if audio wasn't streaming before. Therefore, we should always
respond with an ACK once the command processing has been completed.

Bug: 109712592
Test: Manual: (1) Play music to Headset; (2) Select "This device" as output;
      (3) Stop playing music; (4) Select Headset as output

Change-Id: I0f5d52d14b50882931b9d19de1a2f25204fce19e
parent 9f60ba4b
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -786,8 +786,6 @@ static void btif_a2dp_source_audio_tx_stop_event(void) {

  if (btif_av_is_a2dp_offload_enabled()) return;

  const bool send_ack = btif_a2dp_source_is_streaming();

  uint8_t p_buf[AUDIO_STREAM_OUTPUT_BUFFER_SZ * 2];
  uint16_t event;

@@ -814,7 +812,7 @@ static void btif_a2dp_source_audio_tx_stop_event(void) {
   * to get the ACK for any pending command in such cases.
   */

  if (send_ack) btif_a2dp_command_ack(A2DP_CTRL_ACK_SUCCESS);
  btif_a2dp_command_ack(A2DP_CTRL_ACK_SUCCESS);

  /* audio engine stopped, reset tx suspended flag */
  btif_a2dp_source_cb.tx_flush = false;