summaryrefslogtreecommitdiffstats
path: root/src/handsfree-audio.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2013-02-26 14:12:09 -0600
committerDenis Kenzior <denkenz@gmail.com>2013-02-26 14:14:46 -0600
commitff2d68f2ebc86e89e00fb67d5479ba0c2024c07a (patch)
tree6e776b1356c7c2c62e22f9ae9aa9c04b6b975fc2 /src/handsfree-audio.c
parentdfacb14968a2f1d229359671da65ed3ce61c2fa8 (diff)
downloadofono-ff2d68f2ebc86e89e00fb67d5479ba0c2024c07a.tar.bz2
handsfree-audio: Impelement CardRemoved signal
Diffstat (limited to 'src/handsfree-audio.c')
-rw-r--r--src/handsfree-audio.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index 9e9a7a2c..db65971a 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -179,12 +179,25 @@ int ofono_handsfree_card_register(struct ofono_handsfree_card *card)
return 0;
}
+static void emit_card_removed(struct ofono_handsfree_card *card)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+ const char *path = card->path;
+
+ g_dbus_emit_signal(conn, OFONO_MANAGER_PATH,
+ HFP_AUDIO_MANAGER_INTERFACE,
+ "CardRemoved", DBUS_TYPE_OBJECT_PATH, &path,
+ DBUS_TYPE_INVALID);
+}
+
static void card_unregister(struct ofono_handsfree_card *card)
{
DBusConnection *conn = ofono_dbus_get_connection();
g_dbus_unregister_interface(conn, card->path, HFP_AUDIO_CARD_INTERFACE);
+ emit_card_removed(card);
+
g_free(card->path);
card->path = NULL;
}
@@ -371,6 +384,8 @@ static const GDBusMethodTable am_methods[] = {
static const GDBusSignalTable am_signals[] = {
{ GDBUS_SIGNAL("CardAdded",
GDBUS_ARGS({ "path", "o" }, { "properties", "a{sv}" })) },
+ { GDBUS_SIGNAL("CardRemoved",
+ GDBUS_ARGS({ "path", "o" })) },
{ }
};