本地账号hidumper打印账号信息失败问题处理

Signed-off-by: lichenchen <lichenchen15@huawei.com>
This commit is contained in:
lichenchen 2022-09-15 15:35:35 +08:00
parent 0e9f1a02bd
commit e96aa992a0
3 changed files with 16 additions and 1 deletions

View File

@ -159,7 +159,7 @@ void AccountDumpHelper::ShowOsAccountInfo(std::string& result) const
}
std::vector<std::string> states;
ErrCode ret = osAccountMgrService_->DumpState(-1, states); // -1 means query all
ErrCode ret = osAccountMgrService_->DumpOsAccountInfo(states);
if (ret != ERR_OK) {
result.append("Cannot query os account list, error code ");
result.append(std::to_string(ret));

View File

@ -83,6 +83,7 @@ public:
ErrCode SetCurrentOsAccountIsVerified(const bool isVerified) override;
ErrCode SetOsAccountIsVerified(const int id, const bool isVerified) override;
ErrCode DumpState(const int &id, std::vector<std::string> &state) override;
ErrCode DumpOsAccountInfo(std::vector<std::string> &state);
void CreateBasicAccounts() override;
ErrCode GetCreatedOsAccountNumFromDatabase(const std::string& storeID,

View File

@ -524,6 +524,20 @@ ErrCode OsAccountManagerService::DumpState(const int &id, std::vector<std::strin
return DumpStateByAccounts(osAccountInfos, state);
}
ErrCode OsAccountManagerService::DumpOsAccountInfo(std::vector<std::string> &state)
{
state.clear();
ErrCode result = ERR_OK;
std::vector<OsAccountInfo> osAccountInfos;
result = innerManager_->QueryAllCreatedOsAccounts(osAccountInfos);
if (result != ERR_OK) {
return result;
}
return DumpStateByAccounts(osAccountInfos, state);
}
ErrCode OsAccountManagerService::GetCreatedOsAccountNumFromDatabase(const std::string& storeID,
int &createdOsAccountNum)
{