!1330 schedule ability to foreground and request focus when ability is foreground

Merge pull request !1330 from ccll/master
This commit is contained in:
openharmony_ci 2022-03-22 16:09:05 +00:00 committed by Gitee
commit efb0982147
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -264,15 +264,6 @@ int MissionListManager::StartAbilityLocked(const std::shared_ptr<AbilityRecord>
// 4. move target list to top
MoveMissionListToTop(targetList);
// ability is already foreground, process next ability, excepting for launcher's MainAbility.
if ((abilityRequest.abilityInfo.bundleName != AbilityConfig::LAUNCHER_BUNDLE_NAME ||
abilityRequest.abilityInfo.name != AbilityConfig::LAUNCHER_ABILITY_NAME) &&
(targetAbilityRecord->IsAbilityState(AbilityState::FOREGROUND_NEW) ||
targetAbilityRecord->IsAbilityState(AbilityState::FOREGROUNDING_NEW))) {
PostStartWaittingAbility();
return 0;
}
// 5. schedule target ability
if (!currentTopAbility) {
// top ability is null, then launch the first Ability.