From 8c9e927cf7aac26937c19fc56e7f4e7ee80ec341 Mon Sep 17 00:00:00 2001 From: Luobniz21 Date: Mon, 22 Jun 2026 09:07:22 +0800 Subject: [PATCH] 0622_fix Signed-off-by: Luobniz21 # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Mon Jun 22 09:07:22 2026 +0800 # # On branch 0622_fix # Your branch is up to date with 'origin/0622_fix'. # # Changes to be committed: # modified: services/abilitymgr/src/ability_manager_service.cpp # --- services/abilitymgr/src/ability_manager_service.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index 25aa589ee5..9a0b15597b 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -1471,13 +1471,12 @@ int AbilityManagerService::StartAbilityInner(StartAbilityWrapParam ¶m) return checkRet; } } - // Get caller token ID before StartAbilityInfoWrap constructor - int32_t callerTokenIdForPermission = static_cast(IPCSkeleton::GetCallingTokenID()); StartAbilityInfoWrap threadLocalInfo(param.want, validUserId, appIndex, param.callerToken); // Remove ATOMIC_SERVICE_SHARE_ROUTER if target is not atomic service or caller doesn't have permission if (StartAbilityUtils::startAbilityInfo != nullptr) { + int32_t callerTokenId = param.want.GetIntParam(Want::PARAM_RESV_CALLER_TOKEN, 0); StartAbilityUtils::RemoveAtomicServiceShareRouterIfNeeded(param.want, - StartAbilityUtils::startAbilityInfo->abilityInfo, callerTokenIdForPermission); + StartAbilityUtils::startAbilityInfo->abilityInfo, callerTokenId); } auto shouldBlockFunc = [aams = shared_from_this()]() { return aams->ShouldBlockAllAppStart(); }; AbilityInterceptorParam interceptorParam = AbilityInterceptorParam(param.want, param.requestCode, validUserId, @@ -2289,13 +2288,12 @@ int AbilityManagerService::StartAbilityForOptionInner(const Want &want, const St AbilityEventUtil::SendStartAbilityErrorEvent(eventInfo, checkRet, "CheckMultiInstanceAndAppClone failed"); return checkRet; } - // Get caller token ID before StartAbilityInfoWrap constructor - int32_t callerTokenIdForPermission = static_cast(IPCSkeleton::GetCallingTokenID()); StartAbilityInfoWrap threadLocalInfo(want, validUserId, appIndex, callerToken); // Remove ATOMIC_SERVICE_SHARE_ROUTER if target is not atomic service or caller doesn't have permission if (StartAbilityUtils::startAbilityInfo != nullptr) { + int32_t callerTokenId = want.GetIntParam(Want::PARAM_RESV_CALLER_TOKEN, 0); StartAbilityUtils::RemoveAtomicServiceShareRouterIfNeeded(const_cast(want), - StartAbilityUtils::startAbilityInfo->abilityInfo, callerTokenIdForPermission); + StartAbilityUtils::startAbilityInfo->abilityInfo, callerTokenId); } auto shouldBlockFunc = [aams = shared_from_this()]() { return aams->ShouldBlockAllAppStart(); }; AbilityInterceptorParam interceptorParam = AbilityInterceptorParam(want, requestCode, validUserId,