Loading services/core/java/com/android/server/wm/Transition.java +4 −0 Original line number Diff line number Diff line Loading @@ -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; } Loading services/tests/wmtests/src/com/android/server/wm/TransitionTests.java +14 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
services/core/java/com/android/server/wm/Transition.java +4 −0 Original line number Diff line number Diff line Loading @@ -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; } Loading
services/tests/wmtests/src/com/android/server/wm/TransitionTests.java +14 −0 Original line number Diff line number Diff line Loading @@ -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 Loading