From 3237dd609ed48c98c99bfc31e511c4dd04277ded Mon Sep 17 00:00:00 2001 From: Chethan T N Date: Thu, 20 Nov 2014 12:57:27 +0530 Subject: [PATCH] audio/sink: Fix a2dp XCASE connection Some bluetooth headset (BOSE) initates the avdtp connection immediately after HFP connection is completed, so if application initates a2dp connection and since already avdtp connection is ongoing should return error EBUSY. --- profiles/audio/sink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c index da8992e62..f475709dc 100644 --- a/profiles/audio/sink.c +++ b/profiles/audio/sink.c @@ -292,6 +292,9 @@ int sink_connect(struct btd_service *service) if (sink->connect_id > 0 || sink->disconnect_id > 0) return -EBUSY; + if (sink->state == SINK_STATE_CONNECTING) + return -EBUSY; + if (sink->stream_state >= AVDTP_STATE_OPEN) return -EALREADY; -- 2.47.3