codex告警清理

Signed-off-by: qinlong0101 <qinlong15@huawei.com>
This commit is contained in:
qinlong0101
2022-06-08 15:34:10 +08:00
parent 9ab2b2ff9f
commit 58bd9232f6
2 changed files with 16 additions and 4 deletions
+14
View File
@@ -94,5 +94,19 @@ std::string GetAnonyString(const std::string &value)
return res;
}
std::string GetInterruptString(const std::string &value)
{
constexpr size_t INT32_MIN_ID_LENGTH = 3;
std::string res;
size_t strlen = value.length();
if(strlen <= INT32_MIN_ID_LENGTH) {
res = value;
} else {
res = value.substr(0, strlen / 2);
}
return res;
}
} // namespace DistributedHardware
} // namespace OHOS
@@ -41,10 +41,8 @@ uint64_t ScreenMgrAdapter::CreateVirtualScreen(const std::string &devId, const s
{
DHLOGI("CreateVirtualScreen, width: %u, height: %u", videoParam->GetScreenWidth(),
videoParam->GetScreenHeight());
int32_t devIdsize = devId.size() / 2;
int32_t dhIdsize = dhId.size() / 2;
std::string screenName = DSCREEN_PREFIX + SEPERATOR + devId.substr(0, devIdsize) +
SEPERATOR + dhId.substr(0, dhIdsize);
std::string screenName = DSCREEN_PREFIX + SEPERATOR + GetInterruptString(devId) +
SEPERATOR + GetInterruptString(dhId);
auto iter = screenIdMap_.find(screenName);
if (iter != screenIdMap_.end()) {
DHLOGI("remove an exist virtual screen.");