"type TEXT NOT NULL, " \
"orientation TEXT NOT NULL, " \
"indicatordisplay TEXT, " \
- "operation TEXT, " \
+ "operation TEXT NOT NULL, " \
"color_depth TEXT NOT NULL DEFAULT '24', " \
- "PRIMARY KEY(app_id, orientation) " \
+ "PRIMARY KEY(app_id, orientation, operation) " \
"FOREIGN KEY(app_id) " \
"REFERENCES package_app_info(app_id) " \
"ON DELETE CASCADE)"
ss = (splashscreen_x *)tmp->data;
sqlite3_snprintf(MAX_QUERY_LEN, query,
"INSERT INTO package_app_splash_screen" \
- "(app_id, src, type, orientation, indicatordisplay, operation, color_depth) " \
+ "(app_id, src, type, orientation, indicatordisplay, " \
+ "operation, color_depth) " \
"VALUES(%Q, %Q, %Q, %Q, %Q, %Q, %Q)",
app->appid, ss->src, ss->type, ss->orientation,
ss->indicatordisplay, ss->operation,
ss->color_depth);
+
ret = __exec_query(query);
if (ret == -1) {
_LOGD("Package UiApp Splash Screen DB Insert Failed");
const char *image_type;
const char *indicatordisplay;
const char *orientation;
- const char *operation = NULL;
+ const char *operation = "launch-effect";
const char *color_depth = "24"; /* default */
for (app_tmp = mfx->application; app_tmp; app_tmp = app_tmp->next) {
if (operation && operation[1] != '\0')
operation++;
else
- operation = NULL;
+ operation = "launch-effect";
} else if (strcasestr(md->key, "launch_effect")) {
- operation = NULL;
+ operation = "launch-effect";
} else {
continue;
}
API int pkgmgr_parser_initialize_db(uid_t uid)
{
int ret = -1;
+ char *db_path;
/*Manifest DB*/
ret = __initialize_db(pkgmgr_parser_db, QUERY_CREATE_TABLE_PACKAGE_INFO);
return ret;
}
- if (0 != __parserdb_change_perm(getUserPkgCertDBPathUID(GLOBAL_USER), GLOBAL_USER))
- _LOGD("Failed to change cert db permission\n");
+ db_path = getUserPkgCertDBPathUID(GLOBAL_USER);
+ if (db_path == NULL) {
+ _LOGD("Failed to get user cert db path - GLOBAL_USER");
+ } else {
+ ret = __parserdb_change_perm(db_path, GLOBAL_USER);
+ if (ret != 0)
+ _LOGD("Failed to change cert db permission");
+ free(db_path);
+ }
- if (0 != __parserdb_change_perm(getUserPkgParserDBPathUID(uid), uid))
- _LOGD("Failed to change parser db permission\n");
+ db_path = getUserPkgParserDBPathUID(uid);
+ if (db_path == NULL) {
+ _LOGD("Failed to get user pkg parser db path - %d", uid);
+ } else {
+ ret = __parserdb_change_perm(db_path, uid);
+ if (ret != 0)
+ _LOGD("Failed to change parser db permission\n");
+ free(db_path);
+ }
return 0;
}
API int pkgmgr_parser_create_and_initialize_db(uid_t uid)
{
int ret;
+ char *db_path;
if (getuid() != OWNER_ROOT) {
_LOGE("Only root user is allowed");
return -1;
}
- if (access(getUserPkgParserDBPathUID(uid), F_OK) != -1) {
+ db_path = getUserPkgParserDBPathUID(uid);
+ if (db_path == NULL) {
+ _LOGE("Failed to get pkg parser db path - %d", uid);
+ return -1;
+ }
+
+ if (access(db_path, F_OK) != -1) {
_LOGE("Manifest db for user %d is already exists", uid);
+ free(db_path);
return -1;
}
+ free(db_path);
- if (access(getUserPkgCertDBPathUID(uid), F_OK) != -1) {
+ db_path = getUserPkgCertDBPathUID(uid);
+ if (db_path == NULL) {
+ _LOGE("Failed to get pkg cert db path - %d", uid);
+ return -1;
+ }
+
+ if (access(db_path, F_OK) != -1) {
_LOGE("Cert db for user %d is already exists", uid);
+ free(db_path);
return -1;
}
+ free(db_path);
ret = pkgmgr_parser_check_and_create_db(uid);
if (ret < 0)
API int pkgmgr_parser_check_and_create_db(uid_t uid)
{
int ret = -1;
+ char *db_path;
+
+ db_path = getUserPkgParserDBPathUID(uid);
+ if (db_path == NULL) {
+ _LOGD("Failed to get pkg parser db path - %d", uid);
+ return -1;
+ }
+
/*Manifest DB*/
- ret = __pkgmgr_parser_create_db(&pkgmgr_parser_db, getUserPkgParserDBPathUID(uid));
+ ret = __pkgmgr_parser_create_db(&pkgmgr_parser_db, db_path);
if (ret) {
_LOGD("Manifest DB creation Failed\n");
+ free(db_path);
+ return -1;
+ }
+ free(db_path);
+
+ db_path = getUserPkgCertDBPathUID(GLOBAL_USER);
+ if (db_path == NULL) {
+ _LOGE("Failed to get pkg cert db path - GLOBAL_USER");
return -1;
}
/*Cert DB*/
- ret = __pkgmgr_parser_create_db(&pkgmgr_cert_db, getUserPkgCertDBPathUID(GLOBAL_USER));
+ ret = __pkgmgr_parser_create_db(&pkgmgr_cert_db, db_path);
if (ret) {
_LOGD("Cert DB creation Failed\n");
+ free(db_path);
return -1;
}
+
+ free(db_path);
+
return 0;
}