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
+ E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING,
+ E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_BOOL = E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING
} pkgmgrinfo_pkginfo_filter_prop_bool;
/*Integer properties for filtering based on package info*/
E_PMINFO_APPINFO_PROP_APP_ONBOOT,
E_PMINFO_APPINFO_PROP_APP_AUTORESTART,
E_PMINFO_APPINFO_PROP_APP_TASKMANAGE,
- E_PMINFO_APPINFO_PROP_APP_MAX_BOOL = E_PMINFO_APPINFO_PROP_APP_TASKMANAGE
+ E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION,
+ E_PMINFO_APPINFO_PROP_APP_MAX_BOOL = E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION
} pkgmgrinfo_appinfo_filter_prop_bool;
/*Integer properties for filtering based on app info*/
E_PMINFO_APPINFO_PROP_APP_MAX_INT = E_PMINFO_APPINFO_PROP_APP_MIN_INT
} pkgmgrinfo_appinfo_filter_prop_int;
+/*Integer properties for filtering based on app info*/
+typedef enum _pkgmgrinfo_pkginfo_filter_prop_range {
+ /*Currently No Fields*/
+ E_PMINFO_PKGINFO_PROP_RANGE_MIN_INT = 701,
+ E_PMINFO_PKGINFO_PROP_RANGE_BASIC,
+ E_PMINFO_PKGINFO_PROP_RANGE_MAX_INT = E_PMINFO_PKGINFO_PROP_RANGE_BASIC
+} pkgmgrinfo_pkginfo_filter_prop_range;
+
+
pkgmgrinfo_pkginfo_filter_prop_str _pminfo_pkginfo_convert_to_prop_str(const char *property);
pkgmgrinfo_pkginfo_filter_prop_int _pminfo_pkginfo_convert_to_prop_int(const char *property);
pkgmgrinfo_pkginfo_filter_prop_bool _pminfo_pkginfo_convert_to_prop_bool(const char *property);
pkgmgrinfo_appinfo_filter_prop_int _pminfo_appinfo_convert_to_prop_int(const char *property);
pkgmgrinfo_appinfo_filter_prop_bool _pminfo_appinfo_convert_to_prop_bool(const char *property);
+pkgmgrinfo_pkginfo_filter_prop_range _pminfo_pkginfo_convert_to_prop_range(const char *property);
+
#endif /* __PKGMGR_INFO_INTERNAL_H__ */
#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"
+ /** Boolean property for filtering based on package info*/
+#define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
/** Integer property for filtering based on package info*/
#define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
#define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
/** Boolean property for filtering based on app info*/
#define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
+ /** Boolean property for filtering based on app info*/
+#define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
+
+ /** will be updated*/
+ /** string property for filtering based on pkg info*/
+#define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
/**
* @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
Name: pkgmgr-info
Summary: Packager Manager infomation api for package
-Version: 0.0.102
+Version: 0.0.106
Release: 1
Group: Application Framework/Package Management
License: Apache-2.0
%install
%make_install
-%post -p /sbin/ldconfig
+%post
+
+mkdir -p /opt/usr/apps/tmp
+chown 5100:5100 /opt/usr/apps/tmp
+chmod 771 /opt/usr/apps/tmp
+chsmack -a '*' /opt/usr/apps/tmp
+chsmack -t /opt/usr/apps/tmp
+
+touch /opt/usr/apps/tmp/pkgmgr_tmp.txt
+
+chsmack -a 'pkgmgr::db' /opt/usr/apps/tmp/pkgmgr_tmp.txt
+
+%postun
-%postun -p /sbin/ldconfig
%files
%manifest pkgmgr-info.manifest
<xs:attribute name="size" type="xs:NMTOKEN"/>
<xs:attribute name="root_path" type="xs:string"/>
<xs:attribute name="appsetting" type="xs:boolean"/>
+ <xs:attribute name="nodisplay-setting" type="xs:boolean"/>
</xs:complexType>
</xs:element>
<xs:attribute name="portrait-effectimage" type="xs:string"/>
<xs:attribute name="landscape-effectimage" type="xs:string"/>
<xs:attribute name="guestmode-visibility" type="xs:string"/>
+ <xs:attribute name="launchcondition" type="xs:boolean"/>
</xs:complexType>
</xs:element>
<xs:element name="ime-application">
free((void *)uiapplication->package);
uiapplication->package = NULL;
}
+ if (uiapplication->launchcondition) {
+ free((void *)uiapplication->launchcondition);
+ uiapplication->launchcondition = NULL;
+ }
/*Free Label*/
if (uiapplication->label) {
label_x *label = uiapplication->label;
if (access(icon_with_path, R_OK) == 0) break;
snprintf(icon_with_path, len, "/usr/apps/%s/res/icons/default/small/%s", package, icon);
if (access(icon_with_path, R_OK) == 0) break;
+ snprintf(icon_with_path, len, "/usr/ug/res/images/%s/%s", package, icon);
+ if (access(icon_with_path, R_OK) == 0) break;
} while (0);
free(theme);
}
}
+static void __ps_process_tag(manifest_x * mfx, char *const tagv[])
+{
+ int i = 0;
+ char delims[] = "=";
+ char *ret_result = NULL;
+ char *tag = NULL;
+
+ if (tagv == NULL)
+ return;
+
+ for (tag = strdup(tagv[0]); tag != NULL; ) {
+ ret_result = strtok(tag, delims);
+
+ /*check tag : preload */
+ if (strcmp(ret_result, "preload") == 0) {
+ ret_result = strtok(NULL, delims);
+ if (strcmp(ret_result, "true") == 0) {
+ free((void *)mfx->preload);
+ mfx->preload = strdup("true");
+ } else if (strcmp(ret_result, "false") == 0) {
+ free((void *)mfx->preload);
+ mfx->preload = strdup("false");
+ }
+ /*check tag : removable*/
+ } else if (strcmp(ret_result, "removable") == 0) {
+ ret_result = strtok(NULL, delims);
+ if (strcmp(ret_result, "true") == 0){
+ free((void *)mfx->removable);
+ mfx->removable = strdup("true");
+ } else if (strcmp(ret_result, "false") == 0) {
+ free((void *)mfx->removable);
+ mfx->removable = strdup("false");
+ }
+ /*check tag : not matched*/
+ } else
+ DBG("tag process [%s]is not defined\n", ret_result);
+
+ free(tag);
+
+ /*check next value*/
+ if (tagv[++i] != NULL)
+ tag = strdup(tagv[i]);
+ else {
+ DBG("tag process success...\n");
+ return;
+ }
+ }
+}
static int __ps_process_icon(xmlTextReaderPtr reader, icon_x *icon)
{
} else {
uiapplication->mainapp = strdup("false");
}
+ if (xmlTextReaderGetAttribute(reader, XMLCHAR("launchcondition"))) {
+ uiapplication->launchcondition = ASCII(xmlTextReaderGetAttribute(reader, XMLCHAR("launchcondition")));
+ if (uiapplication->launchcondition == NULL)
+ uiapplication->launchcondition = strdup("false");
+ } else {
+ uiapplication->launchcondition = strdup("false");
+ }
+
if (xmlTextReaderGetAttribute(reader, XMLCHAR("indicatordisplay"))) {
uiapplication->indicatordisplay = ASCII(xmlTextReaderGetAttribute(reader, XMLCHAR("indicatordisplay")));
if (uiapplication->indicatordisplay == NULL)
}
if (xmlTextReaderGetAttribute(reader, XMLCHAR("storeclient-id")))
mfx->storeclient_id= ASCII(xmlTextReaderGetAttribute(reader, XMLCHAR("storeclient-id")));
+ if (xmlTextReaderGetAttribute(reader, XMLCHAR("nodisplay-setting"))) {
+ mfx->nodisplay_setting = ASCII(xmlTextReaderGetAttribute(reader, XMLCHAR("nodisplay-setting")));
+ if (mfx->nodisplay_setting == NULL)
+ mfx->nodisplay_setting = strdup("false");
+ } else {
+ mfx->nodisplay_setting = strdup("false");
+ }
/*Assign default values. If required it will be overwritten in __add_preload_info()*/
mfx->preload = strdup("False");
free((void *)mfx->appsetting);
mfx->appsetting = NULL;
}
+ if (mfx->nodisplay_setting) {
+ free((void *)mfx->nodisplay_setting);
+ mfx->nodisplay_setting = NULL;
+ }
/*Free Icon*/
if (mfx->icon) {
else
mfx->update = strdup("false");
+ __ps_process_tag(mfx, tagv);
+
ret = pkgmgr_parser_insert_manifest_info_in_db(mfx);
if (ret == -1)
DBG("DB Insert failed\n");
const char *mainapp;
const char *package;
const char *recentimage;
+ const char *launchcondition;
const char *indicatordisplay;
const char *portraitimg;
const char *landscapeimg;
const char *mainapp_id; /**< app id of main application*/
const char *package_url; /**< app id of main application*/
const char *root_path; /**< package root path*/
+ const char *nodisplay_setting; /**< package no display setting menu*/
struct icon_x *icon; /**< package icon*/
struct label_x *label; /**< package label*/
struct author_x *author; /**< package author*/
"package_readonly text DEFAULT 'false', " \
"package_update text DEFAULT 'false', " \
"package_appsetting text DEFAULT 'false', " \
+ "package_nodisplay text DEFAULT 'false', " \
"author_name text, " \
"author_email text, " \
"author_href text," \
"app_hwacceleration text DEFAULT 'use-system-setting', " \
"app_mainapp text, " \
"app_recentimage text, " \
+ "app_launchcondition text, " \
"app_indicatordisplay text DEFAULT 'true', " \
"app_portraitimg text, " \
"app_landscapeimg text, " \
sqlite3_free(error_message);
return 0;
}
+
+static int __exec_query_no_msg(char *query)
+{
+ char *error_message = NULL;
+ if (SQLITE_OK !=
+ sqlite3_exec(pkgmgr_parser_db, query, NULL, NULL, &error_message)) {
+ sqlite3_free(error_message);
+ return -1;
+ }
+ sqlite3_free(error_message);
+ return 0;
+}
+
static GList *__create_locale_list(GList *locale, label_x *lbl, license_x *lcn, icon_x *icn, description_x *dcn, author_x *ath)
{
__extract_data(data, lbl, lcn, icn, dcn, ath, &label, &license, &icon, &description, &author);
if (!label && !description && !icon && !license && !author)
return;
- snprintf(query, MAX_QUERY_LEN, "insert into package_localized_info(package, package_locale, " \
+ sqlite3_snprintf(MAX_QUERY_LEN, query, "insert into package_localized_info(package, package_locale, " \
"package_label, package_icon, package_description, package_license, package_author) values " \
- "('%s', '%s', '%s', '%s', '%s', '%s', '%s')", mfx->package, (char*)data,
+ "('%q', '%q', '%q', '%q', '%q', '%q', '%q')", mfx->package, (char*)data,
label, icon, description, license, author);
ret = __exec_query(query);
if (ret == -1)
char *icon = NULL;
char query[MAX_QUERY_LEN] = {'\0'};
+ manifest_x *mfx = (manifest_x *)userdata;
uiapplication_x *up = (uiapplication_x*)userdata;
label_x *lbl = up->label;
icon_x *icn = up->icon;
if (ret == -1)
DBG("Package UiApp Localized Info DB Insert failed\n");
+ /*insert ui app locale info to pkg locale to get mainapp data */
+ if (strcasecmp(up->mainapp, "true")==0) {
+ sqlite3_snprintf(MAX_QUERY_LEN, query, "insert into package_localized_info(package, package_locale, " \
+ "package_label, package_icon, package_description, package_license, package_author) values " \
+ "('%q', '%q', '%q', '%q', '%q', '%q', '%q')", mfx->package, (char*)data,
+ label, icon, NULL, NULL, NULL);
+ ret = __exec_query_no_msg(query);
+ if (ret == -1)
+ DBG("Package locale info inserted before.\n");
+ }
}
static void __insert_uiapplication_icon_section_info(gpointer data, gpointer userdata)
{
snprintf(query, MAX_QUERY_LEN,
"insert into package_app_info(app_id, app_component, app_exec, app_nodisplay, app_type, app_onboot, " \
- "app_multiple, app_autorestart, app_taskmanage, app_enabled, app_hwacceleration, app_mainapp , app_recentimage, app_indicatordisplay, app_portraitimg, app_landscapeimg, app_guestmodevisibility, package) " \
- "values('%s', '%s', '%s', '%s', '%s', '%s','%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",\
+ "app_multiple, app_autorestart, app_taskmanage, app_enabled, app_hwacceleration, app_mainapp , app_recentimage, app_launchcondition, app_indicatordisplay, app_portraitimg, app_landscapeimg, app_guestmodevisibility, package) " \
+ "values('%s', '%s', '%s', '%s', '%s', '%s','%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",\
up->appid, "uiapp", up->exec, up->nodisplay, up->type, "\0", up->multiple,
- "\0", up->taskmanage, up->enabled, up->hwacceleration,up->mainapp, up->recentimage, up->indicatordisplay, up->portraitimg, up->landscapeimg, up->guestmode_visibility, mfx->package);
+ "\0", up->taskmanage, up->enabled, up->hwacceleration,up->mainapp, up->recentimage, up->launchcondition, up->indicatordisplay, up->portraitimg, up->landscapeimg, up->guestmode_visibility, mfx->package);
ret = __exec_query(query);
if (ret == -1) {
DBG("Package UiApp Info DB Insert Failed\n");
}
snprintf(query, MAX_QUERY_LEN,
"insert into package_info(package, package_type, package_version, install_location, package_size, " \
- "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')",\
+ "package_removable, package_preload, package_readonly, package_update, package_appsetting, package_nodisplay, 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', '%s')",\
mfx->package, type, mfx->version, mfx->installlocation, mfx->package_size, mfx->removable, mfx->preload,
- 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);
+ mfx->readonly, mfx->update, mfx->appsetting, mfx->nodisplay_setting, 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");
pvs = pvs->next;
}
+ ret = __insert_ui_mainapp_info(mfx);
+ if (ret == -1)
+ return -1;
+
/*Insert the package locale and app locale info */
pkglocale = __create_locale_list(pkglocale, lbl, lcn, icn, dcn, ath);
g_list_foreach(pkglocale, __trimfunc1, NULL);
ret = __insert_uiapplication_info(mfx);
if (ret == -1)
return -1;
- ret = __insert_ui_mainapp_info(mfx);
- if (ret == -1)
- return -1;
ret = __insert_serviceapplication_info(mfx);
if (ret == -1)
return -1;
{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_UPDATE, PMINFO_PKGINFO_PROP_PACKAGE_UPDATE},
- {E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING, PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING}
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING, PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING},
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING, PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING}
};
struct _appinfo_str_map_t {
{E_PMINFO_APPINFO_PROP_APP_MULTIPLE, PMINFO_APPINFO_PROP_APP_MULTIPLE},
{E_PMINFO_APPINFO_PROP_APP_ONBOOT, PMINFO_APPINFO_PROP_APP_ONBOOT},
{E_PMINFO_APPINFO_PROP_APP_AUTORESTART, PMINFO_APPINFO_PROP_APP_AUTORESTART},
- {E_PMINFO_APPINFO_PROP_APP_TASKMANAGE, PMINFO_APPINFO_PROP_APP_TASKMANAGE}
+ {E_PMINFO_APPINFO_PROP_APP_TASKMANAGE, PMINFO_APPINFO_PROP_APP_TASKMANAGE},
+ {E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION, PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION}
};
inline pkgmgrinfo_pkginfo_filter_prop_str _pminfo_pkginfo_convert_to_prop_str(const char *property)
case E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING:
snprintf(buf, MAX_QUERY_LEN, "package_info.package_appsetting IN %s", node->value);
break;
+ case E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING:
+ snprintf(buf, MAX_QUERY_LEN, "package_info.package_nodisplay 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;
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_LAUNCHCONDITION:
+ snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_launchcondition='%s'", node->value);
+ break;
default:
_LOGE("Invalid Property Type\n");
*condition = NULL;
{
retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL");
retvm_if(icon == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
-
- pkgmgr_pkginfo_x *info_tmp = (pkgmgr_pkginfo_x *)handle;
- pkgmgrinfo_appinfo_h apphandle;
- bool ismainapp = 0;
int ret = PMINFO_R_OK;
- ret = pkgmgrinfo_appinfo_get_appinfo(info_tmp->manifest_info->mainapp_id, &apphandle);
- retvm_if(ret < 0, PMINFO_R_ERROR, "pkgmgrinfo_appinfo_get_appinfo fail");
-
- ret = pkgmgrinfo_appinfo_is_mainapp(apphandle, &ismainapp);
- tryvm_if(ret < 0, ret = PMINFO_R_ERROR, "pkgmgrinfo_appinfo_is_mainapp fail");
-
- if (ismainapp){
- ret = pkgmgrinfo_appinfo_get_icon(apphandle, &info_tmp->tmp);
- tryvm_if(ret < 0, ret = PMINFO_R_ERROR, "pkgmgrinfo_appinfo_get_icon fail");
- tryvm_if(info_tmp->tmp == NULL, ret = PMINFO_R_EINVAL, "icon is NULL");
-
- if (info_tmp->tmp_dup){
- free((void *)info_tmp->tmp_dup);
- info_tmp->tmp_dup = NULL;
- }
+ char *locale = NULL;
+ icon_x *ptr = NULL;
+ *icon = NULL;
+ locale = glocale;
+ retvm_if(locale == NULL, ret = PMINFO_R_ERROR, "manifest locale is NULL");
- info_tmp->tmp_dup= strdup(info_tmp->tmp);
- *icon = info_tmp->tmp_dup;
- } else {
- char *locale = NULL;
- icon_x *ptr = NULL;
- *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 (ptr->lang) {
- if (strcmp(ptr->lang, locale) == 0) {
- *icon = (char *)ptr->text;
- if (strcasecmp(*icon, "(null)") == 0) {
- locale = DEFAULT_LOCALE;
- continue;
- } else
- break;
- } else if (strcmp(ptr->lang, DEFAULT_LOCALE) == 0) {
- *icon = (char *)ptr->text;
+ pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
+ for(ptr = info->manifest_info->icon; ptr != NULL; ptr = ptr->next)
+ {
+ if (ptr->lang) {
+ if (strcmp(ptr->lang, locale) == 0) {
+ *icon = (char *)ptr->text;
+ if (strcasecmp(*icon, "(null)") == 0) {
+ locale = DEFAULT_LOCALE;
+ continue;
+ } else
break;
- }
+ } else if (strcmp(ptr->lang, DEFAULT_LOCALE) == 0) {
+ *icon = (char *)ptr->text;
+ break;
}
}
-
}
-catch:
- pkgmgrinfo_appinfo_destroy_appinfo(apphandle);
return ret;
}
{
retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL");
retvm_if(label == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
-
- pkgmgr_pkginfo_x *info_tmp = (pkgmgr_pkginfo_x *)handle;
- pkgmgrinfo_appinfo_h apphandle;
- bool ismainapp = 0;
int ret = PMINFO_R_OK;
- ret = pkgmgrinfo_appinfo_get_appinfo(info_tmp->manifest_info->mainapp_id, &apphandle);
- retvm_if(ret < 0, PMINFO_R_ERROR, "pkgmgrinfo_appinfo_get_appinfo fail");
-
- ret = pkgmgrinfo_appinfo_is_mainapp(apphandle, &ismainapp);
- tryvm_if(ret < 0, ret = PMINFO_R_ERROR, "pkgmgrinfo_appinfo_is_mainapp fail");
-
- if (ismainapp){
- ret = pkgmgrinfo_appinfo_get_label(apphandle, &info_tmp->tmp);
- tryvm_if(ret < 0, ret = PMINFO_R_ERROR, "pkgmgrinfo_appinfo_get_label fail");
- tryvm_if(info_tmp->tmp == NULL, ret = PMINFO_R_EINVAL, "label is NULL");
-
- if (info_tmp->tmp_dup){
- free((void *)info_tmp->tmp_dup);
- info_tmp->tmp_dup = NULL;
- }
+ char *locale = NULL;
+ label_x *ptr = NULL;
+ *label = NULL;
+ locale = glocale;
+ retvm_if(locale == NULL, ret = PMINFO_R_ERROR, "manifest locale is NULL");
- info_tmp->tmp_dup = strdup(info_tmp->tmp);
- *label = info_tmp->tmp_dup;
- } else {
- char *locale = NULL;
- label_x *ptr = NULL;
- *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 (ptr->lang) {
- if (strcmp(ptr->lang, locale) == 0) {
- *label = (char *)ptr->text;
- if (strcasecmp(*label, "(null)") == 0) {
- locale = DEFAULT_LOCALE;
- continue;
- } else
- break;
- } else if (strcmp(ptr->lang, DEFAULT_LOCALE) == 0) {
- *label = (char *)ptr->text;
+ pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
+ for(ptr = info->manifest_info->label; ptr != NULL; ptr = ptr->next)
+ {
+ if (ptr->lang) {
+ if (strcmp(ptr->lang, locale) == 0) {
+ *label = (char *)ptr->text;
+ if (strcasecmp(*label, "(null)") == 0) {
+ locale = DEFAULT_LOCALE;
+ continue;
+ } else
break;
- }
+ } else if (strcmp(ptr->lang, DEFAULT_LOCALE) == 0) {
+ *label = (char *)ptr->text;
+ break;
}
}
}
-catch:
- pkgmgrinfo_appinfo_destroy_appinfo(apphandle);
return ret;
}
val = (char *)ptr->section;
if (strcmp(val, "preview") == 0)
- *preview_img = (char *)info->uiapp_info->image->text;
+ *preview_img = (char *)ptr->text;
break;
}