[pulseaudio-discuss] [RFCv2 01/17] bluetooth: Track org.ofono service

jprvita at gmail.com jprvita at gmail.com
Mon Apr 15 14:53:16 PDT 2013


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

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

diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index 01bdc3e..260c24e 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -1325,7 +1325,18 @@ 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;
         DBusMessageIter arg_i;
@@ -2170,6 +2181,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 +2258,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