Skip to content

Commit 56d8cc1

Browse files
author
Jean-Baptiste Queru
committed
Merge into jb-mr1-dev
Change-Id: I6504b000be7e3b6e770af99c5a922fd1e9ec73de
2 parents ecfc9ca + 187f3f9 commit 56d8cc1

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

services/java/com/android/server/accessibility/ScreenMagnifier.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,22 @@ public DisplayContentObserver(Context context, Viewport viewport,
869869
mDisplayContentChangeListener = new IDisplayContentChangeListener.Stub() {
870870
@Override
871871
public void onWindowTransition(int displayId, int transition, WindowInfo info) {
872-
mHandler.obtainMessage(MESSAGE_ON_WINDOW_TRANSITION, transition, 0,
873-
WindowInfo.obtain(info)).sendToTarget();
872+
Message message = mHandler.obtainMessage(MESSAGE_ON_WINDOW_TRANSITION,
873+
transition, 0, WindowInfo.obtain(info));
874+
// TODO: This makes me quite unhappy but for the time being the
875+
// least risky fix for cases where the keyguard is removed but
876+
// the windows it force hides are not made visible yet. Hence,
877+
// we would compute the magnified frame before we have a stable
878+
// state. One more reason to move the magnified frame computation
879+
// in the window manager!
880+
if (info.type == WindowManager.LayoutParams.TYPE_KEYGUARD
881+
|| info.type == WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG
882+
&& (transition == WindowManagerPolicy.TRANSIT_EXIT
883+
|| transition == WindowManagerPolicy.TRANSIT_HIDE)) {
884+
mHandler.sendMessageDelayed(message, mLongAnimationDuration);
885+
} else {
886+
message.sendToTarget();
887+
}
874888
}
875889

876890
@Override

0 commit comments

Comments
 (0)