Add APIs for terminating apps 26/80426/5 accepted/tizen/common/20160803.193208 accepted/tizen/ivi/20160804.080800 accepted/tizen/mobile/20160804.080850 accepted/tizen/tv/20160804.080716 accepted/tizen/wearable/20160804.080542 submit/tizen/20160803.012753
authorJunghoon Park <jh9216.park@samsung.com>
Fri, 22 Jul 2016 01:49:18 +0000 (10:49 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Tue, 2 Aug 2016 08:00:03 +0000 (01:00 -0700)
- add aul_terminate_pid_sync_without_restart()
- add aul_terminate_pid_sync_without_restart_for_uid()

Change-Id: I81f171a13c40e58319196b8cd01eaab27a0c4556
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
include/aul.h
include/aul_cmd.h
src/launch.c

index 50ac929..fb60307 100644 (file)
@@ -2017,6 +2017,16 @@ int aul_terminate_pid_without_restart(int pid);
 /*
  * This API is only for Appfw internally.
  */
+int aul_terminate_pid_sync_without_restart(int pid);
+
+/*
+ * This API is only for Appfw internally.
+ */
+int aul_terminate_pid_sync_without_restart_for_uid(int pid, uid_t uid);
+
+/*
+ * This API is only for Appfw internally.
+ */
 const char *aul_get_app_external_root_path(void);
 
 /*
index ce2ee7b..e566ddf 100644 (file)
@@ -106,6 +106,7 @@ enum app_cmd {
        APP_TERM_BY_PID_SYNC,
        APP_GET_STATUS_BY_APPID,
        APP_GET_LAST_CALLER_PID,
+       APP_TERM_BY_PID_SYNC_WITHOUT_RESTART,
        APP_CMD_MAX
 };
 
index 72d8a9d..83bb5f2 100644 (file)
@@ -729,6 +729,25 @@ API int aul_terminate_pid_without_restart(int pid)
        return ret;
 }
 
+API int aul_terminate_pid_sync_without_restart(int pid)
+{
+       return aul_terminate_pid_sync_without_restart_for_uid(pid, getuid());
+}
+
+API int aul_terminate_pid_sync_without_restart_for_uid(int pid, uid_t uid)
+{
+       char pid_str[MAX_PID_STR_BUFSZ];
+       int ret;
+
+       if (pid <= 0)
+               return AUL_R_EINVAL;
+
+       snprintf(pid_str, sizeof(pid_str), "%d", pid);
+       ret = app_request_to_launchpad_for_uid(APP_TERM_BY_PID_SYNC_WITHOUT_RESTART,
+                       pid_str, NULL, uid);
+       return ret;
+}
+
 API int aul_terminate_pid_async(int pid)
 {
        return aul_terminate_pid_async_for_uid(pid, getuid());