From: Junghoon Park Date: Tue, 19 Apr 2016 08:56:41 +0000 (+0900) Subject: Add aul_set_process_group() X-Git-Tag: accepted/tizen/ivi/20160421.010930^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F17%2F66517%2F1;p=platform%2Fcore%2Fappfw%2Faul-1.git Add aul_set_process_group() - support legacy API Change-Id: I7c89fe07ba04ede3e3ba1a470188c9ad5c7a6d44 Signed-off-by: Junghoon Park --- diff --git a/include/app_signal.h b/include/app_signal.h index 85ea1b1..ea6b794 100644 --- a/include/app_signal.h +++ b/include/app_signal.h @@ -72,7 +72,6 @@ #define RESOURCED_PROC_PRELAUNCH_SIGNAL "ProcPrelaunch" #define RESOURCED_PROC_WATCHDOG_SIGNAL "ProcWatchdog" -#define RESOURCED_PROC_GROUP_SIGNAL "ProcGroup" #define PROC_TYPE_EXCLUDE "exclude" #define PROC_TYPE_INCLUDE "include" diff --git a/include/aul.h b/include/aul.h index 71be8ed..4ff3de3 100644 --- a/include/aul.h +++ b/include/aul.h @@ -191,7 +191,10 @@ typedef enum _aul_type { #define AUL_K_API_VERSION "__AUL_API_VERSION__" /** AUL internal private key */ #define AUL_K_ALLOWED_BG "__AUL_ALLOWED_BG__" - +/** AUL internal private key */ +#define AUL_K_OWNER_PID "__AUL_OWNER_PID__" +/** AUL internal private key */ +#define AUL_K_CHILD_PID "__AUL_CHILD_PID__" /** * @brief This is callback function for aul_launch_init * @param[in] type event's type received from system @@ -1843,6 +1846,11 @@ int aul_add_status_local_cb(int (*func) (int, void *), void *data); int aul_remove_status_local_cb(int (*func) (int, void *), void *data); /* + * This API is only for appfw internally. + */ +int aul_set_process_group(int parent_pid, int child_pid); + +/* * This API is only for Appfw internally. */ int aul_terminate_bgapp_pid(int pid); diff --git a/include/aul_cmd.h b/include/aul_cmd.h index 9d24cb0..76eb469 100644 --- a/include/aul_cmd.h +++ b/include/aul_cmd.h @@ -89,6 +89,7 @@ enum app_cmd { APP_SET_APP_CONTROL_DEFAULT_APP, APP_UNSET_APP_CONTROL_DEFAULT_APP, APP_START_ASYNC, + APP_SET_PROCESS_GROUP, APP_CMD_MAX }; diff --git a/src/status.c b/src/status.c index 30b2a3f..9e570ad 100644 --- a/src/status.c +++ b/src/status.c @@ -15,6 +15,7 @@ */ #define _GNU_SOURCE +#include #include #include @@ -172,3 +173,24 @@ API int aul_running_list_update(char *appid, char *app_path, char *pid) return ret; } +API int aul_set_process_group(int owner_pid, int child_pid) +{ + int ret = -1; + bundle *kb = NULL; + char pid_buf[MAX_PID_STR_BUFSZ] = {0,}; + + kb = bundle_create(); + + if (kb == NULL) + return -1; + + snprintf(pid_buf, MAX_PID_STR_BUFSZ, "%d", owner_pid); + bundle_add(kb, AUL_K_OWNER_PID, pid_buf); + snprintf(pid_buf, MAX_PID_STR_BUFSZ, "%d", child_pid); + bundle_add(kb, AUL_K_CHILD_PID, pid_buf); + ret = app_send_cmd(AUL_UTIL_PID, APP_SET_PROCESS_GROUP, kb); + bundle_free(kb); + + return ret; +} +