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

Commit b180d770 authored by Svetoslav's avatar Svetoslav
Browse files

Windows for accessibility with wrong coords on rotation.

We were handling rotation changes for accessiblity in the window
manager too early, before the rotation animation completes. This
lead to wrong window positions being reported to the accessibility
layer. Now we handle rotation for accessibility when the rotation
changes, if we will not animate, or after the rotation animation
completes.

bug:17457240

Change-Id: Ia772f4886bfdbe0f9bc9003c12f36b2fbd6f45ec
parent 9127e458
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -568,6 +568,15 @@ public class WindowAnimator {
                        mBulkUpdateParams |= SET_UPDATE_ROTATION;
                        screenRotationAnimation.kill();
                        displayAnimator.mScreenRotationAnimation = null;

                        //TODO (multidisplay): Accessibility supported only for the default display.
                        if (mService.mAccessibilityController != null
                                && displayId == Display.DEFAULT_DISPLAY) {
                            // We just finished rotation animation which means we did not
                            // anounce the rotation and waited for it to end, announce now.
                            mService.mAccessibilityController.onRotationChangedLocked(
                                    mService.getDefaultDisplayContentLocked(), mService.mRotation);
                        }
                    }
                }

+5 −2
Original line number Diff line number Diff line
@@ -6411,9 +6411,12 @@ public class WindowManagerService extends IWindowManager.Stub
        }

        //TODO (multidisplay): Magnification is supported only for the default display.
        if (mAccessibilityController != null
        // Announce rotation only if we will not animate as we already have the
        // windows in final state. Otherwise, we make this call at the rotation end.
        if (screenRotationAnimation == null && mAccessibilityController != null
                && displayContent.getDisplayId() == Display.DEFAULT_DISPLAY) {
            mAccessibilityController.onRotationChangedLocked(getDefaultDisplayContentLocked(), rotation);
            mAccessibilityController.onRotationChangedLocked(getDefaultDisplayContentLocked(),
                    rotation);
        }

        return true;