mirror of git://git.sysmocom.de/ofono
handsfree-audio: Impelement CardRemoved signal
This commit is contained in:
parent
dfacb14968
commit
ff2d68f2eb
|
@ -179,12 +179,25 @@ int ofono_handsfree_card_register(struct ofono_handsfree_card *card)
|
||||||
return 0;
|
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)
|
static void card_unregister(struct ofono_handsfree_card *card)
|
||||||
{
|
{
|
||||||
DBusConnection *conn = ofono_dbus_get_connection();
|
DBusConnection *conn = ofono_dbus_get_connection();
|
||||||
|
|
||||||
g_dbus_unregister_interface(conn, card->path, HFP_AUDIO_CARD_INTERFACE);
|
g_dbus_unregister_interface(conn, card->path, HFP_AUDIO_CARD_INTERFACE);
|
||||||
|
|
||||||
|
emit_card_removed(card);
|
||||||
|
|
||||||
g_free(card->path);
|
g_free(card->path);
|
||||||
card->path = NULL;
|
card->path = NULL;
|
||||||
}
|
}
|
||||||
|
@ -371,6 +384,8 @@ static const GDBusMethodTable am_methods[] = {
|
||||||
static const GDBusSignalTable am_signals[] = {
|
static const GDBusSignalTable am_signals[] = {
|
||||||
{ GDBUS_SIGNAL("CardAdded",
|
{ GDBUS_SIGNAL("CardAdded",
|
||||||
GDBUS_ARGS({ "path", "o" }, { "properties", "a{sv}" })) },
|
GDBUS_ARGS({ "path", "o" }, { "properties", "a{sv}" })) },
|
||||||
|
{ GDBUS_SIGNAL("CardRemoved",
|
||||||
|
GDBUS_ARGS({ "path", "o" })) },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue