mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-24 22:21:36 -04:00
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:
@@ -4643,6 +4643,14 @@ int AbilityManagerService::DoAbilityForeground(const sptr<IRemoteObject> &token,
|
|||||||
return ERR_WOULD_BLOCK;
|
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);
|
abilityRecord->ProcessForegroundAbility(flag);
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -272,11 +272,11 @@ int MissionListManager::StartAbilityLocked(const std::shared_ptr<AbilityRecord>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (targetAbilityRecord->GetPendingState() == AbilityState::FOREGROUND) {
|
if (targetAbilityRecord->GetPendingState() == AbilityState::FOREGROUND) {
|
||||||
HILOG_ERROR("pending state is FOREGROUND.");
|
HILOG_DEBUG("pending state is FOREGROUND.");
|
||||||
targetAbilityRecord->SetPendingState(AbilityState::FOREGROUND);
|
targetAbilityRecord->SetPendingState(AbilityState::FOREGROUND);
|
||||||
return 0;
|
return ERR_OK;
|
||||||
} else {
|
} else {
|
||||||
HILOG_ERROR("pending state is not FOREGROUND.");
|
HILOG_DEBUG("pending state is not FOREGROUND.");
|
||||||
targetAbilityRecord->SetPendingState(AbilityState::FOREGROUND);
|
targetAbilityRecord->SetPendingState(AbilityState::FOREGROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,7 +322,7 @@ int MissionListManager::StartAbilityLocked(const std::shared_ptr<AbilityRecord>
|
|||||||
#else
|
#else
|
||||||
targetAbilityRecord->ProcessForegroundAbility();
|
targetAbilityRecord->ProcessForegroundAbility();
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t CallType2StartMethod(int32_t callType)
|
static int32_t CallType2StartMethod(int32_t callType)
|
||||||
@@ -720,7 +720,7 @@ int MissionListManager::MinimizeAbilityLocked(const std::shared_ptr<AbilityRecor
|
|||||||
abilityRecord->SetPendingState(AbilityState::BACKGROUND);
|
abilityRecord->SetPendingState(AbilityState::BACKGROUND);
|
||||||
|
|
||||||
if (!abilityRecord->IsAbilityState(AbilityState::FOREGROUND)) {
|
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;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1059,7 +1059,7 @@ void MissionListManager::CompleteForegroundSuccess(const std::shared_ptr<Ability
|
|||||||
UpdateMissionTimeStamp(abilityRecord);
|
UpdateMissionTimeStamp(abilityRecord);
|
||||||
}
|
}
|
||||||
} else if (abilityRecord->GetPendingState() == AbilityState::FOREGROUND) {
|
} else if (abilityRecord->GetPendingState() == AbilityState::FOREGROUND) {
|
||||||
HILOG_ERROR("not continuous startup.");
|
HILOG_DEBUG("not continuous startup.");
|
||||||
abilityRecord->SetPendingState(AbilityState::INITIAL);
|
abilityRecord->SetPendingState(AbilityState::INITIAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1120,7 +1120,7 @@ void MissionListManager::CompleteBackground(const std::shared_ptr<AbilityRecord>
|
|||||||
if (abilityRecord->GetPendingState() == AbilityState::FOREGROUND) {
|
if (abilityRecord->GetPendingState() == AbilityState::FOREGROUND) {
|
||||||
DelayedSingleton<AppScheduler>::GetInstance()->MoveToForeground(abilityRecord->GetToken());
|
DelayedSingleton<AppScheduler>::GetInstance()->MoveToForeground(abilityRecord->GetToken());
|
||||||
} else if (abilityRecord->GetPendingState() == AbilityState::BACKGROUND) {
|
} else if (abilityRecord->GetPendingState() == AbilityState::BACKGROUND) {
|
||||||
HILOG_ERROR("not continuous startup.");
|
HILOG_DEBUG("not continuous startup.");
|
||||||
abilityRecord->SetPendingState(AbilityState::INITIAL);
|
abilityRecord->SetPendingState(AbilityState::INITIAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user