From ab0acd83356fcb44dcbec866ef3bfac16b0af721 Mon Sep 17 00:00:00 2001 From: li-li-wang Date: Fri, 14 Mar 2025 10:09:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B910%=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-li-wang --- .../sa/sa_main/sec_comp_info_helper.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp b/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp index 50c158d..71e67f3 100644 --- a/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp +++ b/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp @@ -35,7 +35,7 @@ namespace Security { namespace SecurityComponent { namespace { constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompInfoHelper"}; -static constexpr double MAX_RECT_PERCENT = 0.1F; // 10% +static constexpr double MAX_RECT_PERCENT = 0.3F; // 30% static constexpr double ZERO_OFFSET = 0.0F; const std::string OUT_OF_SCREEN = ", security component is out of screen, security component(x = "; const std::string OUT_OF_WINDOW = ", security component is out of window, security component(x = "; @@ -205,13 +205,9 @@ bool SecCompInfoHelper::CheckRectValid(const SecCompRect& rect, const SecCompRec return false; } - // check rect > 10% + // check rect > 30% if (GreatOrEqual((rect.width_ * rect.height_), (curScreenWidth * curScreenHeight * MAX_RECT_PERCENT))) { - SC_LOG_ERROR(LABEL, "SecurityComponentCheckFail: security component is larger than 10 percent of screen"); - message = SECURITY_COMPONENT_IS_TOO_LARGER + std::to_string(rect.width_) + - ", height = " + std::to_string(rect.height_) + "), current screen(width = " - + std::to_string(curScreenWidth) + ", height = " + std::to_string(curScreenHeight) + ")"; - return false; + SC_LOG_INFO(LABEL, "security component is larger than 30 percent of screen"); } SC_LOG_DEBUG(LABEL, "check component rect success."); return true; -- Gitee