mirror of
https://gitee.com/openharmony/account_os_account
synced 2024-11-23 10:10:11 +00:00
commit
a48daf186b
@ -83,6 +83,7 @@ IInnerOsAccountManager::IInnerOsAccountManager() : subscribeManager_(OsAccountSu
|
||||
osAccountControl_->GetDeviceOwnerId(deviceOwnerId_);
|
||||
osAccountControl_->GetDefaultActivatedOsAccount(defaultActivatedId_);
|
||||
osAccountControl_->GetOsAccountConfig(config_);
|
||||
SetParameter(PARAM_LOGIN_NAME_MAX.c_str(), std::to_string(Constants::LOCAL_NAME_MAX_SIZE).c_str());
|
||||
ACCOUNT_LOGI("Init end, maxOsAccountNum: %{public}d, maxLoggedInOsAccountNum: %{public}d",
|
||||
config_.maxOsAccountNum, config_.maxLoggedInOsAccountNum);
|
||||
}
|
||||
@ -1025,7 +1026,6 @@ void IInnerOsAccountManager::Init()
|
||||
ACCOUNT_LOGI("Start to create base os accounts");
|
||||
CreateBaseAdminAccount();
|
||||
CreateBaseStandardAccount();
|
||||
SetParameter(PARAM_LOGIN_NAME_MAX.c_str(), std::to_string(Constants::LOCAL_NAME_MAX_SIZE).c_str());
|
||||
ACCOUNT_LOGI("End to create base os accounts");
|
||||
}
|
||||
|
||||
|
@ -531,13 +531,17 @@ ErrCode OsAccountControlFileManager::GetOsAccountInfoById(const int id, OsAccoun
|
||||
{
|
||||
std::string path = Constants::USER_INFO_BASE + Constants::PATH_SEPARATOR + std::to_string(id) +
|
||||
Constants::PATH_SEPARATOR + Constants::USER_INFO_FILE_NAME;
|
||||
ErrCode err = ERR_ACCOUNT_COMMON_FILE_READ_FAILED;
|
||||
if (!accountFileOperator_->IsExistFile(path)) {
|
||||
if (errno == ENOENT) {
|
||||
err = ERR_ACCOUNT_COMMON_ACCOUNT_NOT_EXIST_ERROR;
|
||||
}
|
||||
ACCOUNT_LOGE("file %{public}s does not exist err", path.c_str());
|
||||
if (GetOsAccountFromDatabase("", id, osAccountInfo) == ERR_OK) {
|
||||
InsertOsAccount(osAccountInfo);
|
||||
return ERR_OK;
|
||||
}
|
||||
return errno == ENOENT ? ERR_ACCOUNT_COMMON_ACCOUNT_NOT_EXIST_ERROR : ERR_ACCOUNT_COMMON_FILE_READ_FAILED;
|
||||
return err;
|
||||
}
|
||||
std::string accountInfoStr;
|
||||
if (accountFileOperator_->GetFileContentByPath(path, accountInfoStr) != ERR_OK) {
|
||||
|
Loading…
Reference in New Issue
Block a user