From 52b2d18a6f8b18cd45d31c988d33652dc0cbb552 Mon Sep 17 00:00:00 2001 From: jongmyeongko Date: Fri, 25 Nov 2016 01:35:44 +0900 Subject: [PATCH] fix uninstall and activation issue on disabled package. Change-Id: I74803684d69a90b4fd68da54aef7a45a4c1d4ebd Signed-off-by: jongmyeongko --- packaging/app-installers.spec | 2 +- src/common/pkgmgr_query.cc | 26 +++++++++++++------------- src/common/step/pkgmgr/step_check_removable.cc | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packaging/app-installers.spec b/packaging/app-installers.spec index c531bc7..b093ebe 100644 --- a/packaging/app-installers.spec +++ b/packaging/app-installers.spec @@ -1,6 +1,6 @@ Name: app-installers Summary: Application installers -Version: 1.9 +Version: 1.10 Release: 1 Group: Application Framework/Package Management License: Apache-2.0 diff --git a/src/common/pkgmgr_query.cc b/src/common/pkgmgr_query.cc index 4f63041..cf7b345 100644 --- a/src/common/pkgmgr_query.cc +++ b/src/common/pkgmgr_query.cc @@ -70,7 +70,7 @@ std::string QueryCertificateAuthorCertificate(const std::string& pkgid, std::string QueryTepPath(const std::string& pkgid, uid_t uid) { pkgmgrinfo_pkginfo_h package_info; - if (pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid.c_str(), uid, &package_info) + if (pkgmgrinfo_pkginfo_get_usr_all_pkginfo(pkgid.c_str(), uid, &package_info) != PMINFO_R_OK) return {}; char* tep_name = nullptr; @@ -90,7 +90,7 @@ std::string QueryTepPath(const std::string& pkgid, uid_t uid) { std::string QueryZipMountFile(const std::string& pkgid, uid_t uid) { pkgmgrinfo_pkginfo_h package_info; - if (pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid.c_str(), uid, &package_info) + if (pkgmgrinfo_pkginfo_get_usr_all_pkginfo(pkgid.c_str(), uid, &package_info) != PMINFO_R_OK) return {}; char* zip_mount_file = nullptr; @@ -112,7 +112,7 @@ std::string QueryZipMountFile(const std::string& pkgid, uid_t uid) { bool QueryAppidsForPkgId(const std::string& pkg_id, std::vector* result, uid_t uid) { pkgmgrinfo_pkginfo_h package_info; - if (pkgmgrinfo_pkginfo_get_usr_pkginfo(pkg_id.c_str(), uid, &package_info) + if (pkgmgrinfo_pkginfo_get_usr_all_pkginfo(pkg_id.c_str(), uid, &package_info) != PMINFO_R_OK) { return false; } @@ -126,7 +126,7 @@ bool QueryAppidsForPkgId(const std::string& pkg_id, bool QueryPrivilegesForPkgId(const std::string& pkg_id, uid_t uid, std::vector* result) { pkgmgrinfo_pkginfo_h package_info; - if (pkgmgrinfo_pkginfo_get_usr_pkginfo(pkg_id.c_str(), uid, &package_info) + if (pkgmgrinfo_pkginfo_get_usr_all_pkginfo(pkg_id.c_str(), uid, &package_info) != PMINFO_R_OK) { return false; } @@ -141,7 +141,7 @@ std::string QueryStorageForPkgId(const std::string& pkg_id, uid_t uid) { // initial & default : internal std::string installed_location = "installed_internal"; pkgmgrinfo_pkginfo_h package_info; - if (pkgmgrinfo_pkginfo_get_usr_pkginfo(pkg_id.c_str(), uid, &package_info) + if (pkgmgrinfo_pkginfo_get_usr_all_pkginfo(pkg_id.c_str(), uid, &package_info) != PMINFO_R_OK) { return ""; } @@ -163,11 +163,11 @@ std::string QueryStorageForPkgId(const std::string& pkg_id, uid_t uid) { bool QueryIsPackageInstalled(const std::string& pkg_id, RequestMode request_mode, uid_t uid) { pkgmgrinfo_pkginfo_h handle; - int ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkg_id.c_str(), uid, + int ret = pkgmgrinfo_pkginfo_get_usr_all_pkginfo(pkg_id.c_str(), uid, &handle); if (ret != PMINFO_R_OK) { if (ret != PMINFO_R_ENOENT) - LOG(ERROR) << "Failed to call pkgmgrinfo_pkginfo_get_usr_pkginfo"; + LOG(ERROR) << "Failed to call pkgmgrinfo_pkginfo_get_usr_all_pkginfo"; return false; } bool is_global = false; @@ -187,10 +187,10 @@ bool QueryIsPackageInstalled(const std::string& pkg_id, bool QueryIsPackageInstalled(const std::string& pkg_id, uid_t uid) { pkgmgrinfo_pkginfo_h handle; - int ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkg_id.c_str(), uid, &handle); + int ret = pkgmgrinfo_pkginfo_get_usr_all_pkginfo(pkg_id.c_str(), uid, &handle); if (ret != PMINFO_R_OK) { if (ret != PMINFO_R_ENOENT) - LOG(ERROR) << "Failed to call pkgmgrinfo_pkginfo_get_usr_pkginfo"; + LOG(ERROR) << "Failed to call pkgmgrinfo_pkginfo_get_usr_all_pkginfo"; return false; } @@ -217,10 +217,10 @@ bool QueryIsPackageInstalled(const std::string& pkg_id, uid_t uid) { bool QueryIsGlobalPackage(const std::string& pkg_id, uid_t uid) { pkgmgrinfo_pkginfo_h handle; - int ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkg_id.c_str(), uid, &handle); + int ret = pkgmgrinfo_pkginfo_get_usr_all_pkginfo(pkg_id.c_str(), uid, &handle); if (ret != PMINFO_R_OK) { if (ret != PMINFO_R_ENOENT) - LOG(ERROR) << "Failed to call pkgmgrinfo_pkginfo_get_usr_pkginfo"; + LOG(ERROR) << "Failed to call pkgmgrinfo_pkginfo_get_usr_all_pkginfo"; return false; } @@ -237,10 +237,10 @@ bool QueryIsGlobalPackage(const std::string& pkg_id, uid_t uid) { bool QueryIsReadonlyPackage(const std::string& pkg_id, uid_t uid) { pkgmgrinfo_pkginfo_h handle; - int ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkg_id.c_str(), uid, &handle); + int ret = pkgmgrinfo_pkginfo_get_usr_all_pkginfo(pkg_id.c_str(), uid, &handle); if (ret != PMINFO_R_OK) { if (ret != PMINFO_R_ENOENT) - LOG(ERROR) << "Failed to call pkgmgrinfo_pkginfo_get_usr_pkginfo"; + LOG(ERROR) << "Failed to call pkgmgrinfo_pkginfo_get_usr_all_pkginfo"; return false; } diff --git a/src/common/step/pkgmgr/step_check_removable.cc b/src/common/step/pkgmgr/step_check_removable.cc index 12959b4..58cbef3 100644 --- a/src/common/step/pkgmgr/step_check_removable.cc +++ b/src/common/step/pkgmgr/step_check_removable.cc @@ -17,7 +17,7 @@ Step::Status StepCheckRemovable::process() { return Status::OK; pkgmgrinfo_pkginfo_h handle; - int ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(context_->pkgid.get().c_str(), + int ret = pkgmgrinfo_pkginfo_get_usr_all_pkginfo(context_->pkgid.get().c_str(), context_->uid.get(), &handle); if (ret != PMINFO_R_OK) { LOG(ERROR) << "This package is not installed"; -- 2.7.4