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

Commit a790ce39 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Skip transition only when transferring starting from visible activity" into sc-v2-dev

parents 16805b4c 0e1d1e76
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3935,7 +3935,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        if (tStartingWindow != null && fromActivity.mStartingSurface != null) {
            // In this case, the starting icon has already been displayed, so start
            // letting windows get shown immediately without any more transitions.
            getDisplayContent().mSkipAppTransitionAnimation = true;
            if (fromActivity.mVisible) {
                mDisplayContent.mSkipAppTransitionAnimation = true;
            }

            ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Moving existing starting %s"
                    + " from %s to %s", tStartingWindow, fromActivity, this);
+6 −2
Original line number Diff line number Diff line
@@ -2510,8 +2510,10 @@ public class ActivityRecordTests extends WindowTestsBase {
    @Test
    public void testTransferStartingWindow() {
        registerTestStartingWindowOrganizer();
        final ActivityRecord activity1 = new ActivityBuilder(mAtm).setCreateTask(true).build();
        final ActivityRecord activity2 = new ActivityBuilder(mAtm).setCreateTask(true).build();
        final ActivityRecord activity1 = new ActivityBuilder(mAtm).setCreateTask(true)
                .setVisible(false).build();
        final ActivityRecord activity2 = new ActivityBuilder(mAtm).setCreateTask(true)
                .setVisible(false).build();
        activity1.addStartingWindow(mPackageName,
                android.R.style.Theme, null, "Test", 0, 0, 0, 0, null, true, true, false, true,
                false, false);
@@ -2520,6 +2522,7 @@ public class ActivityRecordTests extends WindowTestsBase {
                android.R.style.Theme, null, "Test", 0, 0, 0, 0, activity1,
                true, true, false, true, false, false);
        waitUntilHandlersIdle();
        assertFalse(mDisplayContent.mSkipAppTransitionAnimation);
        assertNoStartingWindow(activity1);
        assertHasStartingWindow(activity2);
    }
@@ -2627,6 +2630,7 @@ public class ActivityRecordTests extends WindowTestsBase {
                false /* newTask */, false /* isTaskSwitch */, null /* options */,
                null /* sourceRecord */);

        assertTrue(mDisplayContent.mSkipAppTransitionAnimation);
        assertNull(middle.mStartingWindow);
        assertHasStartingWindow(top);
        assertTrue(top.isVisible());