From a11044077a426e9b0b200429c67135de1e57ff1b Mon Sep 17 00:00:00 2001 From: Junghoon Park Date: Wed, 16 Mar 2016 20:19:57 +0900 Subject: [PATCH] Add API for activate-below - API to reorder window stack - Requires https://review.tizen.org/gerrit/#/c/61893/ Change-Id: Iae4c4737e93646515615fea51358d5e6acd023cd Signed-off-by: Junghoon Park --- include/aul.h | 41 ++++++++++++++++------------------------- include/aul_cmd.h | 1 + include/aul_svc.h | 1 + src/app_group.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+), 25 deletions(-) diff --git a/include/aul.h b/include/aul.h index ce595da..de0a135 100644 --- a/include/aul.h +++ b/include/aul.h @@ -2142,31 +2142,6 @@ int aul_running_list_update(char *appid, char *app_path, char *pid); /* * This API is only for Appfw internally. */ -void aul_app_group_add(int leader_pid, int pid, int wid); - -/* - * This API is only for Appfw internally. - */ -void aul_app_group_remove(int pid); - -/* - * This API is only for Appfw internally. - */ -void aul_app_group_attach_window(int parent_wid, int child_wid); - -/* - * This API is only for Appfw internally. - */ -void aul_app_group_detach_window(int child_wid); - -/* - * This API is only for Appfw internally. - */ -int aul_app_group_get_window(int pid); - -/* - * This API is only for Appfw internally. - */ int aul_app_group_get_window(int pid); /* @@ -2214,6 +2189,22 @@ void aul_app_group_lower(int *exit); */ void aul_app_group_get_idle_pids(int *cnt, int **pids); +/** + * @par Description: + * This API puts some app below the caller app + * @par Purpose: + * This API's purpose is to reorder window stack limitedly. + * + * @param[in] below_appid The appid to be reordered below the caller app + * @return Loader ID if success, negative value(<0) if fail + * + * @remark + * The caller app should be resumed before calling this API. + * below_appid should be main app which have been launched before. + * This API is only available in User Session. +*/ +int aul_app_group_activate_below(const char *below_appid); + /* * This API is only for Appfw internally. */ diff --git a/include/aul_cmd.h b/include/aul_cmd.h index 63ce4ba..48b8b4d 100644 --- a/include/aul_cmd.h +++ b/include/aul_cmd.h @@ -56,6 +56,7 @@ enum app_cmd { APP_GROUP_GET_IDLE_PIDS, APP_GROUP_LOWER, APP_GROUP_CLEAR_TOP, + APP_GROUP_ACTIVATE_BELOW, APP_GET_STATUS, APP_ADD_LOADER, APP_REMOVE_LOADER, diff --git a/include/aul_svc.h b/include/aul_svc.h index 5c0f10e..dbd5fa9 100755 --- a/include/aul_svc.h +++ b/include/aul_svc.h @@ -109,6 +109,7 @@ extern "C" { #define AUL_SVC_K_REROUTE "__K_REROUTE__" #define AUL_SVC_K_SHIFT_WINDOW "__K_SHIFT_WINDOW" #define AUL_SVC_K_RECYCLE "__K_RECYCLE" +#define AUL_SVC_K_RELOCATE_BELOW "__K_RELOCATE_BELOW" #define PAD_LOADER_ID_DIRECT 1 diff --git a/src/app_group.c b/src/app_group.c index 64a77e7..cfe47b1 100644 --- a/src/app_group.c +++ b/src/app_group.c @@ -35,6 +35,11 @@ API int aul_app_group_get_window(int pid) char buf[128]; b = bundle_create(); + if (b == NULL) { + _E("out of memory"); + return -1; + } + snprintf(buf, 128, "%d", pid); bundle_add_str(b, AUL_K_PID, buf); ret = app_send_cmd(AUL_UTIL_PID, APP_GROUP_GET_WINDOW, b); @@ -50,6 +55,12 @@ API int aul_app_group_set_window(int wid) char buf[128]; b = bundle_create(); + + if (b == NULL) { + _E("out of memory"); + return -1; + } + snprintf(buf, 128, "%d", wid); bundle_add_str(b, AUL_K_WID, buf); ret = app_send_cmd(AUL_UTIL_PID, APP_GROUP_SET_WINDOW, b); @@ -153,6 +164,12 @@ API int aul_app_group_get_leader_pid(int pid) char buf[128]; b = bundle_create(); + + if (b == NULL) { + _E("out of memory"); + return -1; + } + snprintf(buf, 128, "%d", pid); bundle_add_str(b, AUL_K_PID, buf); ret = app_send_cmd(AUL_UTIL_PID, APP_GROUP_GET_LEADER_PID, b); @@ -196,6 +213,12 @@ API int aul_app_group_get_fg_flag(int pid) char buf[128]; b = bundle_create(); + + if (b == NULL) { + _E("out of memory"); + return -1; + } + snprintf(buf, 128, "%d", pid); bundle_add_str(b, AUL_K_PID, buf); ret = app_send_cmd(AUL_UTIL_PID, APP_GROUP_GET_FG, b); @@ -249,3 +272,26 @@ API void aul_app_group_get_idle_pids(int *cnt, int **pids) free(pkt); } +API int aul_app_group_activate_below(const char *below_appid) +{ + int ret; + bundle *b; + + if (below_appid == NULL) + return -1; + + b = bundle_create(); + + if (b == NULL) { + _E("out of memory"); + return -1; + } + + bundle_add_str(b, AUL_K_APPID, below_appid); + ret = app_send_cmd(AUL_UTIL_PID, APP_GROUP_ACTIVATE_BELOW, b); + bundle_free(b); + + return ret; +} + + -- 2.7.4