!213 清理告警信息

Merge pull request !213 from HanSY/cleanAlarm
This commit is contained in:
openharmony_ci
2025-01-21 04:07:10 +00:00
committed by Gitee
4 changed files with 16 additions and 5 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ public:
std::vector<ResourceId> GetHeaderId() const;
int64_t GetId(ResType resType, const std::string &name) const;
int64_t GetSystemId(ResType resType, const std::string &name) const;
void LoadIdFromHap(const std::map<int64_t, std::vector<ResourceItem>> &items);
int64_t LoadIdFromHap(const std::map<int64_t, std::vector<ResourceItem>> &items);
private:
int64_t GenerateAppId(ResType resType, const std::string &name);
+7 -2
View File
@@ -84,7 +84,7 @@ int64_t IdWorker::GetSystemId(ResType resType, const string &name) const
return result->second.id;
}
void IdWorker::LoadIdFromHap(const map<int64_t, vector<ResourceItem>> &items)
int64_t IdWorker::LoadIdFromHap(const map<int64_t, vector<ResourceItem>> &items)
{
int64_t minId = 0xffffffff;
int64_t maxId = 0x01000000;
@@ -96,7 +96,12 @@ void IdWorker::LoadIdFromHap(const map<int64_t, vector<ResourceItem>> &items)
maxId = max(maxId, item.first);
}
maxId_ = GetMaxId(minId);
appId_ = maxId + 1;
if (static_cast<uint64_t>(maxId) > maxId_) {
PrintError(GetError(ERR_CODE_RESOURCE_ID_EXCEED).FormatCause(static_cast<uint64_t>(maxId), maxId_));
return RESTOOL_ERROR;
}
appId_ = static_cast<uint64_t>(maxId) + 1;
return RESTOOL_SUCCESS;
}
int64_t IdWorker::GenerateAppId(ResType resType, const string &name)
+3 -1
View File
@@ -88,7 +88,9 @@ uint32_t ResourceOverlap::LoadHapResources()
return RESTOOL_ERROR;
}
IdWorker::GetInstance().LoadIdFromHap(items);
if (IdWorker::GetInstance().LoadIdFromHap(items) != RESTOOL_SUCCESS) {
return RESTOOL_ERROR;
}
FileManager &fileManager = FileManager::GetInstance();
fileManager.SetModuleName(moduleName_);
+5 -1
View File
@@ -47,7 +47,11 @@ uint32_t ResourcePack::Package()
}
unique_ptr<ResourcePack> resourcePacker =
ResourcePackerFactory::CreatePacker(packType_, packageParser_);
errorCode = resourcePacker->Pack();
if (!resourcePacker) {
errorCode = RESTOOL_ERROR;
} else {
errorCode = resourcePacker->Pack();
}
}
if (errorCode == RESTOOL_SUCCESS) {
ShowPackSuccess();