mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-11-23 07:10:19 +00:00
!11676 ChangeUIAbilityVisibilityBySCB补充pending状态的判断
Merge pull request !11676 from gongyuechen/master
This commit is contained in:
commit
b57df00fa0
@ -1470,7 +1470,6 @@ void UIAbilityLifecycleManager::DelayCompleteTerminate(const std::shared_ptr<Abi
|
||||
void UIAbilityLifecycleManager::CompleteTerminate(const std::shared_ptr<AbilityRecord> &abilityRecord)
|
||||
{
|
||||
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
|
||||
CHECK_POINTER(abilityRecord);
|
||||
std::lock_guard<ffrt::mutex> guard(sessionLock_);
|
||||
|
||||
CompleteTerminateLocked(abilityRecord);
|
||||
@ -1478,9 +1477,7 @@ void UIAbilityLifecycleManager::CompleteTerminate(const std::shared_ptr<AbilityR
|
||||
|
||||
void UIAbilityLifecycleManager::CompleteTerminateLocked(const std::shared_ptr<AbilityRecord> &abilityRecord)
|
||||
{
|
||||
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
|
||||
CHECK_POINTER(abilityRecord);
|
||||
|
||||
if (abilityRecord->GetAbilityState() != AbilityState::TERMINATING) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "failed, %{public}s, ability not terminating", __func__);
|
||||
return;
|
||||
@ -2721,6 +2718,14 @@ int UIAbilityLifecycleManager::ChangeUIAbilityVisibilityBySCB(sptr<SessionInfo>
|
||||
if (isShow) {
|
||||
uiAbilityRecord->SetAbilityVisibilityState(AbilityVisibilityState::FOREGROUND_SHOW);
|
||||
#ifdef SUPPORT_SCREEN
|
||||
if (uiAbilityRecord->GetPendingState() != AbilityState::INITIAL) {
|
||||
TAG_LOGI(AAFwkTag::ABILITYMGR, "pending state: FOREGROUND/ BACKGROUND, dropped");
|
||||
uiAbilityRecord->SetPendingState(AbilityState::FOREGROUND);
|
||||
return ERR_OK;
|
||||
} else {
|
||||
TAG_LOGD(AAFwkTag::ABILITYMGR, "pending state is not FOREGROUND or BACKGROUND.");
|
||||
uiAbilityRecord->SetPendingState(AbilityState::FOREGROUND);
|
||||
}
|
||||
uiAbilityRecord->ProcessForegroundAbility(sessionInfo->callingTokenId);
|
||||
#endif // SUPPORT_SCREEN
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user