From 26f0ae9da9f18cf7629c033e154bdc56dfa0655f Mon Sep 17 00:00:00 2001 From: c459517356 Date: Fri, 30 Jun 2023 16:50:29 +0800 Subject: [PATCH] cleancode Signed-off-by: c459517356 --- .../core/frame_aware_policy/src/intellisense_server.cpp | 1 + qos_manager/include/qos_common.h | 5 +++++ qos_manager/src/qos_common.cpp | 8 +++++++- qos_manager/src/qos_manager.cpp | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/frameworks/core/frame_aware_policy/src/intellisense_server.cpp b/frameworks/core/frame_aware_policy/src/intellisense_server.cpp index 8b10dcc..d91b3d7 100644 --- a/frameworks/core/frame_aware_policy/src/intellisense_server.cpp +++ b/frameworks/core/frame_aware_policy/src/intellisense_server.cpp @@ -32,6 +32,7 @@ namespace { static std::string configFilePath = "/system/etc/frame_aware_sched/hwrme.xml"; // need To check the exact file path. } using namespace std; +using namespace QosCommon; DEFINE_RMELOG_INTELLISENSE("ueaServer-IntelliSenseServer"); IMPLEMENT_SINGLE_INSTANCE(IntelliSenseServer); diff --git a/qos_manager/include/qos_common.h b/qos_manager/include/qos_common.h index 7f6e502..b54a5aa 100644 --- a/qos_manager/include/qos_common.h +++ b/qos_manager/include/qos_common.h @@ -15,6 +15,9 @@ #ifndef QOS_COMMON_H #define QOS_COMMON_H +namespace OHOS { +namespace QosCommon { + constexpr int NR_QOS = 6; constexpr int QOS_NICE_FLAG = 0x01; constexpr int QOS_LATENCY_NICE_FLAG = 0x02; @@ -98,4 +101,6 @@ int QosApplyForThread(int level, int tid); int QosLeaveForThread(int tid); int QosPolicy(struct QosPolicyDatas *policyDatas); +} // namespace QosCommon +} // namespace OHOS #endif // QOS_COMMON_H \ No newline at end of file diff --git a/qos_manager/src/qos_common.cpp b/qos_manager/src/qos_common.cpp index 86bcc51..c648dcc 100644 --- a/qos_manager/src/qos_common.cpp +++ b/qos_manager/src/qos_common.cpp @@ -22,6 +22,9 @@ constexpr unsigned int AF_QOS_DELEGATED = 0x0001; +namespace OHOS { +namespace QosCommon { + DEFINE_RMELOG_INTELLISENSE("qos_manager"); static int TrivalOpenQosCtrlNode(void) @@ -178,4 +181,7 @@ int QosPolicy(struct QosPolicyDatas *policyDatas) } close(fd); return ret; -} \ No newline at end of file +} + +} // namespace QosCommon +} // namespace OHOS \ No newline at end of file diff --git a/qos_manager/src/qos_manager.cpp b/qos_manager/src/qos_manager.cpp index ec1dad6..3488b47 100644 --- a/qos_manager/src/qos_manager.cpp +++ b/qos_manager/src/qos_manager.cpp @@ -23,7 +23,7 @@ constexpr int ERROR_NUM = -1; namespace OHOS { namespace QOS { - +using namespace QosCommon; DEFINE_RMELOG_INTELLISENSE("qos_manager"); static struct QosPolicyDatas g_defaultPolicy = { -- Gitee