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

Commit 7ef4f6ef authored by Tony Huang's avatar Tony Huang
Browse files

Clear recents tile if exception exit case

We will try to exit split on startAnimation if stages don't have
any child tasks. But split canot handle that transition because
it will be merged to previous one.
To successful clear recents tile in this case, we need to clear
it manually before we start new dismiss transition.

Fix: 289163903
Test: manual
Test: pass existing tests
Change-Id: I1036275b9059425542b0f1a7ecff4bfd5cb0adec
parent dc5de087
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2564,6 +2564,9 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                // so don't handle it.
                Log.e(TAG, "Somehow removed the last task in a stage outside of a proper "
                        + "transition.");
                // This new transition would be merged to current one so we need to clear
                // tile manually here.
                clearSplitPairedInRecents(EXIT_REASON_APP_FINISHED);
                final WindowContainerTransaction wct = new WindowContainerTransaction();
                final int dismissTop = (dismissStages.size() == 1
                        && getStageType(dismissStages.valueAt(0)) == STAGE_TYPE_MAIN)
@@ -2744,6 +2747,12 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                Log.w(TAG, splitFailureMessage("startPendingEnterAnimation",
                        "launched 2 tasks in split, but didn't receive "
                        + "2 tasks in transition. Possibly one of them failed to launch"));
                if (mRecentTasks.isPresent() && mainChild != null) {
                    mRecentTasks.get().removeSplitPair(mainChild.getTaskInfo().taskId);
                }
                if (mRecentTasks.isPresent() && sideChild != null) {
                    mRecentTasks.get().removeSplitPair(sideChild.getTaskInfo().taskId);
                }
                mSplitUnsupportedToast.show();
                return true;
            }