Fix inconsistency between cache and database
[platform/core/appfw/pkgmgr-info.git] / src / common / request_type.cc
index 9ae546b..da674ad 100644 (file)
@@ -26,16 +26,28 @@ const char* ReqTypeToString(ReqType type) {
       "SET_CERT_INFO",
       "GET_CERT_INFO",
       "GET_PKG_DEP_INFO",
-      "QUERY",
+      "READ_QUERY",
+      "WRITE_QUERY",
       "COMMAND",
       "CREATE_DB",
+      "CREATE_CACHE",
+      "REMOVE_ALL_CACHE",
       "ERROR_REQ_TYPE"
   };
-  if (type <= ReqType::REQ_TYPE_NONE
-     || type >= ReqType::MAX)
+
+  if (type <= ReqType::REQ_TYPE_NONE || type >= ReqType::MAX)
     return convertArray[ReqType::MAX];
 
   return convertArray[type];
 }
 
+bool IsDbWriteRequest(ReqType type) {
+  if (type == pkgmgr_common::ReqType::SET_PKG_INFO ||
+      type == pkgmgr_common::ReqType::SET_CERT_INFO ||
+      type == pkgmgr_common::ReqType::WRITE_QUERY)
+    return true;
+
+  return false;
+}
+
 }  // namespace pkgmgr_common