Add API for activate-below 48/62048/9 accepted/tizen/common/20160317.160228 accepted/tizen/ivi/20160318.112604 accepted/tizen/mobile/20160318.111804 accepted/tizen/tv/20160318.112104 accepted/tizen/wearable/20160318.112138 submit/tizen/20160317.004826
authorJunghoon Park <jh9216.park@samsung.com>
Wed, 16 Mar 2016 11:19:57 +0000 (20:19 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Wed, 16 Mar 2016 11:19:57 +0000 (20:19 +0900)
 - API to reorder window stack
 - Requires
   https://review.tizen.org/gerrit/#/c/61893/

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

index ce595da..de0a135 100644 (file)
@@ -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.
  */
index 63ce4ba..48b8b4d 100644 (file)
@@ -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,
index 5c0f10e..dbd5fa9 100755 (executable)
@@ -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
 
index 64a77e7..cfe47b1 100644 (file)
@@ -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;
+}
+
+