Loading services/core/java/com/android/server/wm/ActivityStarter.java +1 −0 Original line number Diff line number Diff line Loading @@ -1582,6 +1582,7 @@ class ActivityStarter { // An activity has changed order/visibility or the task is occluded by a transient // activity, so this isn't just deliver-to-top && mMovedToTopActivity == null && !transitionController.hasOrderChanges() && !transitionController.isTransientHide(startedActivityRootTask)) { // We just delivered to top, so there isn't an actual transition here. if (!forceTransientTransition) { Loading services/core/java/com/android/server/wm/Transition.java +21 −0 Original line number Diff line number Diff line Loading @@ -1755,6 +1755,27 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { } } /** * Checks if the transition contains order changes. * * This is a shallow check that doesn't account for collection in parallel, unlike * {@code collectOrderChanges} */ boolean hasOrderChanges() { ArrayList<Task> onTopTasks = new ArrayList<>(); // Iterate over target displays to get up to date on top tasks. // Cannot use `mOnTopTasksAtReady` as it's not populated before the `applyReady` is called. for (DisplayContent dc : mTargetDisplays) { addOnTopTasks(dc, onTopTasks); } for (Task task : onTopTasks) { if (!mOnTopTasksStart.contains(task)) { return true; } } return false; } /** * Collect tasks which moved-to-top as part of this transition. This also updates the * controller's latest-reported when relevant. Loading services/core/java/com/android/server/wm/TransitionController.java +6 −0 Original line number Diff line number Diff line Loading @@ -792,6 +792,12 @@ class TransitionController { mCollectingTransition.recordTaskOrder(wc); } /** @see Transition#hasOrderChanges */ boolean hasOrderChanges() { if (mCollectingTransition == null) return false; return mCollectingTransition.hasOrderChanges(); } /** * Collects the window containers which need to be synced with the changing display area into * the current collecting transition. Loading services/tests/wmtests/src/com/android/server/wm/TransitionTests.java +3 −0 Original line number Diff line number Diff line Loading @@ -2015,6 +2015,9 @@ public class TransitionTests extends WindowTestsBase { transition.collect(leafTaskA); rootTaskA.moveToFront("test", leafTaskA); // Test has order changes, a shallow check of order changes assertTrue(transition.hasOrderChanges()); // All the tasks were already visible, so there shouldn't be any changes ArrayList<Transition.ChangeInfo> targets = Transition.calculateTargets( participants, changes); Loading Loading
services/core/java/com/android/server/wm/ActivityStarter.java +1 −0 Original line number Diff line number Diff line Loading @@ -1582,6 +1582,7 @@ class ActivityStarter { // An activity has changed order/visibility or the task is occluded by a transient // activity, so this isn't just deliver-to-top && mMovedToTopActivity == null && !transitionController.hasOrderChanges() && !transitionController.isTransientHide(startedActivityRootTask)) { // We just delivered to top, so there isn't an actual transition here. if (!forceTransientTransition) { Loading
services/core/java/com/android/server/wm/Transition.java +21 −0 Original line number Diff line number Diff line Loading @@ -1755,6 +1755,27 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { } } /** * Checks if the transition contains order changes. * * This is a shallow check that doesn't account for collection in parallel, unlike * {@code collectOrderChanges} */ boolean hasOrderChanges() { ArrayList<Task> onTopTasks = new ArrayList<>(); // Iterate over target displays to get up to date on top tasks. // Cannot use `mOnTopTasksAtReady` as it's not populated before the `applyReady` is called. for (DisplayContent dc : mTargetDisplays) { addOnTopTasks(dc, onTopTasks); } for (Task task : onTopTasks) { if (!mOnTopTasksStart.contains(task)) { return true; } } return false; } /** * Collect tasks which moved-to-top as part of this transition. This also updates the * controller's latest-reported when relevant. Loading
services/core/java/com/android/server/wm/TransitionController.java +6 −0 Original line number Diff line number Diff line Loading @@ -792,6 +792,12 @@ class TransitionController { mCollectingTransition.recordTaskOrder(wc); } /** @see Transition#hasOrderChanges */ boolean hasOrderChanges() { if (mCollectingTransition == null) return false; return mCollectingTransition.hasOrderChanges(); } /** * Collects the window containers which need to be synced with the changing display area into * the current collecting transition. Loading
services/tests/wmtests/src/com/android/server/wm/TransitionTests.java +3 −0 Original line number Diff line number Diff line Loading @@ -2015,6 +2015,9 @@ public class TransitionTests extends WindowTestsBase { transition.collect(leafTaskA); rootTaskA.moveToFront("test", leafTaskA); // Test has order changes, a shallow check of order changes assertTrue(transition.hasOrderChanges()); // All the tasks were already visible, so there shouldn't be any changes ArrayList<Transition.ChangeInfo> targets = Transition.calculateTargets( participants, changes); Loading