+EXPORT_API ail_error_e ail_appinfo_get_usr_str(const ail_appinfo_h ai, const char *property, uid_t uid, char **str)
+{
+ int index;
+ char *value;
+ char *pkg;
+ char *pkg_type;
+ char *locale, *localname;
+ ail_prop_str_e prop;
+ char *locale_new;
+
+ retv_if(!ai, AIL_ERROR_INVALID_PARAMETER);
+ retv_if(!property, AIL_ERROR_INVALID_PARAMETER);
+ retv_if(!str, AIL_ERROR_INVALID_PARAMETER);
+
+ prop = _ail_convert_to_prop_str(property);
+
+ if (prop < E_AIL_PROP_STR_MIN || prop > E_AIL_PROP_STR_MAX)
+ return AIL_ERROR_INVALID_PARAMETER;
+
+ localname = NULL;
+
+ if (E_AIL_PROP_NAME_STR == prop) {
+ if (ai->stmt) {
+ if (db_column_str(ai->stmt, E_AIL_PROP_X_SLP_PACKAGETYPE_STR, &pkg_type) < 0)
+ return AIL_ERROR_DB_FAILED;
+ if (pkg_type && (strcasecmp(pkg_type, "tpk") == 0)) {
+ locale = sql_get_locale();
+ retv_if(locale == NULL, AIL_ERROR_FAIL);
+
+ if (db_column_str(ai->stmt, E_AIL_PROP_PACKAGE_STR, &pkg) < 0) {
+ free(locale);
+ return AIL_ERROR_DB_FAILED;
+ }
+ if (pkg == NULL) {
+ free(locale);
+ return AIL_ERROR_DB_FAILED;
+ }
+
+ locale_new = __get_app_locale_by_fallback(pkg, locale);
+ localname = (char *)appinfo_get_localname(pkg, locale_new, uid);
+ free(locale);
+ free(locale_new);
+ } else {
+ if (db_column_str(ai->stmt, SQL_LOCALNAME_IDX, &localname) < 0)
+ return AIL_ERROR_DB_FAILED;
+ }
+ } else {
+ pkg_type = ai->values[E_AIL_PROP_X_SLP_PACKAGETYPE_STR];
+ pkg = ai->values[E_AIL_PROP_PACKAGE_STR];
+ retv_if(pkg == NULL, AIL_ERROR_FAIL);
+
+ locale = sql_get_locale();
+ retv_if(locale == NULL, AIL_ERROR_FAIL);