ec->comp_data->has_video_client = has;
}
+static void
+_tzpol_iface_cb_set_appid(struct wl_client *client, struct wl_resource *res_tzpol, uint32_t pid, const char *appid)
+{
+ E_Policy_Wl_Tzpol *tzpol;
+
+ tzpol = _e_policy_wl_tzpol_get(res_tzpol);
+ EINA_SAFETY_ON_NULL_RETURN(tzpol);
+
+ ELOGF("TZPOL", "Set appid(%s) pid(%d)", NULL, appid, pid);
+
+ /* TODO: deliver to appinfo */
+
+ e_service_launcher_appid_register(appid, pid);
+}
+
// --------------------------------------------------------
// tizen_policy_interface
// --------------------------------------------------------
_tzpol_iface_cb_ack_conformant_region,
_tzpol_iface_cb_destroy,
_tzpol_iface_cb_has_video,
+ _tzpol_iface_cb_set_appid,
};
static void
}
lc->serial = serial;
+ lc->target.pid = pid;
- if (pid > 0 )
+ if (pid >= 0 )
{
- lc->target.pid = pid;
ecs = _launcher_clients_find_by_pid(pid);
EINA_LIST_FOREACH(ecs, l, target_ec)
{
lc->with_swl = EINA_TRUE; /* set swl flag */
lc->serial = serial;
+ lc->target.pid = pid;
- if (pid > 0)
+ if (pid >= 0)
{
- lc->target.pid = pid;
ecs = _launcher_clients_find_by_pid(pid);
EINA_LIST_FOREACH(ecs, l, target_ec)
{
else if (ec == runner->ec) goto show_allow; //show launcher
break;
case LAUNCHER_STATE_MONITORING: //waiting creation of target window
- if ((runner->target.pid > 0) &&
- (ec->netwm.pid != runner->target.pid)) goto show_allow; //detect by pid
- if ((runner->target.appid) && (runner->target.ec != ec)) goto show_allow; //detect by appid
+ if ((runner->target.pid >= 0) && (ec->netwm.pid != runner->target.pid)) goto show_allow; //detect by pid
+ if ((runner->target.appid) && (runner->target.ec) && (runner->target.ec != ec)) goto show_allow; //detect by appid
+ if ((runner->target.appid) && (runner->target.pid < 0) && (!runner->target.ec)) goto show_allow; //not enough info
if (e_object_is_del(E_OBJECT(ec))) goto show_allow;
if (runner->with_swl)
}
}
}
+
+EINTERN void
+e_service_launcher_appid_register(const char *appid, pid_t pid)
+{
+ E_Service_Launcher *runner;
+
+ runner = _launcher_handler_launcher_runner_get();
+ EINA_SAFETY_ON_NULL_RETURN(runner);
+ EINA_SAFETY_ON_TRUE_RETURN(runner->state != LAUNCHER_STATE_MONITORING);
+
+ if (runner->target.appid)
+ {
+ if (!e_util_strcmp(appid, runner->target.appid))
+ {
+ runner->target.pid = pid;
+
+ ELOGF("LAUNCHER_SRV", "Register callee pid:%d by appid(%s)",
+ runner->ec, pid, runner->target.appid);
+ }
+ }
+}
EINTERN void e_service_launcher_client_unset(E_Client *ec);
EINTERN void e_service_launcher_prepare_send_with_shared_widget_info(E_Client *target_ec, const char *shared_widget_info, uint32_t state, uint32_t serial);
EINTERN void e_service_launcher_release_shared_widget_launch(E_Client *ec);
+
EINTERN void e_service_launcher_callee_register(const char *appid, E_Client *callee);
+EINTERN void e_service_launcher_appid_register(const char *appid, pid_t pid);
#endif