summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Riddle Hsu <riddlehsu@google.com> 2022-09-27 20:33:09 +0800
committer Riddle Hsu <riddlehsu@google.com> 2022-10-04 06:44:29 +0000
commit724c1c3c0526c95738ced6ec8760c7842609abcb (patch)
treedf5a65a68d307aa59a98dfb000200ac7b4d67fbf
parent36f16a2fb8e4898019fd62d56f8c2d82c65f4bf1 (diff)
Skip deferring draw for non seamless rotation window
Otherwise even if keepAppearanceInPreviousRotation is not called, the draw transaction requested by InsetsSourceProvider#onPostLayout may still be deferred with start transaction of transition even if blast group sync is off. Bug: 247856453 Test: TransitionTests#testDisplayRotationChange Change-Id: I8360ab65d886e86351c3fa3ffcbff5ec88accedb Merged-In: I8360ab65d886e86351c3fa3ffcbff5ec88accedb
-rw-r--r--services/core/java/com/android/server/wm/AsyncRotationController.java14
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/TransitionTests.java5
2 files changed, 16 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/wm/AsyncRotationController.java b/services/core/java/com/android/server/wm/AsyncRotationController.java
index 8c5f05365837..7d9ae87517b0 100644
--- a/services/core/java/com/android/server/wm/AsyncRotationController.java
+++ b/services/core/java/com/android/server/wm/AsyncRotationController.java
@@ -202,8 +202,7 @@ 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) {
+ if (mTargetWindowTokens.valueAt(i).canDrawBeforeStartTransaction()) {
// Expect a screenshot layer will cover the non seamless windows.
continue;
}
@@ -489,7 +488,7 @@ class AsyncRotationController extends FadeAnimationController implements Consume
return false;
}
final Operation op = mTargetWindowTokens.get(w.mToken);
- if (op == null) return false;
+ if (op == null || op.canDrawBeforeStartTransaction()) return false;
if (DEBUG) Slog.d(TAG, "handleFinishDrawing " + w);
if (op.mDrawTransaction == null) {
if (w.isClientLocal()) {
@@ -554,5 +553,14 @@ class AsyncRotationController extends FadeAnimationController implements Consume
Operation(@Action int action) {
mAction = action;
}
+
+ /**
+ * Returns {@code true} if the corresponding window can draw its latest content before the
+ * start transaction of rotation transition is applied.
+ */
+ boolean canDrawBeforeStartTransaction() {
+ return TransitionController.SYNC_METHOD != BLASTSyncEngine.METHOD_BLAST
+ && mAction != ACTION_SEAMLESS;
+ }
}
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java b/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
index 45d8e226c64f..4435d62d7e60 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
@@ -732,6 +732,11 @@ public class TransitionTests extends WindowTestsBase {
assertTrue(asyncRotationController.isTargetToken(decorToken));
assertShouldFreezeInsetsPosition(asyncRotationController, statusBar, true);
+ if (TransitionController.SYNC_METHOD != BLASTSyncEngine.METHOD_BLAST) {
+ // Only seamless window syncs its draw transaction with transition.
+ assertFalse(asyncRotationController.handleFinishDrawing(statusBar, mMockT));
+ assertTrue(asyncRotationController.handleFinishDrawing(screenDecor, mMockT));
+ }
screenDecor.setOrientationChanging(false);
// Status bar finishes drawing before the start transaction. Its fade-in animation will be
// executed until the transaction is committed, so it is still in target tokens.