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

Commit e20d2b0e authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Skip unnecessary redraw request for sync

It is the similar with [1], but the condition was changed for
non-sync blast that mPrepareSyncSeqId will always be 0.

So add a case that assumes client will receive RELAYOUT_RES_FIRST_TIME,
then it already will report draw.

[1]: I6faad4b9adac7334df7caf3d23df59bd3e96bfd9

Bug: 258880446
Bug: 231435331
Test: Enable shell transition.
      While cold/warm/hot launch app or swipe to recents,
      there should only be one finishDrawing per window.
Change-Id: I955bd7509863c2cbb0e0706cc1dfba9ce99ce10e
parent 814729fe
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -6136,9 +6136,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        if (mRedrawForSyncReported) {
            return false;
        }
        if (mInRelayout && mPrepareSyncSeqId > 0) {
            // The last sync seq id will return to the client, so there is no need to request the
            // client to redraw.
        if (mInRelayout && (mPrepareSyncSeqId > 0 || (mViewVisibility == View.VISIBLE
                && mWinAnimator.mDrawState == DRAW_PENDING))) {
            // The client will report draw if it gets the sync seq id from relayout or it is
            // drawing for being visible, then no need to request redraw.
            return false;
        }
        return useBLASTSync();