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

Commit 1606e828 authored by Chris Li's avatar Chris Li Committed by Automerger Merge Worker
Browse files

Merge "Do not start change transition when the bounds size is not changed"...

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19633801



Change-Id: Ia7d26cae229cbbc19e43de8f7fdd0d7cb05bbc4c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 79508ab4 c3e2032c
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);