Remove g_bus_own_name() logic in bt-telephony 00/192700/1
authorWootak Jung <wootak.jung@samsung.com>
Thu, 8 Nov 2018 05:12:09 +0000 (14:12 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 8 Nov 2018 05:12:09 +0000 (14:12 +0900)
It is not good to call g_bus_own_name() in api layer, it causes
service name of sender is changed to org.tizen.csd.Call.Instance.

This interface has been used on bluetooth-agent and it can call
method on this interface by using sender_name instead of service_name.

Change-Id: I6f77e23ee15b9b1f9e4a4ce53f4993e852006bce

bt-api/bt-telephony.c
bt-service-adaptation/bluetooth-frwk-service.conf.in

index ac5785c..c1274f4 100644 (file)
@@ -67,7 +67,6 @@ char *src_addr = NULL;
 #define HFP_AGENT_PATH "/org/bluez/hfp_agent"
 #define HFP_AGENT_INTERFACE "Org.Hfp.App.Interface"
 
-#define TELEPHONY_APP_INTERFACE "org.tizen.csd.Call.Instance"
 #define CSD_CALL_APP_PATH "/org/tizen/csd/%d"
 #define HFP_NREC_STATUS_CHANGE "NrecStatusChanged"
 #define HFP_ANSWER_CALL "Answer"
@@ -691,16 +690,8 @@ int __bluetooth_telephony_register_object(int reg, GDBusNodeInfo *node_info)
 static int __bluetooth_telephony_proxy_init(void)
 {
        FN_START;
-       guint owner_id;
        GDBusNodeInfo *node_info;
 
-       owner_id = g_bus_own_name(G_BUS_TYPE_SYSTEM,
-                               TELEPHONY_APP_INTERFACE,
-                               G_BUS_NAME_OWNER_FLAGS_NONE,
-                               NULL, NULL, NULL,
-                               NULL, NULL);
-       BT_DBG("owner_id is [%d]", owner_id);
-
        node_info = __bt_telephony_create_method_node_info(
                                bt_telephony_introspection_xml);
        if (node_info == NULL) {
index 17eecaa..28cbf06 100644 (file)
@@ -12,6 +12,7 @@
         <allow send_destination="org.projectx.bt"/>
         <allow own="org.bluez.obex"/>
         <allow send_destination="org.bluez.obex"/>
+        <allow send_interface="org.tizen.csd.Call.Instance"/>
     </policy>
     <policy context="default">
         <deny own="org.projectx.bt"/>
@@ -25,6 +26,5 @@
         <allow send_destination="org.projectx.bt" send_interface="org.bluez.obex.reply"/>
         <allow send_destination="org.projectx.bt_event"/>
         <allow send_destination="org.projectx.bluetooth.share"/>
-        <allow send_destination="org.tizen.csd.Call.Instance"/>
     </policy>
 </busconfig>