int event_type, eventsystem_cb callback, void *user_data);
static void __destroy_eventmap(gpointer data);
static int __eventsystem_launch_on_event_for_userevent(const char *event_name,
- bundle *data, const bool trusted);
+ bundle *data, gboolean trusted);
static int __event_compare_reg_id_cb(gconstpointer a, gconstpointer b)
{
char *interface_name;
char *object_path;
char *member_name;
- char *sender_name = NULL;
GDBusSignalCallback filter;
GBusType bus_type;
guint subscription_id = 0;
ret = ES_R_ERROR;
goto out_3;
}
- sender_name = NULL;
bus_type = G_BUS_TYPE_SYSTEM;
}
subscription_id = g_dbus_connection_signal_subscribe(conn,
- sender_name, /* sender */
+ NULL, /* sender */
interface_name,
member_name, /* member */
object_path, /* object_path */
goto out;
}
- if (__eventsystem_launch_on_event_for_userevent(evti->event_name, data, true) < 0)
+ if (__eventsystem_launch_on_event_for_userevent(evti->event_name, data, TRUE) < 0)
_E("Failed to launch on event for userevent");
} else {
if (__eventsystem_send_event(conn, evti, data) < 0) {
goto out;
}
- if (__eventsystem_launch_on_event_for_userevent(evti->event_name, data, false) < 0)
+ if (__eventsystem_launch_on_event_for_userevent(evti->event_name, data, FALSE) < 0)
_E("Failed to launch on event for userevent");
}
} else {
goto out_2;
}
- g_variant_get(value, "(iis)", &result, &len, &raw);
+ g_variant_get(value, "(ii&s)", &result, &len, &raw);
_D("result(%d), len(%d)", result, len);
if (!result && raw && len > 0) {
callback(event_name, raw, len, user_data);
- bundle_free_encoded_rawdata(&raw);
+ ret = ES_R_OK;
+ } else {
+ ret = ES_R_ERROR;
}
- ret = ES_R_OK;
-
out_2:
g_object_unref(proxy);
g_variant_unref(value);
}
static int __eventsystem_launch_on_event_for_userevent(const char *event_name,
- bundle *data, const bool trusted)
+ bundle *data, gboolean trusted)
{
int ret = ES_R_EINVAL;
GDBusConnection *conn = NULL;
out_1:
if (conn)
g_object_unref(conn);
+
+ return ret;
}
char *interface_name;
char *object_path;
char *member_name;
- char *sender_name = NULL;
GDBusSignalCallback filter;
GBusType bus_type;
guint subscription_id = 0;
ret = ES_R_ERROR;
goto end;
}
- sender_name = NULL;
_D("interface_name(%s), object_path(%s)", interface_name, object_path);
- _D(" member_name(%s), sender_name(%s), type(%d), bus_type(%d)",
- member_name, sender_name, *event_type, bus_type);
+ _D(" member_name(%s), type(%d), bus_type(%d)",
+ member_name, *event_type, bus_type);
if (__get_gdbus_shared_connection(&conn, bus_type, *event_type) < 0) {
_E("getting gdbus-connetion error");
}
subscription_id = g_dbus_connection_signal_subscribe(conn,
- sender_name, /* sender */
+ NULL, /* sender */
interface_name,
member_name, /* member */
object_path, /* object_path */
ret = ES_R_ERROR;
}
- __request_esd_for_last_data(event_name, true);
+ if (*event_type == ES_TYPE_USER)
+ __request_esd_for_last_data(event_name, true);
end:
FREE_AND_NULL(interface_name);
FREE_AND_NULL(object_path);