From cb5f24a85f73d7858151a5bf0e298ec1f4de010a Mon Sep 17 00:00:00 2001 From: Arkadiusz Szulakiewicz Date: Mon, 29 Feb 2016 12:10:14 +0100 Subject: [PATCH] Add support for watch-application to pkgmgr-parser Change-Id: Ie5f183032d715eb78374e8523ff433a4dfbc9c4f --- include/pkgmgrinfo_type.h | 1 + parser/pkgmgr_parser.c | 10 +++++++++- src/pkgmgrinfo_appinfo.c | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/pkgmgrinfo_type.h b/include/pkgmgrinfo_type.h index 503b26a..433b3c3 100644 --- a/include/pkgmgrinfo_type.h +++ b/include/pkgmgrinfo_type.h @@ -342,6 +342,7 @@ typedef enum { PMINFO_UI_APP, /**< UI Application*/ PMINFO_SVC_APP, /**< Service Application*/ PMINFO_WIDGET_APP, /**< Widget Application*/ + PMINFO_WATCH_APP, /**< Watch Application*/ } pkgmgrinfo_app_component; /** diff --git a/parser/pkgmgr_parser.c b/parser/pkgmgr_parser.c index 7b45023..1faf931 100644 --- a/parser/pkgmgr_parser.c +++ b/parser/pkgmgr_parser.c @@ -1697,7 +1697,7 @@ static int __ps_process_application(xmlTextReaderPtr reader, application_x *appl application->package= strdup(package); /* overwrite some attributes if the app is widgetapp */ - if (type == PMINFO_WIDGET_APP) { + if (type == PMINFO_WIDGET_APP || type == PMINFO_WATCH_APP) { free((void *)application->nodisplay); application->nodisplay = strdup("true"); free((void *)application->multiple); @@ -1878,6 +1878,14 @@ static int __start_process(xmlTextReaderPtr reader, manifest_x * mfx, uid_t uid) } mfx->application = g_list_append(mfx->application, application); ret = __ps_process_application(reader, application, PMINFO_WIDGET_APP, uid); + } else if (!strcmp(ASCII(node), "watch-application")) { + application_x *application = calloc(1, sizeof(application_x)); + if (application == NULL) { + _LOGD("Malloc Failed\n"); + return -1; + } + mfx->application = g_list_append(mfx->application, application); + ret = __ps_process_application(reader, application, PMINFO_WATCH_APP, uid); } else if (!strcmp(ASCII(node), "icon")) { icon_x *icon = calloc(1, sizeof(icon_x)); if (icon == NULL) { diff --git a/src/pkgmgrinfo_appinfo.c b/src/pkgmgrinfo_appinfo.c index 86bab49..15383a0 100644 --- a/src/pkgmgrinfo_appinfo.c +++ b/src/pkgmgrinfo_appinfo.c @@ -1515,6 +1515,8 @@ static pkgmgrinfo_app_component __appcomponent_convert(const char *comp) return PMINFO_SVC_APP; else if (strcasecmp(comp, "widgetapp") == 0) return PMINFO_WIDGET_APP; + else if (strcasecmp(comp, "watchapp") == 0) + return PMINFO_WATCH_APP; else return -1; } -- 2.7.4