#include <bundle.h>
#include <dlog.h>
#include<package_manager.h>
+#include <package_info.h>
#include <widget_service.h>
#include "pkgmgr.h"
-
struct pkgmgr_handler {
const char *key;
int (*func)(const char *package, const char *val, void *data);
ret = W_HOME_ERROR_FAIL;
}
- if (PMINFO_R_OK != package_info_destroy(handle)) {
+ if (PACKAGE_MANAGER_ERROR_NONE != package_info_destroy(handle)) {
_E("cannot destroy the appinfo");
ret = W_HOME_ERROR_FAIL;
}
-static int _end_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
+static bool _end_cb(package_info_app_component_type_e comp_type, const char* app_id, void* user_data)
{
- char *appid = NULL;
pkgmgr_request_s *rt = NULL;
- int ret = 0;
- retv_if(NULL == handle, -1);
retv_if(NULL == user_data, -1);
- ret = pkgmgrinfo_appinfo_get_appid(handle, &appid);
- if (ret < 0 || !appid) {
- _E("pkgmgrinfo_appinfo_get_appid error");
+ _E("AppID: [%s]", app_id);
+ if (!app_id) {
+ _E("appid is NULL: Error in fetching appid ");
return 0;
}
static w_home_error_e _end(const char *package, const char *val, void *data)
{
pkgmgr_request_s *rt = NULL;
- pkgmgrinfo_pkginfo_h handle = NULL;
+ package_info_h handle = NULL;
retv_if(!_exist_request_in_list(package), W_HOME_ERROR_FAIL);
goto OUT;
}
- retv_if(PMINFO_R_OK != pkgmgrinfo_pkginfo_get_pkginfo(package, &handle), W_HOME_ERROR_FAIL);
+ retv_if(PACKAGE_MANAGER_ERROR_NONE != package_manager_get_package_info(package, &handle), W_HOME_ERROR_FAIL);
/* Criteria : appid */
- if (PMINFO_R_OK != pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, _end_cb, rt)) {
+ if (PACKAGE_MANAGER_ERROR_NONE != package_info_foreach_app_from_package(handle, PACKAGE_INFO_UIAPP, _end_cb, rt)) {
if (W_HOME_ERROR_NONE != _remove_request_in_list(package))
_E("cannot remove a request(%s:%s)", rt->package, rt->status);
- pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ package_info_destroy(handle);
return W_HOME_ERROR_FAIL;
}
OUT:
if (W_HOME_ERROR_NONE != _remove_request_in_list(package))
_E("cannot remove a request(%s:%s)", rt->package, rt->status);
- if (handle) pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ if (handle) package_info_destroy(handle);
return W_HOME_ERROR_NONE;
}
#include <vconf.h>
#include <efl_extension.h>
#include <efl_util.h>
-#include <pkgmgr-info.h>
+#include <package_manager.h>
#include <widget_service.h>
#include <bundle_internal.h>
#include <package_manager.h>
{
int ret = 0;
char *appid = 0;
- pkgmgrinfo_pkginfo_h handle = NULL;
+ package_info_h handle = NULL;
retv_if(pkgname == NULL, NULL);
- ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgname, &handle);
- if (ret != PMINFO_R_OK) {
+ ret = package_manager_get_package_info(pkgname, &handle);
+ if (ret != PACKAGE_MANAGER_ERROR_NONE) {
_E("Failed to get pkg information from pkgmgr");
goto ERR;
}
- ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &appid);
- if (ret != PMINFO_R_OK) {
+ ret = package_info_get_main_app_id(handle, &appid);
+ if (ret != PACKAGE_MANAGER_ERROR_NONE) {
_E("Failed to get mainapp ID information from pkgmgr");
goto ERR;
}
appid = strdup(appid);
ERR:
if (handle != NULL)
- pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ package_info_destroy(handle);
return appid;
}
retv_if(pkgname == NULL, APP_TYPE_NATIVE);
ret = package_manager_get_package_info(pkgname, &handle);
- if (ret != PMINFO_R_OK) {
+ if (ret != PACKAGE_MANAGER_ERROR_NONE) {
_E("Failed to get pkg information from pkgmgr");
return APP_TYPE_NATIVE;
}
ret = package_info_get_type(handle, &apptype);
- if (ret != PMINFO_R_OK) {
+ if (ret != PACKAGE_MANAGER_ERROR_NONE) {
_E("Failed to get app type from pkginfo handler");
goto ERR;
}