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

Commit c63ea765 authored by wilsonshih's avatar wilsonshih
Browse files

Check task switch by comparing leaf task.

In multi-window mode, the previous top root task can be the parent of
the task of launched activity, so the task switch should comparing by
leaf task level.

Bug: 231363211
Test: atest ActivityStarterTests
Test: enter split screen, start another activity from an existing task,
verify there won't create starting window on that task.

Change-Id: Iaf59e405671a1b8a6674bab4f49ee36b6eb24da3
parent ac94a2da
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1786,7 +1786,8 @@ class ActivityStarter {
        }

        // Get top task at beginning because the order may be changed when reusing existing task.
        final Task prevTopTask = mPreferredTaskDisplayArea.getFocusedRootTask();
        final Task prevTopRootTask = mPreferredTaskDisplayArea.getFocusedRootTask();
        final Task prevTopTask = prevTopRootTask != null ? prevTopRootTask.getTopLeafTask() : null;
        final Task reusedTask = getReusableTask();

        // If requested, freeze the task list