From a6874a64b2c4ff377549dbf1a81ce3bec809e03a Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Mon, 4 Mar 2013 17:48:52 -0300 Subject: handsfree-audio: Reject SCO if Card is not ready The Audio Card is being created when the NewConnection from BlueZ Profile is received, and registered when the service level connection negotiation finishes. This patch rejects SCO connection if the SCO incoming connection arrives when the service level negotiation is ongoing. --- src/handsfree-audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c index 14872b0e..857c258d 100644 --- a/src/handsfree-audio.c +++ b/src/handsfree-audio.c @@ -138,7 +138,7 @@ static gboolean sco_accept(GIOChannel *io, GIOCondition cond, bt_ba2str(&saddr.sco_bdaddr, local); card = card_find(remote, local); - if (card == NULL) { + if (card == NULL || card->path == NULL) { ofono_error("Rejecting SCO: Audio Card not found!"); close(nsk); return TRUE; -- cgit v1.2.3