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

Commit fdfd74fd authored by Ivan Tkachenko's avatar Ivan Tkachenko Committed by Android (Google) Code Review
Browse files

Merge "Fix Desktop Windowing focus if clicked in Taskbar" into main

parents 617fd0ac f18f5bf7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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) {
+21 −0
Original line number Diff line number Diff line
@@ -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.
+6 −0
Original line number Diff line number Diff line
@@ -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.
+3 −0
Original line number Diff line number Diff line
@@ -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);