Add aul_set_process_group() 17/66517/1 accepted/tizen/ivi/20160421.010930 accepted/tizen/mobile/20160421.011003 accepted/tizen/tv/20160421.010943 accepted/tizen/wearable/20160421.010952 submit/tizen/20160420.065042 submit/tizen/20160422.084813
authorJunghoon Park <jh9216.park@samsung.com>
Tue, 19 Apr 2016 08:56:41 +0000 (17:56 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Tue, 19 Apr 2016 08:56:41 +0000 (17:56 +0900)
- support legacy API

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

index 85ea1b1..ea6b794 100644 (file)
@@ -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"
index 71be8ed..4ff3de3 100644 (file)
@@ -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);
index 9d24cb0..76eb469 100644 (file)
@@ -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
 };
 
index 30b2a3f..9e570ad 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #define _GNU_SOURCE
+#include <stdio.h>
 #include <stdlib.h>
 
 #include <aul.h>
@@ -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;
+}
+