mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-11-27 09:21:28 +00:00
fixed process pending state
Signed-off-by: yuwenze <yuwenze1@huawei.com> Change-Id: I6878f235421182f561edd718229d15dfeef928f6
This commit is contained in:
parent
6ca36808d0
commit
a8a16ef082
@ -970,9 +970,10 @@ void AppRunningRecord::AbilityForeground(const std::shared_ptr<AbilityRunningRec
|
||||
}
|
||||
if (curState_ == ApplicationState::APP_STATE_READY || curState_ == ApplicationState::APP_STATE_BACKGROUND
|
||||
|| curState_ == ApplicationState::APP_STATE_FOREGROUND) {
|
||||
if (foregroundingAbilityTokens_.empty() || pendingState_ == ApplicationPendingState::BACKGROUNDING) {
|
||||
TAG_LOGD(AAFwkTag::APPMGR, "application foregrounding.");
|
||||
SetApplicationPendingState(ApplicationPendingState::FOREGROUNDING);
|
||||
TAG_LOGD(AAFwkTag::APPMGR, "application foregrounding.");
|
||||
auto pendingState = pendingState_;
|
||||
SetApplicationPendingState(ApplicationPendingState::FOREGROUNDING);
|
||||
if (pendingState == ApplicationPendingState::READY) {
|
||||
ScheduleForegroundRunning();
|
||||
}
|
||||
foregroundingAbilityTokens_.insert(ability->GetToken());
|
||||
@ -1024,8 +1025,11 @@ void AppRunningRecord::AbilityBackground(const std::shared_ptr<AbilityRunningRec
|
||||
|
||||
// Then schedule application background when all ability is not foreground.
|
||||
if (foregroundSize == 0 && mainBundleName_ != LAUNCHER_NAME && windowIds_.empty()) {
|
||||
auto pendingState = pendingState_;
|
||||
SetApplicationPendingState(ApplicationPendingState::BACKGROUNDING);
|
||||
ScheduleBackgroundRunning();
|
||||
if (pendingState == ApplicationPendingState::READY) {
|
||||
ScheduleBackgroundRunning();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
TAG_LOGW(AAFwkTag::APPMGR, "wrong application state");
|
||||
|
Loading…
Reference in New Issue
Block a user