Add support for watch-application to pkgmgr-parser 30/60630/3
authorArkadiusz Szulakiewicz <a.szulakiewi@partner.samsung.com>
Mon, 29 Feb 2016 11:10:14 +0000 (12:10 +0100)
committerArkadiusz Szulakiewicz <a.szulakiewi@partner.samsung.com>
Mon, 29 Feb 2016 12:27:47 +0000 (13:27 +0100)
Change-Id: Ie5f183032d715eb78374e8523ff433a4dfbc9c4f

include/pkgmgrinfo_type.h
parser/pkgmgr_parser.c
src/pkgmgrinfo_appinfo.c

index 503b26a..433b3c3 100644 (file)
@@ -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;
 
 /**
index 7b45023..1faf931 100644 (file)
@@ -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) {
index 86bab49..15383a0 100644 (file)
@@ -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;
 }