+
+ g_variant_get(parameters, "(u&sa(sss)&s&s)", &target_uid, &req_id, &iter,
+ &key, &val);
+ while (g_variant_iter_loop(iter, "(&s&s&s)", &pkgid, &appid, &pkg_type)) {
+ if (cb_info->req_key) {
+ if (strcmp(cb_info->req_key, req_id) != 0)
+ continue;
+ } else {
+ signal_type = __get_signal_type(signal_name);
+ if (signal_type < 0 || !(cb_info->status_type & signal_type)) {
+ g_variant_iter_free(iter);
+ return;
+ }
+ }
+
+ /* each cb_data can only has one callback */
+ if (cb_info->event_cb) {
+ cb_info->event_cb(target_uid, cb_info->req_id,
+ pkg_type, pkgid, key, val, NULL, cb_info->data);
+ } else if (cb_info->app_event_cb && strcmp(appid, "") != 0) {
+ cb_info->app_event_cb(target_uid, cb_info->req_id,
+ pkg_type, pkgid, appid, key, val, NULL,
+ cb_info->data);
+ } else if (cb_info->size_info_cb) {
+ __handle_size_info_callback(cb_info, pkgid, val);
+ }
+
+ /* TODO: unsubscribe request callback */
+ }
+ g_variant_iter_free(iter);
+}
+
+static void __handle_res_event_signal(const gchar *signal_name,
+ GVariant *parameters, gpointer user_data)
+{
+ uid_t target_uid;
+ char *req_id;
+ char *pkgid = NULL;
+ char *status = NULL;
+ char *path = NULL;
+ pkgmgr_res_event_path_state state;