Description:fix pending state

Sig:SIG_ApplicationFramework
Feature or Bugfix:Bugfix
Binary Source:No

Signed-off-by: yuwenze <yuaqiang1@huawei.com>
Change-Id: I62183c7f47e8e8cb2aa976f76690f666eb5246a2
This commit is contained in:
yuwenze
2022-11-10 02:32:01 +00:00
parent 1e15e34e12
commit 92cc0daa7b
2 changed files with 15 additions and 7 deletions
@@ -4643,6 +4643,14 @@ int AbilityManagerService::DoAbilityForeground(const sptr<IRemoteObject> &token,
return ERR_WOULD_BLOCK;
}
if (abilityRecord->GetPendingState() == AbilityState::FOREGROUND) {
HILOG_DEBUG("pending state is FOREGROUND.");
abilityRecord->SetPendingState(AbilityState::FOREGROUND);
return ERR_OK;
} else {
HILOG_DEBUG("pending state is not FOREGROUND.");
abilityRecord->SetPendingState(AbilityState::FOREGROUND);
}
abilityRecord->ProcessForegroundAbility(flag);
return ERR_OK;
}
@@ -272,11 +272,11 @@ int MissionListManager::StartAbilityLocked(const std::shared_ptr<AbilityRecord>
}
if (targetAbilityRecord->GetPendingState() == AbilityState::FOREGROUND) {
HILOG_ERROR("pending state is FOREGROUND.");
HILOG_DEBUG("pending state is FOREGROUND.");
targetAbilityRecord->SetPendingState(AbilityState::FOREGROUND);
return 0;
return ERR_OK;
} else {
HILOG_ERROR("pending state is not FOREGROUND.");
HILOG_DEBUG("pending state is not FOREGROUND.");
targetAbilityRecord->SetPendingState(AbilityState::FOREGROUND);
}
@@ -322,7 +322,7 @@ int MissionListManager::StartAbilityLocked(const std::shared_ptr<AbilityRecord>
#else
targetAbilityRecord->ProcessForegroundAbility();
#endif
return 0;
return ERR_OK;
}
static int32_t CallType2StartMethod(int32_t callType)
@@ -720,7 +720,7 @@ int MissionListManager::MinimizeAbilityLocked(const std::shared_ptr<AbilityRecor
abilityRecord->SetPendingState(AbilityState::BACKGROUND);
if (!abilityRecord->IsAbilityState(AbilityState::FOREGROUND)) {
HILOG_ERROR("Minimize ability fail, ability state is invalid, not foregroundnew or foregerounding_new.");
HILOG_ERROR("Fail to minimize ability, ability state is not foreground.");
return ERR_OK;
}
@@ -1059,7 +1059,7 @@ void MissionListManager::CompleteForegroundSuccess(const std::shared_ptr<Ability
UpdateMissionTimeStamp(abilityRecord);
}
} else if (abilityRecord->GetPendingState() == AbilityState::FOREGROUND) {
HILOG_ERROR("not continuous startup.");
HILOG_DEBUG("not continuous startup.");
abilityRecord->SetPendingState(AbilityState::INITIAL);
}
}
@@ -1120,7 +1120,7 @@ void MissionListManager::CompleteBackground(const std::shared_ptr<AbilityRecord>
if (abilityRecord->GetPendingState() == AbilityState::FOREGROUND) {
DelayedSingleton<AppScheduler>::GetInstance()->MoveToForeground(abilityRecord->GetToken());
} else if (abilityRecord->GetPendingState() == AbilityState::BACKGROUND) {
HILOG_ERROR("not continuous startup.");
HILOG_DEBUG("not continuous startup.");
abilityRecord->SetPendingState(AbilityState::INITIAL);
}