!2111 删除冗余代码

Merge pull request !2111 from steven_Q/0919
This commit is contained in:
openharmony_ci 2024-09-22 11:41:42 +00:00 committed by Gitee
commit b9ce1edab5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 0 additions and 34 deletions

View File

@ -24,7 +24,6 @@ namespace OHOS {
namespace AccountSA {
class AccountHelperData {
public:
static std::vector<std::string> GetBundleNameTrustList();
static std::map<std::string, std::string> GetAccountEventMap();
};
} // namespace AccountSA

View File

@ -57,7 +57,6 @@ public:
std::int32_t CmdGetAccountIAMService(MessageParcel &data, MessageParcel &reply);
std::int32_t CmdGetDomainAccountService(MessageParcel &data, MessageParcel &reply);
bool HasAccountRequestPermission(const std::string &permissionName);
bool CheckCallerForTrustList();
private:
std::map<AccountMgrInterfaceCode, AccountStubFunc> stubFuncMap_;

View File

@ -122,7 +122,6 @@
"OHOS::AccountSA::GetValidAccountID(std::__h::basic_string<char, std::__h::char_traits<char>, std::__h::allocator<char>> const&, int&)";
"OHOS::AccountSA::IAccountContext::instance_";
"OHOS::AccountSA::AccountMgrService::GetCallingUserID()";
"OHOS::AccountSA::AccountHelperData::GetBundleNameTrustList()";
*OHOS::AccountSA::CommitCredUpdateCallback::CommitCredUpdateCallback*;
"OHOS::AccountSA::IInnerOsAccountManager::CheckAndAddLocalIdOperating(int)";
"OHOS::AccountSA::IInnerOsAccountManager::UpdateAccountStatusForDomain(int, OHOS::AccountSA::DomainAccountStatus)";

View File

@ -57,21 +57,6 @@ static bool ParseJsonData(nlohmann::json &jsonData)
}
}
std::vector<std::string> AccountHelperData::GetBundleNameTrustList()
{
std::vector<std::string> result = {""};
nlohmann::json jsonData;
if (!ParseJsonData(jsonData)) {
return result;
}
if (jsonData.find(KEY_BUNDLE_NAME_LIST) != jsonData.end() && jsonData.at(KEY_BUNDLE_NAME_LIST).is_array()) {
result = jsonData.at(KEY_BUNDLE_NAME_LIST).get<std::vector<std::string>>();
}
return result;
}
std::map<std::string, std::string> AccountHelperData::GetAccountEventMap()
{
std::map<std::string, std::string> result = {};

View File

@ -543,21 +543,5 @@ bool AccountStub::HasAccountRequestPermission(const std::string &permissionName)
ACCOUNT_LOGE("permission %{public}s denied!", permissionName.c_str());
return false;
}
bool AccountStub::CheckCallerForTrustList()
{
std::string bundleName;
std::int32_t uid = IPCSkeleton::GetCallingUid();
if (BundleManagerAdapter::GetInstance()->GetNameForUid(uid, bundleName) != ERR_OK) {
return false;
}
std::vector<std::string> trustList = AccountHelperData::GetBundleNameTrustList();
if (std::find(trustList.begin(), trustList.end(), bundleName) == trustList.end()) {
return false;
}
return true;
}
} // namespace AccountSA
} // namespace OHOS