From bce4418770afdd2388d3522f41d875209e7f6a17 Mon Sep 17 00:00:00 2001 From: liuchungang Date: Mon, 2 Sep 2024 11:01:56 +0800 Subject: [PATCH] =?UTF-8?q?fix=20rs=20auth=20failed=20=EF=BC=88cherry=20pi?= =?UTF-8?q?cked=20commit=20from=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/include/concurrent_task_controller.h | 2 +- services/src/concurrent_task_controller.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/services/include/concurrent_task_controller.h b/services/include/concurrent_task_controller.h index 4d6e2e6..faf4421 100644 --- a/services/include/concurrent_task_controller.h +++ b/services/include/concurrent_task_controller.h @@ -111,7 +111,7 @@ private: int uniAppRate_ = 0; bool rtgEnabled_ = false; bool configEnable_ = false; - bool rsAuthed_ = false; + int authedRSPid_ = 0; bool ddlSceneSchedSwitch_ = false; bool ddlPowerModeEnable_ = false; bool isVideoApp_ = false; diff --git a/services/src/concurrent_task_controller.cpp b/services/src/concurrent_task_controller.cpp index 9d6f030..11d3f19 100644 --- a/services/src/concurrent_task_controller.cpp +++ b/services/src/concurrent_task_controller.cpp @@ -216,14 +216,14 @@ void TaskController::QueryRenderService(int uid, IntervalReply& queryRs) void TaskController::QueryRenderServiceMain(int uid, int pid, IntervalReply& queryRs) { - if (GetProcessNameByToken() != RENDER_SERVICE_PROCESS_NAME) { + if (uid != RS_UID) { return; } - if (!rsAuthed_) { + if (authedRSPid_ != pid) { if (AuthSystemProcess(pid) != 0) { return; } - rsAuthed_ = true; + authedRSPid_ = pid; } if (renderServiceMainGrpId_ <= 0) { TryCreateRSMainGrp(); @@ -246,7 +246,7 @@ void TaskController::QueryRenderServiceMain(int uid, int pid, IntervalReply& que void TaskController::QueryRenderServiceRender(int uid, int pid, IntervalReply& queryRs) { - if (GetProcessNameByToken() != RENDER_SERVICE_PROCESS_NAME) { + if (uid != RS_UID) { return; } if (renderServiceRenderGrpId_ <= 0) { -- Gitee