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

Commit 75f31740 authored by Justin Koh's avatar Justin Koh Committed by Android Git Automerger
Browse files

am 77cdac05: Merge "Wait for all windows to draw before turning screen on" into klp-modular-dev

* commit '77cdac05':
  Wait for all windows to draw before turning screen on
parents 95198b91 77cdac05
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -10943,16 +10943,21 @@ public class WindowManagerService extends IWindowManager.Stub
        public void waitForAllWindowsDrawn(IRemoteCallback callback, long timeout) {
            synchronized (mWindowMap) {
                mWaitingForDrawnCallback = callback;
                final WindowList windows = getDefaultWindowListLocked();
                for (int displayNdx = mDisplayContents.size() - 1; displayNdx >= 0; --displayNdx) {
                    final WindowList windows =
                            mDisplayContents.valueAt(displayNdx).getWindowList();
                    for (int winNdx = windows.size() - 1; winNdx >= 0; --winNdx) {
                        final WindowState win = windows.get(winNdx);
                        if (win.mHasSurface) {
                            win.mWinAnimator.mDrawState = WindowStateAnimator.DRAW_PENDING;
                            // Force add to mResizingWindows.
                            win.mLastContentInsets.set(-1, -1, -1, -1);
                            if (DEBUG_SCREEN_ON) Slog.d(TAG, "waitForAllWindowsDrawn: adding " +
                                    win);
                            mWaitingForDrawn.add(win);
                        }
                    }
                }
                requestTraversalLocked();
                mH.removeMessages(H.WAITING_FOR_DRAWN_TIMEOUT);
                mH.sendEmptyMessageDelayed(H.WAITING_FOR_DRAWN_TIMEOUT, timeout);