Add autostart proxy for nfc-manager auto start 01/205901/1 accepted/tizen/unified/20190512.221900 submit/tizen/20190510.074340
authorJihoon Jung <jh8801.jung@samsung.com>
Fri, 10 May 2019 07:38:25 +0000 (16:38 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Fri, 10 May 2019 07:41:10 +0000 (07:41 +0000)
Change-Id: I10352b873af8f459c52de809905be94f364d42b7
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
src/net_nfc_client_manager.c

index 589b4c613ab1249d8486f51471f04955594f015c..acef38b26dee536e03c65448b632e491c084e0d1 100755 (executable)
@@ -378,16 +378,27 @@ net_nfc_error_e net_nfc_client_manager_configure_discovery_sync(int mode)
        net_nfc_error_e out_result = NET_NFC_OK;
        GError *error = NULL;
 
-       net_nfc_client_manager_init();
-
-       if (manager_proxy == NULL)
-               return NET_NFC_NOT_INITIALIZED;
-
        /* prevent executing daemon when nfc is off */
        if (net_nfc_client_manager_is_activated() == false)
                return NET_NFC_NOT_ACTIVATED;
 
-       if (net_nfc_gdbus_manager_call_configure_discovery_sync(manager_proxy,
+       if (auto_start_proxy == NULL) {
+               auto_start_proxy = net_nfc_gdbus_manager_proxy_new_for_bus_sync(
+                       G_BUS_TYPE_SYSTEM,
+                       G_DBUS_PROXY_FLAGS_NONE,
+                       "org.tizen.NetNfcService",
+                       "/org/tizen/NetNfcService/Manager",
+                       NULL,
+                       &error);
+               if (auto_start_proxy == NULL) {
+                       DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
+                       g_error_free(error);
+
+                       return NET_NFC_UNKNOWN_ERROR;
+               }
+       }
+
+       if (net_nfc_gdbus_manager_call_configure_discovery_sync(auto_start_proxy,
                                        mode,
                                        &out_result,
                                        NULL,