From: jomui Date: Mon, 7 Aug 2017 10:34:43 +0000 (+0900) Subject: add app_control for launching User Consent X-Git-Tag: submit/tizen_3.0/20170808.100821~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f6eba0b96a7adba1569b4aff722d1ec3ce9e122;p=platform%2Fcore%2Flocation%2Fmaps-plugin-here.git add app_control for launching User Consent Signed-off-by: jomui Change-Id: I7300d04639044167f744526ebf9a6207e04de946 --- diff --git a/src/heremaps-uc-dbus.c b/src/heremaps-uc-dbus.c index 194eeba..ba1b8f1 100644 --- a/src/heremaps-uc-dbus.c +++ b/src/heremaps-uc-dbus.c @@ -13,6 +13,7 @@ * limitations under the License. */ +#include #include #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);