Fix dbus connection to shared from private
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-common.c
index 97f1be5..c98fb07 100644 (file)
@@ -897,7 +897,10 @@ static GDBusProxy *__bt_gdbus_get_profile_proxy(void)
        if (profile_gproxy)
                return profile_gproxy;
 
-       gconn = _bt_get_system_private_conn();
+       /* Shared connection should be used because rfcomm interface was registered
+        * on shared connection not private. Otherwise, dbus rejection is occured
+        * because dbus policy is only applied on shared connection not private. */
+       gconn = _bt_get_system_shared_conn();
        if (gconn == NULL)
                return NULL;
 
@@ -1223,7 +1226,7 @@ int _bt_register_profile_ex(bt_register_profile_info_t *info, gboolean use_defau
                                        NULL, &err);
        if (err) {
                g_dbus_error_strip_remote_error(err);
-               BT_ERR("RegisterProfile failed: %s", err->message);
+               BT_ERR("RegisterProfile2 failed: %s", err->message);
 
                if (g_strrstr(err->message, BT_ACCESS_DENIED_MSG))
                        result = BLUETOOTH_ERROR_ACCESS_DENIED;
@@ -1291,7 +1294,7 @@ int _bt_register_profile_platform(bt_register_profile_info_t *info, gboolean use
 
        if (err) {
                g_dbus_error_strip_remote_error(err);
-               BT_ERR("RegisterProfile failed: %s", err->message);
+               BT_ERR("RegisterProfile1 failed: %s", err->message);
 
                if (g_strrstr(err->message, BT_ACCESS_DENIED_MSG))
                        result = BLUETOOTH_ERROR_ACCESS_DENIED;