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

Commit 517129cf authored by tiger_huang's avatar tiger_huang
Browse files

Prevent infinite layout and wallpaper flashing

The original logic would cause mTopFullscreenOpaqueWindowState to be
hidden in PhoneWindowManager.finishPostLayoutPolicyLw(), and to be
shown in WindowAnimator.updateWindowsLocked() continuously if there
is a show-when-locked dialog.

The wallpaper would be hidden after the original wallpaper target is
hidden, before the new wallpaper target is shown.

https://code.google.com/p/android/issues/detail?id=162495

Change-Id: I918e0fa03eec38d9f0c07150c17013c6c21683cb
parent 631565ab
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4120,8 +4120,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    /** {@inheritDoc} */
    @Override
    public int finishPostLayoutPolicyLw() {
        if (mWinShowWhenLocked != null &&
                mWinShowWhenLocked != mTopFullscreenOpaqueWindowState) {
        if (mWinShowWhenLocked != null && mTopFullscreenOpaqueWindowState != null &&
                mWinShowWhenLocked.getAppToken() != mTopFullscreenOpaqueWindowState.getAppToken()
                && isKeyguardLocked()) {
            // A dialog is dismissing the keyguard. Put the wallpaper behind it and hide the
            // fullscreen window.
            // TODO: Make sure FLAG_SHOW_WALLPAPER is restored when dialog is dismissed. Or not.