This commit logs on debug level when a Handsfree Audio Agent registers
or unregisters itself and the CODECs that are enabled.
---
 src/handsfree-audio.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index 3b0814f..411632e 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -663,6 +663,7 @@ static DBusMessage *am_agent_register(DBusConnection *conn,
        DBusMessageIter iter, array;
        int length, i;
        gboolean has_cvsd = FALSE;
+       gboolean has_msbc = FALSE;
 
        if (agent)
                return __ofono_error_in_use(msg);
@@ -688,6 +689,8 @@ static DBusMessage *am_agent_register(DBusConnection *conn,
                } else if (codecs[i] != HFP_CODEC_MSBC)
                        return __ofono_error_invalid_args(msg);
 
+               has_msbc = TRUE;
+
                if (defer_setup)
                        has_wideband = TRUE;
        }
@@ -703,6 +706,12 @@ static DBusMessage *am_agent_register(DBusConnection *conn,
        agent->watch = g_dbus_add_disconnect_watch(conn, sender,
                                                agent_disconnect, NULL, NULL);
 
+       DBG("Agent %s registered with the CODECs:%s%s", sender,
+               has_cvsd ? " CVSD" : "", has_msbc ? " mSBC" : "");
+
+        if (has_msbc && !has_wideband)
+               DBG("mSBC disabled due to lack of SCO defer setup support");
+
        return dbus_message_new_method_return(msg);
 }
 
@@ -731,6 +740,8 @@ static DBusMessage *am_agent_unregister(DBusConnection 
*conn,
        agent_free(agent);
        agent = NULL;
 
+       DBG("Agent %s unregistered", sender);
+
        return dbus_message_new_method_return(msg);
 }
 
-- 
1.7.11.7

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

Reply via email to