mirror of
https://gitee.com/openharmony/account_os_account
synced 2024-11-23 10:10:11 +00:00
本地账号hidumper打印账号信息失败问题处理
Signed-off-by: lichenchen <lichenchen15@huawei.com>
This commit is contained in:
parent
0e9f1a02bd
commit
e96aa992a0
@ -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));
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user