diff --git a/services/src/concurrent_task_controller.cpp b/services/src/concurrent_task_controller.cpp index 1da2c3ae268fdf4734657b08e59406cf4dbbad50..9093ffeee690a806d73fd6ddf8e9019deffe25a9 100644 --- a/services/src/concurrent_task_controller.cpp +++ b/services/src/concurrent_task_controller.cpp @@ -533,7 +533,7 @@ void TaskController::FocusStatusProcess(int uid, int pid, int status) { int ret = -1; unsigned int rtgFlag = AF_RTG_ALL; - unsigned int qosFlag = AF_QOS_ALL; + unsigned int qosFlag = AF_QOS_DELEGATED; if (status == static_cast(MSG_GET_FOCUS)) { ret = AuthSwitch(pid, rtgFlag, qosFlag, static_cast(AuthStatus::AUTH_STATUS_FOCUS)); CONCUR_LOGI("pid %{public}d get focus. ret %{public}d", pid, ret); diff --git a/services/src/qos_interface.cpp b/services/src/qos_interface.cpp index 0e27a43b16ea59889445988813c57c49e02ccb21..4b1b1aa002010b9caf92c4738f66f708c0f8d805 100644 --- a/services/src/qos_interface.cpp +++ b/services/src/qos_interface.cpp @@ -97,7 +97,7 @@ int AuthEnable(unsigned int pid, unsigned int uaFlag, unsigned int status) data.pid = pid; data.rtgUaFlag = uaFlag; - data.qosUaFlag = AF_QOS_ALL; + data.qosUaFlag = AF_QOS_DELEGATED; data.status = status; data.type = static_cast(AuthManipulateType::AUTH_ENABLE); diff --git a/test/unittest/phone/qos_interface_test.cpp b/test/unittest/phone/qos_interface_test.cpp index 4dfa1d3a4b65f1664996ef626fa7901c2420ef65..defe1ee4cebf33651114b3ae91ece7150967110b 100644 --- a/test/unittest/phone/qos_interface_test.cpp +++ b/test/unittest/phone/qos_interface_test.cpp @@ -26,7 +26,6 @@ using namespace testing; using namespace testing::ext; using namespace OHOS::FFRT_TEST; using namespace std; -constexpr unsigned int AF_QOS_ALL = 0x0003; class QosInterfaceTest : public testing::Test { public: @@ -272,6 +271,12 @@ HWTEST_F(QosInterfaceTest, QosPolicyTest, TestSize.Level1) ret = QosPolicySet(policyDatas); EXPECT_EQ(ret, -1); #if defined(ARM64_TEST) && ARM64_TEST + unsigned int pid = getpid(); + unsigned int rtgFlag = AF_RTG_ALL; + unsigned int qosFlag = AF_QOS_ALL; + unsigned int status = static_cast(AuthStatus::AUTH_STATUS_FOREGROUND); + ret = AuthSwitch(pid, rtgFlag, qosFlag, status); + EXPECT_EQ(ret, 0); ret = QosPolicySet(&g_defaultQosPolicy); EXPECT_EQ(ret, 0); #endif