Remove custom is_group_mode() in amd modules 66/244566/5
authorChanggyu Choi <changyu.choi@samsung.com>
Tue, 22 Sep 2020 02:24:25 +0000 (11:24 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Tue, 22 Sep 2020 02:57:23 +0000 (02:57 +0000)
These are duplicated with amd_launch_mode_is_group_mode()

Change-Id: I04eeecf10f57e9139b80357763625d96502988ae
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/modules/rua/src/amd_rua.c
src/modules/ui-core/src/app_group.c

index 2c5235312cf46043e41c193d744737ae466864b6..7787805e88767e5b864805edac1ca8c8754d7762 100644 (file)
@@ -79,33 +79,6 @@ static struct rua_context_s *__get_context(void)
        return &context;
 }
 
-static bool __is_group_mode(bundle *kb, uid_t uid)
-{
-       const char *str;
-       const char *mode;
-       const char *appid;
-       amd_appinfo_h ai;
-
-       if (kb == NULL)
-               return false;
-
-       appid = bundle_get_val(kb, AUL_K_APPID);
-       if (appid == NULL)
-               return false;
-
-       ai = amd_appinfo_find(uid, appid);
-       mode = amd_appinfo_get_value(ai, AMD_AIT_LAUNCH_MODE);
-       if (mode != NULL && strcmp(mode, "caller") == 0) {
-               str = bundle_get_val(kb, AUL_SVC_K_LAUNCH_MODE);
-               if (str != NULL && strcmp(str, "group") == 0)
-                       return true;
-       } else if (mode != NULL && strcmp(mode, "group") == 0) {
-               return true;
-       }
-
-       return false;
-}
-
 static void __rua_data_remove_comp_id(rua_data_t *rua)
 {
        if (!rua || !rua->comp_id)
@@ -251,7 +224,7 @@ static int __rua_data_add_group_mode(rua_data_t *rua, amd_request_h req,
        bundle *kb = amd_request_get_bundle(req);
        uid_t uid = amd_request_get_target_uid(req);
 
-       rua->is_group_mode = __is_group_mode(kb, uid);
+       rua->is_group_mode = amd_launch_mode_is_group_mode(kb, uid);
 
        return 0;
 }
index b56cefd89c8b20dca7d536b311b99bb32a9a6b8d..8cf85ca2ed679f9aa9ec940786c9223777d4150a 100644 (file)
@@ -1335,59 +1335,6 @@ static void __app_group_context_remove_from_recycle_bin(pid_t pid)
        }
 }
 
-static bool __app_group_is_group_mode(bundle *kb, uid_t uid)
-{
-       const char *str;
-       const char *mode = NULL;
-       const char *appid;
-       const char *comp_type;
-       const char *comp_id;
-       const char *type;
-       amd_appinfo_h ai;
-       amd_compinfo_h ci;
-
-       if (!kb)
-               return false;
-
-       appid = bundle_get_val(kb, AUL_K_APPID);
-       if (!appid)
-               return false;
-
-       ai = amd_appinfo_find(uid, appid);
-       if (!ai)
-               return false;
-
-       comp_type = amd_appinfo_get_value(ai, AMD_AIT_COMPTYPE);
-       if (comp_type && !strcmp(comp_type, APP_TYPE_UI)) {
-               mode = amd_appinfo_get_value(ai, AMD_AIT_LAUNCH_MODE);
-       } else if (comp_type && !strcmp(comp_type, APP_TYPE_COMPONENT_BASED)) {
-               comp_id = bundle_get_val(kb, AUL_K_COMPONENT_ID);
-               if (!comp_id)
-                       return false;
-
-               ci = amd_compinfo_find(uid, comp_id);
-               if (!ci)
-                       return false;
-
-               type = amd_compinfo_get_value(ci, AMD_COMPINFO_TYPE_TYPE);
-               if (!type || strcmp(type, "frame") != 0)
-                       return false;
-
-               mode = amd_compinfo_get_value(ci,
-                               AMD_COMPINFO_TYPE_LAUNCH_MODE);
-       }
-
-       if (mode && !strcmp(mode, "caller")) {
-               str = bundle_get_val(kb, APP_SVC_K_LAUNCH_MODE);
-               if (str && !strcmp(str, "group"))
-                       return true;
-       } else if (mode && !strcmp(mode, "group")) {
-               return true;
-       }
-
-       return false;
-}
-
 void _app_group_get_leader_pids(int *cnt, pid_t **pids)
 {
        app_group_h group;
@@ -1907,7 +1854,7 @@ static int __on_launch_prepare_ui_start(const char *msg, int arg1, int arg2,
        bundle *kb = data;
        int ret;
 
-       if (__app_group_is_group_mode(kb, uid)) {
+       if (amd_launch_mode_is_group_mode(kb, uid)) {
                amd_launch_context_set_pid(h, -1);
                amd_launch_context_set_subapp(h, true);
                amd_launch_context_set_app_status(h, NULL);
@@ -1945,7 +1892,7 @@ static int __on_launch_prepare_component_based_start(const char *msg,
                        status = COMP_STATUS_DESTROYED;
        }
 
-       if (__app_group_is_group_mode(kb, uid)) {
+       if (amd_launch_mode_is_group_mode(kb, uid)) {
                amd_launch_context_set_subapp(h, true);
                amd_launch_context_set_comp_status(h, NULL);
                __launch_context.new_instance = true;
@@ -2326,7 +2273,7 @@ static int __on_launch_app_start_start(const char *msg, int arg1, int arg2,
                return AMD_NOTI_CONTINUE;
 
        uid = amd_request_get_target_uid(req);
-       if (__app_group_is_group_mode(kb, uid)) {
+       if (amd_launch_mode_is_group_mode(kb, uid)) {
                if (!__is_running_instance(kb, uid)) {
                        bundle_del(kb, AUL_K_NEW_INSTANCE);
                        bundle_add(kb, AUL_K_NEW_INSTANCE, "true");