!98 修复AI检测出的部分问题

Merge pull request !98 from 金方鑫/master
This commit is contained in:
openharmony_ci 2024-11-20 12:12:00 +00:00 committed by Gitee
commit d1bf9c313d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
8 changed files with 13 additions and 10 deletions

View File

@ -35,7 +35,7 @@ public:
}
template<typename T>
static bool UpdataConfig()
static bool UpdateConfig()
{
T config;
auto cfgOperator = std::make_unique<ConfigOperator>(config);

View File

@ -37,9 +37,9 @@ bool ConfigSubscriber::UpdateConfig(const std::string &file)
ConfigUpdateEvent event{};
bool isSuccess = false;
if (file == CONFIG_CACHE_FILES[EVENT_CFG_INDEX]) {
isSuccess = ConfigManager::UpdataConfig<EventConfig>();
isSuccess = ConfigManager::UpdateConfig<EventConfig>();
} else if (file == CONFIG_CACHE_FILES[MODEL_CFG_INDEX]) {
isSuccess = ConfigManager::UpdataConfig<ModelConfig>();
isSuccess = ConfigManager::UpdateConfig<ModelConfig>();
}
event.path = file;
event.time = SecurityGuardUtils::GetDate();

View File

@ -238,8 +238,8 @@ void to_json(json &jsonObj, const EventContentSt &eventContentSt)
void from_json(const json &jsonObj, EventContentSt &eventContentSt)
{
JsonCfg::Unmarshal(eventContentSt.status, jsonObj, EVENT_CONTENT_STATUS_KEY);
JsonCfg::Unmarshal(eventContentSt.cred, jsonObj, EVENT_CONTENT_CRED_KEY);
JsonCfg::Unmarshal(eventContentSt.extra, jsonObj, EVENT_CONTENT_EXTRA_KEY);
(void)JsonCfg::Unmarshal(eventContentSt.status, jsonObj, EVENT_CONTENT_STATUS_KEY);
(void)JsonCfg::Unmarshal(eventContentSt.cred, jsonObj, EVENT_CONTENT_CRED_KEY);
(void)JsonCfg::Unmarshal(eventContentSt.extra, jsonObj, EVENT_CONTENT_EXTRA_KEY);
}
}

View File

@ -97,7 +97,7 @@ void DataCollectManagerService::OnStart()
AddSystemAbilityListener(RISK_ANALYSIS_MANAGER_SA_ID);
AddSystemAbilityListener(DFX_SYS_HIVIEW_ABILITY_ID);
bool success = ConfigManager::InitConfig<EventConfig>();
if (!success) {
if (!success) {
SGLOGE("init event config error");
}
std::vector<int64_t> eventIds = ConfigDataManager::GetInstance().GetAllEventIds();

View File

@ -30,6 +30,9 @@ int RdbEventStoreCallback::OnCreate(NativeRdb::RdbStore &rdbStore)
}
for (size_t i = 0; i < size; i++) {
ret = rdbStore.ExecuteSql(createTableSqlVec_[i]);
if (ret == NativeRdb::E_ERROR) {
return ret;
}
}
return ret;
}

View File

@ -85,7 +85,7 @@ bool DataCollection::SecurityGuardSubscribeCollector(const std::vector<int64_t>&
}
ret = LoadCollector(eventId, collectorPath, nullptr);
if (ret != SUCCESS) {
LOGE("GetCollectorPath failed, eventId is 0x%{public}" PRIx64, eventId);
LOGE("LoadCollector failed, eventId is 0x%{public}" PRIx64, eventId);
continue;
}
}

View File

@ -35,7 +35,7 @@ public:
}
template<typename T>
static bool UpdataConfig()
static bool UpdateConfig()
{
T config;
auto cfgOperator = std::make_unique<ConfigOperator>(config);

View File

@ -35,7 +35,7 @@ public:
}
template<typename T>
static bool UpdataConfig()
static bool UpdateConfig()
{
T config;
auto cfgOperator = std::make_unique<ConfigOperator>(config);