fix uninstall and activation issue on disabled package. 01/100001/1
authorjongmyeongko <jongmyeong.ko@samsung.com>
Thu, 24 Nov 2016 16:35:44 +0000 (01:35 +0900)
committerjongmyeongko <jongmyeong.ko@samsung.com>
Thu, 24 Nov 2016 16:35:44 +0000 (01:35 +0900)
Change-Id: I74803684d69a90b4fd68da54aef7a45a4c1d4ebd
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
packaging/app-installers.spec
src/common/pkgmgr_query.cc
src/common/step/pkgmgr/step_check_removable.cc

index c531bc7..b093ebe 100644 (file)
@@ -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
index 4f63041..cf7b345 100644 (file)
@@ -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<std::string>* 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<std::string>* 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;
   }
 
index 12959b4..58cbef3 100644 (file)
@@ -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";