Returns "Operation currently not available" if "Connect" method of the
Handsfree Audio Card gets called and there isn't an agent registered.
---
 src/handsfree-audio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index 6fa8b67..8950347 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -282,6 +282,9 @@ static DBusMessage *card_connect(DBusConnection *conn,
        if (driver == NULL)
                return __ofono_error_not_implemented(msg);
 
+       if (agent == NULL)
+               return __ofono_error_not_available(msg);
+
        sk = driver->audio_connect(card->remote, card->local);
        if (sk < 0)
                return __ofono_error_failed(msg);
-- 
1.7.11.7

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to