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

Commit 4a3564ff authored by Prabir Pradhan's avatar Prabir Pradhan Committed by Automerger Merge Worker
Browse files

Merge "AcessibilityController: Use InputConfig to determine window behavior"...

Merge "AcessibilityController: Use InputConfig to determine window behavior" into tm-dev am: 7af8e713

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17056723



Change-Id: I11e8b27d4ebe64a68eb9e9c66d80d9a6e15b5c8a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 86969eb2 7af8e713
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1598,7 +1598,7 @@ final class AccessibilityController {
            // Do not account space of trusted non-touchable windows, except the split-screen
            // divider.
            // If it's not trusted, touch events are not sent to the windows behind it.
            if (((a11yWindow.getFlags() & WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE) != 0)
            if (!a11yWindow.isTouchable()
                    && (a11yWindow.getType() != TYPE_DOCK_DIVIDER)
                    && a11yWindow.isTrustedOverlay()) {
                return false;
@@ -1623,8 +1623,7 @@ final class AccessibilityController {
            // Ignore non-touchable windows, except the split-screen divider, which is
            // occasionally non-touchable but still useful for identifying split-screen
            // mode and the PIP menu.
            if (((a11yWindow.getFlags()
                    & WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE) != 0)
            if (!a11yWindow.isTouchable()
                    && (a11yWindow.getType() != TYPE_DOCK_DIVIDER
                    && !a11yWindow.isPIPMenu())) {
                return false;
+16 −17
Original line number Diff line number Diff line
@@ -601,14 +601,15 @@ public final class AccessibilityWindowsPopulator extends WindowInfosListener {
        // Data
        private IWindow mWindow;
        private int mDisplayId;
        private int mFlags;
        @WindowManager.LayoutParams.WindowType
        private int mType;
        @InputWindowHandle.InputConfigFlags
        private int mInputConfig;
        private int mPrivateFlags;
        private boolean mIsPIPMenu;
        private boolean mIsFocused;
        private boolean mShouldMagnify;
        private boolean mIgnoreDuetoRecentsAnimation;
        private boolean mIsTrustedOverlay;
        private final Region mTouchableRegionInScreen = new Region();
        private final Region mTouchableRegionInWindow = new Region();
        private final Region mLetterBoxBounds = new Region();
@@ -631,7 +632,7 @@ public final class AccessibilityWindowsPopulator extends WindowInfosListener {

            instance.mWindow = inputWindowHandle.getWindow();
            instance.mDisplayId = inputWindowHandle.displayId;
            instance.mFlags = inputWindowHandle.layoutParamsFlags;
            instance.mInputConfig = inputWindowHandle.inputConfig;
            instance.mType = inputWindowHandle.layoutParamsType;
            instance.mIsPIPMenu = inputWindowHandle.getWindow().asBinder().equals(pipIBinder);

@@ -644,8 +645,6 @@ public final class AccessibilityWindowsPopulator extends WindowInfosListener {
            final RecentsAnimationController controller = service.getRecentsAnimationController();
            instance.mIgnoreDuetoRecentsAnimation = windowState != null && controller != null
                    && controller.shouldIgnoreForAccessibility(windowState);
            instance.mIsTrustedOverlay =
                    (inputWindowHandle.inputConfig & InputConfig.TRUSTED_OVERLAY) != 0;

            // TODO (b/199358388) : gets the letterbox bounds of the window from other way.
            if (windowState != null && windowState.areAppWindowBoundsLetterboxed()) {
@@ -682,13 +681,6 @@ public final class AccessibilityWindowsPopulator extends WindowInfosListener {
            outRegion.set(mTouchableRegionInWindow);
        }

        /**
         * @return the layout parameter flag {@link android.view.WindowManager.LayoutParams#flags}.
         */
        public int getFlags() {
            return mFlags;
        }

        /**
         * @return the layout parameter type {@link android.view.WindowManager.LayoutParams#type}.
         */
@@ -751,7 +743,14 @@ public final class AccessibilityWindowsPopulator extends WindowInfosListener {
         * @return true if this window is the trusted overlay.
         */
        public boolean isTrustedOverlay() {
            return mIsTrustedOverlay;
            return (mInputConfig & InputConfig.TRUSTED_OVERLAY) != 0;
        }

        /**
         * @return true if this window is touchable.
         */
        public boolean isTouchable() {
            return (mInputConfig & InputConfig.NOT_TOUCHABLE) == 0;
        }

        /**
@@ -824,8 +823,8 @@ public final class AccessibilityWindowsPopulator extends WindowInfosListener {
            windowInfo.displayId = window.mDisplayId;
            windowInfo.type = window.mType;
            windowInfo.token = window.mWindow.asBinder();
            windowInfo.hasFlagWatchOutsideTouch = (window.mFlags
                    & WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH) != 0;
            windowInfo.hasFlagWatchOutsideTouch = (window.mInputConfig
                    & InputConfig.WATCH_OUTSIDE_TOUCH) != 0;
            windowInfo.inPictureInPicture = false;

            // There only are two windowless windows now, one is split window, and the other
@@ -851,13 +850,13 @@ public final class AccessibilityWindowsPopulator extends WindowInfosListener {
        public String toString() {
            String builder = "A11yWindow=[" + mWindow.asBinder()
                    + ", displayId=" + mDisplayId
                    + ", flag=0x" + Integer.toHexString(mFlags)
                    + ", inputConfig=0x" + Integer.toHexString(mInputConfig)
                    + ", type=" + mType
                    + ", privateFlag=0x" + Integer.toHexString(mPrivateFlags)
                    + ", focused=" + mIsFocused
                    + ", shouldMagnify=" + mShouldMagnify
                    + ", ignoreDuetoRecentsAnimation=" + mIgnoreDuetoRecentsAnimation
                    + ", isTrustedOverlay=" + mIsTrustedOverlay
                    + ", isTrustedOverlay=" + isTrustedOverlay()
                    + ", regionInScreen=" + mTouchableRegionInScreen
                    + ", touchableRegion=" + mTouchableRegionInWindow
                    + ", letterBoxBounds=" + mLetterBoxBounds