--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "request_type.hh"
+
+namespace pkgmgr_common {
+
+const std::string& ReqTypeToString(ReqType type) {
+ static std::string convertArray[] = {
+ "GET_PKG_INFO"
+ "GET_APP_INFO",
+ "SET_PKG_INFO",
+ "SET_CERT_INFO",
+ "GET_CERT_INFO",
+ "GET_PKG_DEP_INFO",
+ "QUERY",
+ "COMMAND",
+ "ERROR_REQ_TYPE"
+ };
+ if (type <= ReqType::REQ_TYPE_NONE
+ || type >= ReqType::MAX)
+ return convertArray[ReqType::MAX];
+
+ return convertArray[type];
+}
+
+} // namespace pkgmgr_common
\ No newline at end of file
#ifndef COMMON_REQUEST_TYPE_HH_
#define COMMON_REQUEST_TYPE_HH_
+#include <string>
+
+#ifndef EXPORT_API
+#define EXPORT_API __attribute__((visibility("default")))
+#endif
+
namespace pkgmgr_common {
enum ReqType {
MAX
};
+EXPORT_API const std::string& ReqTypeToString(ReqType type);
+
} // namespace pkgmgr_common
#endif // COMMON_REQUEST_TYPE_HH_
continue;
}
pkgmgr_common::ReqType type = req->GetRequestType();
- LOGD("Request type(%d), pid(%d)",
- static_cast<int>(type), req->GetSenderPID());
+ LOGD("Request type(%s), pid(%d)",
+ pkgmgr_common::ReqTypeToString(type).c_str(), req->GetSenderPID());
if (type <= pkgmgr_common::ReqType::REQ_TYPE_NONE
|| type >= pkgmgr_common::ReqType::MAX) {
LOGE("Request type is invalid (%d)", static_cast<int>(type));