diff --git a/frameworks/inner_api/security_component/test/unittest/src/test_common.cpp b/frameworks/inner_api/security_component/test/unittest/src/test_common.cpp index 3ba019da00fbacfa5e86be625228bf350d9e3f22..f1073b8ad5780df22597510fa78a8ae846a70a35 100644 --- a/frameworks/inner_api/security_component/test/unittest/src/test_common.cpp +++ b/frameworks/inner_api/security_component/test/unittest/src/test_common.cpp @@ -84,6 +84,9 @@ void TestCommon::BuildLocationComponentInfo(nlohmann::json& jsonComponent) jsonComponent[JsonTagConstants::JSON_CROSS_AXIS_STATE] = 0; jsonComponent[JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG] = false; jsonComponent[JsonTagConstants::JSON_LINEAR_GRADIENT_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_FOREGROUND_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_TEXT_SET_TAG] = false; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_NODE_SET_TAG] = false; } void TestCommon::BuildSaveComponentInfo(nlohmann::json& jsonComponent) @@ -153,6 +156,9 @@ void TestCommon::BuildSaveComponentInfo(nlohmann::json& jsonComponent) jsonComponent[JsonTagConstants::JSON_CROSS_AXIS_STATE] = 0; jsonComponent[JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG] = false; jsonComponent[JsonTagConstants::JSON_LINEAR_GRADIENT_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_FOREGROUND_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_TEXT_SET_TAG] = false; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_NODE_SET_TAG] = false; } void TestCommon::BuildPasteComponentInfo(nlohmann::json& jsonComponent) @@ -222,6 +228,9 @@ void TestCommon::BuildPasteComponentInfo(nlohmann::json& jsonComponent) jsonComponent[JsonTagConstants::JSON_CROSS_AXIS_STATE] = 0; jsonComponent[JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG] = false; jsonComponent[JsonTagConstants::JSON_LINEAR_GRADIENT_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_FOREGROUND_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_TEXT_SET_TAG] = false; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_NODE_SET_TAG] = false; } } // namespace SecurityComponent } // namespace Security diff --git a/frameworks/security_component/src/sec_comp_base.cpp b/frameworks/security_component/src/sec_comp_base.cpp index acd00ea39437dad7a90604a60e58f6bef930c5e9..abb8142295884fd199c5c727b3956720a481807b 100644 --- a/frameworks/security_component/src/sec_comp_base.cpp +++ b/frameworks/security_component/src/sec_comp_base.cpp @@ -72,6 +72,9 @@ const std::string JsonTagConstants::JSON_DISPLAY_ID = "displayId"; const std::string JsonTagConstants::JSON_CROSS_AXIS_STATE = "crossAxisState"; const std::string JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG = "hasNonCompatileChange"; 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"; +const std::string JsonTagConstants::JSON_IS_OVERLAY_NODE_SET_TAG = "isOVerlayNodeCovered"; bool SecCompBase::ParseNonCompatibleChange(const nlohmann::json& json) { @@ -85,6 +88,18 @@ bool SecCompBase::ParseNonCompatibleChange(const nlohmann::json& json) if (!ParseDimension(json, JsonTagConstants::JSON_LINEAR_GRADIENT_BLUR_RADIUS_TAG, blurRadius_)) { return false; } + + if (!ParseDimension(json, JsonTagConstants::JSON_FOREGROUND_BLUR_RADIUS_TAG, foregroundBlurRadius_)) { + return false; + } + + if (!ParseBool(json, JsonTagConstants::JSON_IS_OVERLAY_TEXT_SET_TAG, isOverlayTextSet_)) { + return false; + } + + if (!ParseBool(json, JsonTagConstants::JSON_IS_OVERLAY_NODE_SET_TAG, isOverlayNodeCovered_)) { + return false; + } return true; } @@ -482,6 +497,9 @@ void SecCompBase::ToJson(nlohmann::json& jsonRes) const jsonRes[JsonTagConstants::JSON_CROSS_AXIS_STATE] = crossAxisState_; jsonRes[JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG] = hasNonCompatileChange_; 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_; + jsonRes[JsonTagConstants::JSON_IS_OVERLAY_NODE_SET_TAG] = isOverlayNodeCovered_; } std::string SecCompBase::ToJsonStr() const 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 6ded581996ab539621a995285aaabe8de89cdfd2..e24db73d512c6de0b4f98042e158ddfad7733306 100644 --- a/interfaces/inner_api/security_component/include/sec_comp_base.h +++ b/interfaces/inner_api/security_component/include/sec_comp_base.h @@ -89,6 +89,9 @@ public: static const std::string JSON_CROSS_AXIS_STATE; static const std::string JSON_NON_COMPATIBLE_CHANGE_TAG; static const std::string JSON_LINEAR_GRADIENT_BLUR_RADIUS_TAG; + static const std::string JSON_FOREGROUND_BLUR_RADIUS_TAG; + static const std::string JSON_IS_OVERLAY_TEXT_SET_TAG; + static const std::string JSON_IS_OVERLAY_NODE_SET_TAG; }; class __attribute__((visibility("default"))) SecCompBase { @@ -144,6 +147,9 @@ public: bool hasNonCompatileChange_ = false; double blurRadius_ = 0.0; + double foregroundBlurRadius_ = 0.0; + bool isOverlayTextSet_ = false; + bool isOverlayNodeCovered_ = false; int32_t windowId_ = 0; uint64_t displayId_ = 0; int32_t nodeId_ = 0; diff --git a/services/security_component_service/sa/test/unittest/src/service_test_common.cpp b/services/security_component_service/sa/test/unittest/src/service_test_common.cpp index 6de9eca66de11008f72d9930331bd051339aa9d3..5dcc96b697c6b1ceb469a9af8d89ab984a2d7c02 100644 --- a/services/security_component_service/sa/test/unittest/src/service_test_common.cpp +++ b/services/security_component_service/sa/test/unittest/src/service_test_common.cpp @@ -85,6 +85,9 @@ void ServiceTestCommon::BuildLocationComponentJson(nlohmann::json& jsonComponent jsonComponent[JsonTagConstants::JSON_CROSS_AXIS_STATE] = 0; jsonComponent[JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG] = false; jsonComponent[JsonTagConstants::JSON_LINEAR_GRADIENT_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_FOREGROUND_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_TEXT_SET_TAG] = false; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_NODE_SET_TAG] = false; } void ServiceTestCommon::BuildSaveComponentJson(nlohmann::json& jsonComponent) @@ -154,6 +157,9 @@ void ServiceTestCommon::BuildSaveComponentJson(nlohmann::json& jsonComponent) jsonComponent[JsonTagConstants::JSON_CROSS_AXIS_STATE] = 0; jsonComponent[JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG] = false; jsonComponent[JsonTagConstants::JSON_LINEAR_GRADIENT_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_FOREGROUND_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_TEXT_SET_TAG] = false; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_NODE_SET_TAG] = false; } void ServiceTestCommon::BuildPasteComponentJson(nlohmann::json& jsonComponent) @@ -223,6 +229,9 @@ void ServiceTestCommon::BuildPasteComponentJson(nlohmann::json& jsonComponent) jsonComponent[JsonTagConstants::JSON_CROSS_AXIS_STATE] = 0; jsonComponent[JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG] = false; jsonComponent[JsonTagConstants::JSON_LINEAR_GRADIENT_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_FOREGROUND_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_TEXT_SET_TAG] = false; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_NODE_SET_TAG] = false; } } // namespace SecurityComponent } // namespace Security diff --git a/test/fuzztest/security_component/common/fuzz_common.cpp b/test/fuzztest/security_component/common/fuzz_common.cpp index d83d2b9e67664bb5168a4288850c9a14b583c884..34817ac99168dda780291a125a14f999ba208701 100644 --- a/test/fuzztest/security_component/common/fuzz_common.cpp +++ b/test/fuzztest/security_component/common/fuzz_common.cpp @@ -102,6 +102,9 @@ std::string CompoRandomGenerator::ConstructLocationJson() jsonComponent[JsonTagConstants::JSON_CROSS_AXIS_STATE] = 0; jsonComponent[JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG] = false; jsonComponent[JsonTagConstants::JSON_LINEAR_GRADIENT_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_FOREGROUND_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_TEXT_SET_TAG] = false; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_NODE_SET_TAG] = false; compoJson_ = jsonComponent; return compoJson_.dump(); } @@ -150,6 +153,9 @@ std::string CompoRandomGenerator::ConstructSaveJson() jsonComponent[JsonTagConstants::JSON_CROSS_AXIS_STATE] = 0; jsonComponent[JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG] = false; jsonComponent[JsonTagConstants::JSON_LINEAR_GRADIENT_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_FOREGROUND_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_TEXT_SET_TAG] = false; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_NODE_SET_TAG] = false; compoJson_ = jsonComponent; return compoJson_.dump(); } @@ -198,6 +204,9 @@ std::string CompoRandomGenerator::ConstructPasteJson() jsonComponent[JsonTagConstants::JSON_CROSS_AXIS_STATE] = 0; jsonComponent[JsonTagConstants::JSON_NON_COMPATIBLE_CHANGE_TAG] = false; jsonComponent[JsonTagConstants::JSON_LINEAR_GRADIENT_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_FOREGROUND_BLUR_RADIUS_TAG] = 0.0; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_TEXT_SET_TAG] = false; + jsonComponent[JsonTagConstants::JSON_IS_OVERLAY_NODE_SET_TAG] = false; compoJson_ = jsonComponent; return compoJson_.dump(); }