Remove unused apis
[platform/core/appfw/pkgmgr-info.git] / src / pkgmgrinfo_pkginfo.c
index 051979f..8423b8a 100644 (file)
@@ -32,9 +32,6 @@
 #include <libgen.h>
 #include <sys/stat.h>
 
-#include <libxml/parser.h>
-#include <libxml/xmlreader.h>
-#include <libxml/xmlschemas.h>
 #include <sqlite3.h>
 #include <glib.h>
 
@@ -48,9 +45,7 @@
 
 static bool _get_bool_value(const char *str)
 {
-       if (str == NULL)
-               return false;
-       else if (!strcasecmp(str, "true"))
+       if (str && !strcmp(str, "true"))
                return true;
        else
                return false;
@@ -98,37 +93,6 @@ static void __cleanup_pkginfo(pkgmgr_pkginfo_x *data)
        return;
 }
 
-static int __child_element(xmlTextReaderPtr reader, int depth)
-{
-       int ret = xmlTextReaderRead(reader);
-       int cur = xmlTextReaderDepth(reader);
-       while (ret == 1) {
-
-               switch (xmlTextReaderNodeType(reader)) {
-               case XML_READER_TYPE_ELEMENT:
-                       if (cur == depth + 1)
-                               return 1;
-                       break;
-               case XML_READER_TYPE_TEXT:
-                       /*text is handled by each function separately*/
-                       if (cur == depth + 1)
-                               return 0;
-                       break;
-               case XML_READER_TYPE_END_ELEMENT:
-                       if (cur == depth)
-                               return 0;
-                       break;
-               default:
-                       if (cur <= depth)
-                               return 0;
-                       break;
-               }
-               ret = xmlTextReaderRead(reader);
-               cur = xmlTextReaderDepth(reader);
-       }
-       return ret;
-}
-
 long long _pkgmgr_calculate_dir_size(char *dirname)
 {
        long long total = 0;
@@ -888,8 +852,10 @@ API int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
        retvm_if(type == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
 
-       if (info->pkg_info == NULL || info->pkg_info->type == NULL)
+       if (info->pkg_info == NULL)
                return PMINFO_R_ERROR;
+       if (info->pkg_info->type == NULL)
+               info->pkg_info->type = strdup("");
 
        *type = (char *)info->pkg_info->type;
 
@@ -903,8 +869,10 @@ API int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **versi
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
        retvm_if(version == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
 
-       if (info->pkg_info == NULL || info->pkg_info->version == NULL)
+       if (info->pkg_info == NULL)
                return PMINFO_R_ERROR;
+       if (info->pkg_info->version == NULL)
+               info->pkg_info->version = strdup("");
 
        *version = (char *)info->pkg_info->version;
 
@@ -918,8 +886,10 @@ API int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **a
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
        retvm_if(api_version == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
 
-       if (info->pkg_info == NULL || info->pkg_info->api_version == NULL)
+       if (info->pkg_info == NULL)
                return PMINFO_R_ERROR;
+       if (info->pkg_info->api_version == NULL)
+               info->pkg_info->api_version = strdup("");
 
        *api_version = (char *)info->pkg_info->api_version;
 
@@ -936,9 +906,6 @@ API int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_
        if (info->pkg_info == NULL || info->pkg_info->tep_name == NULL)
                return PMINFO_R_ERROR;
 
-       if (strlen(info->pkg_info->tep_name) == 0)
-               return PMINFO_R_ERROR;
-
        *tep_name = (char *)info->pkg_info->tep_name;
 
        return PMINFO_R_OK;
@@ -953,10 +920,10 @@ API int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char
 
        if (info->pkg_info == NULL)
                return PMINFO_R_ERROR;
+       if (info->pkg_info->zip_mount_file == NULL)
+               info->pkg_info->zip_mount_file = strdup("");
 
-       if (info->pkg_info->zip_mount_file &&
-                       strlen(info->pkg_info->zip_mount_file) > 0)
-               *zip_mount_file = (char *)info->pkg_info->zip_mount_file;
+       *zip_mount_file = (char *)info->pkg_info->zip_mount_file;
 
        return PMINFO_R_OK;
 }
@@ -986,172 +953,25 @@ API int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkg
 API int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
 {
        pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
+       char *temp = NULL;
 
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
        retvm_if(size == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
 
-       if (info->pkg_info == NULL || info->pkg_info->package_size == NULL)
-               return PMINFO_R_ERROR;
-
-       *size = atoi((char *)info->pkg_info->package_size);
-
-       return PMINFO_R_OK;
-}
-
-API int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
-{
-       char *pkgid;
-       char device_path[PKG_STRING_LEN_MAX] = { '\0', };
-       long long rw_size = 0;
-       long long ro_size = 0;
-       long long tmp_size = 0;
-       long long total_size = 0;
-       struct stat fileinfo;
-       int ret;
-
-       retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
-       retvm_if(size == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
-
-       ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
-       if (ret < 0)
+       if (info->pkg_info == NULL)
                return PMINFO_R_ERROR;
 
-       /* RW area */
-       snprintf(device_path, PKG_STRING_LEN_MAX, "%s%s/bin", PKG_RW_PATH, pkgid);
-       if (lstat(device_path, &fileinfo) == 0) {
-               if (!S_ISLNK(fileinfo.st_mode)) {
-                       tmp_size = _pkgmgr_calculate_dir_size(device_path);
-                       if (tmp_size > 0)
-                               rw_size += tmp_size;
-               }
-       }
-
-       snprintf(device_path, PKG_STRING_LEN_MAX, "%s%s/info", PKG_RW_PATH, pkgid);
-       if (lstat(device_path, &fileinfo) == 0) {
-               if (!S_ISLNK(fileinfo.st_mode)) {
-                       tmp_size = _pkgmgr_calculate_dir_size(device_path);
-                       if (tmp_size > 0)
-                       rw_size += tmp_size;
-               }
-       }
-
-       snprintf(device_path, PKG_STRING_LEN_MAX, "%s%s/res", PKG_RW_PATH, pkgid);
-       if (lstat(device_path, &fileinfo) == 0) {
-               if (!S_ISLNK(fileinfo.st_mode)) {
-                       tmp_size = _pkgmgr_calculate_dir_size(device_path);
-                       if (tmp_size > 0)
-                       rw_size += tmp_size;
-               }
-       }
-
-       snprintf(device_path, PKG_STRING_LEN_MAX, "%s%s/data", PKG_RW_PATH, pkgid);
-       if (lstat(device_path, &fileinfo) == 0) {
-               if (!S_ISLNK(fileinfo.st_mode)) {
-                       tmp_size = _pkgmgr_calculate_dir_size(device_path);
-                       if (tmp_size > 0)
-                               rw_size += tmp_size;
-               }
-       }
-
-       snprintf(device_path, PKG_STRING_LEN_MAX, "%s%s/shared", PKG_RW_PATH, pkgid);
-       if (lstat(device_path, &fileinfo) == 0) {
-               if (!S_ISLNK(fileinfo.st_mode)) {
-                       tmp_size = _pkgmgr_calculate_dir_size(device_path);
-                       if (tmp_size > 0)
-                               rw_size += tmp_size;
-       }
-       }
-
-       snprintf(device_path, PKG_STRING_LEN_MAX, "%s%s/setting", PKG_RW_PATH, pkgid);
-       if (lstat(device_path, &fileinfo) == 0) {
-               if (!S_ISLNK(fileinfo.st_mode)) {
-                       tmp_size = _pkgmgr_calculate_dir_size(device_path);
-                       if (tmp_size > 0)
-                               rw_size += tmp_size;
-               }
-       }
-
-       /* RO area */
-       snprintf(device_path, PKG_STRING_LEN_MAX, "%s%s/bin", PKG_RO_PATH, pkgid);
-       if (lstat(device_path, &fileinfo) == 0) {
-               if (!S_ISLNK(fileinfo.st_mode)) {
-                       tmp_size = _pkgmgr_calculate_dir_size(device_path);
-                       if (tmp_size > 0)
-                               ro_size += tmp_size;
-               }
-       }
-
-       snprintf(device_path, PKG_STRING_LEN_MAX, "%s%s/info", PKG_RO_PATH, pkgid);
-       if (lstat(device_path, &fileinfo) == 0) {
-               if (!S_ISLNK(fileinfo.st_mode)) {
-                       tmp_size = _pkgmgr_calculate_dir_size(device_path);
-                       if (tmp_size > 0)
-                               ro_size += tmp_size;
-               }
-       }
-
-       snprintf(device_path, PKG_STRING_LEN_MAX, "%s%s/res", PKG_RO_PATH, pkgid);
-       if (lstat(device_path, &fileinfo) == 0) {
-               if (!S_ISLNK(fileinfo.st_mode)) {
-                       tmp_size = _pkgmgr_calculate_dir_size(device_path);
-                       if (tmp_size > 0)
-                               ro_size += tmp_size;
-               }
-       }
-
-       snprintf(device_path, PKG_STRING_LEN_MAX, "%s%s/data", PKG_RO_PATH, pkgid);
-       if (lstat(device_path, &fileinfo) == 0) {
-               if (!S_ISLNK(fileinfo.st_mode)) {
-                       tmp_size = _pkgmgr_calculate_dir_size(device_path);
-                       if (tmp_size > 0)
-                               ro_size += tmp_size;
-               }
-       }
-
-       snprintf(device_path, PKG_STRING_LEN_MAX, "%s%s/shared", PKG_RO_PATH, pkgid);
-       if (lstat(device_path, &fileinfo) == 0) {
-               if (!S_ISLNK(fileinfo.st_mode)) {
-                       tmp_size = _pkgmgr_calculate_dir_size(device_path);
-                       if (tmp_size > 0)
-                               ro_size += tmp_size;
-               }
-       }
-
-       snprintf(device_path, PKG_STRING_LEN_MAX, "%s%s/setting", PKG_RO_PATH, pkgid);
-       if (lstat(device_path, &fileinfo) == 0) {
-               if (!S_ISLNK(fileinfo.st_mode)) {
-                       tmp_size = _pkgmgr_calculate_dir_size(device_path);
-                       if (tmp_size > 0)
-                               ro_size += tmp_size;
+       if (info->pkg_info->package_size == NULL) {
+               temp = strdup("");
+               if (temp == NULL) {
+                       _LOGE("out of memory");
+                       return PMINFO_R_ERROR;
+               } else {
+                       info->pkg_info->package_size = temp;
                }
        }
 
-       /* Total size */
-       total_size = rw_size + ro_size;
-       *size = (int)total_size;
-
-       return PMINFO_R_OK;
-}
-
-API int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
-{
-       char *pkgid;
-       char device_path[PKG_STRING_LEN_MAX] = { '\0', };
-       long long total_size = 0;
-
-       retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
-       retvm_if(size == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
-
-       if (pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid) < 0)
-               return PMINFO_R_ERROR;
-
-       snprintf(device_path, PKG_STRING_LEN_MAX, "%s%s/data", PKG_RW_PATH, pkgid);
-       if (access(device_path, R_OK) == 0)
-               total_size = _pkgmgr_calculate_dir_size(device_path);
-       if (total_size < 0)
-               return PMINFO_R_ERROR;
-
-       *size = (int)total_size;
+       *size = atoi((char *)info->pkg_info->package_size);
 
        return PMINFO_R_OK;
 }
@@ -1169,13 +989,12 @@ API int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
        locale = info->locale;
        retvm_if(locale == NULL, PMINFO_R_ERROR, "manifest locale is NULL");
 
-       if (info->pkg_info == NULL)
+       if (info->pkg_info == NULL || info->pkg_info->icon == NULL)
                return PMINFO_R_ERROR;
 
        for (tmp = info->pkg_info->icon; tmp; tmp = tmp->next) {
                ptr = (icon_x *)tmp->data;
                if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
-                               !strcasecmp(ptr->text, "(null)") ||
                                strcmp(ptr->lang, locale))
                        continue;
                *icon = (char *)ptr->text;
@@ -1192,7 +1011,9 @@ API int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
                return PMINFO_R_OK;
        }
 
-       return PMINFO_R_ERROR;
+       *icon = "";
+
+       return PMINFO_R_OK;
 }
 
 API int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
@@ -1208,6 +1029,9 @@ API int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
        locale = info->locale;
        retvm_if(locale == NULL, PMINFO_R_ERROR, "manifest locale is NULL");
 
+       if (info->pkg_info == NULL || info->pkg_info->label == NULL)
+               return PMINFO_R_ERROR;
+
        for (tmp = info->pkg_info->label; tmp != NULL; tmp = tmp->next) {
                ptr = (label_x *)tmp->data;
                if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
@@ -1227,7 +1051,9 @@ API int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
                return PMINFO_R_OK;
        }
 
-       return PMINFO_R_ERROR;
+       *label = "";
+
+       return PMINFO_R_OK;
 }
 
 API int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
@@ -1243,6 +1069,9 @@ API int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **d
        locale = info->locale;
        retvm_if(locale == NULL, PMINFO_R_ERROR, "manifest locale is NULL");
 
+       if (info->pkg_info == NULL || info->pkg_info->description == NULL)
+               return PMINFO_R_ERROR;
+
        for (tmp = info->pkg_info->description; tmp; tmp = tmp->next) {
                ptr = (description_x *)tmp->data;
                if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
@@ -1262,7 +1091,9 @@ API int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **d
                return PMINFO_R_OK;
        }
 
-       return PMINFO_R_ERROR;
+       *description = "";
+
+       return PMINFO_R_OK;
 }
 
 API int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
@@ -1277,8 +1108,10 @@ API int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **a
                return PMINFO_R_ERROR;
 
        author = (author_x *)info->pkg_info->author->data;
-       if (author == NULL || author->text == NULL)
+       if (author == NULL)
                return PMINFO_R_ERROR;
+       if (author->text == NULL)
+               author->text = strdup("");
 
        *author_name = (char *)author->text;
 
@@ -1297,8 +1130,10 @@ API int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **
                return PMINFO_R_ERROR;
 
        author = (author_x *)info->pkg_info->author->data;
-       if (author == NULL || author->email == NULL)
+       if (author == NULL)
                return PMINFO_R_ERROR;
+       if (author->email == NULL)
+               author->email = strdup("");
 
        *author_email = (char *)author->email;
 
@@ -1317,8 +1152,10 @@ API int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **a
                return PMINFO_R_ERROR;
 
        author = (author_x *)info->pkg_info->author->data;
-       if (author == NULL || author->href == NULL)
+       if (author == NULL)
                return PMINFO_R_ERROR;
+       if (author->href == NULL)
+               author->href = strdup("");
 
        *author_href = (char *)author->href;
 
@@ -1367,8 +1204,10 @@ API int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char *
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
        retvm_if(storeclientid == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
 
-       if (info->pkg_info == NULL || info->pkg_info->storeclient_id == NULL)
+       if (info->pkg_info == NULL)
                return PMINFO_R_ERROR;
+       if (info->pkg_info->storeclient_id == NULL)
+               info->pkg_info->storeclient_id = strdup("");
 
        *storeclientid = (char *)info->pkg_info->storeclient_id;
 
@@ -1397,120 +1236,16 @@ API int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
        retvm_if(url == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
 
-       if (info->pkg_info == NULL || info->pkg_info->package_url == NULL)
+       if (info->pkg_info == NULL)
                return PMINFO_R_ERROR;
+       if (info->pkg_info->package_url == NULL)
+               info->pkg_info->package_url = strdup("");
 
        *url = (char *)info->pkg_info->package_url;
 
        return PMINFO_R_OK;
 }
 
-API int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size)
-{
-       const char *val = NULL;
-       const xmlChar *node;
-       xmlTextReaderPtr reader;
-       retvm_if(manifest == NULL, PMINFO_R_EINVAL, "Input argument is NULL\n");
-       retvm_if(size == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
-
-       xmlInitParser();
-       reader = xmlReaderForFile(manifest, NULL, 0);
-
-       if (reader){
-               if (__child_element(reader, -1)) {
-                       node = xmlTextReaderConstName(reader);
-                       if (!node) {
-                               _LOGE("xmlTextReaderConstName value is NULL\n");
-                               xmlFreeTextReader(reader);
-                               xmlCleanupParser();
-                               return PMINFO_R_ERROR;
-                       }
-
-                       if (!strcmp(ASC_CHAR(node), "manifest")) {
-                               if (xmlTextReaderGetAttribute(reader, XML_CHAR("size")))
-                                       val = ASC_CHAR(xmlTextReaderGetAttribute(reader, XML_CHAR("size")));
-
-                               if (val) {
-                                       *size = atoi(val);
-                               } else {
-                                       *size = 0;
-                                       _LOGE("package size is not specified\n");
-                                       xmlFreeTextReader(reader);
-                                       xmlCleanupParser();
-                                       return PMINFO_R_ERROR;
-                               }
-                       } else {
-                               _LOGE("Unable to create xml reader\n");
-                               xmlFreeTextReader(reader);
-                               xmlCleanupParser();
-                               return PMINFO_R_ERROR;
-                       }
-               }
-       } else {
-               _LOGE("xmlReaderForFile value is NULL\n");
-               xmlCleanupParser();
-               return PMINFO_R_ERROR;
-       }
-
-       xmlFreeTextReader(reader);
-       xmlCleanupParser();
-
-       return PMINFO_R_OK;
-}
-
-API int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location)
-{
-       const char *val = NULL;
-       const xmlChar *node;
-       xmlTextReaderPtr reader;
-       retvm_if(manifest == NULL, PMINFO_R_EINVAL, "Input argument is NULL\n");
-       retvm_if(location == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
-
-       xmlInitParser();
-       reader = xmlReaderForFile(manifest, NULL, 0);
-
-       if (reader) {
-               if ( __child_element(reader, -1)) {
-                       node = xmlTextReaderConstName(reader);
-                       if (!node) {
-                               _LOGE("xmlTextReaderConstName value is NULL\n");
-                               xmlFreeTextReader(reader);
-                               xmlCleanupParser();
-                               return PMINFO_R_ERROR;
-                       }
-
-                       if (!strcmp(ASC_CHAR(node), "manifest")) {
-                               if (xmlTextReaderGetAttribute(reader, XML_CHAR("install-location")))
-                                       val = ASC_CHAR(xmlTextReaderGetAttribute(reader, XML_CHAR("install-location")));
-
-                               if (val) {
-                                       if (strcmp(val, "internal-only") == 0)
-                                               *location = PMINFO_INSTALL_LOCATION_INTERNAL_ONLY;
-                                       else if (strcmp(val, "prefer-external") == 0)
-                                               *location = PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL;
-                                       else
-                                               *location = PMINFO_INSTALL_LOCATION_AUTO;
-                               }
-                       } else {
-                               _LOGE("Unable to create xml reader\n");
-                               xmlFreeTextReader(reader);
-                               xmlCleanupParser();
-                               return PMINFO_R_ERROR;
-                       }
-               }
-       } else {
-               _LOGE("xmlReaderForFile value is NULL\n");
-               xmlCleanupParser();
-               return PMINFO_R_ERROR;
-       }
-
-       xmlFreeTextReader(reader);
-       xmlCleanupParser();
-
-       return PMINFO_R_OK;
-}
-
-
 API int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
 {
        pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
@@ -1533,8 +1268,10 @@ API int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
        retvm_if(path == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
 
-       if (info->pkg_info == NULL || info->pkg_info->csc_path == NULL)
+       if (info->pkg_info == NULL)
                return PMINFO_R_ERROR;
+       if (info->pkg_info->csc_path == NULL)
+               info->pkg_info->csc_path = strdup("");
 
        *path = (char *)info->pkg_info->csc_path;
 
@@ -1577,7 +1314,6 @@ API int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *acce
        }
 
        /*check whether application is in internal or not */
-       fp = fopen(app_dir_path, "r");
        if (fp == NULL) {
                _LOGD(" app path in internal memory not accesible\n");
                *accessible = 0;