Skip syncing draw for non seamless rotation window

To avoid multiple applyWithNextDraw consuming buffers, especially
for insets provider window.

Seamless rotation window may not be covered by the screenshot, such
as display cutout. Then it still needs to be synced as how legacy
transition did in WindowState#seamlesslyRotateIfAllowed.

Bug: 247856453
Test: Enable taskbar (adb shell wm size 2600x2200) and rotate screen
      multiple times. No flicker and no ANR.
Change-Id: I51f85b481d65fb4f954fb75c8de6a3b9fc561971
This commit is contained in:
Riddle Hsu
2022-09-21 18:36:44 +08:00
parent 4dc756781a
commit 78c601a499

View File

@@ -202,10 +202,16 @@ class AsyncRotationController extends FadeAnimationController implements Consume
// target windows. But the windows still need to use sync transaction to keep the appearance
// in previous rotation, so request a no-op sync to keep the state.
for (int i = mTargetWindowTokens.size() - 1; i >= 0; i--) {
if (TransitionController.SYNC_METHOD != BLASTSyncEngine.METHOD_BLAST
&& mTargetWindowTokens.valueAt(i).mAction != Operation.ACTION_SEAMLESS) {
// Expect a screenshot layer will cover the non seamless windows.
continue;
}
final WindowToken token = mTargetWindowTokens.keyAt(i);
for (int j = token.getChildCount() - 1; j >= 0; j--) {
// TODO(b/234585256): The consumer should be handleFinishDrawing().
token.getChildAt(j).applyWithNextDraw(t -> {});
if (DEBUG) Slog.d(TAG, "Sync draw for " + token.getChildAt(j));
}
}
mIsSyncDrawRequested = true;