From 2ebf7ed224d04b44dcf03d64eb1966d526ae8b41 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Mon, 12 May 2025 20:04:08 +0530 Subject: [PATCH] transport: Fix the use of callback in transport_asha_suspend Some devices do not send a response to the stop command, so audio status notification might not be received after stop. Instead, as with the Android implementation, we just immediately acknowledge the client's stop request after sending it to the device. --- profiles/audio/transport.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index c5ae3a71b..153515191 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -2302,6 +2302,13 @@ static void asha_transport_state_cb(int status, void *user_data) asha_transport_sync_state(transport, asha_dev); } +static gboolean asha_transport_suspend_cb(void *user_data) +{ + asha_transport_state_cb(-1, user_data); + + return FALSE; +} + static guint transport_asha_resume(struct media_transport *transport, struct media_owner *owner) { @@ -2323,7 +2330,7 @@ static guint transport_asha_suspend(struct media_transport *transport, if (owner) { ret = bt_asha_device_stop(asha_dev); asha_transport_sync_state(transport, asha_dev); - asha_transport_state_cb(-1, owner); + g_idle_add(asha_transport_suspend_cb, owner); } else { ret = bt_asha_device_stop(asha_dev); /* We won't have a callback to set the final state */ -- 2.47.3