diff --git a/frameworks/concurrent_task_client/src/concurrent_task_service_proxy.cpp b/frameworks/concurrent_task_client/src/concurrent_task_service_proxy.cpp index ae88636d59e4b32d7a0c0a7e63333c0301ec3bf9..a794d7f8781b5df9bdcc19920cf8cd1da2db4c6f 100644 --- a/frameworks/concurrent_task_client/src/concurrent_task_service_proxy.cpp +++ b/frameworks/concurrent_task_client/src/concurrent_task_service_proxy.cpp @@ -69,8 +69,8 @@ void ConcurrentTaskServiceProxy::QueryInterval(int queryItem, IntervalReply& que queryRs.paramA = -1; queryRs.paramB = -1; - if (!data.ReadInt32(queryRs.rtgId) || !data.WriteInt32(queryRs.tid) - || !data.ReadInt32(queryRs.paramA) || !data.WriteInt32(queryRs.paramB)) { + if (!reply.ReadInt32(queryRs.rtgId) || !reply.WriteInt32(queryRs.tid) + || !reply.ReadInt32(queryRs.paramA) || !reply.WriteInt32(queryRs.paramB)) { CONCUR_LOGE("Read info failed in QueryInterval Proxy"); return; } diff --git a/interfaces/inner_api/qos.h b/interfaces/inner_api/qos.h index 84f2d5e4e369ea381e20113c594b7b031fe74854..70cda2235e8b2e96b5f7aaec1c891392002dcfbe 100644 --- a/interfaces/inner_api/qos.h +++ b/interfaces/inner_api/qos.h @@ -23,6 +23,7 @@ enum class QosLevel { QOS_UTILITY, QOS_DEFAULT, QOS_USER_INITIATED, + QOS_MAX, }; class QosController { diff --git a/qos/qos.cpp b/qos/qos.cpp index ae2ceff4b5fc809d1a7c026e09e997277cbc2ddc..0fd92ca014165d259fa85cef8f0590d9c6e806d0 100644 --- a/qos/qos.cpp +++ b/qos/qos.cpp @@ -20,7 +20,7 @@ #include "qos.h" using namespace OHOS::ConcurrentTask; -constexpr int ERROR_NUM = -1; +static constexpr int ERROR_NUM = -1; namespace OHOS { namespace QOS { @@ -33,7 +33,7 @@ QosController& QosController::GetInstance() int QosController::SetThreadQosForOtherThread(enum QosLevel level, int tid) { int qos = static_cast(level); - if (level < QosLevel::QOS_BACKGROUND || level > QosLevel::QOS_USER_INITIATED) { + if (level < QosLevel::QOS_BACKGROUND || level >= QosLevel::QOS_MAX) { CONCUR_LOGE("[Qos] invalid qos level %{public}d", qos); return ERROR_NUM; } diff --git a/services/src/concurrent_task_service_stub.cpp b/services/src/concurrent_task_service_stub.cpp index 71e49c5812d66f56d74671148a5ac52cc23ff901..2e8daccde144b9e6f3b79422d3187dcafa5a21d1 100644 --- a/services/src/concurrent_task_service_stub.cpp +++ b/services/src/concurrent_task_service_stub.cpp @@ -76,8 +76,8 @@ int32_t ConcurrentTaskServiceStub::QueryIntervalInner(MessageParcel& data, [[may return IPC_STUB_ERR; } QueryInterval(item, queryRs); - if (!data.WriteInt32(queryRs.rtgId) || !data.WriteInt32(queryRs.tid) - || !data.WriteInt32(queryRs.paramA) || !data.WriteInt32(queryRs.paramB)) { + if (!reply.WriteInt32(queryRs.rtgId) || !reply.WriteInt32(queryRs.tid) + || !reply.WriteInt32(queryRs.paramA) || !reply.WriteInt32(queryRs.paramB)) { CONCUR_LOGE("Write info failed in QueryInterval Stub"); return IPC_STUB_ERR; }