!2144 delay kill scb when transition

Merge pull request !2144 from Jasonye/delay
This commit is contained in:
openharmony_ci 2024-10-14 08:03:08 +00:00 committed by Gitee
commit 11bc4ae5b9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -2246,6 +2246,9 @@ ErrCode IInnerOsAccountManager::UpdateAccountToBackground(int32_t oldId)
if (errCode != ERR_OK) {
return ERR_ACCOUNT_COMMON_ACCOUNT_NOT_EXIST_ERROR;
}
if (oldOsAccountInfo.GetIsForeground()) {
std::this_thread::sleep_for(std::chrono::milliseconds(DELAY_FOR_REMOVING_FOREGROUND_OS_ACCOUNT));
}
oldOsAccountInfo.SetIsForeground(false);
oldOsAccountInfo.SetDisplayId(Constants::INVALID_DISPALY_ID);
errCode = osAccountControl_->UpdateOsAccount(oldOsAccountInfo);