Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9be5b33a authored by mincheli's avatar mincheli Committed by Minche Li
Browse files

Makes TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY as trusted overlay

A MotionEvent dispatched within the area of trusted overlay
would not referred as an obscured event even a trusted overlay
overlaps other windows.
If a MotionEvent is referred as obscured when clicking accessibility
settings dialog, it would stop users from switching on an accessibility
settings and show a warning toast.
This change could make magnification window as trusted overlay that
users able to switch on an accessibility setting by touching inside
the area of the magnification window.

Bug: 144075853
Test: Verified an a11y settings is abled to be switched on when
the MotionEevent is dispatched within the magnification overlay.

Change-Id: I83a6ce1f6e66c55c45746e5a16d0d988d1c1ae0b
parent 35c955ff
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -107,6 +107,7 @@ struct InputWindowInfo {
        TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW+27,
        TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW+27,
        TYPE_ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW+32,
        TYPE_ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW+32,
        TYPE_DOCK_DIVIDER = FIRST_SYSTEM_WINDOW+34,
        TYPE_DOCK_DIVIDER = FIRST_SYSTEM_WINDOW+34,
        TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW+39,
        LAST_SYSTEM_WINDOW      = 2999,
        LAST_SYSTEM_WINDOW      = 2999,
    };
    };


+2 −1
Original line number Original line Diff line number Diff line
@@ -43,7 +43,8 @@ bool InputWindowInfo::frameContainsPoint(int32_t x, int32_t y) const {
}
}


bool InputWindowInfo::isTrustedOverlay() const {
bool InputWindowInfo::isTrustedOverlay() const {
    return layoutParamsType == TYPE_INPUT_METHOD
    return layoutParamsType == TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY
            || layoutParamsType == TYPE_INPUT_METHOD
            || layoutParamsType == TYPE_INPUT_METHOD_DIALOG
            || layoutParamsType == TYPE_INPUT_METHOD_DIALOG
            || layoutParamsType == TYPE_MAGNIFICATION_OVERLAY
            || layoutParamsType == TYPE_MAGNIFICATION_OVERLAY
            || layoutParamsType == TYPE_STATUS_BAR
            || layoutParamsType == TYPE_STATUS_BAR