!11689 解决保活应用重启时隐藏启动还是走onForeground生命周期问题

Merge pull request !11689 from 杨旭光/bugfix/keep-alive-on-foreground
This commit is contained in:
openharmony_ci 2024-11-21 12:46:22 +00:00 committed by Gitee
commit 255051b194
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

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);