__save_xml_attribute(reader, "landscape-effectimage", &application->landscapeimg, NULL);
__save_xml_attribute(reader, "guestmode-visibility", &application->guestmode_visibility, "true");
__save_xml_attribute(reader, "permission-type", &application->permission_type, "normal");
- __save_xml_attribute(reader, "component-type", &application->component_type, type == PMINFO_UI_APP ? "uiapp" : "svcapp");
+ __save_xml_attribute(reader, "component-type", &application->component_type, type == PMINFO_UI_APP ? "uiapp" : type == PMINFO_SVC_APP ? "svcapp" : "widgetapp");
/*component_type has "svcapp" or "uiapp", if it is not, parsing manifest is fail*/
retvm_if(((strcmp(application->component_type, "svcapp") != 0) && (strcmp(application->component_type, "uiapp") != 0) && (strcmp(application->component_type, "widgetapp") != 0)), PM_PARSER_R_ERROR, "invalid component_type[%s]", application->component_type);
__save_xml_attribute(reader, "submode", &application->submode, "false");
__save_xml_attribute(reader, "on-boot", &application->onboot, "false");
application->package= strdup(package);
+ /* overwrite some attributes if the app is widgetapp */
+ if (type == PMINFO_WIDGET_APP) {
+ free((void *)application->nodisplay);
+ application->nodisplay = strdup("true");
+ free((void *)application->multiple);
+ application->multiple = strdup("true");
+ free((void *)application->type);
+ application->type = strdup("capp");
+ free((void *)application->taskmanage);
+ application->taskmanage = strdup("false");
+ free((void *)application->indicatordisplay);
+ application->indicatordisplay = strdup("false");
+ }
depth = xmlTextReaderDepth(reader);
while ((ret = __next_child_element(reader, depth))) {
return -1;
}
mfx->application = g_list_append(mfx->application, application);
- ret = __ps_process_application(reader, application, PMINFO_UI_APP, uid);
+ ret = __ps_process_application(reader, application, PMINFO_WIDGET_APP, uid);
} else if (!strcmp(ASCII(node), "icon")) {
icon_x *icon = calloc(1, sizeof(icon_x));
if (icon == NULL) {
return ret;
}
-#define PRELOAD_PACKAGE_LIST SYSCONFDIR "/package-manager/preload/preload_list.txt"
-static int __add_preload_info(manifest_x * mfx, const char *manifest, uid_t uid)
-{
- FILE *fp = NULL;
- char buffer[1024] = { 0 };
- int state = 0;
-
- if(strstr(manifest, getUserManifestPath(uid))) {
- free((void *)mfx->readonly);
- mfx->readonly = strdup("True");
-
- free((void *)mfx->preload);
- mfx->preload = strdup("True");
-
- free((void *)mfx->removable);
- mfx->removable = strdup("False");
-
- free((void *)mfx->system);
- mfx->system = strdup("True");
-
- return 0;
- }
-
- fp = fopen(PRELOAD_PACKAGE_LIST, "r");
- if (fp == NULL) {
- _LOGE("no preload list\n");
- return -1;
- }
-
- while (fgets(buffer, sizeof(buffer), fp) != NULL) {
- if (buffer[0] == '#') {
- if(strcasestr(buffer, "RW_NORM"))
- state = 2;
- else if(strcasestr(buffer, "RW_RM"))
- state = 3;
- else
- continue;
- }
-
- __str_trim(buffer);
-
- if(!strcmp(mfx->package, buffer)) {
- free((void *)mfx->preload);
- mfx->preload = strdup("True");
- if(state == 2){
- free((void *)mfx->readonly);
- mfx->readonly = strdup("False");
- free((void *)mfx->removable);
- mfx->removable = strdup("False");
- } else if(state == 3){
- free((void *)mfx->readonly);
- mfx->readonly = strdup("False");
- free((void *)mfx->removable);
- mfx->removable = strdup("True");
- }
- }
-
- memset(buffer, 0x00, sizeof(buffer));
- }
-
- if (fp != NULL)
- fclose(fp);
-
- return 0;
-}
-
static int __check_preload_updated(manifest_x * mfx, const char *manifest, uid_t uid)
{
if (!strstr(manifest, getUserManifestPath(uid))) {
return 0;
}
-
-API int pkgmgr_parser_preload_package_type(const char *package)
-{
- FILE *fp = NULL;
- char buffer[1024] = { 0 };
- int state = 0;
- int ret = PM_PRELOAD_NONE;
-
- fp = fopen(PRELOAD_PACKAGE_LIST, "r");
- if (fp == NULL) {
- _LOGE("no preload list\n");
- return -1;
- }
-
- while (fgets(buffer, sizeof(buffer), fp) != NULL) {
- if (buffer[0] == '#') {
- if(strcasestr(buffer, "RW_NORM"))
- state = 2;
- else if(strcasestr(buffer, "RW_RM"))
- state = 3;
- else
- continue;
- }
-
- __str_trim(buffer);
-
- if(!strcmp(package, buffer)) {
- if(state == 2){
- ret = PM_PRELOAD_RW_NORM;
- break;
- } else if(state == 3){
- ret = PM_PRELOAD_RW_RM;
- break;
- }
- }
-
- memset(buffer, 0x00, sizeof(buffer));
- }
-
- if (fp != NULL)
- fclose(fp);
-
- return ret;
-}
-
API int pkgmgr_parser_create_desktop_file(manifest_x *mfx)
{
/* desktop file is no longer used */
retvm_if(ret == PMINFO_R_ERROR, PMINFO_R_ERROR, "DB Insert failed");
_LOGD("DB Insert Success\n");
- __ps_process_tag_parser(mfx, manifest, ACTION_INSTALL);
ret = __ps_process_metadata_parser(mfx, ACTION_INSTALL);
if (ret == -1)
_LOGD("Creating metadata parser failed\n");
retvm_if(ret == PMINFO_R_ERROR, PMINFO_R_ERROR, "DB Insert failed");
_LOGD("DB Insert Success\n");
- __ps_process_tag_parser(mfx, manifest, ACTION_INSTALL);
ret = __ps_process_metadata_parser(mfx, ACTION_INSTALL);
if (ret == -1)
_LOGD("Creating metadata parser failed\n");
retvm_if(manifest == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
_LOGD("pkgmgr_parser_process_manifest_x_for_upgrade parsing manifest for upgradation: %s\n", manifest);
int ret = -1;
- bool preload = false;
bool system = false;
char *csc_path = NULL;
pkgmgrinfo_pkginfo_h handle = NULL;
retvm_if(ret == PMINFO_R_ERROR, PMINFO_R_ERROR, "DB Insert failed");
_LOGD("DB Update Success\n");
- __ps_process_tag_parser(mfx, manifest, ACTION_UPGRADE);
ret = __ps_process_metadata_parser(mfx, ACTION_UPGRADE);
if (ret == -1){
_LOGD("Upgrade metadata parser failed\n");
retvm_if(ret == PMINFO_R_ERROR, PMINFO_R_ERROR, "DB Insert failed");
_LOGD("DB Update Success\n");
- __ps_process_tag_parser(mfx, manifest, ACTION_UPGRADE);
ret = __ps_process_metadata_parser(mfx, ACTION_UPGRADE);
if (ret == -1)
_LOGD("Upgrade metadata parser failed\n");
__ps_process_tag_parser(mfx, manifest, ACTION_UNINSTALL);
- __add_preload_info(mfx, manifest, GLOBAL_USER);
- _LOGD("Added preload infomation\n");
-
ret = __ps_process_metadata_parser(mfx, ACTION_UNINSTALL);
if (ret == -1)
_LOGD("Removing metadata parser failed\n");
int ret = -1;
xmlInitParser();
- __ps_process_tag_parser(mfx, manifest, ACTION_UNINSTALL);
ret = __ps_process_metadata_parser(mfx, ACTION_UNINSTALL);
if (ret == -1)
int ret = -1;
xmlInitParser();
- __ps_process_tag_parser(mfx, manifest, ACTION_UNINSTALL);
-
ret = __ps_process_metadata_parser(mfx, ACTION_UNINSTALL);
if (ret == -1)
_LOGD("Removing metadata parser failed\n");