mirror of
https://github.com/openharmony/security_security_component_manager.git
synced 2026-08-24 22:51:27 -04:00
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<uint32_t>(compWinId) & UI_EXTENSION_MASK) == UI_EXTENSION_MASK) {
|
||||
SC_LOG_INFO(LABEL, "UI extension can not check");
|
||||
return true;
|
||||
}
|
||||
std::vector<sptr<Rosen::AccessibilityWindowInfo>> infos;
|
||||
if (Rosen::WindowManager::GetInstance().GetAccessibilityWindowInfo(infos) != Rosen::WMError::WM_OK) {
|
||||
SC_LOG_ERROR(LABEL, "Get AccessibilityWindowInfo failed");
|
||||
|
||||
@@ -90,6 +90,6 @@ public:
|
||||
private:
|
||||
~WindowManager() {};
|
||||
};
|
||||
} // namespace Security
|
||||
} // namespace Rosen
|
||||
} // namespace OHOS
|
||||
#endif // SECURITY_COMPONENT_MOCK_WINDOW_MANAGER_H
|
||||
|
||||
Reference in New Issue
Block a user