X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=daemon%2Fnet_nfc_server_system_handler.c;h=9cdf65f810643a24e4ba6c61e2e0da5beb8a500b;hb=73e03a89ec8a42d4b7c6916597f9f3d25dabef37;hp=32fa5eee0d5df771ad29ea867fc2f9fb6b6fec62;hpb=2a8efde023301785cc00d5a7cf78becd3c4c1eb9;p=platform%2Fcore%2Fconnectivity%2Fnfc-manager-neard.git diff --git a/daemon/net_nfc_server_system_handler.c b/daemon/net_nfc_server_system_handler.c index 32fa5ee..9cdf65f 100644 --- a/daemon/net_nfc_server_system_handler.c +++ b/daemon/net_nfc_server_system_handler.c @@ -24,38 +24,25 @@ static NetNfcGDbusPopup *popup_skeleton = NULL; static gboolean popup_handle_set(NetNfcGDbusPopup *popup_manager, GDBusMethodInvocation *invocation, - int state, - gint focus_state, - GVariant *smack_privilege, - gpointer user_data); - -static gboolean popup_handle_get(NetNfcGDbusPopup *popup_manager, - GDBusMethodInvocation *invocation, - GVariant *smack_privilege, - gpointer user_data); - -static gboolean popup_handle_set(NetNfcGDbusPopup *popup_manager, - GDBusMethodInvocation *invocation, gint state, gint focus_state, GVariant *smack_privilege, gpointer user_data) { - NFC_INFO(">>> REQUEST from [%s]", - g_dbus_method_invocation_get_sender(invocation)); + bool ret; + NFC_INFO(">>> REQUEST from [%s]", g_dbus_method_invocation_get_sender(invocation)); /* check privilege and update client context */ - if (net_nfc_server_gdbus_check_privilege(invocation, - smack_privilege, - "nfc-manager", - "w") == false) { + ret = net_nfc_server_gdbus_check_privilege(invocation, smack_privilege, + "nfc-manager", "w"); + if (false == ret) + { NFC_ERR("permission denied, and finished request"); return FALSE; } - net_nfc_server_gdbus_set_launch_state( - g_dbus_method_invocation_get_sender(invocation), + net_nfc_server_gdbus_set_launch_state(g_dbus_method_invocation_get_sender(invocation), state, focus_state); net_nfc_gdbus_popup_complete_set(popup_manager, invocation, NET_NFC_OK); @@ -64,20 +51,18 @@ static gboolean popup_handle_set(NetNfcGDbusPopup *popup_manager, } static gboolean popup_handle_get(NetNfcGDbusPopup *popup_manager, - GDBusMethodInvocation *invocation, - GVariant *smack_privilege, - gpointer user_data) + GDBusMethodInvocation *invocation, GVariant *smack_privilege, gpointer user_data) { + bool ret; gboolean state; - NFC_INFO(">>> REQUEST from [%s]", - g_dbus_method_invocation_get_sender(invocation)); + NFC_INFO(">>> REQUEST from [%s]", g_dbus_method_invocation_get_sender(invocation)); /* check privilege and update client context */ - if (net_nfc_server_gdbus_check_privilege(invocation, - smack_privilege, - "nfc-manager", - "r") == false) { + ret = net_nfc_server_gdbus_check_privilege(invocation, smack_privilege, + "nfc-manager", "r"); + if (false == ret) + { NFC_ERR("permission denied, and finished request"); return FALSE; @@ -86,44 +71,34 @@ static gboolean popup_handle_get(NetNfcGDbusPopup *popup_manager, state = net_nfc_server_gdbus_get_launch_state( g_dbus_method_invocation_get_sender(invocation)); - net_nfc_gdbus_popup_complete_get(popup_manager, invocation, - NET_NFC_OK, state); + net_nfc_gdbus_popup_complete_get(popup_manager, invocation, NET_NFC_OK, state); return TRUE; } gboolean net_nfc_server_system_handler_init(GDBusConnection *connection) { - GError *error = NULL; gboolean result; + GError *error = NULL; if (popup_skeleton) g_object_unref(popup_skeleton); popup_skeleton = net_nfc_gdbus_popup_skeleton_new(); - if (popup_skeleton == NULL) + if (NULL == popup_skeleton) { NFC_ERR("Failed to allocate popup skeleton"); return FALSE; } - g_signal_connect(popup_skeleton, - "handle-set", - G_CALLBACK(popup_handle_set), - NULL); - - g_signal_connect(popup_skeleton, - "handle-get", - G_CALLBACK(popup_handle_get), - NULL); - - result = g_dbus_interface_skeleton_export( - G_DBUS_INTERFACE_SKELETON(popup_skeleton), - connection, - "/org/tizen/NetNfcService/Popup", - &error); - if (result == FALSE) + g_signal_connect(popup_skeleton, "handle-set", G_CALLBACK(popup_handle_set), NULL); + + g_signal_connect(popup_skeleton, "handle-get", G_CALLBACK(popup_handle_get), NULL); + + result = g_dbus_interface_skeleton_export(G_DBUS_INTERFACE_SKELETON(popup_skeleton), + connection, "/org/tizen/NetNfcService/Popup", &error); + if (FALSE == result) { NFC_ERR("Can not skeleton_export %s", error->message);