4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Junsuk Oh <junsuk77.oh@samsung.com>,
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
24 #include "pkgmgrinfo_private.h"
26 struct _pkginfo_str_map_t {
27 pkgmgrinfo_pkginfo_filter_prop_str prop;
31 static struct _pkginfo_str_map_t pkginfo_str_prop_map[] = {
32 {E_PMINFO_PKGINFO_PROP_PACKAGE_ID, PMINFO_PKGINFO_PROP_PACKAGE_ID},
33 {E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE, PMINFO_PKGINFO_PROP_PACKAGE_TYPE},
34 {E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION, PMINFO_PKGINFO_PROP_PACKAGE_VERSION},
35 {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION,PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION},
36 {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE,PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE},
37 {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME},
38 {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL},
39 {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF},
40 {E_PMINFO_PKGINFO_PROP_PACKAGE_STORECLIENT_ID, PMINFO_PKGINFO_PROP_PACKAGE_STORECLIENT_ID}
43 struct _pkginfo_int_map_t {
44 pkgmgrinfo_pkginfo_filter_prop_int prop;
48 static struct _pkginfo_int_map_t pkginfo_int_prop_map[] = {
49 {E_PMINFO_PKGINFO_PROP_PACKAGE_SIZE, PMINFO_PKGINFO_PROP_PACKAGE_SIZE},
50 {E_PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_MODE, PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_MODE}
53 struct _pkginfo_bool_map_t {
54 pkgmgrinfo_pkginfo_filter_prop_bool prop;
58 static struct _pkginfo_bool_map_t pkginfo_bool_prop_map[] = {
59 {E_PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE, PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE},
60 {E_PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD},
61 {E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY, PMINFO_PKGINFO_PROP_PACKAGE_READONLY},
62 {E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE, PMINFO_PKGINFO_PROP_PACKAGE_UPDATE},
63 {E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING, PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING},
64 {E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING, PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING},
65 {E_PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE, PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE},
66 {E_PMINFO_PKGINFO_PROP_PACKAGE_DISABLE, PMINFO_PKGINFO_PROP_PACKAGE_DISABLE},
67 {E_PMINFO_PKGINFO_PROP_PACKAGE_USE_RESET, PMINFO_PKGINFO_PROP_PACKAGE_USE_RESET}
70 struct _appinfo_str_map_t {
71 pkgmgrinfo_appinfo_filter_prop_str prop;
75 static struct _appinfo_str_map_t appinfo_str_prop_map[] = {
76 {E_PMINFO_APPINFO_PROP_APP_ID, PMINFO_APPINFO_PROP_APP_ID},
77 {E_PMINFO_APPINFO_PROP_APP_COMPONENT, PMINFO_APPINFO_PROP_APP_COMPONENT},
78 {E_PMINFO_APPINFO_PROP_APP_COMPONENT_TYPE, PMINFO_APPINFO_PROP_APP_COMPONENT_TYPE},
79 {E_PMINFO_APPINFO_PROP_APP_EXEC, PMINFO_APPINFO_PROP_APP_EXEC},
80 {E_PMINFO_APPINFO_PROP_APP_AMBIENT_SUPPORT, PMINFO_APPINFO_PROP_APP_AMBIENT_SUPPORT},
81 {E_PMINFO_APPINFO_PROP_APP_ICON, PMINFO_APPINFO_PROP_APP_ICON},
82 {E_PMINFO_APPINFO_PROP_APP_TYPE, PMINFO_APPINFO_PROP_APP_TYPE},
83 {E_PMINFO_APPINFO_PROP_APP_OPERATION, PMINFO_APPINFO_PROP_APP_OPERATION},
84 {E_PMINFO_APPINFO_PROP_APP_URI, PMINFO_APPINFO_PROP_APP_URI},
85 {E_PMINFO_APPINFO_PROP_APP_MIME, PMINFO_APPINFO_PROP_APP_MIME},
86 {E_PMINFO_APPINFO_PROP_APP_CATEGORY, PMINFO_APPINFO_PROP_APP_CATEGORY},
87 {E_PMINFO_APPINFO_PROP_APP_HWACCELERATION, PMINFO_APPINFO_PROP_APP_HWACCELERATION},
88 {E_PMINFO_APPINFO_PROP_APP_SCREENREADER, PMINFO_APPINFO_PROP_APP_SCREENREADER}
91 struct _appinfo_int_map_t {
92 pkgmgrinfo_appinfo_filter_prop_int prop;
96 static struct _appinfo_int_map_t appinfo_int_prop_map[] = {
97 {E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE, PMINFO_APPINFO_PROP_APP_SUPPORT_MODE}
100 struct _appinfo_bool_map_t {
101 pkgmgrinfo_appinfo_filter_prop_bool prop;
102 const char *property;
105 static struct _appinfo_bool_map_t appinfo_bool_prop_map[] = {
106 {E_PMINFO_APPINFO_PROP_APP_NODISPLAY, PMINFO_APPINFO_PROP_APP_NODISPLAY},
107 {E_PMINFO_APPINFO_PROP_APP_MULTIPLE, PMINFO_APPINFO_PROP_APP_MULTIPLE},
108 {E_PMINFO_APPINFO_PROP_APP_ONBOOT, PMINFO_APPINFO_PROP_APP_ONBOOT},
109 {E_PMINFO_APPINFO_PROP_APP_AUTORESTART, PMINFO_APPINFO_PROP_APP_AUTORESTART},
110 {E_PMINFO_APPINFO_PROP_APP_TASKMANAGE, PMINFO_APPINFO_PROP_APP_TASKMANAGE},
111 {E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION, PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION},
112 {E_PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE, PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE},
113 {E_PMINFO_APPINFO_PROP_APP_DISABLE, PMINFO_APPINFO_PROP_APP_DISABLE},
114 {E_PMINFO_APPINFO_PROP_APP_REMOVABLE, PMINFO_APPINFO_PROP_APP_REMOVABLE}
117 inline int _pkgmgrinfo_validate_cb(void *data, int ncols, char **coltxt, char **colname)
120 *p = atoi(coltxt[0]);
124 inline pkgmgrinfo_pkginfo_filter_prop_str _pminfo_pkginfo_convert_to_prop_str(const char *property)
128 pkgmgrinfo_pkginfo_filter_prop_str prop = -1;
130 if (property == NULL)
132 max = E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_STR - E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_STR + 1;
133 for (i = 0 ; i < max; i++) {
134 if (strcmp(property, pkginfo_str_prop_map[i].property) == 0) {
135 prop = pkginfo_str_prop_map[i].prop;
142 inline pkgmgrinfo_pkginfo_filter_prop_int _pminfo_pkginfo_convert_to_prop_int(const char *property)
146 pkgmgrinfo_pkginfo_filter_prop_int prop = -1;
148 if (property == NULL)
150 max = E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_INT - E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_INT + 1;
151 for (i = 0 ; i < max; i++) {
152 if (strcmp(property, pkginfo_int_prop_map[i].property) == 0) {
153 prop = pkginfo_int_prop_map[i].prop;
160 inline pkgmgrinfo_pkginfo_filter_prop_bool _pminfo_pkginfo_convert_to_prop_bool(const char *property)
164 pkgmgrinfo_pkginfo_filter_prop_bool prop = -1;
166 if (property == NULL)
168 max = E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_BOOL - E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_BOOL + 1;
169 for (i = 0 ; i < max; i++) {
170 if (strcmp(property, pkginfo_bool_prop_map[i].property) == 0) {
171 prop = pkginfo_bool_prop_map[i].prop;
178 inline pkgmgrinfo_appinfo_filter_prop_str _pminfo_appinfo_convert_to_prop_str(const char *property)
182 pkgmgrinfo_appinfo_filter_prop_str prop = -1;
184 if (property == NULL)
186 max = E_PMINFO_APPINFO_PROP_APP_MAX_STR - E_PMINFO_APPINFO_PROP_APP_MIN_STR + 1;
187 for (i = 0 ; i < max; i++) {
188 if (strcmp(property, appinfo_str_prop_map[i].property) == 0) {
189 prop = appinfo_str_prop_map[i].prop;
196 inline pkgmgrinfo_appinfo_filter_prop_int _pminfo_appinfo_convert_to_prop_int(const char *property)
200 pkgmgrinfo_appinfo_filter_prop_int prop = -1;
202 if (property == NULL)
204 max = E_PMINFO_APPINFO_PROP_APP_MAX_INT - E_PMINFO_APPINFO_PROP_APP_MIN_INT + 1;
205 for (i = 0 ; i < max; i++) {
206 if (strcmp(property, appinfo_int_prop_map[i].property) == 0) {
207 prop = appinfo_int_prop_map[i].prop;
214 inline pkgmgrinfo_appinfo_filter_prop_bool _pminfo_appinfo_convert_to_prop_bool(const char *property)
218 pkgmgrinfo_appinfo_filter_prop_bool prop = -1;
220 if (property == NULL)
222 max = E_PMINFO_APPINFO_PROP_APP_MAX_BOOL - E_PMINFO_APPINFO_PROP_APP_MIN_BOOL + 1;
223 for (i = 0 ; i < max; i++) {
224 if (strcmp(property, appinfo_bool_prop_map[i].property) == 0) {
225 prop = appinfo_bool_prop_map[i].prop;
232 int __exec_db_query(sqlite3 *db, char *query, sqlite_query_callback callback, void *data)
234 char *error_message = NULL;
236 sqlite3_exec(db, query, callback, data, &error_message)) {
237 _LOGE("Don't execute query = %s error message = %s\n", query,
239 sqlite3_free(error_message);
242 sqlite3_free(error_message);
246 void __cleanup_list_pkginfo(pkgmgr_pkginfo_x *list_pkginfo, pkgmgr_pkginfo_x *node)
248 pkgmgr_pkginfo_x *temp_node = NULL;
250 if (list_pkginfo != NULL) {
251 LISTHEAD(list_pkginfo, node);
252 temp_node = node->next;
255 temp_node = node->next;
256 __cleanup_pkginfo(node);
259 __cleanup_pkginfo(list_pkginfo);
263 void __cleanup_pkginfo(pkgmgr_pkginfo_x *data)
268 FREE_AND_NULL(data->locale);
270 _pkgmgrinfo_basic_free_manifest_x(data->manifest_info);
275 void __cleanup_appinfo(pkgmgr_appinfo_x *data)
280 FREE_AND_NULL(data->locale);
282 manifest_x *mfx = calloc(1, sizeof(manifest_x));
284 _LOGE("out of memory");
288 mfx->uiapplication = data->uiapp_info;
289 _pkgmgrinfo_basic_free_manifest_x(mfx);
294 char* __convert_system_locale_to_manifest_locale()
296 char *syslocale = NULL;
298 syslocale = vconf_get_str(VCONFKEY_LANGSET);
300 if (syslocale == NULL) {
301 _LOGE("syslocale is null\n");
302 return strdup(DEFAULT_LOCALE);
305 char *locale = malloc(6);
307 _LOGE("Malloc Failed\n");
308 FREE_AND_NULL(syslocale);
309 return strdup(DEFAULT_LOCALE);
312 sprintf(locale, "%c%c-%c%c", syslocale[0], syslocale[1], tolower(syslocale[3]), tolower(syslocale[4]));
314 FREE_AND_NULL(syslocale);
318 gint __compare_func(gconstpointer data1, gconstpointer data2)
320 pkgmgrinfo_node_x *node1 = (pkgmgrinfo_node_x*)data1;
321 pkgmgrinfo_node_x *node2 = (pkgmgrinfo_node_x*)data2;
322 if (node1->prop == node2->prop)
324 else if (node1->prop > node2->prop)
331 void __get_filter_condition(gpointer data, char **condition)
333 pkgmgrinfo_node_x *node = (pkgmgrinfo_node_x*)data;
334 char buf[MAX_QUERY_LEN + 1] = {'\0'};
335 char temp[PKG_STRING_LEN_MAX] = {'\0'};
336 switch (node->prop) {
337 case E_PMINFO_PKGINFO_PROP_PACKAGE_ID:
338 snprintf(buf, MAX_QUERY_LEN, "package_info.package='%s'", node->value);
340 case E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE:
341 snprintf(buf, MAX_QUERY_LEN, "package_info.package_type='%s'", node->value);
343 case E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION:
344 snprintf(buf, MAX_QUERY_LEN, "package_info.package_version='%s'", node->value);
346 case E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION:
347 snprintf(buf, MAX_QUERY_LEN, "package_info.install_location='%s'", node->value);
349 case E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE:
350 snprintf(buf, MAX_QUERY_LEN, "package_info.installed_storage='%s'", node->value);
352 case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME:
353 snprintf(buf, MAX_QUERY_LEN, "package_info.author_name='%s'", node->value);
355 case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF:
356 snprintf(buf, MAX_QUERY_LEN, "package_info.author_href='%s'", node->value);
358 case E_PMINFO_PKGINFO_PROP_PACKAGE_STORECLIENT_ID:
359 snprintf(buf, MAX_QUERY_LEN, "package_info.storeclient_id='%s'", node->value);
361 case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL:
362 snprintf(buf, MAX_QUERY_LEN, "package_info.author_email='%s'", node->value);
364 case E_PMINFO_PKGINFO_PROP_PACKAGE_SIZE:
365 snprintf(buf, MAX_QUERY_LEN, "package_info.package_size='%s'", node->value);
367 case E_PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE:
368 snprintf(buf, MAX_QUERY_LEN, "package_info.package_removable IN %s", node->value);
370 case E_PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD:
371 snprintf(buf, MAX_QUERY_LEN, "package_info.package_preload IN %s", node->value);
373 case E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY:
374 snprintf(buf, MAX_QUERY_LEN, "package_info.package_readonly IN %s", node->value);
376 case E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE:
377 snprintf(buf, MAX_QUERY_LEN, "package_info.package_update IN %s", node->value);
379 case E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING:
380 snprintf(buf, MAX_QUERY_LEN, "package_info.package_appsetting IN %s", node->value);
382 case E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING:
383 snprintf(buf, MAX_QUERY_LEN, "package_info.package_nodisplay IN %s", node->value);
385 case E_PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE:
386 snprintf(buf, MAX_QUERY_LEN, "package_info.package_support_disable IN %s", node->value);
388 case E_PMINFO_PKGINFO_PROP_PACKAGE_DISABLE:
389 snprintf(buf, MAX_QUERY_LEN, "package_info.package_disable IN %s", node->value);
391 case E_PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_MODE:
392 snprintf(buf, MAX_QUERY_LEN, "package_info.package_support_mode & %s", node->value);
394 case E_PMINFO_PKGINFO_PROP_PACKAGE_USE_RESET:
395 snprintf(buf, MAX_QUERY_LEN, "package_info.package_reserve2 IN %s", node->value);
398 case E_PMINFO_APPINFO_PROP_APP_ID:
399 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_id='%s'", node->value);
401 case E_PMINFO_APPINFO_PROP_APP_COMPONENT:
402 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_component='%s'", node->value);
404 case E_PMINFO_APPINFO_PROP_APP_COMPONENT_TYPE:
405 sqlite3_snprintf(MAX_QUERY_LEN, buf, "package_app_info.component_type=%Q", node->value);
407 case E_PMINFO_APPINFO_PROP_APP_EXEC:
408 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_exec='%s'", node->value);
410 case E_PMINFO_APPINFO_PROP_APP_AMBIENT_SUPPORT:
411 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_ambient_support='%s'", node->value);
413 case E_PMINFO_APPINFO_PROP_APP_ICON:
414 snprintf(buf, MAX_QUERY_LEN, "package_app_localized_info.app_icon='%s'", node->value);
416 case E_PMINFO_APPINFO_PROP_APP_TYPE:
417 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_type='%s'", node->value);
419 case E_PMINFO_APPINFO_PROP_APP_OPERATION:
420 snprintf(temp, PKG_STRING_LEN_MAX, "(%s)", node->value);
421 snprintf(buf, MAX_QUERY_LEN, "package_app_app_svc.operation IN %s", temp);
423 case E_PMINFO_APPINFO_PROP_APP_URI:
424 snprintf(temp, PKG_STRING_LEN_MAX, "(%s)", node->value);
425 snprintf(buf, MAX_QUERY_LEN, "package_app_app_svc.uri_scheme IN %s", temp);
427 case E_PMINFO_APPINFO_PROP_APP_MIME:
428 snprintf(temp, PKG_STRING_LEN_MAX, "(%s)", node->value);
429 snprintf(buf, MAX_QUERY_LEN, "package_app_app_svc.mime_type IN %s", temp);
431 case E_PMINFO_APPINFO_PROP_APP_CATEGORY:
432 snprintf(temp, PKG_STRING_LEN_MAX, "(%s)", node->value);
433 snprintf(buf, MAX_QUERY_LEN, "package_app_app_category.category IN %s", temp);
435 case E_PMINFO_APPINFO_PROP_APP_NODISPLAY:
436 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_nodisplay IN %s", node->value);
438 case E_PMINFO_APPINFO_PROP_APP_MULTIPLE:
439 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_multiple IN %s", node->value);
441 case E_PMINFO_APPINFO_PROP_APP_ONBOOT:
442 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_onboot IN %s", node->value);
444 case E_PMINFO_APPINFO_PROP_APP_AUTORESTART:
445 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_autorestart IN %s", node->value);
447 case E_PMINFO_APPINFO_PROP_APP_TASKMANAGE:
448 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_taskmanage IN %s", node->value);
450 case E_PMINFO_APPINFO_PROP_APP_HWACCELERATION:
451 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_hwacceleration='%s'", node->value);
453 case E_PMINFO_APPINFO_PROP_APP_SCREENREADER:
454 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_screenreader='%s'", node->value);
456 case E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION:
457 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_launchcondition IN %s", node->value);
459 case E_PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE:
460 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_support_disable IN %s", node->value);
462 case E_PMINFO_APPINFO_PROP_APP_DISABLE:
463 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_disable IN %s", node->value);
465 case E_PMINFO_APPINFO_PROP_APP_REMOVABLE:
466 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_removable IN %s", node->value);
468 case E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE:
469 snprintf(buf, MAX_QUERY_LEN, "package_app_info.app_support_mode & %s", node->value);
472 _LOGE("Invalid Property Type\n");
476 *condition = strdup(buf);
480 int __pkginfo_check_installed_storage(pkgmgr_pkginfo_x *pkginfo)
482 char buf[MAX_QUERY_LEN] = {'\0'};
483 retvm_if(pkginfo->manifest_info->package == NULL, PMINFO_R_OK, "pkgid is NULL\n");
484 retvm_if(pkginfo->manifest_info->installed_storage == NULL, PMINFO_R_ERROR, "installed_storage is NULL\n");
486 if (strcmp(pkginfo->manifest_info->installed_storage,"installed_external") == 0) {
487 snprintf(buf, MAX_QUERY_LEN - 1, "%s%s", PKG_SD_PATH, pkginfo->manifest_info->package);
488 if (access(buf, R_OK) != 0) {
489 _LOGE("can not access [%s]", buf);
490 return PMINFO_R_ERROR;
497 int __appinfo_check_installed_storage(pkgmgr_appinfo_x *appinfo)
499 char buf[MAX_QUERY_LEN] = {'\0'};
500 char pkgid[MAX_QUERY_LEN] = {'\0'};
502 snprintf(pkgid, MAX_QUERY_LEN - 1, "%s", appinfo->uiapp_info->package);
504 retvm_if(appinfo->uiapp_info->installed_storage == NULL, PMINFO_R_ERROR, "installed_storage is NULL\n");
506 if (strcmp(appinfo->uiapp_info->installed_storage,"installed_external") == 0) {
507 snprintf(buf, MAX_QUERY_LEN - 1, "%s%s", PKG_SD_PATH, pkgid);
508 if (access(buf, R_OK) != 0) {
509 _LOGE("can not access [%s]", buf);
510 return PMINFO_R_ERROR;