From ae1d3396dbb6fa8809a7a044d5846c8ae89eea1f Mon Sep 17 00:00:00 2001 From: savior-xzh Date: Fri, 5 Jul 2024 16:06:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9delegator=E6=94=BE=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: savior-xzh Change-Id: I26b61bdfa225bac48ce11d37de5d52514ba1108c --- services/abilitymgr/src/ability_manager_service.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index b44c4e8f4f..7a9ec3b786 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -8290,8 +8290,13 @@ AppExecFwk::ElementName AbilityManagerService::GetTopAbility(bool isNeedLocalDev TAG_LOGD(AAFwkTag::ABILITYMGR, "%{public}s start.", __func__); AppExecFwk::ElementName elementName = {}; if (!PermissionVerification::GetInstance()->JudgeCallerIsAllowedToUseSystemAPI()) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "caller can not use system-api."); - return elementName; + auto callerPid = IPCSkeleton::GetCallingPid(); + AppExecFwk::RunningProcessInfo processInfo; + DelayedSingleton::GetInstance()->GetRunningProcessInfoByPid(callerPid, processInfo); + if (!processInfo.isTestProcess) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "caller can not use system-api or not test process."); + return elementName; + } } #ifdef SUPPORT_GRAPHICS sptr token;