linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ v1 1/3] sink: Fix transitioning to BTD_SERVICE_STATE_DISCONNECTED on idle
@ 2024-11-06 15:49 Luiz Augusto von Dentz
  2024-11-06 15:49 ` [PATCH BlueZ v1 2/3] source: " Luiz Augusto von Dentz
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2024-11-06 15:49 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If the stream transition to AVDTP_STATE_IDLE it means the stream has
been disconnected, not the session, therefore
btd_service_disconnecting_complete shall not be called otherwise it may
trigger the policy plugin to disconnect AVRCP in cases like codec
reconfiguration.

Fixes: https://github.com/bluez/bluez/issues/1003
---
 profiles/audio/sink.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c
index 77f195436032..7e02bcca1a01 100644
--- a/profiles/audio/sink.c
+++ b/profiles/audio/sink.c
@@ -110,6 +110,7 @@ static void avdtp_state_callback(struct btd_device *dev,
 	switch (new_state) {
 	case AVDTP_SESSION_STATE_DISCONNECTED:
 		sink_set_state(sink, SINK_STATE_DISCONNECTED);
+		btd_service_disconnecting_complete(sink->service, 0);
 		break;
 	case AVDTP_SESSION_STATE_CONNECTING:
 		sink_set_state(sink, SINK_STATE_CONNECTING);
@@ -135,8 +136,6 @@ static void stream_state_changed(struct avdtp_stream *stream,
 
 	switch (new_state) {
 	case AVDTP_STATE_IDLE:
-		btd_service_disconnecting_complete(sink->service, 0);
-
 		if (sink->connect_id > 0) {
 			a2dp_cancel(sink->connect_id);
 			sink->connect_id = 0;
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-11-06 20:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-06 15:49 [PATCH BlueZ v1 1/3] sink: Fix transitioning to BTD_SERVICE_STATE_DISCONNECTED on idle Luiz Augusto von Dentz
2024-11-06 15:49 ` [PATCH BlueZ v1 2/3] source: " Luiz Augusto von Dentz
2024-11-06 15:49 ` [PATCH BlueZ v1 3/3] a2dp: Don't wait to reconfigure Luiz Augusto von Dentz
2024-11-06 18:45 ` [BlueZ,v1,1/3] sink: Fix transitioning to BTD_SERVICE_STATE_DISCONNECTED on idle bluez.test.bot
2024-11-06 20:10 ` [PATCH BlueZ v1 1/3] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).