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

Commit 9a0a78af authored by Ming-Shin Lu's avatar Ming-Shin Lu
Browse files

Fix TaskView is invisible during quick switch

When doing quick switch to a delayed task, before this task callbacked
onTaskAppeard, it may have timing that the previous task will going to
stop, caused the task surface removed.

So in ActivityStaskSupervisor#processStoppingAndFinishingActivities,
we should consider recents animation to prevent the task going to stop
too early.

Fix: 158854884
Test: manual as issue steps:
    1. Launch delayed task A
    2. Launch Calculator
    3. Quick switch to A, start and hold new gesture before onTaskAppeared(A)
    4. After the 3 second delay (when A would have appeared),
    5. Expect Calculator surface should not be hidden.
Change-Id: Iaaf1f92fe1180d3245607c50c800253cb8ccc2ff
parent ae64ae50
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ import static com.android.server.wm.RootWindowContainer.MATCH_TASK_IN_STACKS_OR_
import static com.android.server.wm.RootWindowContainer.MATCH_TASK_IN_STACKS_OR_RECENT_TASKS_AND_RESTORE;
import static com.android.server.wm.RootWindowContainer.TAG_STATES;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_RECENTS;
import static com.android.server.wm.Task.FLAG_FORCE_HIDDEN_FOR_PINNED_TASK;
import static com.android.server.wm.Task.LOCK_TASK_AUTH_LAUNCHABLE;
import static com.android.server.wm.Task.LOCK_TASK_AUTH_LAUNCHABLE_PRIV;
@@ -1809,7 +1810,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
        for (int i = mStoppingActivities.size() - 1; i >= 0; --i) {
            final ActivityRecord s = mStoppingActivities.get(i);
            final boolean animating = s.isAnimating(TRANSITION | PARENTS,
                    ANIMATION_TYPE_APP_TRANSITION);
                    ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_RECENTS);
            if (DEBUG_STATES) Slog.v(TAG, "Stopping " + s + ": nowVisible=" + s.nowVisible
                    + " animating=" + animating + " finishing=" + s.finishing);
            if (!animating || mService.mShuttingDown) {