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)
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;
}
}
}
-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;
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);
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;
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");