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

Commit 32a48b01 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix magnification bounds cut out with floating a11y button" into sc-dev

parents 9efd8c3d 987144aa
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_IS_ROUNDED_CO
import static android.view.WindowManager.LayoutParams.TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
import static android.view.WindowManager.LayoutParams.TYPE_MAGNIFICATION_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;

import static com.android.server.accessibility.AccessibilityTraceFileProto.ENTRY;
import static com.android.server.accessibility.AccessibilityTraceFileProto.MAGIC_NUMBER;
@@ -938,8 +939,7 @@ final class AccessibilityController {
                for (int i = visibleWindowCount - 1; i >= 0; i--) {
                    WindowState windowState = visibleWindows.valueAt(i);
                    final int windowType = windowState.mAttrs.type;
                    if ((windowType == TYPE_MAGNIFICATION_OVERLAY
                            || windowType == TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY)
                    if (isExcludedWindowType(windowType)
                            || ((windowState.mAttrs.privateFlags
                            & PRIVATE_FLAG_IS_ROUNDED_CORNERS_OVERLAY) != 0)) {
                        continue;
@@ -1040,6 +1040,17 @@ final class AccessibilityController {
                }
            }

            private boolean isExcludedWindowType(int windowType) {
                return windowType == TYPE_MAGNIFICATION_OVERLAY
                        // Omit the touch region to avoid the cut out of the magnification
                        // bounds because nav bar panel is unmagnifiable.
                        || windowType == TYPE_NAVIGATION_BAR_PANEL
                        // Omit the touch region of window magnification to avoid the cut out of the
                        // magnification and the magnified center of window magnification could be
                        // in the bounds
                        || windowType == TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY;
            }

            void onRotationChanged(SurfaceControl.Transaction t) {
                // If we are showing the magnification border, hide it immediately so
                // the user does not see strange artifacts during rotation. The screenshot