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

Commit 10054666 authored by chaviw's avatar chaviw
Browse files

Only allow one relayout with sync per sync request

If a new relayout occurs while in a sync, VRI will attempt another sync.
This is not intended so only allow one relayout request during a sync to
actually use blast sync

Test: Presubmit with shell transitions
Change-Id: Ic1211add59374ce82081bc88f6b2dfdd367438e3
Bug: 200285149
parent f0a71961
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2515,9 +2515,11 @@ public class WindowManagerService extends IWindowManager.Stub
            }
            win.mInRelayout = false;

            if (mUseBLASTSync && win.useBLASTSync() && viewVisibility != View.GONE) {
            if (mUseBLASTSync && win.useBLASTSync() && viewVisibility != View.GONE
                    && win.mNextRelayoutUseSync) {
                win.prepareDrawHandlers();
                win.markRedrawForSyncReported();
                win.mNextRelayoutUseSync = false;
                result |= RELAYOUT_RES_BLAST_SYNC;
            }

+3 −0
Original line number Diff line number Diff line
@@ -367,6 +367,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
    private boolean mDragResizingChangeReported = true;
    private int mResizeMode;
    private boolean mRedrawForSyncReported;
    boolean mNextRelayoutUseSync;

    /**
     * {@code true} when the client was still drawing for sync when the sync-set was finished or
@@ -5914,6 +5915,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        // to draw even if the children draw first or don't need to sync, so we start
        // in WAITING state rather than READY.
        mSyncState = SYNC_STATE_WAITING_FOR_DRAW;
        mNextRelayoutUseSync = true;
        requestRedrawForSync();
        return true;
    }
@@ -6095,6 +6097,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
     */
    void applyWithNextDraw(Consumer<SurfaceControl.Transaction> consumer) {
        mPendingDrawHandlers.add(consumer);
        mNextRelayoutUseSync = true;
        requestRedrawForSync();

        mWmService.mH.sendNewMessageDelayed(WINDOW_STATE_BLAST_SYNC_TIMEOUT, this,