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

Commit ccc9e9b9 authored by Craig Mautner's avatar Craig Mautner
Browse files

Further refine test for window gone.

Do not treat a window that is animating as being onscreen until it
has been drawn. The indication that a window was "gone" was occurring
too soon resulting in windows appearing before the status bar came
back and having to be drawn twice, with and without the status bar.
By waiting for the window to be drawn the status bar appears and the
window does not have to get redrawn.

Bug 7696315 fixed.

Change-Id: Ic93bf6eed03cf12a92a656791725a6d26e0ad0e9
parent 83323f42
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7688,7 +7688,7 @@ public class WindowManagerService extends IWindowManager.Stub
            // soon won't be visible, to avoid wasting time and funky
            // changes while a window is animating away.
            final boolean gone = (behindDream && mPolicy.canBeForceHidden(win, win.mAttrs))
                    || (win.isGoneForLayoutLw() && !win.isOnScreen());
                    || (win.isGoneForLayoutLw() && !(win.isOnScreen() && win.isDrawFinishedLw()));

            if (DEBUG_LAYOUT && !win.mLayoutAttached) {
                Slog.v(TAG, "1ST PASS " + win
+12 −1
Original line number Diff line number Diff line
@@ -807,6 +807,17 @@ final class WindowState implements WindowManagerPolicy.WindowState {
                || mExiting || mDestroying;
    }

    /**
     * Returns true if the window has a surface that it has drawn a
     * complete UI in to.
     */
    public boolean isDrawFinishedLw() {
        return mHasSurface && !mDestroying &&
                (mWinAnimator.mDrawState == WindowStateAnimator.COMMIT_DRAW_PENDING
                || mWinAnimator.mDrawState == WindowStateAnimator.READY_TO_SHOW
                || mWinAnimator.mDrawState == WindowStateAnimator.HAS_DRAWN);
    }

    /**
     * Returns true if the window has a surface that it has drawn a
     * complete UI in to.