Refactor pkgmgr-info
[platform/core/appfw/pkgmgr-info.git] / src / server / database / cert_get_db_handler.cc
index d6daecb..397795f 100644 (file)
@@ -19,6 +19,8 @@
 #include <shared_mutex>
 #include <vector>
 
+#include "utils/logging.hh"
+
 #include "pkgmgrinfo_debug.h"
 #include "pkgmgrinfo_internal.h"
 
@@ -39,13 +41,13 @@ void CertGetDBHandler::SetPkgID(std::string pkgid) {
 }
 
 int CertGetDBHandler::Execute() {
-  std::shared_lock<std::shared_timed_mutex> s(lock_);
+  std::shared_lock<std::shared_mutex> s(lock_);
 
   SetOpType(pkgmgr_common::DBOperationType::OPERATION_TYPE_READ);
   SetDBType(pkgmgr_common::DBType::DB_TYPE_FILE_CERTDB);
 
   if (!Connect()) {
-    _LOGE("Failed to connect database");
+    LOG(ERROR) << "Failed to connect database";
     return PMINFO_R_ERROR;
   }
 
@@ -55,9 +57,9 @@ int CertGetDBHandler::Execute() {
     return ret;
 
   handle_ = reinterpret_cast<pkgmgr_certinfo_x*>(handle);
-  sqlite3* conn = GetConnection().front().first;
+  const auto& db = GetConnection().front().first;
 
-  return certinfo_internal_get(conn, pkgid_.c_str(), uid_, handle_);
+  return internal::CertInfoGet(db, pkgid_, uid_, handle_);
 }
 
 }  // namespace database