Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3e2032c authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Do not start change transition when the bounds size is not changed" into tm-qpr-dev

parents d888fe44 16974702
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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) {
+17 −0
Original line number Diff line number Diff line
@@ -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);