Signed-off-by: Luobniz21 <luoyicong@h-partners.com>

# 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
#
This commit is contained in:
Luobniz21
2026-06-22 09:07:22 +08:00
parent a07d589204
commit 8c9e927cf7
@@ -1471,13 +1471,12 @@ int AbilityManagerService::StartAbilityInner(StartAbilityWrapParam &param)
return checkRet;
}
}
// Get caller token ID before StartAbilityInfoWrap constructor
int32_t callerTokenIdForPermission = static_cast<int32_t>(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<int32_t>(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 &>(want),
StartAbilityUtils::startAbilityInfo->abilityInfo, callerTokenIdForPermission);
StartAbilityUtils::startAbilityInfo->abilityInfo, callerTokenId);
}
auto shouldBlockFunc = [aams = shared_from_this()]() { return aams->ShouldBlockAllAppStart(); };
AbilityInterceptorParam interceptorParam = AbilityInterceptorParam(want, requestCode, validUserId,