- Caller may add extra data about loader name to launch an app.
- If it exist, the loader will be used with first priority.
Change-Id: I195341ab46a6f2610997ff18fada3c3ddc8d2a88
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
#define AUL_K_WAYLAND_WORKING_DIR "__AUL_WAYLAND_WORKING_DIR__"
#define AUL_K_ROOT_PATH "__AUL_ROOT_PATH__"
#define AUL_K_API_VERSION "__AUL_API_VERSION__"
+#define AUL_K_LOADER_NAME "__AUL_LOADER_NAME__"
#ifdef __cplusplus
}
char *comp_type;
char *internal_pool;
char *root_path;
+ char *loader_name;
} appinfo_t;
char *_proc_get_cmdline_bypid(int pid);
GList *_loader_info_load(const char *path);
void _loader_info_dispose(GList *info);
int _loader_info_find_type(GList *info, const char *app_type, bool hwacc);
+int _loader_info_find_type_by_loader_name(GList *info, const char *loader_name);
int *_loader_get_alternative_types(GList *info, int type, int *len);
}
static candidate_process_context_t *__find_available_slot(const char *hwacc,
- const char *app_type)
+ const char *app_type, const char *loader_name)
{
int type;
candidate_process_context_t *cpc;
int len = 0;
int i;
- type = _loader_info_find_type(loader_info_list, app_type, __is_hw_acc(hwacc));
+ if (loader_name)
+ type = _loader_info_find_type_by_loader_name(loader_info_list, loader_name);
+ else
+ type = _loader_info_find_type(loader_info_list, app_type, __is_hw_acc(hwacc));
cpc = __find_slot(type, PAD_LOADER_ID_STATIC);
if (!cpc)
return NULL;
SECURE_LOGD("app_type : %s\n", menu_info->app_type);
SECURE_LOGD("pkg_type : %s\n", menu_info->pkg_type);
-
if (menu_info->comp_type &&
- strcmp(menu_info->comp_type, "svcapp") == 0) {
+ strcmp(menu_info->comp_type, "svcapp") == 0) {
loader_id = PAD_LOADER_ID_DIRECT;
} else if ((loader_id = __get_loader_id(kb)) <= PAD_LOADER_ID_STATIC) {
- cpc = __find_available_slot(menu_info->hwacc, menu_info->app_type);
+ cpc = __find_available_slot(menu_info->hwacc, menu_info->app_type, menu_info->loader_name);
} else {
type = LAUNCHPAD_TYPE_DYNAMIC;
cpc = __find_slot(type, loader_id);
if (ptr)
menu_info->root_path = strdup(ptr);
+ ptr = bundle_get_val(kb, AUL_K_LOADER_NAME);
+ if (ptr)
+ menu_info->loader_name = strdup(ptr);
+
if (!_appinfo_get_app_path(menu_info)) {
_appinfo_free(menu_info);
return NULL;
free(menu_info->internal_pool);
if (menu_info->root_path != NULL)
free(menu_info->root_path);
+ if (menu_info->loader_name != NULL)
+ free(menu_info->loader_name);
free(menu_info);
}
while (token) {
refined_tok[0] = '\0';
sscanf(token, "%s", refined_tok);
- if (refined_tok[0] != '\0')
+ if (refined_tok[0] != '\0' && strcasecmp("null", refined_tok) != 0)
info->app_types = g_list_append(info->app_types, strdup(refined_tok));
token = strtok_r(NULL, "|", &savedptr);
}
static int __comp_str(gconstpointer a, gconstpointer b)
{
+ if (!a || !b)
+ return -1;
return strcmp(a, b);
}
{
GList *cur = NULL;
-
if (hwacc)
cur = g_list_find_custom(info, app_type, __comp_app_type_with_hw_acc);
else
return cur_info->type;
}
+int _loader_info_find_type_by_loader_name(GList *info, const char *loader_name)
+{
+ GList *cur = NULL;
+
+ cur = g_list_find_custom(info, loader_name, __comp_name);
+ if (cur == NULL)
+ return -1;
+
+ loader_info_t *cur_info = (loader_info_t *)cur->data;
+
+ return cur_info->type;
+}
+
static int *__make_type_array(GList *info, GList *loaders, int *len)
{
int l;