Loading services/core/java/com/android/server/wm/AsyncRotationController.java +11 −3 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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()) { Loading Loading @@ -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; } } } services/tests/wmtests/src/com/android/server/wm/TransitionTests.java +5 −0 Original line number Diff line number Diff line Loading @@ -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. Loading Loading
services/core/java/com/android/server/wm/AsyncRotationController.java +11 −3 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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()) { Loading Loading @@ -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; } } }
services/tests/wmtests/src/com/android/server/wm/TransitionTests.java +5 −0 Original line number Diff line number Diff line Loading @@ -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. Loading