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

Commit 371fe190 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Introduce a transition flag for background launched activity" into main

parents 2cfac953 1df27e32
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -630,6 +630,12 @@ public interface WindowManager extends ViewManager {
     */
    int TRANSIT_FLAG_AOD_APPEARING = (1 << 15); // 0x8000

    /**
     * Transition flag: Indicates that the task shouldn't move to front when launching the activity.
     * @hide
     */
    int TRANSIT_FLAG_AVOID_MOVE_TO_FRONT = (1 << 16); // 0x10000

    /**
     * @hide
     */
@@ -650,6 +656,7 @@ public interface WindowManager extends ViewManager {
            TRANSIT_FLAG_KEYGUARD_UNOCCLUDING,
            TRANSIT_FLAG_PHYSICAL_DISPLAY_SWITCH,
            TRANSIT_FLAG_AOD_APPEARING,
            TRANSIT_FLAG_AVOID_MOVE_TO_FRONT,
    })
    @Retention(RetentionPolicy.SOURCE)
    @interface TransitionFlags {}
+4 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ import static android.os.Process.INVALID_UID;
import static android.security.Flags.preventIntentRedirectAbortOrThrowException;
import static android.security.Flags.preventIntentRedirectShowToast;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManager.TRANSIT_FLAG_AVOID_MOVE_TO_FRONT;
import static android.view.WindowManager.TRANSIT_NONE;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
@@ -1841,6 +1842,9 @@ class ActivityStarter {
            // no-user-leaving implies not entering PiP.
            transition.setCanPipOnFinish(false /* canPipOnFinish */);
        }
        if (avoidMoveToFront() && transition != null) {
            transition.addFlag(TRANSIT_FLAG_AVOID_MOVE_TO_FRONT);
        }
        if (isIndependentLaunch && transition != null) {
            transitionController.requestStartTransition(transition,
                    mTargetTask == null ? started.getTask() : mTargetTask,