Fix dbus connection to shared from private 10/199210/1 accepted/tizen/unified/20190208.061633 submit/tizen/20190207.084653
authorWootak Jung <wootak.jung@samsung.com>
Thu, 7 Feb 2019 07:47:03 +0000 (16:47 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 7 Feb 2019 07:47:03 +0000 (16:47 +0900)
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.

Change-Id: I49ca31b06deeec8c9092fd99342d22d0b9290229

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;