Removed unnecessary debug messages logging 79/39179/4
authorMateusz Malicki <m.malicki2@samsung.com>
Mon, 11 May 2015 08:57:29 +0000 (10:57 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Mon, 11 May 2015 13:02:35 +0000 (06:02 -0700)
[Bug]           Unnecessary debug messages
[Cause]         Listening to signals from all the dbus buses
[Solution]      Listen on only one dbus interface
[Verification]  Build with DEBUG, run on odroid. There shouldn't be
                debug messages about received signals from external services

Change-Id: I9096b581d970da5a6bd18beca5fa8d13688ab875

libs/dbus/connection.cpp
libs/dbus/connection.hpp
server/host-dbus-connection.cpp

index 441174b..3485ea5 100644 (file)
@@ -213,13 +213,16 @@ void DbusConnection::emitSignal(const std::string& objectPath,
 }
 
 DbusConnection::SubscriptionId DbusConnection::signalSubscribe(const SignalCallback& callback,
-                                                               const std::string& senderBusName)
+                                                               const std::string& senderBusName,
+                                                               const std::string& interface,
+                                                               const std::string& objectPath,
+                                                               const std::string& member)
 {
     return g_dbus_connection_signal_subscribe(mConnection,
                                               senderBusName.empty() ? NULL : senderBusName.c_str(),
-                                              NULL,
-                                              NULL,
-                                              NULL,
+                                              interface.empty() ? NULL : interface.c_str(),
+                                              objectPath.empty() ? NULL : objectPath.c_str(),
+                                              member.empty() ? NULL : member.c_str(),
                                               NULL,
                                               G_DBUS_SIGNAL_FLAGS_NONE,
                                               &DbusConnection::onSignal,
index 6603c9d..faf737c 100644 (file)
@@ -125,7 +125,11 @@ public:
      * Empty sender means subscribe to all signals
      * Returns a subscription identifier that can be used to unsubscribe signal
      */
-    SubscriptionId signalSubscribe(const SignalCallback& callback, const std::string& senderBusName);
+    SubscriptionId signalSubscribe(const SignalCallback& callback,
+                                   const std::string& senderBusName = "",
+                                   const std::string& interface = "",
+                                   const std::string& objectPath ="",
+                                   const std::string& member = "");
 
     /**
      * Unsubscribes from a signal.
index 98325ac..ad0ba0d 100644 (file)
@@ -71,7 +71,8 @@ HostDbusConnection::HostDbusConnection()
 
     mSubscriptionId = mDbusConnection->signalSubscribe(std::bind(&HostDbusConnection::onSignalCall,
                                                                  this, _1, _2, _3, _4, _5),
-                                                       std::string());
+                                                       std::string(),
+                                                       api::dbus::INTERFACE);
     LOGD("Connected");
 }