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

Commit 057b8a99 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[RESTRICT AUTOMERGE] Do not resume activity if behind a translucent task" into rvc-dev

parents c6e84150 43b8bcc0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ class EnsureActivitiesVisibleHelper {
        // activities are actually behind other fullscreen activities, but still required
        // to be visible (such as performing Recents animation).
        final boolean resumeTopActivity = mTop != null && !mTop.mLaunchTaskBehind
                && mContiner.isTopActivityFocusable()
                && mContiner.canBeResumed(starting)
                && (starting == null || !starting.isDescendantOf(mContiner));

        final PooledConsumer f = PooledLambda.obtainConsumer(
+2 −1
Original line number Diff line number Diff line
@@ -1963,7 +1963,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
        }

        try {
            if (mStackSupervisor.realStartActivityLocked(r, app, top == r /*andResume*/,
            if (mStackSupervisor.realStartActivityLocked(r, app,
                    top == r && r.getTask().canBeResumed(r) /*andResume*/,
                    true /*checkConfig*/)) {
                mTmpBoolean = true;
            }
+11 −0
Original line number Diff line number Diff line
@@ -3638,6 +3638,17 @@ class Task extends WindowContainer<WindowContainer> {
        return getVisibility(starting) != STACK_VISIBILITY_INVISIBLE;
    }

    /**
     * Returns {@code true} is the activity in this Task can be resumed.
     *
     * @param starting The currently starting activity or {@code null} if there is none.
     */
    boolean canBeResumed(@Nullable ActivityRecord starting) {
        // No need to resume activity in Task that is not visible.
        return isTopActivityFocusable()
                && getVisibility(starting) == STACK_VISIBILITY_VISIBLE;
    }

    /**
     * Returns true if the task should be visible.
     *