Loading system/btif/src/btif_a2dp_audio_interface.cc +14 −3 Original line number Diff line number Diff line Loading @@ -339,6 +339,9 @@ void btif_a2dp_audio_on_started(tBTA_AV_STATUS status) { LOG_INFO(LOG_TAG, "%s: status = %d", __func__, status); if (btAudio != nullptr) { if (a2dp_cmd_pending == A2DP_CTRL_CMD_START) { if (status != A2DP_CTRL_ACK_PENDING) { a2dp_cmd_pending = A2DP_CTRL_CMD_NONE; } LOG_INFO(LOG_TAG, "%s: calling method onStarted", __func__); auto hal_status = mapToStatus(status); btAudio->streamStarted(hal_status); Loading @@ -353,6 +356,9 @@ void btif_a2dp_audio_on_suspended(tBTA_AV_STATUS status) { LOG_INFO(LOG_TAG, "%s: status = %d", __func__, status); if (btAudio != nullptr) { if (a2dp_cmd_pending == A2DP_CTRL_CMD_SUSPEND) { if (status != A2DP_CTRL_ACK_PENDING) { a2dp_cmd_pending = A2DP_CTRL_CMD_NONE; } LOG_INFO(LOG_TAG, "calling method onSuspended"); auto hal_status = mapToStatus(status); btAudio->streamSuspended(hal_status); Loading @@ -366,6 +372,7 @@ void btif_a2dp_audio_on_suspended(tBTA_AV_STATUS status) { void btif_a2dp_audio_on_stopped(tBTA_AV_STATUS status) { LOG_INFO(LOG_TAG, "%s: status = %d", __func__, status); if (btAudio != nullptr && a2dp_cmd_pending == A2DP_CTRL_CMD_START) { a2dp_cmd_pending = A2DP_CTRL_CMD_NONE; LOG_INFO(LOG_TAG, "%s: Remote disconnected when start under progress", __func__); btAudio->streamStarted(mapToStatus(A2DP_CTRL_ACK_DISCONNECT_IN_PROGRESS)); Loading Loading @@ -418,7 +425,6 @@ void btif_a2dp_audio_send_stop_req() { uint8_t btif_a2dp_audio_process_request(uint8_t cmd) { LOG_INFO(LOG_TAG, "%s: cmd: %s", __func__, audio_a2dp_hw_dump_ctrl_event((tA2DP_CTRL_CMD)cmd)); a2dp_cmd_pending = cmd; uint8_t status; switch (cmd) { case A2DP_CTRL_CMD_START: Loading Loading @@ -461,7 +467,7 @@ uint8_t btif_a2dp_audio_process_request(uint8_t cmd) { APPL_TRACE_WARNING("%s: A2DP command %s while AV stream is not ready", __func__, audio_a2dp_hw_dump_ctrl_event((tA2DP_CTRL_CMD)cmd)); return A2DP_CTRL_ACK_FAILURE; status = A2DP_CTRL_ACK_FAILURE; break; case A2DP_CTRL_CMD_STOP: Loading @@ -472,7 +478,7 @@ uint8_t btif_a2dp_audio_process_request(uint8_t cmd) { break; } btif_av_stream_stop(RawAddress::kEmpty); return A2DP_CTRL_ACK_SUCCESS; status = A2DP_CTRL_ACK_SUCCESS; break; case A2DP_CTRL_CMD_SUSPEND: Loading Loading @@ -502,5 +508,10 @@ uint8_t btif_a2dp_audio_process_request(uint8_t cmd) { } LOG_INFO(LOG_TAG, "a2dp-ctrl-cmd : %s DONE returning status %d", audio_a2dp_hw_dump_ctrl_event((tA2DP_CTRL_CMD)cmd), status); if (status == A2DP_CTRL_ACK_PENDING) { a2dp_cmd_pending = cmd; } else { a2dp_cmd_pending = A2DP_CTRL_CMD_NONE; } return status; } Loading
system/btif/src/btif_a2dp_audio_interface.cc +14 −3 Original line number Diff line number Diff line Loading @@ -339,6 +339,9 @@ void btif_a2dp_audio_on_started(tBTA_AV_STATUS status) { LOG_INFO(LOG_TAG, "%s: status = %d", __func__, status); if (btAudio != nullptr) { if (a2dp_cmd_pending == A2DP_CTRL_CMD_START) { if (status != A2DP_CTRL_ACK_PENDING) { a2dp_cmd_pending = A2DP_CTRL_CMD_NONE; } LOG_INFO(LOG_TAG, "%s: calling method onStarted", __func__); auto hal_status = mapToStatus(status); btAudio->streamStarted(hal_status); Loading @@ -353,6 +356,9 @@ void btif_a2dp_audio_on_suspended(tBTA_AV_STATUS status) { LOG_INFO(LOG_TAG, "%s: status = %d", __func__, status); if (btAudio != nullptr) { if (a2dp_cmd_pending == A2DP_CTRL_CMD_SUSPEND) { if (status != A2DP_CTRL_ACK_PENDING) { a2dp_cmd_pending = A2DP_CTRL_CMD_NONE; } LOG_INFO(LOG_TAG, "calling method onSuspended"); auto hal_status = mapToStatus(status); btAudio->streamSuspended(hal_status); Loading @@ -366,6 +372,7 @@ void btif_a2dp_audio_on_suspended(tBTA_AV_STATUS status) { void btif_a2dp_audio_on_stopped(tBTA_AV_STATUS status) { LOG_INFO(LOG_TAG, "%s: status = %d", __func__, status); if (btAudio != nullptr && a2dp_cmd_pending == A2DP_CTRL_CMD_START) { a2dp_cmd_pending = A2DP_CTRL_CMD_NONE; LOG_INFO(LOG_TAG, "%s: Remote disconnected when start under progress", __func__); btAudio->streamStarted(mapToStatus(A2DP_CTRL_ACK_DISCONNECT_IN_PROGRESS)); Loading Loading @@ -418,7 +425,6 @@ void btif_a2dp_audio_send_stop_req() { uint8_t btif_a2dp_audio_process_request(uint8_t cmd) { LOG_INFO(LOG_TAG, "%s: cmd: %s", __func__, audio_a2dp_hw_dump_ctrl_event((tA2DP_CTRL_CMD)cmd)); a2dp_cmd_pending = cmd; uint8_t status; switch (cmd) { case A2DP_CTRL_CMD_START: Loading Loading @@ -461,7 +467,7 @@ uint8_t btif_a2dp_audio_process_request(uint8_t cmd) { APPL_TRACE_WARNING("%s: A2DP command %s while AV stream is not ready", __func__, audio_a2dp_hw_dump_ctrl_event((tA2DP_CTRL_CMD)cmd)); return A2DP_CTRL_ACK_FAILURE; status = A2DP_CTRL_ACK_FAILURE; break; case A2DP_CTRL_CMD_STOP: Loading @@ -472,7 +478,7 @@ uint8_t btif_a2dp_audio_process_request(uint8_t cmd) { break; } btif_av_stream_stop(RawAddress::kEmpty); return A2DP_CTRL_ACK_SUCCESS; status = A2DP_CTRL_ACK_SUCCESS; break; case A2DP_CTRL_CMD_SUSPEND: Loading Loading @@ -502,5 +508,10 @@ uint8_t btif_a2dp_audio_process_request(uint8_t cmd) { } LOG_INFO(LOG_TAG, "a2dp-ctrl-cmd : %s DONE returning status %d", audio_a2dp_hw_dump_ctrl_event((tA2DP_CTRL_CMD)cmd), status); if (status == A2DP_CTRL_ACK_PENDING) { a2dp_cmd_pending = cmd; } else { a2dp_cmd_pending = A2DP_CTRL_CMD_NONE; } return status; }