From 058ce4d75a1bf01dbb65f088ba98f5657ec14182 Mon Sep 17 00:00:00 2001 From: liuyuxiu Date: Mon, 27 May 2024 11:29:36 +0800 Subject: [PATCH] fixed 2987377 from https://gitee.com/mufeng_413/resourceschedule_qos_manager/pulls/124 fixed 4704d59 from https://gitee.com/YuXiuLiu/resourceschedule_qos_manager/pulls/123 qos switch adapte cross_platform Signed-off-by: liuyuxiu --- 119.diff:Zone.Identifier | 4 ++++ qos/qos.cpp | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 119.diff:Zone.Identifier diff --git a/119.diff:Zone.Identifier b/119.diff:Zone.Identifier new file mode 100644 index 0000000..0074d6d --- /dev/null +++ b/119.diff:Zone.Identifier @@ -0,0 +1,4 @@ +[ZoneTransfer] +ZoneId=3 +ReferrerUrl=https://gitee.com/openharmony/resourceschedule_qos_manager/pulls/119 +HostUrl=https://gitee.com/openharmony/resourceschedule_qos_manager/pulls/119.diff diff --git a/qos/qos.cpp b/qos/qos.cpp index fc928a6..6c6d91f 100644 --- a/qos/qos.cpp +++ b/qos/qos.cpp @@ -16,7 +16,9 @@ #include #include #include "concurrent_task_log.h" +#if !defined(CROSS_PLATFORM) #include "parameters.h" +#endif #include "qos_interface.h" #include "qos.h" using namespace OHOS::ConcurrentTask; @@ -33,12 +35,14 @@ QosController& QosController::GetInstance() int QosController::SetThreadQosForOtherThread(enum QosLevel level, int tid) { +#if !defined(CROSS_PLATFORM) bool qosEnable = OHOS::system::GetBoolParameter("persist.all.setQos.on", true); - int qos = static_cast(level); if (!qosEnable) { - CONCUR_LOGD("[Qos] qoslevel %{public}d apply for tid %{public}d disable", qos, tid); + CONCUR_LOGD("[Qos] qoslevel %{public}d apply for tid %{public}d disable", static_cast(level), tid); return 0; } +#endif + int qos = static_cast(level); if (level < QosLevel::QOS_BACKGROUND || level >= QosLevel::QOS_MAX) { CONCUR_LOGE("[Qos] invalid qos level %{public}d", qos); return ERROR_NUM; @@ -55,11 +59,13 @@ int QosController::SetThreadQosForOtherThread(enum QosLevel level, int tid) int QosController::ResetThreadQosForOtherThread(int tid) { +#if !defined(CROSS_PLATFORM) bool qosEnable = OHOS::system::GetBoolParameter("persist.all.setQos.on", true); if (!qosEnable) { CONCUR_LOGD("[Qos] qoslevel reset disable for tid %{public}d.", tid); return 0; } +#endif int ret = QosLeaveForOther(tid); if (ret == 0) { CONCUR_LOGD("[Qos] qoslevel reset for tid %{public}d success", tid); -- Gitee