Replaced API's in pkgmgr-info.h with corresponding public API's 29/195429/2
authorTezaswy Singh <tezaswy.s@samsung.com>
Thu, 13 Dec 2018 18:57:50 +0000 (00:27 +0530)
committerTEZASWY SINGH <tezaswy.s@samsung.com>
Fri, 14 Dec 2018 09:14:48 +0000 (09:14 +0000)
Change-Id: If55f15e22d6fb16caa94d3017d79fa7d266f4c1d

src/add-viewer_package.c [changed mode: 0644->0755]
src/clock.c
src/notification/noti_detail_view.c
src/notification/noti_popup_small_view.c
src/pkgmgr.c
src/util.c

old mode 100644 (file)
new mode 100755 (executable)
index 922c752..769b355
@@ -27,7 +27,7 @@
 #include <widget_service_internal.h>
 #include <widget_service.h>
 #include <widget_errno.h>
-#include <pkgmgr-info.h>
+#include <package_manager.h>
 
 #if defined(LOG_TAG)
 #undef LOG_TAG
@@ -100,19 +100,19 @@ static int is_preloaded(const char *pkgid)
 {
        int ret;
        bool preload;
-       pkgmgrinfo_pkginfo_h handle;
+       package_info_h handle;
 
-       ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
-       if (ret != PMINFO_R_OK)
+       ret = package_manager_get_package_info(pkgid, &handle);
+       if (ret != PACKAGE_MANAGER_ERROR_NONE)
                return 0;
 
-       ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
-       if (ret != PMINFO_R_OK) {
-               pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+       ret = package_info_is_preload_package(handle, &preload);
+       if (ret != PACKAGE_MANAGER_ERROR_NONE) {
+               package_info_destroy(handle);
                return 0;
        }
 
-       pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+       package_info_destroy(handle);
        return preload == true ? 1 : 0;
 }
 #endif
@@ -138,7 +138,7 @@ static int load_name_and_icon(struct add_viewer_package *item)
 
        if (!item->name || !item->icon) {
                char *pkgname;
-               pkgmgrinfo_appinfo_h ai;
+               package_info_h ai;
                int ret;
 
                pkgname = widget_service_get_main_app_id(item->pkgname);
@@ -147,10 +147,10 @@ static int load_name_and_icon(struct add_viewer_package *item)
                        return -EINVAL;
                }
 
-               ret = pkgmgrinfo_appinfo_get_appinfo(pkgname, &ai);
+               ret = package_manager_get_package_info(pkgname, &ai);
                free((char *)pkgname);
 
-               if (ret != PMINFO_R_OK) {
+               if (ret != PACKAGE_MANAGER_ERROR_NONE) {
                        ErrPrint("Failed to get appinfo: %s\n", add_viewer_package_list_pkgname(item));
                        if (!item->name) {
                                ret = add_viewer_package_list_set_name(item, add_viewer_package_list_pkgname(item));
@@ -170,33 +170,33 @@ static int load_name_and_icon(struct add_viewer_package *item)
 
                if (!item->icon) {
                        char *icon;
-                       ret = pkgmgrinfo_appinfo_get_icon(ai, &icon);
-                       if (ret != PMINFO_R_OK || !icon || access(icon, R_OK) != 0) {
+                       ret = package_info_get_icon(ai, &icon);
+                       if (ret != PACKAGE_MANAGER_ERROR_NONE || !icon || access(icon, R_OK) != 0) {
                                ErrPrint("Fail to get the icon path %s - %d\n", icon, errno);
                                icon = RESDIR"/image/unknown.png";
                        }
 
                        ret = add_viewer_package_list_set_icon(item, icon);
                        if (ret != 0) {
-                               pkgmgrinfo_appinfo_destroy_appinfo(ai);
+                               package_info_destroy(ai);
                                return ret;
                        }
                }
 
                if (!item->name) {
                        char *name;
-                       ret = pkgmgrinfo_appinfo_get_label(ai, &name);
-                       if (ret != PMINFO_R_OK || !name)
+                       ret = package_info_get_label(ai, &name);
+                       if (ret != PACKAGE_MANAGER_ERROR_NONE || !name)
                                name = item->pkgname;
 
                        ret = add_viewer_package_list_set_name(item, name);
                        if (ret != 0) {
-                               pkgmgrinfo_appinfo_destroy_appinfo(ai);
+                               package_info_destroy(ai);
                                return ret;
                        }
                }
 
-               pkgmgrinfo_appinfo_destroy_appinfo(ai);
+               package_info_destroy(ai);
        }
 
        return 0;
index 04ba4d926f96fd84ea5eec935518f2e62aab9775..5c2e441cf3802710f67130c3a2537b66d9a230a3 100755 (executable)
@@ -19,7 +19,6 @@
 #include <efl_extension.h>
 #include <watch_control.h>
 #include <vconf.h>
-#include <pkgmgr-info.h>
 #include <pkgmgrinfo_type.h>
 #include <app_control_internal.h>
 #include <time.h>
index 86baab5c088de3d3d88bb0a739121f7cc546bcdc..02068cf7b3a466ecb6b53e4151e2130b14cffcb4 100755 (executable)
@@ -21,7 +21,6 @@
 #include <glib.h>
 #include <stdbool.h>
 #include <package_manager.h>
-#include <pkgmgr-info.h>
 #include <app_manager.h>
 #include <vconf.h>
 
@@ -426,19 +425,19 @@ static bool _noti_detail_view_check_package_info(const char *package_id)
 
 static char *_noti_detail_view_get_app_name(char *appid)
 {
-       pkgmgrinfo_appinfo_h handle;
+       package_info_h handle;
        char *name = NULL;
        int ret;
 
-       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
-       if (ret != PMINFO_R_OK) {
-               _E("Failed[%d] pkgmgrinfo_appinfo_get_appinfo(%s)", ret, appid);
+       ret = package_manager_get_package_info(appid, &handle);
+       if (ret != PACKAGE_MANAGER_ERROR_NONE) {
+               _E("Failed[%d] package_manager_get_package_info(%s)", ret, appid);
                return NULL;
        }
-       ret = pkgmgrinfo_appinfo_get_label(handle, &name);
-       if (ret != PMINFO_R_OK) {
-               _E("pkgmgrinfo_appinfo_get_label(%s) : %d", appid, ret);
-               pkgmgrinfo_appinfo_destroy_appinfo(handle);
+       ret = package_info_get_label(handle, &name);
+       if (ret != PACKAGE_MANAGER_ERROR_NONE) {
+               _E("(package_info_get_label(%s) : %d", appid, ret);
+               package_info_destroy(handle);
                return NULL;
        }
 
index 55c8b882d860a030c71f1c717259b1011a27e78c..1a0bb83f7bf50ee5ad9035bcddd821e363b46135 100755 (executable)
@@ -18,8 +18,8 @@
 
 #include <Elementary.h>
 #include <app_common.h>
+#include <package_manager.h>
 #include <notification.h>
-#include <pkgmgr-info.h>
 #include "util.h"
 #include "log.h"
 #include "home_app_manager.h"
@@ -44,19 +44,19 @@ static struct noti_small_popup_view_info_t {
 
 static char *_noti_small_popup_view_get_app_name(char *appid)
 {
-       pkgmgrinfo_appinfo_h handle;
+       package_info_h handle;
        char *name = NULL;
        int ret;
 
-       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
-       if (ret != PMINFO_R_OK) {
-               _E("Failed[%d] pkgmgrinfo_appinfo_get_appinfo(%s)", ret, appid);
+       ret = package_manager_get_package_info(appid, &handle);
+       if (ret != PACKAGE_MANAGER_ERROR_NONE) {
+               _E("Failed[%d] package_manager_get_package_info(%s)", ret, appid);
                return NULL;
        }
-       ret = pkgmgrinfo_appinfo_get_label(handle, &name);
-       if (ret != PMINFO_R_OK) {
-               _E("pkgmgrinfo_appinfo_get_label(%s) : %d", appid, ret);
-               pkgmgrinfo_appinfo_destroy_appinfo(handle);
+       ret = package_info_get_label(handle, &name);
+       if (ret != PACKAGE_MANAGER_ERROR_NONE) {
+               _E("package_info_get_label(%s) : %d", appid, ret);
+               package_info_destroy(handle);
                return NULL;
        }
 
index 91552cc91ef00cb136720cb1075553df15fdf5c9..3986b4557ff4bce3da9e4c035ae7a68969f578e1 100755 (executable)
@@ -20,6 +20,7 @@
 #include <pkgmgr-info.h>
 #include <bundle.h>
 #include <dlog.h>
+#include<package_manager.h>
 
 #include <widget_service.h>
 
@@ -321,15 +322,15 @@ HAPI w_home_error_e pkgmgr_uninstall(const char *appid)
        req_pc = pkgmgr_client_new(PC_REQUEST);
        retv_if(NULL == req_pc, W_HOME_ERROR_FAIL);
 
-       pkgmgrinfo_appinfo_h handle = NULL;
-       if (PMINFO_R_OK != pkgmgrinfo_appinfo_get_appinfo(appid, &handle)) {
+       package_info_h handle = NULL;
+       if (PACKAGE_MANAGER_ERROR_NONE != package_manager_get_package_info(appid, &handle)) {
                if (PKGMGR_R_OK != pkgmgr_client_free(req_pc))
                        _E("cannot free pkgmgr_client for request.");
                return W_HOME_ERROR_FAIL;
        }
 
-       if (PMINFO_R_OK != pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid)) {
-               if (PMINFO_R_OK != pkgmgrinfo_appinfo_destroy_appinfo(handle))
+       if (PACKAGE_MANAGER_ERROR_NONE != package_info_get_package(handle, &pkgid)) {
+               if (PACKAGE_MANAGER_ERROR_NONE != package_info_destroy(handle))
                        _E("cannot destroy the appinfo");
 
                if (PKGMGR_R_OK != pkgmgr_client_free(req_pc))
@@ -346,7 +347,7 @@ HAPI w_home_error_e pkgmgr_uninstall(const char *appid)
                ret = W_HOME_ERROR_FAIL;
        }
 
-       if (PMINFO_R_OK != pkgmgrinfo_appinfo_destroy_appinfo(handle)) {
+       if (PMINFO_R_OK != package_info_destroy(handle)) {
                _E("cannot destroy the appinfo");
                ret = W_HOME_ERROR_FAIL;
        }
@@ -740,15 +741,15 @@ HAPI void pkgmgr_fini(void)
 HAPI int pkgmgr_exist(char *appid)
 {
        int ret = 0;
-       pkgmgrinfo_appinfo_h handle = NULL;
+       package_info_h handle = NULL;
 
-       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
-       if (PMINFO_R_OK != ret || NULL == handle) {
+       ret = package_manager_get_package_info(appid, &handle);
+       if (PACKAGE_MANAGER_ERROR_NONE != ret || NULL == handle) {
                _SD("%s doesn't exist in this binary", appid);
                return 0;
        }
 
-       pkgmgrinfo_appinfo_destroy_appinfo(handle);
+       package_info_destroy(handle);
 
        return 1;
 }
index 150471c3d45e8f85bb1b0bd546bb8a8fd8a3bf5a..b1e7aa0621092448df91ff26971d02f84d2b75c9 100755 (executable)
@@ -30,7 +30,7 @@
 #include <pkgmgr-info.h>
 #include <widget_service.h>
 #include <bundle_internal.h>
-#include <app_control.h>
+#include <package_manager.h>
 
 #include <unicode/unum.h>
 #include <unicode/ustring.h>
@@ -534,17 +534,17 @@ static char *_get_app_pkgname(const char *appid)
 {
        int ret = 0;
        char *pkgname = NULL;
-       pkgmgrinfo_appinfo_h handle = NULL;
+       package_info_h handle = NULL;
        retv_if(appid == NULL, NULL);
 
-       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
-       if (ret != PMINFO_R_OK) {
+       ret = package_manager_get_package_info(appid, &handle);
+       if (ret != PACKAGE_MANAGER_ERROR_NONE) {
                _E("Failed to get app information from pkgmgr");
                goto ERR;
        }
 
-       ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
-       if (ret != PMINFO_R_OK) {
+       ret = package_info_get_package(handle, &pkgname);
+       if (ret != PACKAGE_MANAGER_ERROR_NONE) {
                _E("Failed to get pkgname from app info handler");
                goto ERR;
        }
@@ -553,7 +553,7 @@ static char *_get_app_pkgname(const char *appid)
 
 ERR:
        if (handle != NULL)
-               pkgmgrinfo_appinfo_destroy_appinfo(handle);
+               package_info_destroy(handle);
 
        return pkgname;
 }
@@ -564,16 +564,16 @@ static int _get_app_type(char *pkgname)
 {
        int ret = 0;
        char *apptype = NULL;
-       pkgmgrinfo_pkginfo_h handle = NULL;
+       package_info_h handle = NULL;
        retv_if(pkgname == NULL, APP_TYPE_NATIVE);
 
-       ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgname, &handle);
+       ret = package_manager_get_package_info(pkgname, &handle);
        if (ret != PMINFO_R_OK) {
                _E("Failed to get pkg information from pkgmgr");
                return APP_TYPE_NATIVE;
        }
 
-       ret = pkgmgrinfo_pkginfo_get_type(handle, &apptype);
+       ret = package_info_get_type(handle, &apptype);
        if (ret != PMINFO_R_OK) {
                _E("Failed to get app type from pkginfo handler");
                goto ERR;
@@ -581,7 +581,7 @@ static int _get_app_type(char *pkgname)
 
        if (apptype != NULL) {
                if (strcmp(apptype, "wgt") == 0) {
-                       pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+                       package_info_destroy(handle);
                        return APP_TYPE_WEB;
                } else {
                        char *widget_id;
@@ -589,7 +589,7 @@ static int _get_app_type(char *pkgname)
                        if (widget_id) {
                                _D("Widget: %s\n", widget_id);
                                free(widget_id);
-                               pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+                               package_info_destroy(handle);
                                return APP_TYPE_WIDGET;
                        }
                        _D("MC: %s\n", pkgname);
@@ -597,7 +597,7 @@ static int _get_app_type(char *pkgname)
        }
 
 ERR:
-       pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+       package_info_destroy(handle);
        return APP_TYPE_NATIVE;
 }