From 7fdab02fd894d8aafce5d0197fb391e3832e54e6 Mon Sep 17 00:00:00 2001 From: liuyuxiu Date: Mon, 26 Aug 2024 14:47:25 +0800 Subject: [PATCH] reduce DDL auth Signed-off-by: liuyuxiu --- services/include/qos_interface.h | 1 + services/src/concurrent_task_controller.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/services/include/qos_interface.h b/services/include/qos_interface.h index 42d8987..855b5d2 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 dc4ad7a..24cddd6 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)); -- Gitee