"type text not null, " \
"orientation text not null, " \
"indicatordisplay text, " \
- "PRIMARY KEY(app_id, orientation) " \
+ "operation text, " \
+ "PRIMARY KEY(app_id, orientation, operation) " \
"FOREIGN KEY(app_id) " \
"REFERENCES package_app_info(app_id) " \
"ON DELETE CASCADE)"
const char *orientation = (const char *)b;
int dpi = -1;
+ if (ss->operation || ss->dpi == NULL)
+ return -1;
+
system_info_get_platform_int("http://tizen.org/feature/screen.dpi", &dpi);
if (!dpi)
return -1;
splashscreen_x *ss = (splashscreen_x *)a;
const char *orientation = (const char *)b;
- if (strcasecmp(ss->orientation, orientation) == 0 && (ss->dpi == NULL))
+ if (ss->operation || ss->dpi)
+ return -1;
+
+ if (strcasecmp(ss->orientation, orientation) == 0)
return 0;
return -1;
}
-static splashscreen_x *__find_splashscreen(GList *splashscreens, const char *orientation)
+static splashscreen_x *__find_default_splashscreen(GList *splashscreens,
+ const char *orientation)
{
GList *tmp;
return NULL;
}
+static void __find_appcontrol_splashscreen_with_dpi(gpointer data, gpointer user_data)
+{
+ splashscreen_x *ss = (splashscreen_x *)data;
+ GList **list = (GList **)user_data;
+ int dpi = -1;
+
+ if (ss->operation == NULL || ss->dpi == NULL)
+ return;
+
+ system_info_get_platform_int("http://tizen.org/feature/screen.dpi", &dpi);
+ if (!dpi)
+ return;
+
+ if (__check_dpi(ss->dpi, dpi) != 0)
+ return;
+
+ *list = g_list_append(*list, ss);
+}
+
+static void __find_appcontrol_splashscreen(gpointer data, gpointer user_data)
+{
+ splashscreen_x *ss = (splashscreen_x *)data;
+ GList **list = (GList **)user_data;
+ splashscreen_x *ss_tmp;
+ GList *tmp;
+
+ if (ss->operation == NULL || ss->dpi)
+ return;
+
+ for (tmp = *list; tmp; tmp = tmp->next) {
+ ss_tmp = (splashscreen_x *)tmp->data;
+ if (ss_tmp->operation
+ && strcmp(ss_tmp->operation, ss->operation) == 0
+ && strcmp(ss_tmp->orientation, ss->orientation) == 0)
+ return;
+ }
+
+ *list = g_list_append(*list, ss);
+}
+
+static GList *__find_splashscreens(GList *splashscreens)
+{
+ GList *list = NULL;
+ splashscreen_x *ss;
+
+ g_list_foreach(splashscreens,
+ __find_appcontrol_splashscreen_with_dpi, &list);
+ g_list_foreach(splashscreens,
+ __find_appcontrol_splashscreen, &list);
+
+ ss = __find_default_splashscreen(splashscreens, "portrait");
+ if (ss)
+ list = g_list_append(list, ss);
+ ss = __find_default_splashscreen(splashscreens, "landscape");
+ if (ss)
+ list = g_list_append(list, ss);
+
+ return list;
+}
+
static int __insert_application_splashscreen_info(manifest_x *mfx)
{
GList *app_tmp;
application_x *app;
+ GList *ss_tmp;
splashscreen_x *ss;
+ GList *tmp;
int ret = -1;
char query[MAX_QUERY_LEN];
if (app == NULL || app->splashscreens == NULL)
continue;
- ss = __find_splashscreen(app->splashscreens, "portrait");
- if (ss) {
- snprintf(query, sizeof(query),
- "insert into package_app_splash_screen" \
- "(app_id, src, type, orientation, indicatordisplay) " \
- "values('%s', '%s', '%s', '%s', '%s')",
- app->appid, ss->src, ss->type, ss->orientation,
- ss->indicatordisplay);
- ret = __exec_query(query);
- if (ret == -1) {
- _LOGD("Package UiApp Splash Screen DB Insert Failed");
- return -1;
- }
- memset(query, '\0', MAX_QUERY_LEN);
- }
- ss = __find_splashscreen(app->splashscreens, "landscape");
- if (ss) {
+ ss_tmp = __find_splashscreens(app->splashscreens);
+ if (ss_tmp == NULL)
+ continue;
+
+ for (tmp = ss_tmp; tmp; tmp = tmp->next) {
+ ss = (splashscreen_x *)tmp->data;
snprintf(query, sizeof(query),
"insert into package_app_splash_screen" \
- "(app_id, src, type, orientation, indicatordisplay) " \
- "values('%s', '%s', '%s', '%s', '%s')",
+ "(app_id, src, type, orientation, indicatordisplay, operation) " \
+ "values('%s', '%s', '%s', '%s', '%s', '%s')",
app->appid, ss->src, ss->type, ss->orientation,
- ss->indicatordisplay);
+ ss->indicatordisplay, __get_str(ss->operation));
ret = __exec_query(query);
if (ret == -1) {
_LOGD("Package UiApp Splash Screen DB Insert Failed");
}
memset(query, '\0', MAX_QUERY_LEN);
}
+ g_list_free(ss_tmp);
}
return 0;
}
const char *image_type;
const char *indicatordisplay;
const char *orientation;
+ const char *operation = NULL;
for (app_tmp = mfx->application; app_tmp; app_tmp = app_tmp->next) {
app = (application_x *)app_tmp->data;
orientation = "portrait";
snprintf(query, sizeof(query),
"insert into package_app_splash_screen" \
- "(app_id, src, type, orientation, indicatordisplay) " \
- "values('%s', '%s', '%s', '%s', '%s')",
+ "(app_id, src, type, orientation, indicatordisplay, operation) " \
+ "values('%s', '%s', '%s', '%s', '%s', '%s')",
app->appid, app->portraitimg, image_type,
- orientation, indicatordisplay);
+ orientation, indicatordisplay, __get_str(operation));
ret = __exec_query(query);
if (ret == -1) {
_LOGD("Package UiApp Splash Screen DB Insert Failed");
orientation = "landscape";
snprintf(query, sizeof(query),
"insert into package_app_splash_screen" \
- "(app_id, src, type, orientation, indicatordisplay) " \
- "values('%s', '%s', '%s', '%s', '%s')",
+ "(app_id, src, type, orientation, indicatordisplay, operation) " \
+ "values('%s', '%s', '%s', '%s', '%s', '%s')",
app->appid, app->landscapeimg, image_type,
- orientation, indicatordisplay);
+ orientation, indicatordisplay, __get_str(operation));
ret = __exec_query(query);
if (ret == -1) {
_LOGD("Package UiApp Splash Screen DB Insert Failed");