};
static struct _pkginfo_str_map_t pkginfo_str_prop_map[] = {
- {E_PMINFO_PKGINFO_PROP_PACKAGE_ID, PMINFO_PKGINFO_PROP_PACKAGE_ID},
- {E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE, PMINFO_PKGINFO_PROP_PACKAGE_TYPE},
- {E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION, PMINFO_PKGINFO_PROP_PACKAGE_VERSION},
- {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION,PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION},
- {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE,PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE},
- {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME},
- {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL},
- {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF},
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_ID, PMINFO_PKGINFO_PROP_PACKAGE_ID},
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE, PMINFO_PKGINFO_PROP_PACKAGE_TYPE},
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION, PMINFO_PKGINFO_PROP_PACKAGE_VERSION},
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION, PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION},
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE, PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE},
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME},
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL},
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF},
{E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE, PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE}
};
{E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE, PMINFO_PKGINFO_PROP_PACKAGE_UPDATE},
{E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING, PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING},
{E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING, PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING},
- {E_PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE, PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE}
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE, PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE},
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_DISABLE, PMINFO_PKGINFO_PROP_PACKAGE_DISABLE}
};
struct _appinfo_str_map_t {
static struct _appinfo_str_map_t appinfo_str_prop_map[] = {
{E_PMINFO_APPINFO_PROP_APP_ID, PMINFO_APPINFO_PROP_APP_ID},
{E_PMINFO_APPINFO_PROP_APP_COMPONENT, PMINFO_APPINFO_PROP_APP_COMPONENT},
- {E_PMINFO_APPINFO_PROP_APP_EXEC, PMINFO_APPINFO_PROP_APP_EXEC},
- {E_PMINFO_APPINFO_PROP_APP_ICON, PMINFO_APPINFO_PROP_APP_ICON},
- {E_PMINFO_APPINFO_PROP_APP_TYPE, PMINFO_APPINFO_PROP_APP_TYPE},
- {E_PMINFO_APPINFO_PROP_APP_OPERATION, PMINFO_APPINFO_PROP_APP_OPERATION},
- {E_PMINFO_APPINFO_PROP_APP_URI, PMINFO_APPINFO_PROP_APP_URI},
- {E_PMINFO_APPINFO_PROP_APP_MIME, PMINFO_APPINFO_PROP_APP_MIME},
- {E_PMINFO_APPINFO_PROP_APP_CATEGORY, PMINFO_APPINFO_PROP_APP_CATEGORY},
+ {E_PMINFO_APPINFO_PROP_APP_EXEC, PMINFO_APPINFO_PROP_APP_EXEC},
+ {E_PMINFO_APPINFO_PROP_APP_ICON, PMINFO_APPINFO_PROP_APP_ICON},
+ {E_PMINFO_APPINFO_PROP_APP_TYPE, PMINFO_APPINFO_PROP_APP_TYPE},
+ {E_PMINFO_APPINFO_PROP_APP_OPERATION, PMINFO_APPINFO_PROP_APP_OPERATION},
+ {E_PMINFO_APPINFO_PROP_APP_URI, PMINFO_APPINFO_PROP_APP_URI},
+ {E_PMINFO_APPINFO_PROP_APP_MIME, PMINFO_APPINFO_PROP_APP_MIME},
+ {E_PMINFO_APPINFO_PROP_APP_CATEGORY, PMINFO_APPINFO_PROP_APP_CATEGORY},
{E_PMINFO_APPINFO_PROP_APP_HWACCELERATION, PMINFO_APPINFO_PROP_APP_HWACCELERATION},
{E_PMINFO_APPINFO_PROP_APP_SCREENREADER, PMINFO_APPINFO_PROP_APP_SCREENREADER},
{E_PMINFO_APPINFO_PROP_APP_METADATA_KEY, PMINFO_APPINFO_PROP_APP_METADATA_KEY},
{E_PMINFO_APPINFO_PROP_APP_METADATA_VALUE, PMINFO_APPINFO_PROP_APP_METADATA_VALUE},
- {E_PMINFO_APPINFO_PROP_APP_PACKAGE, PMINFO_APPINFO_PROP_APP_PACKAGE}
+ {E_PMINFO_APPINFO_PROP_APP_PACKAGE, PMINFO_APPINFO_PROP_APP_PACKAGE},
+ {E_PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE, PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE}
};
struct _appinfo_int_map_t {
};
static struct _appinfo_int_map_t appinfo_int_prop_map[] = {
- {E_PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER, PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER}
+ {E_PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER, PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER},
+ {E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE, PMINFO_APPINFO_PROP_APP_SUPPORT_MODE}
};
struct _appinfo_bool_map_t {
{E_PMINFO_APPINFO_PROP_APP_TASKMANAGE, PMINFO_APPINFO_PROP_APP_TASKMANAGE},
{E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION, PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION},
{E_PMINFO_APPINFO_PROP_APP_UI_GADGET, PMINFO_APPINFO_PROP_APP_UI_GADGET},
- {E_PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE, PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE}
+ {E_PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE, PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE},
+ {E_PMINFO_APPINFO_PROP_APP_DISABLE, PMINFO_APPINFO_PROP_APP_DISABLE}
};
inline pkgmgrinfo_pkginfo_filter_prop_str _pminfo_pkginfo_convert_to_prop_str(const char *property)
return prop;
}
-void __get_filter_condition(gpointer data, char **condition)
+int __get_filter_condition(gpointer data, char **condition, GList **params)
{
- pkgmgrinfo_node_x *node = (pkgmgrinfo_node_x*)data;
+ pkgmgrinfo_node_x *node = (pkgmgrinfo_node_x *)data;
char buf[MAX_QUERY_LEN] = {'\0'};
- char temp[PKG_STRING_LEN_MAX] = {'\0'};
+ int flag = 0;
+ char *ptr = NULL;
+ char *saveptr = NULL;
+
switch (node->prop) {
case E_PMINFO_PKGINFO_PROP_PACKAGE_ID:
- snprintf(buf, sizeof(buf), "package_info.package='%s'", node->value);
+ snprintf(buf, sizeof(buf), "pi.package=?");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE:
- snprintf(buf, sizeof(buf), "package_info.package_type='%s'", node->value);
+ snprintf(buf, sizeof(buf), "pi.package_type=?");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION:
- snprintf(buf, sizeof(buf), "package_info.package_version='%s'", node->value);
+ snprintf(buf, sizeof(buf), "pi.package_version=?");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION:
- snprintf(buf, sizeof(buf), "package_info.install_location='%s'", node->value);
+ snprintf(buf, sizeof(buf), "pi.install_location=?");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE:
- snprintf(buf, sizeof(buf), "package_info.installed_storage='%s'", node->value);
+ snprintf(buf, sizeof(buf), "pi.installed_storage=?");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME:
- snprintf(buf, sizeof(buf), "package_info.author_name='%s'", node->value);
+ snprintf(buf, sizeof(buf), "pi.author_name=?");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF:
- snprintf(buf, sizeof(buf), "package_info.author_href='%s'", node->value);
+ snprintf(buf, sizeof(buf), "pi.author_href=?");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL:
- snprintf(buf, sizeof(buf), "package_info.author_email='%s'", node->value);
+ snprintf(buf, sizeof(buf), "pi.author_email=?");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE:
- snprintf(buf, sizeof(buf), "package_privilege_info.privilege='%s'", node->value);
+ snprintf(buf, sizeof(buf), "package_privilege_info.privilege=?");
+ flag = E_PMINFO_PKGINFO_JOIN_PRIVILEGE_INFO;
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_SIZE:
- snprintf(buf, sizeof(buf), "package_info.package_size='%s'", node->value);
+ snprintf(buf, sizeof(buf), "pi.package_size=?");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE:
- snprintf(buf, sizeof(buf), "package_info.package_removable IN %s", node->value);
+ snprintf(buf, sizeof(buf), "pi.package_removable=? COLLATE NOCASE");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD:
- snprintf(buf, sizeof(buf), "package_info.package_preload IN %s", node->value);
+ snprintf(buf, sizeof(buf), "pi.package_preload=? COLLATE NOCASE");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY:
- snprintf(buf, sizeof(buf), "package_info.package_readonly IN %s", node->value);
+ snprintf(buf, sizeof(buf), "pi.package_readonly=? COLLATE NOCASE");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE:
- snprintf(buf, sizeof(buf), "package_info.package_update IN %s", node->value);
+ snprintf(buf, sizeof(buf), "pi.package_update=? COLLATE NOCASE");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING:
- snprintf(buf, sizeof(buf), "package_info.package_appsetting IN %s", node->value);
+ snprintf(buf, sizeof(buf), "pi.package_appsetting=? COLLATE NOCASE");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING:
- snprintf(buf, sizeof(buf), "package_info.package_nodisplay IN %s", node->value);
+ snprintf(buf, sizeof(buf), "pi.package_nodisplay=? COLLATE NOCASE");
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE:
- snprintf(buf, sizeof(buf), "package_info.package_support_disable IN %s", node->value);
+ snprintf(buf, sizeof(buf), "pi.package_support_disable=? COLLATE NOCASE");
+ break;
+ case E_PMINFO_PKGINFO_PROP_PACKAGE_DISABLE:
+ snprintf(buf, sizeof(buf), "pi.package_disable=? COLLATE NOCASE");
break;
case E_PMINFO_APPINFO_PROP_APP_ID:
- snprintf(buf, sizeof(buf), "package_app_info.app_id='%s'", node->value);
+ snprintf(buf, sizeof(buf), "ai.app_id=?");
break;
case E_PMINFO_APPINFO_PROP_APP_COMPONENT:
- snprintf(buf, sizeof(buf), "package_app_info.app_component='%s'", node->value);
+ snprintf(buf, sizeof(buf), "ai.app_component=?");
break;
case E_PMINFO_APPINFO_PROP_APP_EXEC:
- snprintf(buf, sizeof(buf), "package_app_info.app_exec='%s'", node->value);
+ snprintf(buf, sizeof(buf), "ai.app_exec=?");
break;
case E_PMINFO_APPINFO_PROP_APP_ICON:
- snprintf(buf, sizeof(buf), "package_app_localized_info.app_icon='%s'", node->value);
+ snprintf(buf, sizeof(buf), "package_app_localized_info.app_icon=?");
+ flag = E_PMINFO_APPINFO_JOIN_LOCALIZED_INFO;
break;
case E_PMINFO_APPINFO_PROP_APP_TYPE:
- snprintf(buf, sizeof(buf), "package_app_info.app_type='%s'", node->value);
+ snprintf(buf, sizeof(buf), "ai.app_type=?");
break;
case E_PMINFO_APPINFO_PROP_APP_OPERATION:
- snprintf(temp, sizeof(temp), "(%s)", node->value);
- snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE %s|%%|%%", temp);
+ snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE ?||'|%%%%|%%%%'");
+ flag = E_PMINFO_APPINFO_JOIN_APP_CONTROL;
break;
case E_PMINFO_APPINFO_PROP_APP_URI:
- snprintf(temp, sizeof(temp), "(%s)", node->value);
- snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE %%|%s|%%", temp);
+ snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE '%%%%|'||?||'|%%%%'");
+ flag = E_PMINFO_APPINFO_JOIN_APP_CONTROL;
break;
case E_PMINFO_APPINFO_PROP_APP_MIME:
- snprintf(temp, sizeof(temp), "(%s)", node->value);
- snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE %%|%%|%s", temp);
+ snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE '%%%%|%%%%|'||?");
+ flag = E_PMINFO_APPINFO_JOIN_APP_CONTROL;
break;
case E_PMINFO_APPINFO_PROP_APP_CATEGORY:
- snprintf(temp, sizeof(temp), "(%s)", node->value);
- snprintf(buf, sizeof(buf), "package_app_app_category.category IN %s", temp);
- break;
+ snprintf(buf, sizeof(buf), "package_app_app_category.category IN (");
+ ptr = strtok_r(node->value, ",", &saveptr);
+ if (ptr == NULL)
+ return 0;
+ strncat(buf, "?", MAX_QUERY_LEN - 2);
+ *params = g_list_append(*params, strdup(ptr));
+ while ((ptr = strtok_r(NULL, ",", &saveptr))) {
+ strncat(buf, ", ?", MAX_QUERY_LEN - strlen(", ?") - 1);
+ *params = g_list_append(*params, strdup(ptr));
+ }
+ strncat(buf, ")", MAX_QUERY_LEN - 2);
+ *condition = strdup(buf);
+ flag = E_PMINFO_APPINFO_JOIN_CATEGORY;
+
+ return flag;
case E_PMINFO_APPINFO_PROP_APP_NODISPLAY:
- snprintf(buf, sizeof(buf), "package_app_info.app_nodisplay IN %s", node->value);
+ snprintf(buf, sizeof(buf), "ai.app_nodisplay=? COLLATE NOCASE");
break;
case E_PMINFO_APPINFO_PROP_APP_MULTIPLE:
- snprintf(buf, sizeof(buf), "package_app_info.app_multiple IN %s", node->value);
+ snprintf(buf, sizeof(buf), "ai.app_multiple=? COLLATE NOCASE");
break;
case E_PMINFO_APPINFO_PROP_APP_ONBOOT:
- snprintf(buf, sizeof(buf), "package_app_info.app_onboot IN %s", node->value);
+ snprintf(buf, sizeof(buf), "ai.app_onboot=? COLLATE NOCASE");
break;
case E_PMINFO_APPINFO_PROP_APP_AUTORESTART:
- snprintf(buf, sizeof(buf), "package_app_info.app_autorestart IN %s", node->value);
+ snprintf(buf, sizeof(buf), "ai.app_autorestart=? COLLATE NOCASE");
break;
case E_PMINFO_APPINFO_PROP_APP_TASKMANAGE:
- snprintf(buf, sizeof(buf), "package_app_info.app_taskmanage IN %s", node->value);
+ snprintf(buf, sizeof(buf), "ai.app_taskmanage=? COLLATE NOCASE");
break;
case E_PMINFO_APPINFO_PROP_APP_HWACCELERATION:
- snprintf(buf, sizeof(buf), "package_app_info.app_hwacceleration='%s'", node->value);
+ snprintf(buf, sizeof(buf), "ai.app_hwacceleration=?");
break;
case E_PMINFO_APPINFO_PROP_APP_SCREENREADER:
- snprintf(buf, sizeof(buf), "package_app_info.app_screenreader='%s'", node->value);
+ snprintf(buf, sizeof(buf), "ai.app_screenreader=?");
break;
case E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION:
- snprintf(buf, sizeof(buf), "package_app_info.app_launchcondition IN %s", node->value);
+ snprintf(buf, sizeof(buf), "ai.app_launchcondition=? COLLATE NOCASE");
break;
case E_PMINFO_APPINFO_PROP_APP_PACKAGE:
- snprintf(buf, sizeof(buf), "package_app_info.package='%s'", node->value);
+ snprintf(buf, sizeof(buf), "ai.package=?");
+ break;
+ case E_PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE:
+ snprintf(buf, sizeof(buf), "ai.app_installed_storage=?");
break;
case E_PMINFO_APPINFO_PROP_APP_UI_GADGET:
- snprintf(buf, sizeof(buf), "package_app_info.app_ui_gadget IN %s", node->value);
+ snprintf(buf, sizeof(buf), "ai.app_ui_gadget=? COLLATE NOCASE");
break;
case E_PMINFO_APPINFO_PROP_APP_METADATA_KEY:
- snprintf(buf, sizeof(buf), "package_app_app_metadata.md_key='%s'", node->value);
+ snprintf(buf, sizeof(buf), "package_app_app_metadata.md_key=?");
+ flag = E_PMINFO_APPINFO_JOIN_METADATA;
break;
case E_PMINFO_APPINFO_PROP_APP_METADATA_VALUE:
- snprintf(buf, sizeof(buf), "package_app_app_metadata.md_value='%s'", node->value);
+ snprintf(buf, sizeof(buf), "package_app_app_metadata.md_value=?");
+ flag = E_PMINFO_APPINFO_JOIN_METADATA;
+ break;
+ case E_PMINFO_APPINFO_PROP_APP_DISABLE:
+ snprintf(buf, MAX_QUERY_LEN, "ai.app_disable=? COLLATE NOCASE");
break;
case E_PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE:
- snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_support_disable IN %s", node->value);
+ snprintf(buf, MAX_QUERY_LEN, "ai.app_support_disable=? COLLATE NOCASE");
break;
case E_PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER:
- snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_id NOT IN "
- "(SELECT app_id from package_app_disable_for_user WHERE uid='%s')", node->value);
+ snprintf(buf, MAX_QUERY_LEN, "ai.app_id NOT IN "
+ "(SELECT app_id from package_app_info_for_uid WHERE uid=? " \
+ "AND is_disabled='true' COLLATE NOCASE)");
+ break;
+ case E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE:
+ snprintf(buf, sizeof(buf), "ai.app_support_mode=?");
break;
default:
_LOGE("Invalid Property Type\n");
*condition = NULL;
- return;
+ return 0;
}
*condition = strdup(buf);
- return;
+ *params = g_list_append(*params, strdup(node->value));
+ return flag;
+}
+
+int _add_icon_info_into_list(const char *locale, char *value, GList **icon)
+{
+ icon_x *info;
+
+ info = calloc(1, sizeof(icon_x));
+ if (info == NULL) {
+ LOGE("out of memory");
+ return PMINFO_R_ERROR;
+ }
+ info->text = value;
+ info->lang = strdup(locale);
+ *icon = g_list_append(*icon, info);
+
+ return PMINFO_R_OK;
+}
+
+int _add_label_info_into_list(const char *locale, char *value, GList **label)
+{
+ label_x *info;
+
+ info = calloc(1, sizeof(label_x));
+ if (info == NULL) {
+ LOGE("out of memory");
+ return PMINFO_R_ERROR;
+ }
+ info->text = value;
+ info->lang = strdup(locale);
+ *label = g_list_append(*label, info);
+
+ return PMINFO_R_OK;
}
char *_get_system_locale(void)
return locale;
}
+int __pkginfo_check_installed_storage(package_x *pkginfo)
+{
+ char buf[MAX_QUERY_LEN] = {'\0'};
+ int ret;
+
+ retvm_if(pkginfo->package == NULL, PMINFO_R_OK, "pkgid is NULL\n");
+ retvm_if(pkginfo->installed_storage == NULL, PMINFO_R_ERROR,
+ "installed_storage is NULL\n");
+
+ if (strcmp(pkginfo->installed_storage, "installed_external") == 0) {
+ snprintf(buf, MAX_QUERY_LEN - 1, "%s", pkginfo->external_path);
+ ret = access(buf, F_OK);
+ if (ret != 0) {
+ _LOGE("can not access [%s] - %d", buf, ret);
+ return PMINFO_R_ERROR;
+ }
+ }
+
+ return PMINFO_R_OK;
+}
+
+int __appinfo_check_installed_storage(application_x *appinfo)
+{
+ retvm_if(appinfo->installed_storage == NULL, PMINFO_R_ERROR,
+ "installed_storage is NULL\n");
+
+ if (strcmp(appinfo->installed_storage, "installed_external") == 0) {
+ retvm_if(appinfo->external_path == NULL, PMINFO_R_ERROR,
+ "external path is NULL\n");
+ if (access(appinfo->external_path, R_OK) != 0) {
+ _LOGE("can not access [%s]", appinfo->external_path);
+ return PMINFO_R_ERROR;
+ }
+ }
+
+ return PMINFO_R_OK;
+}
+