From a7dec6c9b049e0c7a74beb1538cef8fea2b3764e Mon Sep 17 00:00:00 2001 From: libing23 Date: Fri, 22 Dec 2023 11:34:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BE=E8=A1=8Cuiexternsion=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E5=AE=89=E5=85=A8=E6=8E=A7=E4=BB=B6=20Signed-off-by:?= =?UTF-8?q?=20libing23=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sa/sa_main/sec_comp_entity.cpp | 3 +-- .../sa/sa_main/window_info_helper.cpp | 5 +++++ .../sa/test/mock/include/window_manager.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/services/security_component_service/sa/sa_main/sec_comp_entity.cpp b/services/security_component_service/sa/sa_main/sec_comp_entity.cpp index 98dc023..6837692 100644 --- a/services/security_component_service/sa/sa_main/sec_comp_entity.cpp +++ b/services/security_component_service/sa/sa_main/sec_comp_entity.cpp @@ -58,7 +58,6 @@ int32_t SecCompEntity::CheckPointEvent(const SecCompClickEvent& clickInfo) const clickInfo.point.touchX, clickInfo.point.touchY); return SC_SERVICE_ERROR_CLICK_EVENT_INVALID; } - return SC_OK; } @@ -83,7 +82,7 @@ int32_t SecCompEntity::CheckClickInfo(const SecCompClickEvent& clickInfo) const { if (!WindowInfoHelper::CheckOtherWindowCoverComp(componentInfo_->windowId_, componentInfo_->rect_)) { - SC_LOG_ERROR(LABEL, "Component may be covered by other window"); + SC_LOG_ERROR(LABEL, "SecurityComponentCheckFail: Component may be covered by other window"); return SC_SERVICE_ERROR_CLICK_EVENT_INVALID; } diff --git a/services/security_component_service/sa/sa_main/window_info_helper.cpp b/services/security_component_service/sa/sa_main/window_info_helper.cpp index d1c3862..e437774 100644 --- a/services/security_component_service/sa/sa_main/window_info_helper.cpp +++ b/services/security_component_service/sa/sa_main/window_info_helper.cpp @@ -24,6 +24,7 @@ namespace SecurityComponent { namespace { constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "WindowInfoHelper"}; constexpr int32_t INVALID_WINDOW_LAYER = -1; +constexpr uint32_t UI_EXTENSION_MASK = 0x40000000; } float WindowInfoHelper::GetWindowScale(int32_t windowId) @@ -61,6 +62,10 @@ static bool IsRectInWindRect(Rosen::Rect& windRect, const SecCompRect& secRect) bool WindowInfoHelper::CheckOtherWindowCoverComp(int32_t compWinId, const SecCompRect& secRect) { + if ((static_cast(compWinId) & UI_EXTENSION_MASK) == UI_EXTENSION_MASK) { + SC_LOG_INFO(LABEL, "UI extension can not check"); + return true; + } std::vector> infos; if (Rosen::WindowManager::GetInstance().GetAccessibilityWindowInfo(infos) != Rosen::WMError::WM_OK) { SC_LOG_ERROR(LABEL, "Get AccessibilityWindowInfo failed"); diff --git a/services/security_component_service/sa/test/mock/include/window_manager.h b/services/security_component_service/sa/test/mock/include/window_manager.h index 92969a0..6d2f578 100644 --- a/services/security_component_service/sa/test/mock/include/window_manager.h +++ b/services/security_component_service/sa/test/mock/include/window_manager.h @@ -90,6 +90,6 @@ public: private: ~WindowManager() {}; }; -} // namespace Security +} // namespace Rosen } // namespace OHOS #endif // SECURITY_COMPONENT_MOCK_WINDOW_MANAGER_H