bugfix: start ability in hidden mode goes onForeground

Signed-off-by: yangxuguang-huawei <yangxuguang3@huawei.com>
Change-Id: If0158fed8f9088c60ce786829fc5ae1543b260c4
This commit is contained in:
yangxuguang-huawei 2024-11-21 17:12:29 +08:00
parent 05ca8714b8
commit dc8a82b759

View File

@ -366,7 +366,8 @@ void UIAbilityImpl::UpdateSilentForeground(const AAFwk::LifeCycleStateInfo &targ
}
if (lifecycleState_ == AAFwk::ABILITY_STATE_INITIAL &&
sessionInfo && sessionInfo->processOptions &&
AAFwk::ProcessOptions::IsValidProcessMode(sessionInfo->processOptions->processMode) &&
(sessionInfo->processOptions->isRestartKeepAlive
|| AAFwk::ProcessOptions::IsValidProcessMode(sessionInfo->processOptions->processMode)) &&
sessionInfo->processOptions->startupVisibility == AAFwk::StartupVisibility::STARTUP_HIDE) {
TAG_LOGI(AAFwkTag::UIABILITY, "set IsSilentForeground to true");
ability_->SetIsSilentForeground(true);