[pulseaudio-discuss] [RFCv3 01/20] bluetooth: Track org.ofono service

jprvita at gmail.com jprvita at gmail.com
Sun Apr 21 20:07:31 PDT 2013


From: João Paulo Rechi Vita <jprvita at openbossa.org>

---
 src/modules/bluetooth/bluetooth-util.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index 01bdc3e..fc762e5 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -1325,6 +1325,14 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
             }
         }
 
+        if (pa_streq(name, "org.ofono")) {
+            if (old_owner && *old_owner)
+                pa_log_debug("oFono disappeared");
+
+            if (new_owner && *new_owner)
+                pa_log_debug("oFono appeared");
+        }
+
         return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
     } else if (dbus_message_is_signal(m, "org.bluez.MediaTransport", "PropertyChanged")) {
         pa_bluetooth_transport *t;
@@ -2170,6 +2178,8 @@ pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *c) {
                 ",arg0='org.bluez.Device1'",
                 "type='signal',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged'"
                 ",arg0='org.bluez.MediaTransport1'",
+                "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',"
+                "arg0='org.ofono'",
                 NULL) < 0) {
         pa_log("Failed to add D-Bus matches: %s", err.message);
         goto fail;
@@ -2245,6 +2255,8 @@ void pa_bluetooth_discovery_unref(pa_bluetooth_discovery *y) {
             "type='signal',sender='org.bluez',interface='org.bluez.MediaTransport',member='PropertyChanged'",
             "type='signal',sender='org.bluez',interface='org.freedesktop.DBus.ObjectManager',member='InterfacesAdded'",
             "type='signal',sender='org.bluez',interface='org.freedesktop.DBus.ObjectManager',member='InterfacesRemoved'",
+            "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',"
+            "arg0='org.ofono'",
             NULL);
 
         if (y->filter_added)
-- 
1.7.11.7



More information about the pulseaudio-discuss mailing list