mirror of
https://gitee.com/openharmony/account_os_account
synced 2025-02-17 02:29:07 +00:00
!2159 账号启动激活默认用户, 判断用户状态
Merge pull request !2159 from 周士淼/fix_1014_activeDefult
This commit is contained in:
commit
7943281d06
@ -153,7 +153,7 @@ void IInnerOsAccountManager::RetryToGetAccount(OsAccountInfo &osAccountInfo)
|
||||
while (retryTimes < MAX_RETRY_TIMES) {
|
||||
std::vector<OsAccountInfo> osAccountInfos;
|
||||
QueryAllCreatedOsAccounts(osAccountInfos);
|
||||
if (!osAccountInfos.empty() && !osAccountInfos[0].GetToBeRemoved()) {
|
||||
if (!osAccountInfos.empty() && (IsValidOsAccount(osAccountInfos[0]) == ERR_OK)) {
|
||||
osAccountInfo = osAccountInfos[0];
|
||||
return;
|
||||
}
|
||||
@ -206,7 +206,7 @@ ErrCode IInnerOsAccountManager::ActivateDefaultOsAccount()
|
||||
ACCOUNT_LOGI("start to activate default account");
|
||||
OsAccountInfo osAccountInfo;
|
||||
ErrCode errCode = GetRealOsAccountInfoById(defaultActivatedId_, osAccountInfo);
|
||||
if (errCode != ERR_OK || osAccountInfo.GetToBeRemoved()) {
|
||||
if ((errCode != ERR_OK) || (IsValidOsAccount(osAccountInfo) != ERR_OK)) {
|
||||
ACCOUNT_LOGE("account not found, localId: %{public}d, error: %{public}d", defaultActivatedId_, errCode);
|
||||
RetryToGetAccount(osAccountInfo);
|
||||
SetDefaultActivatedOsAccount(osAccountInfo.GetLocalId());
|
||||
|
Loading…
x
Reference in New Issue
Block a user