!103 更新异常打点位置

Merge pull request !103 from WoHoo/master
This commit is contained in:
openharmony_ci 2024-09-26 06:13:14 +00:00 committed by Gitee
commit ae35d22b1d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 16 additions and 3 deletions

View File

@ -44,6 +44,7 @@ void WhiteListConfigMgr::LoadDefault()
defaultWhiteUrl_ = preferences_->GetString(DEFAULT_URL_KEY, "");
if (defaultWhiteUrl_.empty()) {
UNIVERSAL_ERROR_EVENT(READ_DEFAULT_WHITE_LIST_FAULT);
APP_DOMAIN_VERIFY_HILOGW(APP_DOMAIN_VERIFY_MODULE_COMMON, "WhiteListConfigMgr::Load defaultWhiteUrl empty.");
}
}
@ -157,7 +158,10 @@ void WhiteListConfigMgr::UpdateWhiteList(const std::unordered_set<std::string>&
std::lock_guard<std::mutex> lock(whiteListLock_);
whiteListSet_ = filtedWhiteList;
if (!whiteListSet_.empty()) {
Save();
if (!Save()) {
UNIVERSAL_ERROR_EVENT(WRITE_DYNAMIC_WHITE_LIST_FAULT);
APP_DOMAIN_VERIFY_HILOGE(APP_DOMAIN_VERIFY_MGR_MODULE_SERVICE, "save white list failed.");
}
}
}

View File

@ -73,6 +73,7 @@ private:
bool LoadAllFromRdb();
bool VerifyResultInfoToDB(const std::string bundleName, const VerifyResultInfo& verifyResultInfo);
bool DBToVerifyResultInfo(const std::vector<RdbDataItem>& items, VerifyResultInfo& verifyResultInfo);
bool LoadData();
private:
std::shared_ptr<AppDomainVerifyRdbDataManager> rdbDataManager_ = nullptr;

View File

@ -23,8 +23,9 @@ AppDomainVerifyDataMgr::AppDomainVerifyDataMgr()
{
APP_DOMAIN_VERIFY_HILOGD(APP_DOMAIN_VERIFY_MGR_MODULE_SERVICE, "new instance created.");
verifyMap_ = std::make_shared<std::unordered_map<std::string, VerifyResultInfo>>();
if (InitRdb()) {
LoadAllFromRdb();
if (!LoadData()) {
UNIVERSAL_ERROR_EVENT(LOAD_DB_FAULT);
APP_DOMAIN_VERIFY_HILOGE(APP_DOMAIN_VERIFY_MGR_MODULE_SERVICE, "load data failed.");
}
}
@ -208,5 +209,12 @@ bool AppDomainVerifyDataMgr::QueryAssociatedBundleNames(
APP_DOMAIN_VERIFY_HILOGD(APP_DOMAIN_VERIFY_MGR_MODULE_SERVICE, "call end");
return true;
}
bool AppDomainVerifyDataMgr::LoadData()
{
if (InitRdb()) {
return LoadAllFromRdb();
}
return false;
}
} // namespace AppDomainVerify
} // namespace OHOS