diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-04-11 08:56:50 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-04-11 08:56:50 +0000 |
commit | 993e7c747c360fb05b98e316b7ec760d2fb70365 (patch) | |
tree | b9de2035ca735b74fa9eacd170ab6ebd145a434c /audio/headset.c | |
parent | b8a407aa8470ad8d92d9142edb41c17548b0cb2c (diff) |
Implement ChangeDefaultHeadset and RemoveHeadset methods
Diffstat (limited to 'audio/headset.c')
-rw-r--r-- | audio/headset.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/audio/headset.c b/audio/headset.c index e1122bd6..ab4c4d8f 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -795,6 +795,13 @@ failed: return -1; } +gint headset_path_cmp(gconstpointer headset, gconstpointer path) +{ + const struct headset *hs = headset; + + return strcmp(hs->object_path, path); +} + gint headset_bda_cmp(gconstpointer headset, gconstpointer bda) { const struct headset *hs = headset; @@ -1559,6 +1566,12 @@ void headset_unref(struct headset *hs) { assert(hs != NULL); + if (hs->state > HEADSET_STATE_DISCONNECTED) + hs_disconnect(hs, NULL); + + if (!dbus_connection_unregister_object_path(hs->conn, hs->object_path)) + error("D-Bus failed to unregister %s path", hs->object_path); + dbus_connection_unref(hs->conn); g_free(hs); |