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

Commit 43b2500a authored by Rachit Jain's avatar Rachit Jain
Browse files

Shell transitions not received when activity already open on another display

- Add condition to not abort the transition when the task has some change which is yet to be applied.
- Example - Display change in this case such as an activity that is already open on display 1 (distant display) and the activity is opened on display 2 (default display)

Flag: NONE (bugfix)
Bug: 349196013
Test: m
Test: Open Youtube when it is already open on the distant display and verify if the shell transitions are received or not.

Change-Id: Ib4949721eb77fb96eaa19e210f97b44163d4e4a5
parent 672d707f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1649,7 +1649,8 @@ class ActivityStarter {
                // activity, so this isn't just deliver-to-top
                && mMovedToTopActivity == null
                && !transitionController.hasOrderChanges()
                && !transitionController.isTransientHide(startedActivityRootTask)) {
                && !transitionController.isTransientHide(startedActivityRootTask)
                && !newTransition.hasChanged(mLastStartActivityRecord)) {
            // We just delivered to top, so there isn't an actual transition here.
            if (!forceTransientTransition) {
                newTransition.abort();
@@ -1792,6 +1793,7 @@ class ActivityStarter {
                    activity.destroyIfPossible("Removes redundant singleInstance");
                }
            }
            targetTaskTop.mTransitionController.collect(targetTaskTop);
            recordTransientLaunchIfNeeded(targetTaskTop);
            // Recycle the target task for this launch.
            startResult =
+6 −0
Original line number Diff line number Diff line
@@ -3230,6 +3230,12 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        Trace.asyncTraceForTrackEnd(Trace.TRACE_TAG_WINDOW_MANAGER, TAG, cookie);
    }

    boolean hasChanged(WindowContainer wc) {
        final ChangeInfo chg = mChanges.get(wc);
        if (chg == null) return false;
        return chg.hasChanged();
    }

    @VisibleForTesting
    static class ChangeInfo {
        private static final int FLAG_NONE = 0;