control: Support group service names in name owner triggers
If a group provides a service name, which is required to be the service
name for all group members and their interfaces, use that service name
when subscribing to nameOwnerChanged signals or calling the nameHasOwner
method. This can be used so that the service name does not have to be
looked up for each group member(and interface) or where the service for
a group(and interface) may not be on dbus when subscribing.
Change-Id: Ic52aef519eef61103478742c7a32e1f268809d38
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/triggers/init.cpp b/control/json/triggers/init.cpp
index 1ce272c..2a9ce9e 100644
--- a/control/json/triggers/init.cpp
+++ b/control/json/triggers/init.cpp
@@ -73,7 +73,11 @@
auto intf = group.getInterface();
try
{
- servName = mgr->getService(member, intf);
+ servName = group.getService();
+ if (servName.empty())
+ {
+ servName = mgr->getService(member, intf);
+ }
if (!servName.empty() && lastName != servName)
{
// Member not provided by same service as last group member