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

Commit 7510672d authored by mincheli's avatar mincheli
Browse files

Applied TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY in WindowState

Add WindowType, TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY, supported in WindowState.
1. b/147799487
   TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY can be shown for all users
   after switching to another user.
2. b/150568357
   TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY should be excluded from
   magnified window as well as TYPE_MAGNIFICATION_OVERLAY

Bug: 147799487
Bug: 150568357
Test: atest WmTests:WindowStateTests
Change-Id: I0668c14714d783e3a0653cc42239685cecd33422
parent b8afcf63
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST;
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
import static android.view.WindowManager.LayoutParams.TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY;
@@ -3195,6 +3196,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP

            // These are the windows that by default are shown to all users. However, to
            // protect against spoofing, check permissions below.
            case TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY:
            case TYPE_APPLICATION_STARTING:
            case TYPE_BOOT_PROGRESS:
            case TYPE_DISPLAY_OVERLAY:
@@ -5135,13 +5137,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP

    @Override
    boolean shouldMagnify() {
        if (mAttrs.type == TYPE_INPUT_METHOD ||
                mAttrs.type == TYPE_INPUT_METHOD_DIALOG ||
                mAttrs.type == TYPE_MAGNIFICATION_OVERLAY ||
                mAttrs.type == TYPE_NAVIGATION_BAR ||
        if (mAttrs.type == TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY
                || mAttrs.type == TYPE_INPUT_METHOD
                || mAttrs.type == TYPE_INPUT_METHOD_DIALOG
                || mAttrs.type == TYPE_MAGNIFICATION_OVERLAY
                || mAttrs.type == TYPE_NAVIGATION_BAR
                // It's tempting to wonder: Have we forgotten the rounded corners overlay?
                // worry not: it's a fake TYPE_NAVIGATION_BAR_PANEL
                mAttrs.type == TYPE_NAVIGATION_BAR_PANEL) {
                || mAttrs.type == TYPE_NAVIGATION_BAR_PANEL) {
            return false;
        }
        return true;