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

Commit 187f3f94 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Magnified frame not properly computed when keyguard goes away.

1. The keyguard force hides some windows when it is shown and as soon
   as the keyguard goes away there windows are made visible. However,
   the window transition that the keyguard is moving away is reported
   before the force hidden windows are shown which makes the screen
   magnifier compute the magnified region with an incomplete list of
   windows of interest.

bug:7215285

Change-Id: I3abc4d97b7a74de8183ad20477dadf66c82da037
parent bc391d58
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -869,8 +869,22 @@ public final class ScreenMagnifier implements EventStreamTransformation {
            mDisplayContentChangeListener = new IDisplayContentChangeListener.Stub() {
                @Override
                public void onWindowTransition(int displayId, int transition, WindowInfo info) {
                    mHandler.obtainMessage(MESSAGE_ON_WINDOW_TRANSITION, transition, 0,
                            WindowInfo.obtain(info)).sendToTarget();
                    Message message = mHandler.obtainMessage(MESSAGE_ON_WINDOW_TRANSITION,
                            transition, 0, WindowInfo.obtain(info));
                    // TODO: This makes me quite unhappy but for the time being the
                    //       least risky fix for cases where the keyguard is removed but
                    //       the windows it force hides are not made visible yet. Hence,
                    //       we would compute the magnified frame before we have a stable
                    //       state. One more reason to move the magnified frame computation
                    //       in the window manager!
                    if (info.type == WindowManager.LayoutParams.TYPE_KEYGUARD
                                || info.type == WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG
                            && (transition == WindowManagerPolicy.TRANSIT_EXIT
                                || transition == WindowManagerPolicy.TRANSIT_HIDE)) {
                        mHandler.sendMessageDelayed(message, mLongAnimationDuration);
                    } else {
                        message.sendToTarget();
                    }
                }

                @Override