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

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

Merge "Pause transient launch after switching to a translucent task" into main

parents 38112a26 ad6fbf6b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1290,6 +1290,10 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
            // Prevent spurious background app switches.
            if (ar.mDisplayContent.mFocusedApp == ar) {
                mController.mAtm.stopAppSwitches();
            } else if (ar.isState(RESUMED) && task.getVisibility(null /* starting */)
                    == TaskFragment.TASK_FRAGMENT_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT) {
                ar.getTaskFragment().startPausing(false /* uiSleeping */, null /* resuming */,
                        "finishTransition-behind-translucent");
            }
            found = true;
        }
+14 −0
Original line number Diff line number Diff line
@@ -1661,6 +1661,20 @@ public class TransitionTests extends WindowTestsBase {
        // Transition#finishTransition -> updateImeForVisibleTransientLaunch.
        verify(mDisplayContent).computeImeLayeringTarget(true /* update */);
        assertFalse(translucentApp.isVisible());

        // Simulate switching/returning to the translucent activity while the recent is running.
        recent.setState(ActivityRecord.State.RESUMED, "test");
        final Transition transition2 = createTestTransition(TRANSIT_OPEN, player.mController);
        player.mController.moveToCollecting(transition2);
        player.mController.requestStartTransition(transition2, taskRecent,
                null /* remoteTransition */, null /* displayChange */);
        transition2.setTransientLaunch(recent, taskRecent);
        translucentApp.getTask().moveToFront("move-translucent-to-front");
        mDisplayContent.setFocusedApp(translucentApp);
        player.start();
        player.finish();
        // The translucent activity is moved to top, so the recent should be scheduled to pause.
        assertEquals(recent.getState(), ActivityRecord.State.PAUSING);
    }

    @Test