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

Commit f77531a6 authored by wilsonshih's avatar wilsonshih
Browse files

Fix predictive back be canceled due to moveTaskToFront transition.

In multi-window mode, tap on a on-screen task could trigger a TO_FRONT
transition which intent to move it to front. It shouldn't cancel
predictive-back animation since the transition won't really have any
visibility state change.

Bug: 321923516
Test: enter split screen, open a sub-activity in task A, tap on
another task B, then trigger predictive back on task A, verify
the predictive back won't be canceled from TO_FRONT transition.

Change-Id: I3b0b5153cf6ceb07d9f3d8fa5fc289741c2a8e54
parent 9cbc80a3
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.view.RemoteAnimationTarget.MODE_CLOSING;
import static android.view.RemoteAnimationTarget.MODE_OPENING;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_OLD_NONE;
import static android.view.WindowManager.TRANSIT_TO_BACK;
@@ -777,6 +778,10 @@ class BackNavigationController {
                    && wc.asTaskFragment() == null) {
                continue;
            }
            // Only care if visibility changed.
            if (targets.get(i).getTransitMode(wc) == TRANSIT_CHANGE) {
                continue;
            }
            // WC can be visible due to setLaunchBehind
            if (wc.isVisibleRequested()) {
                mTmpOpenApps.add(wc);
@@ -1544,15 +1549,17 @@ class BackNavigationController {
                return this;
            }

            // WC must be Activity/TaskFragment/Task
            boolean containTarget(@NonNull WindowContainer wc) {
                if (mOpenTargets != null) {
                    for (int i = mOpenTargets.length - 1; i >= 0; --i) {
                        if (wc == mOpenTargets[i] || mOpenTargets[i].hasChild(wc)) {
                        if (wc == mOpenTargets[i] || mOpenTargets[i].hasChild(wc)
                                || wc.hasChild(mOpenTargets[i])) {
                            return true;
                        }
                    }
                }
                return wc == mCloseTarget || mCloseTarget.hasChild(wc);
                return wc == mCloseTarget || mCloseTarget.hasChild(wc) || wc.hasChild(mCloseTarget);
            }

            /**