e_service_launcher: query pid from appid when dealing with launch request(s) 50/233150/1
authorSung-Jin Park <sj76.park@samsung.com>
Tue, 12 May 2020 12:25:51 +0000 (21:25 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Tue, 12 May 2020 12:26:05 +0000 (21:26 +0900)
Change-Id: Icc1afaee9432bf5bb746786475a4c8db636fe278
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/bin/services/e_service_launcher.c

index 4d1c8587bc139a9b9d90cf1f3f1f65a715f9f764..1c598c7776043296e8d6bd34cc66f6030fb79175 100644 (file)
@@ -1,5 +1,6 @@
 #include "e.h"
 #include "e_policy_wl.h"
+#include "e_appinfo.h"
 #include <tzsh_server.h>
 #include <wayland-tbm-server.h>
 #include "services/e_service_launcher.h"
@@ -903,6 +904,7 @@ _launcher_cb_launch(struct wl_client *client EINA_UNUSED,
    E_Client *target_ec;
    Eina_List *ecs, *l;
    Eina_Bool sent = EINA_FALSE;
+   E_Appinfo *epai = NULL;
 
    lc = wl_resource_get_user_data(res_tws_lc);
    EINA_SAFETY_ON_NULL_RETURN(lc);
@@ -937,6 +939,13 @@ _launcher_cb_launch(struct wl_client *client EINA_UNUSED,
    lc->serial = serial;
    lc->target.pid = pid;
 
+   if (pid < 0)
+     {
+        epai = e_appinfo_find_with_appid(app_id);
+        lc->target.pid = pid = e_appinfo_pid_get(epai);
+        ELOGF("LAUNCHER_SRV", "Found pid:%d, appid:%s", NULL, pid, app_id);
+     }
+
    if (pid >= 0 )
      {
         ecs = _launcher_clients_find_by_pid(pid);
@@ -989,6 +998,7 @@ _launcher_cb_launch_with_shared_widget(struct wl_client *client EINA_UNUSED,
    E_Client *target_ec;
    Eina_List *ecs, *l;
    Eina_Bool sent = EINA_FALSE;
+   E_Appinfo *epai = NULL;
 
    lc = wl_resource_get_user_data(res_tws_lc);
    EINA_SAFETY_ON_NULL_RETURN(lc);
@@ -1026,6 +1036,13 @@ _launcher_cb_launch_with_shared_widget(struct wl_client *client EINA_UNUSED,
    lc->serial = serial;
    lc->target.pid = pid;
 
+   if (pid < 0)
+     {
+        epai = e_appinfo_find_with_appid(app_id);
+        lc->target.pid = pid = e_appinfo_pid_get(epai);
+        ELOGF("LAUNCHER_SRV", "Found pid:%d, appid:%s", NULL, pid, app_id);
+     }
+
    if (pid >= 0)
      {
         ecs = _launcher_clients_find_by_pid(pid);