Merge "Disable freeze insets for non blast sync shell transition" into tm-qpr-dev
This commit is contained in:
@@ -357,7 +357,12 @@ class AsyncRotationController extends FadeAnimationController implements Consume
|
||||
* or seamless transformation in a rotated display.
|
||||
*/
|
||||
boolean shouldFreezeInsetsPosition(WindowState w) {
|
||||
return mTransitionOp != OP_LEGACY && w.mTransitionController.inTransition()
|
||||
if (TransitionController.SYNC_METHOD != BLASTSyncEngine.METHOD_BLAST) {
|
||||
// Expect a screenshot layer has covered the screen, so it is fine to let client side
|
||||
// insets animation runner update the position directly.
|
||||
return false;
|
||||
}
|
||||
return mTransitionOp != OP_LEGACY && !mIsStartTransactionCommitted
|
||||
&& isTargetToken(w.mToken);
|
||||
}
|
||||
|
||||
|
||||
@@ -729,7 +729,7 @@ public class TransitionTests extends WindowTestsBase {
|
||||
assertTrue(ime.mToken.inTransition());
|
||||
assertTrue(task.inTransition());
|
||||
assertTrue(asyncRotationController.isTargetToken(decorToken));
|
||||
assertTrue(asyncRotationController.shouldFreezeInsetsPosition(navBar));
|
||||
assertShouldFreezeInsetsPosition(asyncRotationController, statusBar, true);
|
||||
|
||||
screenDecor.setOrientationChanging(false);
|
||||
// Status bar finishes drawing before the start transaction. Its fade-in animation will be
|
||||
@@ -744,6 +744,7 @@ public class TransitionTests extends WindowTestsBase {
|
||||
// The transaction is committed, so fade-in animation for status bar is consumed.
|
||||
transactionCommittedListener.onTransactionCommitted();
|
||||
assertFalse(asyncRotationController.isTargetToken(statusBar.mToken));
|
||||
assertShouldFreezeInsetsPosition(asyncRotationController, navBar, false);
|
||||
|
||||
// Navigation bar finishes drawing after the start transaction, so its fade-in animation
|
||||
// can execute directly.
|
||||
@@ -779,7 +780,7 @@ public class TransitionTests extends WindowTestsBase {
|
||||
final AsyncRotationController asyncRotationController =
|
||||
mDisplayContent.getAsyncRotationController();
|
||||
assertNotNull(asyncRotationController);
|
||||
assertTrue(asyncRotationController.shouldFreezeInsetsPosition(statusBar));
|
||||
assertShouldFreezeInsetsPosition(asyncRotationController, statusBar, true);
|
||||
|
||||
statusBar.setOrientationChanging(true);
|
||||
player.startTransition();
|
||||
@@ -825,7 +826,7 @@ public class TransitionTests extends WindowTestsBase {
|
||||
final AsyncRotationController asyncRotationController =
|
||||
mDisplayContent.getAsyncRotationController();
|
||||
assertNotNull(asyncRotationController);
|
||||
assertTrue(asyncRotationController.shouldFreezeInsetsPosition(statusBar));
|
||||
assertShouldFreezeInsetsPosition(asyncRotationController, statusBar, true);
|
||||
assertTrue(app.getTask().inTransition());
|
||||
|
||||
player.start();
|
||||
@@ -860,6 +861,15 @@ public class TransitionTests extends WindowTestsBase {
|
||||
assertNull(mDisplayContent.getAsyncRotationController());
|
||||
}
|
||||
|
||||
private static void assertShouldFreezeInsetsPosition(AsyncRotationController controller,
|
||||
WindowState w, boolean freeze) {
|
||||
if (TransitionController.SYNC_METHOD != BLASTSyncEngine.METHOD_BLAST) {
|
||||
// Non blast sync should never freeze insets position.
|
||||
freeze = false;
|
||||
}
|
||||
assertEquals(freeze, controller.shouldFreezeInsetsPosition(w));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeferRotationForTransientLaunch() {
|
||||
final TestTransitionPlayer player = registerTestTransitionPlayer();
|
||||
|
||||
Reference in New Issue
Block a user