E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE,
E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION,
E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION,
+ E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE,
E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME,
E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL,
E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF,
E_PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE = E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_BOOL,
E_PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD,
E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY,
- E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_BOOL = E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY
+ E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE,
+ E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING,
+ E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_BOOL = E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING
} pkgmgrinfo_pkginfo_filter_prop_bool;
/*Integer properties for filtering based on package info*/
#define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
/** String property for filtering based on package info*/
#define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
+ /** String property for filtering based on package info*/
+#define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
/** String property for filtering based on package info*/
#define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
/** String property for filtering based on package info*/
#define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
/** Boolean property for filtering based on package info*/
#define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
+ /** Boolean property for filtering based on package info*/
+#define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
+ /** Boolean property for filtering based on package info*/
+#define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
/** Integer property for filtering based on package info*/
#define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
*/
int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
+
+/**
+ * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
+ * @brief This API gets the package 'upate' value from the package ID
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle pointer to package info handle
+ * @param[out] update pointer to hold package update value
+ * @return 0 if success, error code(<0) if fail
+ * @retval PMINFO_R_OK success
+ * @retval PMINFO_R_EINVAL invalid argument
+ * @retval PMINFO_R_ERROR internal error
+ * @pre pkgmgrinfo_pkginfo_get_pkginfo()
+ * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
+ * @see pkgmgrinfo_pkginfo_get_pkgid()
+ * @code
+static int get_pkg_update(const char *pkgid)
+{
+ int ret = 0;
+ bool update;
+ pkgmgrinfo_pkginfo_h handle;
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return -1;
+ }
+ printf("pkg update: %d\n", update);
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
+
/**
* @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
* @brief This API gets the package 'accessible' value from the package ID
Name: pkgmgr-info
Summary: Packager Manager infomation api for package
-Version: 0.0.83
-Release: 2
+Version: 0.0.87
+Release: 1
Group: System/Libraries
License: Apache License, Version 2.0
Source0: %{name}-%{version}.tar.gz
<xs:attribute name="version" use="required" type="xs:NMTOKEN"/>
<xs:attribute name="size" type="xs:NMTOKEN"/>
<xs:attribute name="root_path" type="xs:string"/>
+ <xs:attribute name="appsetting" type="xs:boolean"/>
</xs:complexType>
</xs:element>
FILE *fp = NULL;
char buffer[1024] = { 0 };
char temp_path[1024] = { 0 };
- char *lib_path = NULL;
char *path = NULL;
if (type == NULL) {
static int __run_parser_prestep(xmlTextReaderPtr reader, ACTION_TYPE action, const char *pkgid)
{
- int nLoop = 0;
- int pid = 0;
- char *parser_cmd = NULL;
int ret = -1;
const xmlChar *name;
- char *lib_path = NULL;
- void *lib_handle = NULL;
- int (*plugin_install) (xmlDocPtr);
DBG("__run_parser_prestep");
mfx->type = ASCII(xmlTextReaderGetAttribute(reader, XMLCHAR("type")));
if (xmlTextReaderGetAttribute(reader, XMLCHAR("root_path")))
mfx->root_path = ASCII(xmlTextReaderGetAttribute(reader, XMLCHAR("root_path")));
+ if (xmlTextReaderGetAttribute(reader, XMLCHAR("appsetting"))) {
+ mfx->appsetting = ASCII(xmlTextReaderGetAttribute(reader, XMLCHAR("appsetting")));
+ if (mfx->appsetting == NULL)
+ mfx->appsetting = strdup("false");
+ } else {
+ mfx->appsetting = strdup("false");
+ }
/*Assign default values. If required it will be overwritten in __add_preload_info()*/
mfx->preload = strdup("False");
val = strndup(buf, PKG_STRING_LEN_MAX - 1);
mfx->installed_time = val;
+ mfx->installed_storage= strdup("installed_internal");
+
ret = __start_process(reader, mfx);
} else {
DBG("No Manifest element found\n");
mime_x *mi = NULL;
uri_x *ui = NULL;
subapp_x *sub = NULL;
- int ret = -1;
- char query[PKG_STRING_LEN_MAX] = {'\0'};
char *operation = NULL;
char *mime = NULL;
char *uri = NULL;
mime_x *mi = NULL;
uri_x *ui = NULL;
subapp_x *sub = NULL;
- int ret = -1;
- char query[PKG_STRING_LEN_MAX] = {'\0'};
char *operation = NULL;
char *mime = NULL;
char *uri = NULL;
free((void *)mfx->removable);
mfx->removable = NULL;
}
+ if (mfx->update) {
+ free((void *)mfx->update);
+ mfx->update = NULL;
+ }
if (mfx->type) {
free((void *)mfx->type);
mfx->type = NULL;
free((void *)mfx->installed_time);
mfx->installed_time = NULL;
}
+ if (mfx->installed_storage) {
+ free((void *)mfx->installed_storage);
+ mfx->installed_storage = NULL;
+ }
if (mfx->storeclient_id) {
free((void *)mfx->storeclient_id);
mfx->storeclient_id = NULL;
free((void *)mfx->root_path);
mfx->root_path = NULL;
}
+ if (mfx->appsetting) {
+ free((void *)mfx->appsetting);
+ mfx->appsetting = NULL;
+ }
/*Free Icon*/
if (mfx->icon) {
DBG("parsing manifest for installation: %s\n", manifest);
manifest_x *mfx = NULL;
int ret = -1;
+ char roxml_check[PKG_STRING_LEN_MAX] = {'\0'};
+
xmlInitParser();
mfx = pkgmgr_parser_process_manifest_xml(manifest);
DBG("Parsing Finished\n");
__streamFile(manifest, ACTION_INSTALL, temp, mfx->package);
__add_preload_info(mfx, manifest);
DBG("Added preload infomation\n");
+
+ snprintf(roxml_check, PKG_STRING_LEN_MAX, MANIFEST_RO_DIRECTORY "/%s.xml", mfx->package);
+ if (access(roxml_check, F_OK) == 0)
+ mfx->update = strdup("true");
+ else
+ mfx->update = strdup("false");
+
ret = pkgmgr_parser_insert_manifest_info_in_db(mfx);
if (ret == -1)
DBG("DB Insert failed\n");
__streamFile(manifest, ACTION_UPGRADE, temp, mfx->package);
__add_preload_info(mfx, manifest);
DBG("Added preload infomation\n");
+
+ mfx->update = strdup("true");
ret = pkgmgr_parser_update_manifest_info_in_db(mfx);
if (ret == -1)
DBG("DB Update failed\n");
const char *removable; /**< package removable flag*/
const char *preload; /**< package preload flag*/
const char *readonly; /**< package readonly flag*/
+ const char *update; /**< package update flag*/
+ const char *appsetting; /**< package app setting flag*/
const char *type; /**< package type*/
const char *package_size; /**< package size for external installation*/
const char *installed_time; /**< installed time after finishing of installation*/
+ const char *installed_storage; /**< package currently installed storage*/
const char *storeclient_id; /**< id of store client for installed package*/
const char *mainapp_id; /**< app id of main application*/
const char *package_url; /**< app id of main application*/
"package_removable text DEFAULT 'true', " \
"package_preload text DEFAULT 'false', " \
"package_readonly text DEFAULT 'false', " \
+ "package_update text DEFAULT 'false', " \
+ "package_appsetting text DEFAULT 'false', " \
"author_name text, " \
"author_email text, " \
"author_href text," \
"installed_time text," \
+ "installed_storage text," \
"storeclient_id text," \
"mainapp_id text," \
"package_url text," \
static void __preserve_guestmode_visibility_value(manifest_x *mfx)
{
- int ret = -1;
char *error_message = NULL;
char query[MAX_QUERY_LEN] = {'\0'};
snprintf(query, MAX_QUERY_LEN - 1, "select app_id, app_guestmodevisibility from package_app_info where package='%s'", mfx->package);
}
snprintf(query, MAX_QUERY_LEN,
"insert into package_info(package, package_type, package_version, install_location, package_size, " \
- "package_removable, package_preload, package_readonly, author_name, author_email, author_href, installed_time, storeclient_id, mainapp_id, package_url, root_path) " \
- "values('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",\
+ "package_removable, package_preload, package_readonly, package_update, package_appsetting, author_name, author_email, author_href, installed_time, installed_storage, storeclient_id, mainapp_id, package_url, root_path) " \
+ "values('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",\
mfx->package, type, mfx->version, mfx->installlocation, mfx->package_size, mfx->removable, mfx->preload,
- mfx->readonly, auth_name, auth_email, auth_href, mfx->installed_time, mfx->storeclient_id, mfx->mainapp_id, mfx->package_url, path);
+ mfx->readonly, mfx->update, mfx->appsetting, auth_name, auth_email, auth_href, mfx->installed_time, mfx->installed_storage, mfx->storeclient_id, mfx->mainapp_id, mfx->package_url, path);
ret = __exec_query(query);
if (ret == -1) {
DBG("Package Info DB Insert Failed\n");
{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}
static struct _pkginfo_bool_map_t pkginfo_bool_prop_map[] = {
{E_PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE, PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE},
{E_PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD},
- {E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY, PMINFO_PKGINFO_PROP_PACKAGE_READONLY}
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY, PMINFO_PKGINFO_PROP_PACKAGE_READONLY},
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE, PMINFO_PKGINFO_PROP_PACKAGE_UPDATE},
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING, PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING}
};
struct _appinfo_str_map_t {
#define PKG_TYPE_STRING_LEN_MAX 128
#define PKG_VERSION_STRING_LEN_MAX 128
#define PKG_VALUE_STRING_LEN_MAX 512
+#define PKG_LOCALE_STRING_LEN_MAX 8
#define PKG_RW_PATH "/opt/usr/apps/"
#define PKG_RO_PATH "/usr/apps/"
#define BLOCK_SIZE 4096 /*in bytes*/
typedef int (*sqlite_query_callback)(void *data, int ncols, char **coltxt, char **colname);
char *pkgtype = "rpm";
+static char glocale[PKG_LOCALE_STRING_LEN_MAX];
__thread sqlite3 *manifest_db = NULL;
__thread sqlite3 *datacontrol_db = NULL;
__thread int gflag[9];/*one for each cert type*/
case E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION:
snprintf(buf, MAX_QUERY_LEN, "package_info.install_location='%s'", node->value);
break;
+ case E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE:
+ snprintf(buf, MAX_QUERY_LEN, "package_info.installed_storage='%s'", node->value);
+ break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME:
snprintf(buf, MAX_QUERY_LEN, "package_info.author_name='%s'", node->value);
break;
case E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY:
snprintf(buf, MAX_QUERY_LEN, "package_info.package_readonly IN %s", node->value);
break;
+ case E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE:
+ snprintf(buf, MAX_QUERY_LEN, "package_info.package_update IN %s", node->value);
+ break;
+ case E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING:
+ snprintf(buf, MAX_QUERY_LEN, "package_info.package_appsetting IN %s", node->value);
+ break;
case E_PMINFO_APPINFO_PROP_APP_ID:
snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_id='%s'", node->value);
break;
info->manifest_info->readonly = strdup(coltxt[i]);
else
info->manifest_info->readonly = NULL;
+ } else if (strcmp(colname[i], "package_update") == 0 ){
+ if (coltxt[i])
+ info->manifest_info->update= strdup(coltxt[i]);
+ else
+ info->manifest_info->update = NULL;
+ } else if (strcmp(colname[i], "package_appsetting") == 0 ){
+ if (coltxt[i])
+ info->manifest_info->appsetting = strdup(coltxt[i]);
+ else
+ info->manifest_info->appsetting = NULL;
} else if (strcmp(colname[i], "installed_time") == 0 ){
if (coltxt[i])
info->manifest_info->installed_time = strdup(coltxt[i]);
else
info->uiapp_info->type = NULL;
} else if (strcmp(colname[i], "app_icon_section") == 0 ) {
- if (coltxt[i]){
+ if (coltxt[i])
info->uiapp_info->icon->section= strdup(coltxt[i]);
- _LOGE("isectt == %s \n",info->uiapp_info->icon->section);
- }
else
info->uiapp_info->icon->section = NULL;
} else if (strcmp(colname[i], "app_icon") == 0) {
ret = PMINFO_R_EINVAL;
goto err;
}
-
+ strncpy(glocale, locale, PKG_LOCALE_STRING_LEN_MAX - 1);
ret = __open_manifest_db();
if (ret == -1) {
_LOGE("Fail to open manifest DB\n");
ret = PMINFO_R_EINVAL;
goto err;
}
+ strncpy(glocale, locale, PKG_LOCALE_STRING_LEN_MAX - 1);
pkginfo = (pkgmgr_pkginfo_x *)calloc(1, sizeof(pkgmgr_pkginfo_x));
if (pkginfo == NULL) {
_LOGE("Failed to allocate memory for pkginfo\n");
info_tmp->tmp_dup= strdup(info_tmp->tmp);
*icon = info_tmp->tmp_dup;
} else {
- char *syslocale = NULL;
char *locale = NULL;
- char *save = NULL;
icon_x *ptr = NULL;
- syslocale = vconf_get_str(VCONFKEY_LANGSET);
- tryvm_if(syslocale == NULL, ret = PMINFO_R_EINVAL, "current locale is NULL");
-
- locale = __convert_system_locale_to_manifest_locale(syslocale);
- tryvm_if(locale == NULL, ret = PMINFO_R_EINVAL, "manifest locale is NULL");
-
- save = locale;
*icon = NULL;
+ locale = glocale;
+ tryvm_if(locale == NULL, ret = PMINFO_R_ERROR, "manifest locale is NULL");
pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
for(ptr = info->manifest_info->icon; ptr != NULL; ptr = ptr->next)
{
}
}
- if (syslocale) {
- free(syslocale);
- syslocale = NULL;
- }
- locale = save;
- if (locale) {
- free(locale);
- locale = NULL;
- }
}
catch:
info_tmp->tmp_dup = strdup(info_tmp->tmp);
*label = info_tmp->tmp_dup;
} else {
- char *syslocale = NULL;
char *locale = NULL;
- char *save = NULL;
label_x *ptr = NULL;
-
- syslocale = vconf_get_str(VCONFKEY_LANGSET);
- tryvm_if(syslocale == NULL, ret = PMINFO_R_EINVAL, "current locale is NULL");
-
- locale = __convert_system_locale_to_manifest_locale(syslocale);
- tryvm_if(locale == NULL, ret = PMINFO_R_EINVAL, "manifest locale is NULL");
-
- save = locale;
*label = NULL;
+ locale = glocale;
+ tryvm_if(locale == NULL, ret = PMINFO_R_ERROR, "manifest locale is NULL");
pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
for(ptr = info->manifest_info->label; ptr != NULL; ptr = ptr->next)
{
}
}
}
-
- if (syslocale) {
- free(syslocale);
- syslocale = NULL;
- }
- locale = save;
- if (locale) {
- free(locale);
- locale = NULL;
- }
}
catch:
_LOGE("Argument supplied to hold return value is NULL\n");
return PMINFO_R_EINVAL;
}
- char *syslocale = NULL;
char *locale = NULL;
- char *save = NULL;
description_x *ptr = NULL;
- syslocale = vconf_get_str(VCONFKEY_LANGSET);
- if (syslocale == NULL) {
- _LOGE("current locale is NULL\n");
- return PMINFO_R_EINVAL;
- }
- locale = __convert_system_locale_to_manifest_locale(syslocale);
- if (locale == NULL) {
- _LOGE("manifest locale is NULL\n");
- return PMINFO_R_EINVAL;
- }
- save = locale;
*description = NULL;
+ locale = glocale;
+ retvm_if(locale == NULL, PMINFO_R_ERROR, "manifest locale is NULL");
pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
for(ptr = info->manifest_info->description; ptr != NULL; ptr = ptr->next)
{
}
}
}
- if (syslocale) {
- free(syslocale);
- syslocale = NULL;
- }
- locale = save;
- if (locale) {
- free(locale);
- locale = NULL;
- }
return PMINFO_R_OK;
}
_LOGE("Argument supplied to hold return value is NULL\n");
return PMINFO_R_EINVAL;
}
- char *syslocale = NULL;
char *locale = NULL;
- char *save = NULL;
author_x *ptr = NULL;
- syslocale = vconf_get_str(VCONFKEY_LANGSET);
- if (syslocale == NULL) {
- _LOGE("current locale is NULL\n");
- return PMINFO_R_EINVAL;
- }
- locale = __convert_system_locale_to_manifest_locale(syslocale);
- if (locale == NULL) {
- _LOGE("manifest locale is NULL\n");
- return PMINFO_R_EINVAL;
- }
- save = locale;
*author_name = NULL;
+ locale = glocale;
+ retvm_if(locale == NULL, PMINFO_R_ERROR, "manifest locale is NULL");
pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
for(ptr = info->manifest_info->author; ptr != NULL; ptr = ptr->next)
{
}
}
}
- if (syslocale) {
- free(syslocale);
- syslocale = NULL;
- }
- locale = save;
- if (locale) {
- free(locale);
- locale = NULL;
- }
return PMINFO_R_OK;
}
API int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
{
- int ret = -1;
char *pkgid;
pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
pkgmgr_cert_x *info= NULL;
char *lcert = NULL;
char *rcert = NULL;
- char *lhs_package_id = NULL;
- char *rhs_package_id = NULL;
int exist = -1;
info = (pkgmgr_cert_x *)calloc(1, sizeof(pkgmgr_cert_x));
return PMINFO_R_OK;
}
+API int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
+{
+ retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
+ retvm_if(update == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
+
+ char *val = NULL;
+ pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
+ val = (char *)info->manifest_info->update;
+ if (val) {
+ if (strcasecmp(val, "true") == 0)
+ *update = 1;
+ else if (strcasecmp(val, "false") == 0)
+ *update = 0;
+ else
+ *update = 1;
+ }
+ return PMINFO_R_OK;
+}
+
API int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
{
if (handle == NULL) {
val = strndup("internal-only", PKG_STRING_LEN_MAX - 1);
else if (strcmp(value, PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL) == 0)
val = strndup("prefer-external", PKG_STRING_LEN_MAX - 1);
+ else if (strcmp(value, "installed_internal") == 0)
+ val = strndup("installed_internal", PKG_STRING_LEN_MAX - 1);
+ else if (strcmp(value, "installed_external") == 0)
+ val = strndup("installed_external", PKG_STRING_LEN_MAX - 1);
else
val = strndup(value, PKG_STRING_LEN_MAX - 1);
if (val == NULL) {
free(syslocale);
return PMINFO_R_ERROR;
}
+ strncpy(glocale, locale, PKG_LOCALE_STRING_LEN_MAX - 1);
ret = __open_manifest_db();
if (ret == -1) {
_LOGE("Fail to open manifest DB\n");
free(syslocale);
return PMINFO_R_ERROR;
}
+ strncpy(glocale, locale, PKG_LOCALE_STRING_LEN_MAX - 1);
ret = __open_manifest_db();
if (ret == -1) {
_LOGE("Fail to open manifest DB\n");
retvm_if(app_func == NULL, PMINFO_R_EINVAL, "callback pointer is NULL");
retvm_if((component != PMINFO_UI_APP) && (component != PMINFO_SVC_APP) && (component != PMINFO_ALL_APP), PMINFO_R_EINVAL, "Invalid App Component Type");
- char *error_message = NULL;
char *syslocale = NULL;
char *locale = NULL;
int ret = -1;
tryvm_if(locale == NULL, ret = PMINFO_R_EINVAL, "manifest locale is NULL");
/*calloc allinfo*/
+ strncpy(glocale, locale, PKG_LOCALE_STRING_LEN_MAX - 1);
allinfo = (pkgmgr_appinfo_x *)calloc(1, sizeof(pkgmgr_appinfo_x));
tryvm_if(allinfo == NULL, ret = PMINFO_R_ERROR, "Failed to allocate memory for appinfo");
{
retvm_if(app_func == NULL, PMINFO_R_EINVAL, "callback function is NULL");
- char *error_message = NULL;
int ret = PMINFO_R_OK;
char query[MAX_QUERY_LEN] = {'\0'};
char *syslocale = NULL;
retvm_if(ret != SQLITE_OK, ret = PMINFO_R_ERROR, "connect db [%s] failed!", MANIFEST_DB);
/*calloc pkginfo*/
+ strncpy(glocale, locale, PKG_LOCALE_STRING_LEN_MAX - 1);
pkgmgr_pkginfo_x *info = NULL;
info = (pkgmgr_pkginfo_x *)calloc(1, sizeof(pkgmgr_pkginfo_x));
tryvm_if(info == NULL, ret = PMINFO_R_ERROR, "Out of Memory!!!");
retvm_if(handle == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
pkgmgr_appinfo_x *appinfo = NULL;
- char *error_message = NULL;
char *syslocale = NULL;
char *locale = NULL;
int ret = -1;
tryvm_if(locale == NULL, ret = PMINFO_R_ERROR, "manifest locale is NULL");
/*calloc appinfo*/
+ strncpy(glocale, locale, PKG_LOCALE_STRING_LEN_MAX - 1);
appinfo = (pkgmgr_appinfo_x *)calloc(1, sizeof(pkgmgr_appinfo_x));
tryvm_if(appinfo == NULL, ret = PMINFO_R_ERROR, "Failed to allocate memory for appinfo");
_LOGE("Argument supplied to hold return value is NULL\n");
return PMINFO_R_EINVAL;
}
- char *syslocale = NULL;
char *locale = NULL;
- char *save = NULL;
icon_x *ptr = NULL;
icon_x *start = NULL;
- syslocale = vconf_get_str(VCONFKEY_LANGSET);
- if (syslocale == NULL) {
- _LOGE("current locale is NULL\n");
- return PMINFO_R_EINVAL;
- }
- locale = __convert_system_locale_to_manifest_locale(syslocale);
- if (locale == NULL) {
- _LOGE("manifest locale is NULL\n");
- return PMINFO_R_EINVAL;
- }
- save = locale;
*icon = NULL;
+ locale= glocale;
+ retvm_if(locale == NULL, PMINFO_R_ERROR, "manifest locale is NULL");
pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
if (info->app_component == PMINFO_UI_APP)
start = info->uiapp_info->icon;
}
}
}
- if (syslocale) {
- free(syslocale);
- syslocale = NULL;
- }
- locale = save;
- if (locale) {
- free(locale);
- locale = NULL;
- }
return PMINFO_R_OK;
}
_LOGE("Argument supplied to hold return value is NULL\n");
return PMINFO_R_EINVAL;
}
- char *syslocale = NULL;
char *locale = NULL;
- char *save = NULL;
label_x *ptr = NULL;
label_x *start = NULL;
- syslocale = vconf_get_str(VCONFKEY_LANGSET);
- if (syslocale == NULL) {
- _LOGE("current locale is NULL\n");
- return PMINFO_R_EINVAL;
- }
- locale = __convert_system_locale_to_manifest_locale(syslocale);
- if (locale == NULL) {
- _LOGE("manifest locale is NULL\n");
- return PMINFO_R_EINVAL;
- }
-
- save = locale;
*label = NULL;
+ locale = glocale;
+ retvm_if(locale == NULL, PMINFO_R_ERROR, "manifest locale is NULL");
pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
if (info->app_component == PMINFO_UI_APP)
start = info->uiapp_info->label;
}
}
}
- if (syslocale) {
- free(syslocale);
- syslocale = NULL;
- }
- locale = save;
- if (locale) {
- free(locale);
- locale = NULL;
- }
return PMINFO_R_OK;
}
free(syslocale);
return PMINFO_R_ERROR;
}
+ strncpy(glocale, locale, PKG_LOCALE_STRING_LEN_MAX - 1);
ret = __open_manifest_db();
if (ret == -1) {
_LOGE("Fail to open manifest DB\n");
free(syslocale);
return PMINFO_R_ERROR;
}
+ strncpy(glocale, locale, PKG_LOCALE_STRING_LEN_MAX - 1);
ret = __open_manifest_db();
if (ret == -1) {
_LOGE("Fail to open manifest DB\n");
_LOGE("Argument supplied is NULL\n");
return PMINFO_R_EINVAL;
}
- int ret = -1;
char *error_message = NULL;
int exist = -1;
char query[MAX_QUERY_LEN] = {'\0'};