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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user