Fix StepCheckRestriction 51/74251/2
authorSangyoon Jang <s89.jang@samsung.com>
Mon, 13 Jun 2016 10:20:19 +0000 (19:20 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Mon, 13 Jun 2016 10:36:09 +0000 (19:36 +0900)
- Use proper api.
- Print pkgid at error log.

Change-Id: If73974fcde73235ed4a499b4a8f2695c2098135e
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/common/step/pkgmgr/step_check_restriction.cc

index 3b58c72..544a896 100644 (file)
@@ -41,8 +41,8 @@ Step::Status StepCheckRestriction::process() {
     return Status::ERROR;
 
   int mode;
-  int ret = pkgmgr_client_usr_get_pkg_restriction_mode(
-      pc, nullptr, &mode, context_->uid.get());
+  int ret = pkgmgr_client_usr_get_restriction_mode(
+      pc, &mode, context_->uid.get());
   if (ret != PKGMGR_R_OK) {
     LOG(ERROR) << "Failed to get restriction mode bit";
     pkgmgr_client_free(pc);
@@ -58,7 +58,8 @@ Step::Status StepCheckRestriction::process() {
   ret = pkgmgr_client_usr_get_pkg_restriction_mode(
       pc, context_->pkgid.get().c_str(), &mode, context_->uid.get());
   if (ret != PKGMGR_R_OK) {
-    LOG(ERROR) << "Failed to get restriction mode bit";
+    LOG(ERROR) << "Failed to get pkg(" << context_->pkgid.get()
+               << ") restriction mode bit";
     pkgmgr_client_free(pc);
     return Status::ERROR;
   }