From 1a3fe7fd44fadff7e4833ec7370004c549f883e2 Mon Sep 17 00:00:00 2001 From: li-li-wang Date: Mon, 24 Mar 2025 15:23:12 +0800 Subject: [PATCH] =?UTF-8?q?ai=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-li-wang --- frameworks/security_component/src/sec_comp_base.cpp | 6 +++--- .../inner_api/security_component/include/sec_comp_base.h | 2 +- .../sa/sa_main/first_use_dialog.cpp | 2 +- .../sa/sa_main/sec_comp_manager.cpp | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/frameworks/security_component/src/sec_comp_base.cpp b/frameworks/security_component/src/sec_comp_base.cpp index 13a2c20..5a76982 100644 --- a/frameworks/security_component/src/sec_comp_base.cpp +++ b/frameworks/security_component/src/sec_comp_base.cpp @@ -72,7 +72,7 @@ const std::string JsonTagConstants::JSON_DISPLAY_ID = "displayId"; const std::string JsonTagConstants::JSON_CROSS_AXIS_STATE = "crossAxisState"; const std::string JsonTagConstants::JSON_IS_ICON_EXCEEDED_TAG = "isIconExceeded"; const std::string JsonTagConstants::JSON_IS_BORDER_COVERED_TAG = "isBorderCovered"; -const std::string JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG = "hasNonCompatileChange"; +const std::string JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG = "hasNonCompatibleChange"; const std::string JsonTagConstants::JSON_LINEAR_GRADIENT_BLUR_RADIUS_TAG = "blurRadius"; const std::string JsonTagConstants::JSON_FOREGROUND_BLUR_RADIUS_TAG = "foregroundBlurRadius"; const std::string JsonTagConstants::JSON_IS_OVERLAY_TEXT_SET_TAG = "isOverlayTextSet"; @@ -85,7 +85,7 @@ bool SecCompBase::ParseNonCompatibleChange(const nlohmann::json& json) SC_LOG_ERROR(LABEL, "json: %{public}s tag invalid.", tag.c_str()); return false; } - hasNonCompatileChange_ = json.at(tag).get(); + hasNonCompatibleChange_ = json.at(tag).get(); if (!ParseBool(json, JsonTagConstants::JSON_IS_ICON_EXCEEDED_TAG, isIconExceeded_)) { return false; @@ -505,7 +505,7 @@ void SecCompBase::ToJson(nlohmann::json& jsonRes) const jsonRes[JsonTagConstants::JSON_CROSS_AXIS_STATE] = crossAxisState_; jsonRes[JsonTagConstants::JSON_IS_ICON_EXCEEDED_TAG] = isIconExceeded_; jsonRes[JsonTagConstants::JSON_IS_BORDER_COVERED_TAG] = isBorderCovered_; - jsonRes[JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG] = hasNonCompatileChange_; + jsonRes[JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG] = hasNonCompatibleChange_; jsonRes[JsonTagConstants::JSON_LINEAR_GRADIENT_BLUR_RADIUS_TAG] = blurRadius_; jsonRes[JsonTagConstants::JSON_FOREGROUND_BLUR_RADIUS_TAG] = foregroundBlurRadius_; jsonRes[JsonTagConstants::JSON_IS_OVERLAY_TEXT_SET_TAG] = isOverlayTextSet_; diff --git a/interfaces/inner_api/security_component/include/sec_comp_base.h b/interfaces/inner_api/security_component/include/sec_comp_base.h index ae37388..5676f63 100644 --- a/interfaces/inner_api/security_component/include/sec_comp_base.h +++ b/interfaces/inner_api/security_component/include/sec_comp_base.h @@ -147,7 +147,7 @@ public: int32_t icon_ = UNKNOWN_ICON; SecCompBackground bg_ = SecCompBackground::UNKNOWN_BG; - bool hasNonCompatileChange_ = false; + bool hasNonCompatibleChange_ = false; double blurRadius_ = 0.0; double foregroundBlurRadius_ = 0.0; bool isOverlayTextSet_ = false; diff --git a/services/security_component_service/sa/sa_main/first_use_dialog.cpp b/services/security_component_service/sa/sa_main/first_use_dialog.cpp index 445c621..c92cd6c 100644 --- a/services/security_component_service/sa/sa_main/first_use_dialog.cpp +++ b/services/security_component_service/sa/sa_main/first_use_dialog.cpp @@ -164,7 +164,7 @@ bool FirstUseDialog::ParseRecord(nlohmann::json& jsonRes, } id = jsonRes.at(TOKEN_ID_TAG).get(); if (id == AccessToken::INVALID_TOKENID) { - SC_LOG_ERROR(LABEL, "TokenId is not invalid."); + SC_LOG_ERROR(LABEL, "TokenId is invalid."); return false; } diff --git a/services/security_component_service/sa/sa_main/sec_comp_manager.cpp b/services/security_component_service/sa/sa_main/sec_comp_manager.cpp index 1e5b618..8f68d59 100644 --- a/services/security_component_service/sa/sa_main/sec_comp_manager.cpp +++ b/services/security_component_service/sa/sa_main/sec_comp_manager.cpp @@ -469,7 +469,7 @@ int32_t SecCompManager::CheckClickSecurityComponentInfo(std::shared_ptrGetType()); return SC_SERVICE_ERROR_COMPONENT_INFO_INVALID; } - if (report && (report->isClipped_ || report->hasNonCompatileChange_)) { + if (report && (report->isClipped_ || report->hasNonCompatibleChange_)) { HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SEC_COMPONENT, "CLIP_CHECK_FAILED", HiviewDFX::HiSysEvent::EventType::SECURITY, "CALLER_BUNDLE_NAME", bundleName, "COMPONENT_INFO", jsonComponent.dump().c_str()); @@ -560,7 +560,8 @@ int32_t SecCompManager::ReportSecurityComponentClickEvent(SecCompInfo& info, con if (res != SC_OK) { return res; } - SecCompBase* report = SecCompInfoHelper::ParseComponent(sc->GetType(), compJson, message, true); + SecCompBase* reportComponentInfo = SecCompInfoHelper::ParseComponent(sc->GetType(), compJson, message, true); + std::shared_ptr report(reportComponentInfo); if (report == nullptr) { return SC_SERVICE_ERROR_COMPONENT_INFO_INVALID; } -- Gitee