4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
32 #include "pkgmgr-info.h"
33 #include "pkgmgrinfo_debug.h"
34 #include "pkgmgrinfo_private.h"
35 #include "pkgmgr_parser.h"
37 struct _pkginfo_str_map_t {
38 pkgmgrinfo_pkginfo_filter_prop_str prop;
42 static struct _pkginfo_str_map_t pkginfo_str_prop_map[] = {
43 {E_PMINFO_PKGINFO_PROP_PACKAGE_ID, PMINFO_PKGINFO_PROP_PACKAGE_ID},
44 {E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE, PMINFO_PKGINFO_PROP_PACKAGE_TYPE},
45 {E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION, PMINFO_PKGINFO_PROP_PACKAGE_VERSION},
46 {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION, PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION},
47 {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE, PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE},
48 {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME},
49 {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL},
50 {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF},
51 {E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE, PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE}
54 struct _pkginfo_int_map_t {
55 pkgmgrinfo_pkginfo_filter_prop_int prop;
59 static struct _pkginfo_int_map_t pkginfo_int_prop_map[] = {
60 {E_PMINFO_PKGINFO_PROP_PACKAGE_SIZE, PMINFO_PKGINFO_PROP_PACKAGE_SIZE}
63 struct _pkginfo_bool_map_t {
64 pkgmgrinfo_pkginfo_filter_prop_bool prop;
68 static struct _pkginfo_bool_map_t pkginfo_bool_prop_map[] = {
69 {E_PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE, PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE},
70 {E_PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD},
71 {E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY, PMINFO_PKGINFO_PROP_PACKAGE_READONLY},
72 {E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE, PMINFO_PKGINFO_PROP_PACKAGE_UPDATE},
73 {E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING, PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING},
74 {E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING, PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING},
75 {E_PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE, PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE},
76 {E_PMINFO_PKGINFO_PROP_PACKAGE_DISABLE, PMINFO_PKGINFO_PROP_PACKAGE_DISABLE},
77 {E_PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE, PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE}
80 struct _appinfo_str_map_t {
81 pkgmgrinfo_appinfo_filter_prop_str prop;
85 static struct _appinfo_str_map_t appinfo_str_prop_map[] = {
86 {E_PMINFO_APPINFO_PROP_APP_ID, PMINFO_APPINFO_PROP_APP_ID},
87 {E_PMINFO_APPINFO_PROP_APP_COMPONENT, PMINFO_APPINFO_PROP_APP_COMPONENT},
88 {E_PMINFO_APPINFO_PROP_APP_EXEC, PMINFO_APPINFO_PROP_APP_EXEC},
89 {E_PMINFO_APPINFO_PROP_APP_ICON, PMINFO_APPINFO_PROP_APP_ICON},
90 {E_PMINFO_APPINFO_PROP_APP_TYPE, PMINFO_APPINFO_PROP_APP_TYPE},
91 {E_PMINFO_APPINFO_PROP_APP_OPERATION, PMINFO_APPINFO_PROP_APP_OPERATION},
92 {E_PMINFO_APPINFO_PROP_APP_URI, PMINFO_APPINFO_PROP_APP_URI},
93 {E_PMINFO_APPINFO_PROP_APP_MIME, PMINFO_APPINFO_PROP_APP_MIME},
94 {E_PMINFO_APPINFO_PROP_APP_CATEGORY, PMINFO_APPINFO_PROP_APP_CATEGORY},
95 {E_PMINFO_APPINFO_PROP_APP_HWACCELERATION, PMINFO_APPINFO_PROP_APP_HWACCELERATION},
96 {E_PMINFO_APPINFO_PROP_APP_SCREENREADER, PMINFO_APPINFO_PROP_APP_SCREENREADER},
97 {E_PMINFO_APPINFO_PROP_APP_METADATA_KEY, PMINFO_APPINFO_PROP_APP_METADATA_KEY},
98 {E_PMINFO_APPINFO_PROP_APP_METADATA_VALUE, PMINFO_APPINFO_PROP_APP_METADATA_VALUE},
99 {E_PMINFO_APPINFO_PROP_APP_PACKAGE, PMINFO_APPINFO_PROP_APP_PACKAGE},
100 {E_PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE, PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE}
103 struct _appinfo_int_map_t {
104 pkgmgrinfo_appinfo_filter_prop_int prop;
105 const char *property;
108 static struct _appinfo_int_map_t appinfo_int_prop_map[] = {
109 {E_PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER, PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER},
110 {E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE, PMINFO_APPINFO_PROP_APP_SUPPORT_MODE}
113 struct _appinfo_bool_map_t {
114 pkgmgrinfo_appinfo_filter_prop_bool prop;
115 const char *property;
118 static struct _appinfo_bool_map_t appinfo_bool_prop_map[] = {
119 {E_PMINFO_APPINFO_PROP_APP_NODISPLAY, PMINFO_APPINFO_PROP_APP_NODISPLAY},
120 {E_PMINFO_APPINFO_PROP_APP_MULTIPLE, PMINFO_APPINFO_PROP_APP_MULTIPLE},
121 {E_PMINFO_APPINFO_PROP_APP_ONBOOT, PMINFO_APPINFO_PROP_APP_ONBOOT},
122 {E_PMINFO_APPINFO_PROP_APP_AUTORESTART, PMINFO_APPINFO_PROP_APP_AUTORESTART},
123 {E_PMINFO_APPINFO_PROP_APP_TASKMANAGE, PMINFO_APPINFO_PROP_APP_TASKMANAGE},
124 {E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION, PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION},
125 {E_PMINFO_APPINFO_PROP_APP_UI_GADGET, PMINFO_APPINFO_PROP_APP_UI_GADGET},
126 {E_PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE, PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE},
127 {E_PMINFO_APPINFO_PROP_APP_DISABLE, PMINFO_APPINFO_PROP_APP_DISABLE},
128 {E_PMINFO_APPINFO_PROP_APP_CHECK_STORAGE, PMINFO_APPINFO_PROP_APP_CHECK_STORAGE}
131 inline pkgmgrinfo_pkginfo_filter_prop_str _pminfo_pkginfo_convert_to_prop_str(const char *property)
135 pkgmgrinfo_pkginfo_filter_prop_str prop = -1;
137 if (property == NULL)
139 max = E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_STR - E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_STR + 1;
140 for (i = 0 ; i < max; i++) {
141 if (strcmp(property, pkginfo_str_prop_map[i].property) == 0) {
142 prop = pkginfo_str_prop_map[i].prop;
149 inline pkgmgrinfo_pkginfo_filter_prop_int _pminfo_pkginfo_convert_to_prop_int(const char *property)
153 pkgmgrinfo_pkginfo_filter_prop_int prop = -1;
155 if (property == NULL)
157 max = E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_INT - E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_INT + 1;
158 for (i = 0 ; i < max; i++) {
159 if (strcmp(property, pkginfo_int_prop_map[i].property) == 0) {
160 prop = pkginfo_int_prop_map[i].prop;
167 inline pkgmgrinfo_pkginfo_filter_prop_bool _pminfo_pkginfo_convert_to_prop_bool(const char *property)
171 pkgmgrinfo_pkginfo_filter_prop_bool prop = -1;
173 if (property == NULL)
175 max = E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_BOOL - E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_BOOL + 1;
176 for (i = 0 ; i < max; i++) {
177 if (strcmp(property, pkginfo_bool_prop_map[i].property) == 0) {
178 prop = pkginfo_bool_prop_map[i].prop;
185 inline pkgmgrinfo_appinfo_filter_prop_str _pminfo_appinfo_convert_to_prop_str(const char *property)
189 pkgmgrinfo_appinfo_filter_prop_str prop = -1;
191 if (property == NULL)
193 max = E_PMINFO_APPINFO_PROP_APP_MAX_STR - E_PMINFO_APPINFO_PROP_APP_MIN_STR + 1;
194 for (i = 0 ; i < max; i++) {
195 if (strcmp(property, appinfo_str_prop_map[i].property) == 0) {
196 prop = appinfo_str_prop_map[i].prop;
203 inline pkgmgrinfo_appinfo_filter_prop_int _pminfo_appinfo_convert_to_prop_int(const char *property)
207 pkgmgrinfo_appinfo_filter_prop_int prop = -1;
209 if (property == NULL)
211 max = E_PMINFO_APPINFO_PROP_APP_MAX_INT - E_PMINFO_APPINFO_PROP_APP_MIN_INT + 1;
212 for (i = 0 ; i < max; i++) {
213 if (strcmp(property, appinfo_int_prop_map[i].property) == 0) {
214 prop = appinfo_int_prop_map[i].prop;
221 inline pkgmgrinfo_appinfo_filter_prop_bool _pminfo_appinfo_convert_to_prop_bool(const char *property)
225 pkgmgrinfo_appinfo_filter_prop_bool prop = -1;
227 if (property == NULL)
229 max = E_PMINFO_APPINFO_PROP_APP_MAX_BOOL - E_PMINFO_APPINFO_PROP_APP_MIN_BOOL + 1;
230 for (i = 0 ; i < max; i++) {
231 if (strcmp(property, appinfo_bool_prop_map[i].property) == 0) {
232 prop = appinfo_bool_prop_map[i].prop;
239 int __get_filter_condition(gpointer data, char **condition, GList **params)
241 pkgmgrinfo_node_x *node = (pkgmgrinfo_node_x *)data;
242 char buf[MAX_QUERY_LEN] = {'\0'};
245 char *saveptr = NULL;
247 switch (node->prop) {
248 case E_PMINFO_PKGINFO_PROP_PACKAGE_ID:
249 snprintf(buf, sizeof(buf), "pi.package=?");
251 case E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE:
252 snprintf(buf, sizeof(buf), "pi.package_type=?");
254 case E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION:
255 snprintf(buf, sizeof(buf), "pi.package_version=?");
257 case E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION:
258 snprintf(buf, sizeof(buf), "pi.install_location=?");
260 case E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE:
261 snprintf(buf, sizeof(buf), "pi.installed_storage=?");
263 case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME:
264 snprintf(buf, sizeof(buf), "pi.author_name=?");
266 case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF:
267 snprintf(buf, sizeof(buf), "pi.author_href=?");
269 case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL:
270 snprintf(buf, sizeof(buf), "pi.author_email=?");
272 case E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE:
273 snprintf(buf, sizeof(buf), "package_privilege_info.privilege=?");
274 flag = E_PMINFO_PKGINFO_JOIN_PRIVILEGE_INFO;
276 case E_PMINFO_PKGINFO_PROP_PACKAGE_SIZE:
277 snprintf(buf, sizeof(buf), "pi.package_size=?");
279 case E_PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE:
280 snprintf(buf, sizeof(buf), "pi.package_removable=? COLLATE NOCASE");
282 case E_PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD:
283 snprintf(buf, sizeof(buf), "pi.package_preload=? COLLATE NOCASE");
285 case E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY:
286 snprintf(buf, sizeof(buf), "pi.package_readonly=? COLLATE NOCASE");
288 case E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE:
289 snprintf(buf, sizeof(buf), "pi.package_update=? COLLATE NOCASE");
291 case E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING:
292 snprintf(buf, sizeof(buf), "pi.package_appsetting=? COLLATE NOCASE");
294 case E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING:
295 snprintf(buf, sizeof(buf), "pi.package_nodisplay=? COLLATE NOCASE");
297 case E_PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE:
298 snprintf(buf, sizeof(buf), "pi.package_support_disable=? COLLATE NOCASE");
300 case E_PMINFO_PKGINFO_PROP_PACKAGE_DISABLE:
301 snprintf(buf, sizeof(buf), "pi.package_disable=? COLLATE NOCASE");
304 case E_PMINFO_APPINFO_PROP_APP_ID:
305 snprintf(buf, sizeof(buf), "ai.app_id=?");
307 case E_PMINFO_APPINFO_PROP_APP_COMPONENT:
308 snprintf(buf, sizeof(buf), "ai.app_component=?");
310 case E_PMINFO_APPINFO_PROP_APP_EXEC:
311 snprintf(buf, sizeof(buf), "ai.app_exec=?");
313 case E_PMINFO_APPINFO_PROP_APP_ICON:
314 snprintf(buf, sizeof(buf), "package_app_localized_info.app_icon=?");
315 flag = E_PMINFO_APPINFO_JOIN_LOCALIZED_INFO;
317 case E_PMINFO_APPINFO_PROP_APP_TYPE:
318 snprintf(buf, sizeof(buf), "ai.app_type=?");
320 case E_PMINFO_APPINFO_PROP_APP_OPERATION:
321 snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE ?||'|%%%%|%%%%'");
322 flag = E_PMINFO_APPINFO_JOIN_APP_CONTROL;
324 case E_PMINFO_APPINFO_PROP_APP_URI:
325 snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE '%%%%|'||?||'|%%%%'");
326 flag = E_PMINFO_APPINFO_JOIN_APP_CONTROL;
328 case E_PMINFO_APPINFO_PROP_APP_MIME:
329 snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE '%%%%|%%%%|'||?");
330 flag = E_PMINFO_APPINFO_JOIN_APP_CONTROL;
332 case E_PMINFO_APPINFO_PROP_APP_CATEGORY:
333 snprintf(buf, sizeof(buf), "package_app_app_category.category IN (");
334 ptr = strtok_r(node->value, ",", &saveptr);
337 strncat(buf, "?", MAX_QUERY_LEN - 2);
338 *params = g_list_append(*params, strdup(ptr));
339 while ((ptr = strtok_r(NULL, ",", &saveptr))) {
340 strncat(buf, ", ?", MAX_QUERY_LEN - strlen(", ?") - 1);
341 *params = g_list_append(*params, strdup(ptr));
343 strncat(buf, ")", MAX_QUERY_LEN - 2);
344 *condition = strdup(buf);
345 flag = E_PMINFO_APPINFO_JOIN_CATEGORY;
348 case E_PMINFO_APPINFO_PROP_APP_NODISPLAY:
349 snprintf(buf, sizeof(buf), "ai.app_nodisplay=? COLLATE NOCASE");
351 case E_PMINFO_APPINFO_PROP_APP_MULTIPLE:
352 snprintf(buf, sizeof(buf), "ai.app_multiple=? COLLATE NOCASE");
354 case E_PMINFO_APPINFO_PROP_APP_ONBOOT:
355 snprintf(buf, sizeof(buf), "ai.app_onboot=? COLLATE NOCASE");
357 case E_PMINFO_APPINFO_PROP_APP_AUTORESTART:
358 snprintf(buf, sizeof(buf), "ai.app_autorestart=? COLLATE NOCASE");
360 case E_PMINFO_APPINFO_PROP_APP_TASKMANAGE:
361 snprintf(buf, sizeof(buf), "ai.app_taskmanage=? COLLATE NOCASE");
363 case E_PMINFO_APPINFO_PROP_APP_HWACCELERATION:
364 snprintf(buf, sizeof(buf), "ai.app_hwacceleration=?");
366 case E_PMINFO_APPINFO_PROP_APP_SCREENREADER:
367 snprintf(buf, sizeof(buf), "ai.app_screenreader=?");
369 case E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION:
370 snprintf(buf, sizeof(buf), "ai.app_launchcondition=? COLLATE NOCASE");
372 case E_PMINFO_APPINFO_PROP_APP_PACKAGE:
373 snprintf(buf, sizeof(buf), "ai.package=?");
375 case E_PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE:
376 snprintf(buf, sizeof(buf), "ai.app_installed_storage=?");
378 case E_PMINFO_APPINFO_PROP_APP_UI_GADGET:
379 snprintf(buf, sizeof(buf), "ai.app_ui_gadget=? COLLATE NOCASE");
381 case E_PMINFO_APPINFO_PROP_APP_METADATA_KEY:
382 snprintf(buf, sizeof(buf), "package_app_app_metadata.md_key=?");
383 flag = E_PMINFO_APPINFO_JOIN_METADATA;
385 case E_PMINFO_APPINFO_PROP_APP_METADATA_VALUE:
386 snprintf(buf, sizeof(buf), "package_app_app_metadata.md_value=?");
387 flag = E_PMINFO_APPINFO_JOIN_METADATA;
389 case E_PMINFO_APPINFO_PROP_APP_DISABLE:
390 snprintf(buf, MAX_QUERY_LEN, "ai.app_disable=? COLLATE NOCASE");
392 case E_PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE:
393 snprintf(buf, MAX_QUERY_LEN, "ai.app_support_disable=? COLLATE NOCASE");
395 case E_PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER:
396 snprintf(buf, MAX_QUERY_LEN, "ai.app_id NOT IN "
397 "(SELECT app_id from package_app_info_for_uid WHERE uid=? " \
398 "AND is_disabled='true' COLLATE NOCASE)");
400 case E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE:
401 snprintf(buf, sizeof(buf), "ai.app_support_mode=?");
403 case E_PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE:
404 case E_PMINFO_APPINFO_PROP_APP_CHECK_STORAGE:
408 _LOGE("Invalid Property Type\n");
412 *condition = strdup(buf);
413 *params = g_list_append(*params, strdup(node->value));
417 int _add_icon_info_into_list(const char *locale, char *value, GList **icon)
421 info = calloc(1, sizeof(icon_x));
423 LOGE("out of memory");
424 return PMINFO_R_ERROR;
427 info->lang = strdup(locale);
428 *icon = g_list_append(*icon, info);
433 int _add_label_info_into_list(const char *locale, char *value, GList **label)
437 info = calloc(1, sizeof(label_x));
439 LOGE("out of memory");
440 return PMINFO_R_ERROR;
443 info->lang = strdup(locale);
444 *label = g_list_append(*label, info);
449 char *_get_system_locale(void)
454 lang = vconf_get_str(VCONFKEY_LANGSET);
456 locale = strdup(DEFAULT_LOCALE);
457 if (locale == NULL) {
458 LOGE("out of memory");
464 locale = malloc(sizeof(char) * 6);
465 if (locale == NULL) {
466 LOGE("out of memory");
471 strncpy(locale, lang, 2);
473 locale[3] = tolower(lang[3]);
474 locale[4] = tolower(lang[4]);
482 int __pkginfo_check_installed_storage(package_x *pkginfo)
484 char buf[MAX_QUERY_LEN] = {'\0'};
487 retvm_if(pkginfo->package == NULL, PMINFO_R_OK, "pkgid is NULL\n");
488 retvm_if(pkginfo->installed_storage == NULL, PMINFO_R_ERROR,
489 "installed_storage is NULL\n");
491 if (strcmp(pkginfo->installed_storage, "installed_external") == 0) {
492 snprintf(buf, MAX_QUERY_LEN - 1, "%s", pkginfo->external_path);
493 ret = access(buf, F_OK);
495 _LOGE("can not access [%s] - %d", buf, ret);
496 return PMINFO_R_ERROR;
503 int __appinfo_check_installed_storage(application_x *appinfo)
505 retvm_if(appinfo->installed_storage == NULL, PMINFO_R_ERROR,
506 "installed_storage is NULL\n");
508 if (strcmp(appinfo->installed_storage, "installed_external") == 0) {
509 retvm_if(appinfo->external_path == NULL, PMINFO_R_ERROR,
510 "external path is NULL\n");
511 if (access(appinfo->external_path, R_OK) != 0) {
512 _LOGE("can not access [%s]", appinfo->external_path);
513 return PMINFO_R_ERROR;