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

Commit a7ad1844 authored by Evan Rosky's avatar Evan Rosky
Browse files

Don't prematurely finish sync if an explicit sync is in flight

If there is an explicit BLAST sync, we must wait for it even if
the window has already supposedly drawn. Otherwise an explicit
sync will be finished before it has the correct buffer.

Bug: 329154913
Test: enter pip via swipe + pip2, observe no content flicker
Change-Id: Ifac82f6b9be9f1228ce44509ff6786fc7ba09202
parent 66bf088c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5700,7 +5700,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            // window becomes visible while the sync group is still active.
            return true;
        }
        if (mSyncState == SYNC_STATE_WAITING_FOR_DRAW && mLastConfigReportedToClient && isDrawn()) {
        if (mSyncState == SYNC_STATE_WAITING_FOR_DRAW && mLastConfigReportedToClient && isDrawn()
                && mPrepareSyncSeqId <= 0) {
            // Complete the sync state immediately for a drawn window that doesn't need to redraw.
            onSyncFinishedDrawing();
        }
+2 −1
Original line number Diff line number Diff line
@@ -1376,8 +1376,9 @@ public class WindowOrganizerTests extends WindowTestsBase {
        assertTrue(w1.syncNextBuffer());
        assertTrue(w2.syncNextBuffer());

        // A drawn window can complete the sync state automatically.
        // A drawn window in non-explicit sync can complete the sync state automatically.
        w1.mWinAnimator.mDrawState = WindowStateAnimator.HAS_DRAWN;
        w1.mPrepareSyncSeqId = 0;
        makeLastConfigReportedToClient(w1, true /* visible */);
        mWm.mSyncEngine.onSurfacePlacement();
        verify(mockCallback).onTransactionReady(anyInt(), any());