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

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

Don't increment seq-id for non-sync frame change

There's 2 reasons why the frame might change:
1. WM is changing it, in which case it will be in a sync
   when sync is required.
2. Client requests relayout for position+size change, in
   which case, it will trigger a BLAST sync.

In both cases, the presence of sync will already increment
the seqId, so incrementing on frame-size alone is redundant
and actually triggers false-positives.

This also means we need to tell the client not to draw
when a sync started in response to a relayout. Once the
sync actually starts, WM will send the latest layout
info via reportResized.

Bug: 435801229
Bug: 385976595
Test: Existing Tests
Flag: com.android.window.flags.always_seq_id_layout
Change-Id: Ied495ce48eb983873b6d126aafa2c9bb937f2b61
parent eacb68c5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2635,6 +2635,7 @@ public class WindowManagerService extends IWindowManager.Stub
            }

            final int oldVisibility = win.mViewVisibility;
            final int oldBufferSeqId = win.mBufferSeqId;

            // If the window is becoming visible, visibleOrAdding may change which may in turn
            // change the IME layering target.
@@ -2863,6 +2864,11 @@ public class WindowManagerService extends IWindowManager.Stub
                            : -1;
                    win.markRedrawForSyncReported();
                } else {
                    if (win.mBufferSeqId > oldBufferSeqId) {
                        // A sync was started so this current layout is invalid until subsequent
                        // reportResized.
                        result |= RELAYOUT_RES_CANCEL_AND_REDRAW;
                    }
                    outRelayoutResult.syncSeqId = -1;
                }
            }
+0 −1
Original line number Diff line number Diff line
@@ -3759,7 +3759,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                }
                mSyncSeqId = mBufferSeqId;
            } else if (!mLastConfigReportedToClient
                    || mWindowFrames.isFrameSizeChanged()
                    || mWindowFrames.isForceReportingResized()
                    || mSyncState == SYNC_STATE_WAITING_FOR_DRAW) {
                ++mSyncSeqId;