Loading services/core/java/com/android/server/wm/TaskFragment.java +4 −1 Original line number Diff line number Diff line Loading @@ -2340,7 +2340,10 @@ class TaskFragment extends WindowContainer<WindowContainer> { return false; } return !startBounds.equals(getBounds()); // Only take snapshot if the bounds are resized. final Rect endBounds = getConfiguration().windowConfiguration.getBounds(); return endBounds.width() != startBounds.width() || endBounds.height() != startBounds.height(); } boolean canHaveEmbeddingActivityTransition(@NonNull ActivityRecord child) { Loading services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java +17 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,23 @@ public class TaskFragmentTest extends WindowTestsBase { verify(mTransaction).setWindowCrop(mLeash, 500, 500); } @Test public void testStartChangeTransition_doNotFreezeWhenOnlyMoved() { final Rect startBounds = new Rect(0, 0, 1000, 1000); final Rect endBounds = new Rect(startBounds); endBounds.offset(500, 0); mTaskFragment.setBounds(startBounds); doReturn(true).when(mTaskFragment).isVisible(); doReturn(true).when(mTaskFragment).isVisibleRequested(); clearInvocations(mTransaction); mTaskFragment.setBounds(endBounds); // No change transition, but update the organized surface position. verify(mTaskFragment, never()).initializeChangeTransition(any(), any()); verify(mTransaction).setPosition(mLeash, endBounds.left, endBounds.top); } @Test public void testNotOkToAnimate_doNotStartChangeTransition() { mockSurfaceFreezerSnapshot(mTaskFragment.mSurfaceFreezer); Loading Loading
services/core/java/com/android/server/wm/TaskFragment.java +4 −1 Original line number Diff line number Diff line Loading @@ -2340,7 +2340,10 @@ class TaskFragment extends WindowContainer<WindowContainer> { return false; } return !startBounds.equals(getBounds()); // Only take snapshot if the bounds are resized. final Rect endBounds = getConfiguration().windowConfiguration.getBounds(); return endBounds.width() != startBounds.width() || endBounds.height() != startBounds.height(); } boolean canHaveEmbeddingActivityTransition(@NonNull ActivityRecord child) { Loading
services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java +17 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,23 @@ public class TaskFragmentTest extends WindowTestsBase { verify(mTransaction).setWindowCrop(mLeash, 500, 500); } @Test public void testStartChangeTransition_doNotFreezeWhenOnlyMoved() { final Rect startBounds = new Rect(0, 0, 1000, 1000); final Rect endBounds = new Rect(startBounds); endBounds.offset(500, 0); mTaskFragment.setBounds(startBounds); doReturn(true).when(mTaskFragment).isVisible(); doReturn(true).when(mTaskFragment).isVisibleRequested(); clearInvocations(mTransaction); mTaskFragment.setBounds(endBounds); // No change transition, but update the organized surface position. verify(mTaskFragment, never()).initializeChangeTransition(any(), any()); verify(mTransaction).setPosition(mLeash, endBounds.left, endBounds.top); } @Test public void testNotOkToAnimate_doNotStartChangeTransition() { mockSurfaceFreezerSnapshot(mTaskFragment.mSurfaceFreezer); Loading