diff --git a/services/include/qos_interface.h b/services/include/qos_interface.h index 42d8987fcc5795041da17032267b339977c0d4a4..855b5d26e277038c4683ed2de60e2487c8f8b723 100644 --- a/services/include/qos_interface.h +++ b/services/include/qos_interface.h @@ -163,6 +163,7 @@ enum QosCtrlCmdid { */ #define AF_RTG_ALL 0x1fff #define AF_RTG_DELEGATED 0x1fff +#define AF_RTG_APP 0x10b8 struct RtgEnableData { int enable; diff --git a/services/src/concurrent_task_controller.cpp b/services/src/concurrent_task_controller.cpp index dc4ad7a18838f9d6392e7ae4f9d8f7abcc5f8420..24cddd662d8709bbe152fca62c8f2a39c475a3a0 100644 --- a/services/src/concurrent_task_controller.cpp +++ b/services/src/concurrent_task_controller.cpp @@ -521,7 +521,7 @@ void TaskController::NewForeground(int uid, int pid) if (ret != static_cast(AuthStatus::AUTH_STATUS_FOCUS)) { CONCUR_LOGI("pid %{public}d change to foreground.", pid); unsigned int pidParam = static_cast(pid); - unsigned int uaFlag = AF_RTG_ALL; + unsigned int uaFlag = AF_RTG_APP; unsigned int status = static_cast(AuthStatus::AUTH_STATUS_FOREGROUND); int ret = AuthEnable(pidParam, uaFlag, status); if (ret == 0) { @@ -594,7 +594,7 @@ void TaskController::NewAppStart(int uid, int pid, const std::string& bundleName { CONCUR_LOGI("pid %{public}d start.", pid); unsigned int pidParam = static_cast(pid); - unsigned int uaFlag = AF_RTG_ALL; + unsigned int uaFlag = AF_RTG_APP; unsigned int status = static_cast(AuthStatus::AUTH_STATUS_DEFAULT); int ret = AuthEnable(pidParam, uaFlag, status); @@ -671,7 +671,7 @@ void TaskController::ContinuousTaskProcess(int uid, int pid, int status) void TaskController::FocusStatusProcess(int uid, int pid, int status) { int ret = -1; - unsigned int rtgFlag = AF_RTG_ALL; + unsigned int rtgFlag = AF_RTG_APP; unsigned int qosFlag = AF_QOS_DELEGATED; if (status == static_cast(MSG_GET_FOCUS)) { ret = AuthSwitch(pid, rtgFlag, qosFlag, static_cast(AuthStatus::AUTH_STATUS_FOCUS));