add app_control for launching User Consent 66/142866/3
authorjomui <jongmun.woo@samsung.com>
Mon, 7 Aug 2017 10:34:43 +0000 (19:34 +0900)
committerSeechan Kim <cbible.kim@samsung.com>
Tue, 8 Aug 2017 09:50:01 +0000 (09:50 +0000)
Signed-off-by: jomui <jongmun.woo@samsung.com>
Change-Id: I7300d04639044167f744526ebf9a6207e04de946

src/heremaps-uc-dbus.c

index 194eebae96c8866b36d8db9c2c079dac5d8ca71e..ba1b8f1588009714dc38e0541a6f46b839e905bb 100644 (file)
@@ -13,6 +13,7 @@
  * limitations under the License.
  */
 
+#include <app.h>
 #include <stdio.h>
 #include "heremaps-uc-dbus.h"
 
@@ -67,33 +68,38 @@ EXPORT_API int heremaps_uc_dbus_launch_receiver()
                        g_error_free(error);
                        error = NULL;
                }
-               return HEREMAPS_UC_DBUS_ERROR_CONNECTION;
-       }
-       MAPS_LOGD("handle->conn: %p", handle->conn);
-       g_free(bus_addr);
-
-       handle->service_name = g_strdup(UC_RECEIVER_NAME);
-       handle->service_path = g_strdup(UC_RECEIVER_PATH);
-       handle->signal_path = g_strdup_printf("%s/%s", handle->service_path, "SAMSUNG");
-       MAPS_LOGD("Object Path [%s]", handle->signal_path);
-
-       proxy = g_dbus_proxy_new_sync(handle->conn, G_DBUS_PROXY_FLAGS_NONE, NULL, handle->service_name, handle->signal_path, UC_INTERFACE_NAME, NULL, NULL);
-       if (proxy) {
-               MAPS_LOGD("proxy: %p", proxy);
-               g_object_unref(proxy);
+               app_control_h app_control = NULL;
+               app_control_create(&app_control);
+               app_control_set_app_id(app_control, "org.tizen.heremaps-uc");
+               app_control_send_launch_request(app_control, NULL, NULL);
+               app_control_destroy(app_control);
        } else {
-               if (error) {
-                       MAPS_LOGD("Fail to get proxy Error[%s]", error->message);
-                       g_error_free(error);
+               MAPS_LOGD("handle->conn: %p", handle->conn);
+
+               handle->service_name = g_strdup(UC_RECEIVER_NAME);
+               handle->service_path = g_strdup(UC_RECEIVER_PATH);
+               handle->signal_path = g_strdup_printf("%s/%s", handle->service_path, "SAMSUNG");
+               MAPS_LOGD("Object Path [%s]", handle->signal_path);
+
+               proxy = g_dbus_proxy_new_sync(handle->conn, G_DBUS_PROXY_FLAGS_NONE, NULL, handle->service_name, handle->signal_path, UC_INTERFACE_NAME, NULL, NULL);
+               if (proxy) {
+                       MAPS_LOGD("proxy: %p", proxy);
+                       g_object_unref(proxy);
+               } else {
+                       if (error) {
+                               MAPS_LOGD("Fail to get proxy Error[%s]", error->message);
+                               g_error_free(error);
+                       }
                }
+               MAPS_LOGD("g_dbus_proxy_new_sync is done");
        }
-       MAPS_LOGD("g_dbus_proxy_new_sync is done");
 
        if (handle->conn) {
                g_object_unref(handle->conn);
                handle->conn = NULL;
                MAPS_LOGD("g_object_unref : handle->conn");
        }
+       g_free(bus_addr);
        g_free(handle->service_path);
        g_free(handle->service_name);
        g_free(handle->signal_path);