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

Commit 27246de3 authored by Robin Lee's avatar Robin Lee Committed by Android (Google) Code Review
Browse files

Merge "Tweak how we skip transitions for first activity"

parents 42683601 2dde31ef
Loading
Loading
Loading
Loading
+67 −61
Original line number Diff line number Diff line
@@ -5020,9 +5020,20 @@ class Task extends TaskFragment {
        ProtoLog.i(WM_DEBUG_ADD_REMOVE, "Adding activity %s to task %s "
                        + "callers: %s", r, task, new RuntimeException("here").fillInStackTrace());

        // The transition animation and starting window are not needed if {@code allowMoveToFront}
        // is false, because the activity won't be visible.
        if ((!isActivityTypeHomeOrRecents() || hasActivity()) && allowMoveToFront) {
        if (isActivityTypeHomeOrRecents() && getActivityBelow(r) == null) {
            // If this is the first activity, don't do any fancy animations,
            // because there is nothing for it to animate on top of.
            ActivityOptions.abort(options);
            return;
        }

        if (!allowMoveToFront) {
            // The transition animation and starting window are not needed if
            // {@code allowMoveToFront} is false, because the activity won't be visible.
            ActivityOptions.abort(options);
            return;
        }

        final DisplayContent dc = mDisplayContent;
        if (DEBUG_TRANSITION) Slog.v(TAG_TRANSITION,
                "Prepare open transition: starting " + r);
@@ -5080,11 +5091,6 @@ class Task extends TaskFragment {
            mWmService.mStartingSurfaceController.showStartingWindow(r, prev, newTask,
                    isTaskSwitch, sourceRecord);
        }
        } else {
            // If this is the first activity, don't do any fancy animations,
            // because there is nothing for it to animate on top of.
            ActivityOptions.abort(options);
        }
    }

    /** On Task switch, finds the top activity that supports PiP. */