implement app screen reader
[platform/core/appfw/pkgmgr-info.git] / src / pkgmgr-info.c
index 28d9720..b0568ee 100755 (executable)
@@ -175,9 +175,11 @@ typedef struct _pkgmgrinfo_appcontrol_x {
        int operation_count;
        int uri_count;
        int mime_count;
+       int subapp_count;
        char **operation;
        char **uri;
        char **mime;
+       char **subapp;
 } pkgmgrinfo_appcontrol_x;
 
 typedef int (*sqlite_query_callback)(void *data, int ncols, char **coltxt, char **colname);
@@ -366,6 +368,9 @@ static void __get_filter_condition(gpointer data, char **condition)
        case E_PMINFO_APPINFO_PROP_APP_HWACCELERATION:
                snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_hwacceleration='%s'", node->value);
                break;
+       case E_PMINFO_APPINFO_PROP_APP_SCREENREADER:
+               snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_screenreader='%s'", node->value);
+               break;
        case E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION:
                snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_launchcondition IN %s", node->value);
                break;
@@ -593,6 +598,11 @@ static int __uiapp_list_cb(void *data, int ncols, char **coltxt, char **colname)
                                info->manifest_info->uiapplication->hwacceleration = strdup(coltxt[i]);
                        else
                                info->manifest_info->uiapplication->hwacceleration = NULL;
+               } else if (strcmp(colname[i], "app_screenreader") == 0 ){
+                       if (coltxt[i])
+                               info->manifest_info->uiapplication->screenreader = strdup(coltxt[i]);
+                       else
+                               info->manifest_info->uiapplication->screenreader = NULL;
                } else if (strcmp(colname[i], "app_indicatordisplay") == 0 ){
                        if (coltxt[i])
                                info->manifest_info->uiapplication->indicatordisplay = strdup(coltxt[i]);
@@ -657,6 +667,26 @@ static int __uiapp_list_cb(void *data, int ncols, char **coltxt, char **colname)
                                info->manifest_info->uiapplication->permission_type = strdup(coltxt[i]);
                        else
                                info->manifest_info->uiapplication->permission_type = NULL;
+               } else if (strcmp(colname[i], "component_type") == 0 ) {
+                       if (coltxt[i])
+                               info->manifest_info->uiapplication->component_type = strdup(coltxt[i]);
+                       else
+                               info->manifest_info->uiapplication->component_type = NULL;
+               } else if (strcmp(colname[i], "app_preload") == 0 ) {
+                       if (coltxt[i])
+                               info->manifest_info->uiapplication->preload = strdup(coltxt[i]);
+                       else
+                               info->manifest_info->uiapplication->preload = NULL;
+               } else if (strcmp(colname[i], "app_submode") == 0 ) {
+                       if (coltxt[i])
+                               info->manifest_info->uiapplication->submode = strdup(coltxt[i]);
+                       else
+                               info->manifest_info->uiapplication->submode = NULL;
+               } else if (strcmp(colname[i], "app_submode_mainid") == 0 ) {
+                       if (coltxt[i])
+                               info->manifest_info->uiapplication->submode_mainid = strdup(coltxt[i]);
+                       else
+                               info->manifest_info->uiapplication->submode_mainid = NULL;
                } else
                        continue;
        }
@@ -794,6 +824,11 @@ static int __allapp_list_cb(void *data, int ncols, char **coltxt, char **colname
                                                                info->manifest_info->uiapplication->hwacceleration = strdup(coltxt[i]);
                                                        else
                                                                info->manifest_info->uiapplication->hwacceleration = NULL;
+                                               } else if (strcmp(colname[i], "app_screenreader") == 0 ){
+                                                       if (coltxt[i])
+                                                               info->manifest_info->uiapplication->screenreader = strdup(coltxt[i]);
+                                                       else
+                                                               info->manifest_info->uiapplication->screenreader = NULL;
                                                } else if (strcmp(colname[i], "app_indicatordisplay") == 0 ){
                                                        if (coltxt[i])
                                                                info->manifest_info->uiapplication->indicatordisplay = strdup(coltxt[i]);
@@ -1050,6 +1085,11 @@ static int __pkginfo_cb(void *data, int ncols, char **coltxt, char **colname)
                                info->manifest_info->installed_time = strdup(coltxt[i]);
                        else
                                info->manifest_info->installed_time = NULL;
+               } else if (strcmp(colname[i], "installed_storage") == 0 ){
+                       if (coltxt[i])
+                               info->manifest_info->installed_storage = strdup(coltxt[i]);
+                       else
+                               info->manifest_info->installed_storage = NULL;
                } else if (strcmp(colname[i], "mainapp_id") == 0 ){
                        if (coltxt[i])
                                info->manifest_info->mainapp_id = strdup(coltxt[i]);
@@ -1060,6 +1100,11 @@ static int __pkginfo_cb(void *data, int ncols, char **coltxt, char **colname)
                                info->manifest_info->root_path = strdup(coltxt[i]);
                        else
                                info->manifest_info->root_path = NULL;
+               } else if (strcmp(colname[i], "csc_path") == 0 ){
+                       if (coltxt[i])
+                               info->manifest_info->csc_path = strdup(coltxt[i]);
+                       else
+                               info->manifest_info->csc_path = NULL;
                } else if (strcmp(colname[i], "privilege") == 0 ){
                        if (coltxt[i])
                                info->manifest_info->privileges->privilege->text = strdup(coltxt[i]);
@@ -1242,6 +1287,11 @@ static int __mini_appinfo_cb(void *data, int ncols, char **coltxt, char **colnam
                                info->uiapp_info->hwacceleration = strdup(coltxt[i]);
                        else
                                info->uiapp_info->hwacceleration = NULL;
+               } else if (strcmp(colname[i], "app_screenreader") == 0 ) {
+                       if (coltxt[i])
+                               info->uiapp_info->screenreader = strdup(coltxt[i]);
+                       else
+                               info->uiapp_info->screenreader = NULL;
                } else if (strcmp(colname[i], "app_enabled") == 0 ) {
                        if (coltxt[i])
                                info->uiapp_info->enabled= strdup(coltxt[i]);
@@ -1292,6 +1342,26 @@ static int __mini_appinfo_cb(void *data, int ncols, char **coltxt, char **colnam
                                info->uiapp_info->permission_type = strdup(coltxt[i]);
                        else
                                info->uiapp_info->permission_type = NULL;
+               } else if (strcmp(colname[i], "component_type") == 0 ) {
+                       if (coltxt[i])
+                               info->uiapp_info->component_type = strdup(coltxt[i]);
+                       else
+                               info->uiapp_info->component_type = NULL;
+               } else if (strcmp(colname[i], "app_preload") == 0 ) {
+                       if (coltxt[i])
+                               info->uiapp_info->preload = strdup(coltxt[i]);
+                       else
+                               info->uiapp_info->preload = NULL;
+               } else if (strcmp(colname[i], "app_submode") == 0 ) {
+                       if (coltxt[i])
+                               info->uiapp_info->submode = strdup(coltxt[i]);
+                       else
+                               info->uiapp_info->submode = NULL;
+               } else if (strcmp(colname[i], "app_submode_mainid") == 0 ) {
+                       if (coltxt[i])
+                               info->uiapp_info->submode_mainid = strdup(coltxt[i]);
+                       else
+                               info->uiapp_info->submode_mainid = NULL;
                } else
                        continue;
        }
@@ -1382,6 +1452,11 @@ static int __appinfo_cb(void *data, int ncols, char **coltxt, char **colname)
                                        info->uiapp_info->hwacceleration = strdup(coltxt[i]);
                                else
                                        info->uiapp_info->hwacceleration = NULL;
+                       } else if (strcmp(colname[i], "app_screenreader") == 0 ) {
+                               if (coltxt[i])
+                                       info->uiapp_info->screenreader = strdup(coltxt[i]);
+                               else
+                                       info->uiapp_info->screenreader = NULL;
                        } else if (strcmp(colname[i], "app_enabled") == 0 ) {
                                if (coltxt[i])
                                        info->uiapp_info->enabled= strdup(coltxt[i]);
@@ -1466,6 +1541,26 @@ static int __appinfo_cb(void *data, int ncols, char **coltxt, char **colname)
                                        info->uiapp_info->permission_type = strdup(coltxt[i]);
                                else
                                        info->uiapp_info->permission_type = NULL;
+                       } else if (strcmp(colname[i], "component_type") == 0 ) {
+                               if (coltxt[i])
+                                       info->uiapp_info->component_type = strdup(coltxt[i]);
+                               else
+                                       info->uiapp_info->component_type = NULL;
+                       } else if (strcmp(colname[i], "app_preload") == 0 ) {
+                               if (coltxt[i])
+                                       info->uiapp_info->preload = strdup(coltxt[i]);
+                               else
+                                       info->uiapp_info->preload = NULL;
+                       } else if (strcmp(colname[i], "app_submode") == 0 ) {
+                               if (coltxt[i])
+                                       info->uiapp_info->submode = strdup(coltxt[i]);
+                               else
+                                       info->uiapp_info->submode = NULL;
+                       } else if (strcmp(colname[i], "app_submode_mainid") == 0 ) {
+                               if (coltxt[i])
+                                       info->uiapp_info->submode_mainid = strdup(coltxt[i]);
+                               else
+                                       info->uiapp_info->submode_mainid = NULL;
                        } else
                                continue;
                }
@@ -1842,7 +1937,6 @@ static char* __get_app_locale_by_fallback(sqlite3 *db, const char *appid, const
        check_result = __check_app_locale_from_app_localized_info_by_fallback(db, appid, locale);
        if(check_result == 1) {
                   locale_new = __get_app_locale_from_app_localized_info_by_fallback(db, appid, locale);
-                  _LOGD("%s found (%s) language-locale in DB by fallback!\n", appid, locale_new);
                   free(locale);
                   if (locale_new == NULL)
                           locale_new =  strdup(DEFAULT_LOCALE);
@@ -1851,7 +1945,6 @@ static char* __get_app_locale_by_fallback(sqlite3 *db, const char *appid, const
 
        /* default locale */
        free(locale);
-       _LOGD("%s DEFAULT_LOCALE)\n", appid);
        return  strdup(DEFAULT_LOCALE);
 }
 
@@ -2669,55 +2762,16 @@ API int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pk
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
        retvm_if(storage == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
 
-       char *pkgid = NULL;
-       pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
-       if (pkgid == NULL){
-                _LOGE("invalid func parameters\n");
-                return PMINFO_R_ERROR;
-       }
-
-       FILE *fp = NULL;
-       char app_mmc_path[FILENAME_MAX] = { 0, };
-       char app_dir_path[FILENAME_MAX] = { 0, };
-       char app_mmc_internal_path[FILENAME_MAX] = { 0, };
-       snprintf(app_dir_path, FILENAME_MAX,
-       "%s%s", PKG_INSTALLATION_PATH, pkgid);
-       snprintf(app_mmc_path, FILENAME_MAX,
-       "%s%s", PKG_SD_PATH, pkgid);
-       snprintf(app_mmc_internal_path, FILENAME_MAX,
-       "%s%s/.mmc", PKG_INSTALLATION_PATH, pkgid);
+       pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
 
-       /*check whether application is in external memory or not */
-       fp = fopen(app_mmc_path, "r");
-       if (fp == NULL) {
-               _LOGE(" app path in external memory not accesible\n");
-       } else {
-               fclose(fp);
-               fp = NULL;
-               *storage = PMINFO_EXTERNAL_STORAGE;
-               return PMINFO_R_OK;
-       }
+        if (strcmp(info->manifest_info->installed_storage,"installed_internal") == 0)
+               *storage = PMINFO_INTERNAL_STORAGE;
+        else if (strcmp(info->manifest_info->installed_storage,"installed_external") == 0)
+                *storage = PMINFO_EXTERNAL_STORAGE;
+        else
+                return PMINFO_R_ERROR;
 
-       /*check whether application is in internal or not */
-       fp = fopen(app_dir_path, "r");
-       if (fp == NULL) {
-               _LOGE(" app path in internal memory not accesible\n");
-               *storage = -1;
-               return PMINFO_R_ERROR;
-       } else {
-               fclose(fp);
-               /*check whether the application is installed in SD card
-                       but SD card is not present*/
-               fp = fopen(app_mmc_internal_path, "r");
-               if (fp == NULL) {
-                       *storage = PMINFO_INTERNAL_STORAGE;
-                       return PMINFO_R_OK;
-               } else {
-                       fclose(fp);
-                       *storage = PMINFO_EXTERNAL_STORAGE;
-                       return PMINFO_R_OK;
-               }
-       }
+       return PMINFO_R_OK;
 }
 
 API int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
@@ -2880,6 +2934,19 @@ API int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **pat
        return PMINFO_R_OK;
 }
 
+API int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
+       retvm_if(path == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
+
+       pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
+       if (info->manifest_info->csc_path)
+               *path = (char *)info->manifest_info->csc_path;
+       else
+               *path = (char *)info->manifest_info->csc_path;
+
+       return PMINFO_R_OK;
+}
 
 API int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
 {
@@ -3093,6 +3160,8 @@ API int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *acce
 {
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
        retvm_if(accessible == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
+
+#if 0 //smack issue occured, check later
        char *pkgid = NULL;
        pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
        if (pkgid == NULL){
@@ -3145,6 +3214,9 @@ API int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *acce
        }
 
        _LOGD("pkgmgr_get_pkg_external_validation() end\n");
+#endif
+
+       *accessible = 1;
        return PMINFO_R_OK;
 }
 
@@ -3205,6 +3277,25 @@ API int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload
        return PMINFO_R_OK;
 }
 
+API int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
+       retvm_if(system == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
+
+       char *preload = NULL;
+       char *removable = NULL;
+       pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
+       preload = (char *)info->manifest_info->preload;
+       removable = (char *)info->manifest_info->removable;
+
+       if ((strcasecmp(preload, "true") == 0) && (strcasecmp(removable, "false") == 0))
+               *system = 1;
+       else
+               *system = 0;
+
+       return PMINFO_R_OK;
+}
+
 API int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
 {
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
@@ -3669,9 +3760,11 @@ API int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
        pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
        ptr = info->manifest_info->privileges->privilege;
        for (; ptr; ptr = ptr->next) {
-               ret = privilege_func(ptr->text, user_data);
-               if (ret < 0)
-                       break;
+               if (ptr->text){
+                       ret = privilege_func(ptr->text, user_data);
+                       if (ret < 0)
+                               break;
+               }
        }
        return PMINFO_R_OK;
 }
@@ -4664,6 +4757,18 @@ API int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h  handle,
        return PMINFO_R_OK;
 }
 
+API int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h  handle,
+                                       int *subapp_count, char ***subapp)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
+       retvm_if(subapp == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+       retvm_if(subapp_count == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+       pkgmgrinfo_appcontrol_x *data = (pkgmgrinfo_appcontrol_x *)handle;
+       *subapp_count = data->subapp_count;
+       *subapp = data->subapp;
+       return PMINFO_R_OK;
+}
+
 API int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h  handle, char **icon)
 {
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL\n");
@@ -4782,6 +4887,79 @@ API int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h  handle, pkg
        return PMINFO_R_OK;
 }
 
+API int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h  handle, char **component_type)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
+       retvm_if(component_type == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+
+       *component_type = (char *)info->uiapp_info->component_type;
+
+       return PMINFO_R_OK;
+}
+
+API int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
+       retvm_if(hwacceleration == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+       char *val = NULL;
+       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+       val = (char *)info->uiapp_info->hwacceleration;
+       if (val) {
+               if (strcasecmp(val, "not-use-GL") == 0)
+                       *hwacceleration = PMINFO_HWACCELERATION_NOT_USE_GL;
+               else if (strcasecmp(val, "use-GL") == 0)
+                       *hwacceleration = PMINFO_HWACCELERATION_USE_GL;
+               else
+                       *hwacceleration = PMINFO_HWACCELERATION_USE_SYSTEM_SETTING;
+       }
+       return PMINFO_R_OK;
+}
+
+API int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_screenreader *screenreader)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
+       retvm_if(screenreader == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+       char *val = NULL;
+       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+       val = (char *)info->uiapp_info->screenreader;
+       if (val) {
+               if (strcasecmp(val, "screenreader-off") == 0)
+                       *screenreader = PMINFO_SCREENREADER_OFF;
+               else if (strcasecmp(val, "screenreader-on") == 0)
+                       *screenreader = PMINFO_SCREENREADER_ON;
+               else
+                       *screenreader = PMINFO_SCREENREADER_USE_SYSTEM_SETTING;
+       }
+       return PMINFO_R_OK;
+}
+
+API int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
+       retvm_if(portrait_img == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+       retvm_if(landscape_img == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+
+       if (info->app_component == PMINFO_UI_APP){
+               *portrait_img = (char *)info->uiapp_info->portraitimg;
+               *landscape_img = (char *)info->uiapp_info->landscapeimg;
+       }
+
+       return PMINFO_R_OK;
+}
+
+API int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h  handle, char **submode_mainid)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
+       retvm_if(submode_mainid == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+
+       *submode_mainid = (char *)info->uiapp_info->submode_mainid;
+
+       return PMINFO_R_OK;
+}
+
 API int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
                        pkgmgrinfo_app_permission_list_cb permission_func, void *user_data)
 {
@@ -4841,9 +5019,11 @@ API int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
        else
                return PMINFO_R_EINVAL;
        for (; ptr; ptr = ptr->next) {
-               ret = metadata_func(ptr->key, ptr->value, user_data);
-               if (ret < 0)
-                       break;
+               if (ptr->key) {
+                       ret = metadata_func(ptr->key, ptr->value, user_data);
+                       if (ret < 0)
+                               break;
+               }
        }
        return PMINFO_R_OK;
 }
@@ -4858,16 +5038,19 @@ API int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
        int oc = 0;
        int mc = 0;
        int uc = 0;
+       int sc = 0;
        char *pkgid = NULL;
        char *manifest = NULL;
        char **operation = NULL;
        char **uri = NULL;
        char **mime = NULL;
+       char **subapp = NULL;
        appcontrol_x *appcontrol = NULL;
        manifest_x *mfx = NULL;
        operation_x *op = NULL;
        uri_x *ui = NULL;
        mime_x *mi = NULL;
+       subapp_x *sa = NULL;
        pkgmgrinfo_app_component component;
        pkgmgrinfo_appcontrol_x *ptr = NULL;
        ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
@@ -4903,15 +5086,15 @@ API int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
        switch (component) {
        case PMINFO_UI_APP:
                if (mfx->uiapplication) {
-                       if (mfx->uiapplication->appcontrol) {
-                               appcontrol = mfx->uiapplication->appcontrol;
+                       if (mfx->uiapplication->appsvc) {
+                               appcontrol = mfx->uiapplication->appsvc;
                        }
                }
                break;
        case PMINFO_SVC_APP:
                if (mfx->serviceapplication) {
-                       if (mfx->serviceapplication->appcontrol) {
-                               appcontrol = mfx->serviceapplication->appcontrol;
+                       if (mfx->serviceapplication->appsvc) {
+                               appcontrol = mfx->serviceapplication->appsvc;
                        }
                }
                break;
@@ -4934,6 +5117,11 @@ API int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
                        mc = mc + 1;
                mi = appcontrol->mime;
 
+               sa = appcontrol->subapp;
+               for (; sa; sa = sa->next)
+                       sc = sc + 1;
+               sa = appcontrol->subapp;
+
                operation = (char **)calloc(oc, sizeof(char *));
                for (i = 0; i < oc; i++) {
                        operation[i] = strndup(op->name, PKG_STRING_LEN_MAX - 1);
@@ -4951,13 +5139,23 @@ API int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
                        mime[i] = strndup(mi->name, PKG_STRING_LEN_MAX - 1);
                        mi = mi->next;
                }
+
+               subapp = (char **)calloc(sc, sizeof(char *));
+               for (i = 0; i < sc; i++) {
+                       subapp[i] = strndup(sa->name, PKG_STRING_LEN_MAX - 1);
+                       sa = sa->next;
+               }
+
                /*populate appcontrol handle*/
                ptr->operation_count = oc;
                ptr->uri_count = uc;
                ptr->mime_count = mc;
+               ptr->subapp_count = sc;
                ptr->operation = operation;
                ptr->uri = uri;
                ptr->mime = mime;
+               ptr->subapp = subapp;
+
                ret = appcontrol_func((void *)ptr, user_data);
                for (i = 0; i < oc; i++) {
                        if (operation[i]) {
@@ -4989,11 +5187,22 @@ API int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
                        free(mime);
                        mime = NULL;
                }
+               for (i = 0; i < sc; i++) {
+                       if (subapp[i]) {
+                               free(subapp[i]);
+                               subapp[i] = NULL;
+                       }
+               }
+               if (subapp) {
+                       free(subapp);
+                       subapp = NULL;
+               }
                if (ret < 0)
                        break;
                uc = 0;
                mc = 0;
                oc = 0;
+               sc = 0;
        }
        pkgmgr_parser_free_manifest_xml(mfx);
        if (ptr) {
@@ -5058,22 +5267,6 @@ API int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h han
        return PMINFO_R_OK;
 }
 
-
-API int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img)
-{
-       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
-       retvm_if(portrait_img == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
-       retvm_if(landscape_img == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
-       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
-
-       if (info->app_component == PMINFO_UI_APP){
-               *portrait_img = (char *)info->uiapp_info->portraitimg;
-               *landscape_img = (char *)info->uiapp_info->landscapeimg;
-       }
-
-       return PMINFO_R_OK;
-}
-
 API int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h  handle, bool *taskmanage)
 {
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
@@ -5119,24 +5312,6 @@ API int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h  handle, bool *enable
 
 }
 
-API int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
-{
-       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
-       retvm_if(hwacceleration == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
-       char *val = NULL;
-       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
-       val = (char *)info->uiapp_info->hwacceleration;
-       if (val) {
-               if (strcasecmp(val, "not-use-GL") == 0)
-                       *hwacceleration = PMINFO_HWACCELERATION_NOT_USE_GL;
-               else if (strcasecmp(val, "use-GL") == 0)
-                       *hwacceleration = PMINFO_HWACCELERATION_USE_GL;
-               else
-                       *hwacceleration = PMINFO_HWACCELERATION_USE_SYSTEM_SETTING;
-       }
-       return PMINFO_R_OK;
-}
-
 API int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h  handle, bool *onboot)
 {
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
@@ -5191,6 +5366,42 @@ API int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainap
        return PMINFO_R_OK;
 }
 
+API int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL\n");
+       retvm_if(preload == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
+       char *val = NULL;
+       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+       val = (char *)info->uiapp_info->preload;
+       if (val) {
+               if (strcasecmp(val, "true") == 0)
+                       *preload = 1;
+               else if (strcasecmp(val, "false") == 0)
+                       *preload = 0;
+               else
+                       *preload = 0;
+       }
+       return PMINFO_R_OK;
+}
+
+API int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL\n");
+       retvm_if(submode == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
+       char *val = NULL;
+       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+       val = (char *)info->uiapp_info->submode;
+       if (val) {
+               if (strcasecmp(val, "true") == 0)
+                       *submode = 1;
+               else if (strcasecmp(val, "false") == 0)
+                       *submode = 0;
+               else
+                       *submode = 0;
+       }
+       return PMINFO_R_OK;
+}
+
 API int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h  handle)
 {
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");