Fix syspopup launch API 65/103765/2 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable tizen_3.0.m2 tizen_3.0_tv accepted/tizen/3.0.m2/mobile/20170104.125445 accepted/tizen/3.0.m2/tv/20170104.125647 accepted/tizen/3.0.m2/wearable/20170104.125911 accepted/tizen/3.0/common/20161222.075015 accepted/tizen/3.0/ivi/20161221.103945 accepted/tizen/3.0/mobile/20161221.103654 accepted/tizen/3.0/tv/20161221.103857 accepted/tizen/3.0/wearable/20161221.103926 accepted/tizen/common/20170109.202239 accepted/tizen/ivi/20170105.223144 accepted/tizen/ivi/20170106.050446 accepted/tizen/mobile/20170105.223033 accepted/tizen/mobile/20170106.050352 accepted/tizen/tv/20170105.223103 accepted/tizen/tv/20170106.050412 accepted/tizen/wearable/20170105.223123 accepted/tizen/wearable/20170106.050431 submit/tizen/20170105.005252 submit/tizen/20170105.223144 submit/tizen_3.0.m2/20170104.093750 submit/tizen_3.0/20161221.012134
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 9 Dec 2016 10:24:52 +0000 (19:24 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 13 Dec 2016 08:01:15 +0000 (17:01 +0900)
- Remove using sd-login API
- Use aul_launch_app_async_for_uid instead of aul_launch_app_for_uid
- Requires
https://review.tizen.org/gerrit/#/c/102397/
https://review.tizen.org/gerrit/#/c/102399/

Change-Id: Icf6805b6502097ca32c371fff3c90b6662e15d9f
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
packaging/syspopup.spec
syspopup-caller/CMakeLists.txt
syspopup-caller/syspopup_caller.c

index 9691792..bb52152 100644 (file)
@@ -32,7 +32,6 @@ BuildRequires:  pkgconfig(ecore-x)
 BuildRequires:  pkgconfig(evas)
 BuildRequires:  pkgconfig(elementary)
 BuildRequires:  pkgconfig(libtzplatform-config)
-BuildRequires:  pkgconfig(libsystemd-daemon)
 BuildRequires:  pkgconfig(aul)
 
 %define upgrade_script_path /usr/share/upgrade/scripts
index 3ee1a45..aee2857 100644 (file)
@@ -22,7 +22,7 @@ INCLUDE(FindPkgConfig)
 
 SET(pc_requires "bundle")
 
-pkg_check_modules(spcpkgs REQUIRED dlog bundle sqlite3 glib-2.0 gio-2.0 libtzplatform-config libsystemd-daemon aul)
+pkg_check_modules(spcpkgs REQUIRED dlog bundle sqlite3 glib-2.0 gio-2.0 libtzplatform-config aul)
 
 FOREACH(flag ${spcpkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 2d513a3..663172f 100755 (executable)
@@ -27,7 +27,6 @@
 #include <glib.h>
 #include <gio/gio.h>
 #include <bundle.h>
-#include <systemd/sd-login.h>
 #include <aul.h>
 
 #include "syspopup_core.h"
@@ -42,11 +41,6 @@ API int syspopup_launch_for_uid(char *popup_name, bundle *b, uid_t uid)
        syspopup_info_t *info;
        int ret = -1;
        int is_bundle = 0;
-       int uid_max;
-       int i;
-       char *state = NULL;
-       uid_t *uids = NULL;
-       uid_t cuid = getuid();
 
        if (popup_name == NULL) {
                _E("popup_name is NULL");
@@ -63,67 +57,37 @@ API int syspopup_launch_for_uid(char *popup_name, bundle *b, uid_t uid)
 
        if (b == NULL) {
                b = bundle_create();
+               if (b == NULL) {
+                       _E("out of memory");
+                       _syspopup_info_free(info);
+                       return -1;
+               }
                is_bundle = 1;
        }
 
        if (_syspopup_set_name_to_bundle(b, popup_name) < 0) {
                _E("bundle set error\n");
                _syspopup_info_free(info);
-               if (is_bundle == 1)
+               if (is_bundle)
                        bundle_free(b);
-
                return -1;
        }
 
-       if (cuid >= REGULAR_UID_MIN) {
-               if (cuid != uid) {
-                       _E("Cannot launch syspopup %s in other users",
-                                       popup_name);
-                       ret = -1;
-                       goto end;
-               }
-
-               ret = aul_launch_app_for_uid(info->pkgname, b, uid);
-               if (ret < 0)
-                       _E("syspopup launch error - %d", ret);
-       } else {
-               if (uid >= REGULAR_UID_MIN) {
-                       ret = aul_launch_app_for_uid(info->pkgname, b, uid);
-                       if (ret < 0)
-                               _E("syspopup launch error - %d", ret);
-               } else {
-                       uid_max = sd_get_uids(&uids);
-                       if (uid_max <= 0) {
-                               _E("Failed to get uid list");
-                               ret = -1;
-                               goto end;
-                       }
-
-                       for (i = 0; i < uid_max; i++) {
-                               if (sd_uid_get_state(uids[i], &state) < 0)
-                                       continue;
-
-                               if (state && (!strcmp(state, "online") ||
-                                               !strcmp(state, "opening"))) {
-                                       ret = aul_launch_app_for_uid(
-                                                       info->pkgname,
-                                                       b, uids[i]);
-                                       if (ret < 0) {
-                                               _E("syspopup launch error - %d",
-                                                               ret);
-                                       }
-                               }
-                       }
-               }
+       ret = aul_launch_app_async_for_uid(info->pkgname, b, uid);
+       if (ret < 0) {
+               _E("syspopup launch error - %d", ret);
+               _syspopup_info_free(info);
+               if (is_bundle)
+                       bundle_free(b);
+               return -1;
        }
 
-end:
        if (is_bundle)
                bundle_free(b);
 
        _syspopup_info_free(info);
 
-       return ret > 0 ? 0 : -1;
+       return 0;
 }
 
 API int syspopup_launch(char *popup_name, bundle *b)