Avoid extra force-relayout for sync

The related steps of launching app with shell transition:
1. Set sync state
2. Start/resume the app
3. Add app or starting window and calls relayoutWindow
4. relayoutWindow
     - performSurfacePlacement
       - updateResizingWindowIfNeeded
     - Return sync id because sync state was set
5. The client finishes drawing with sync draw transaction

If updateResizingWindowIfNeeded still includes the window to redraw,
there will be extra non-sync relayoutWindow/finishDrawing, because
the sync seq id doesn't increase. That is unnecessary cost.

Bug: 231435331
Test: Enable shell transition.
      While cold/warm/hot launch app or swipe to recents,
      the 2nd doFrame of app window should not call relayoutWindow.
Change-Id: I6faad4b9adac7334df7caf3d23df59bd3e96bfd9
This commit is contained in:
Riddle Hsu
2022-05-05 23:00:47 +08:00
parent 619760a5eb
commit 4b89e85c43

View File

@@ -6043,6 +6043,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
if (mRedrawForSyncReported) {
return false;
}
if (mInRelayout) {
// The last sync seq id will return to the client, so there is no need to request the
// client to redraw.
return false;
}
return useBLASTSync();
}