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

Commit 61c0c686 authored by Jeff Chang's avatar Jeff Chang
Browse files

Clean up the legacy recent root task

910089a8, add the recents root task for legacy split screen.
System switched to use the stage split from android S and there is no
use case to reparent recent task to split-root. So that we should
clean up the legacy code.

Bug: 159029784
Test: atest WmTests:RootTaskTests
      - Using the 3p launcher.
      - Enter the split-screen and lunch the recents app
Change-Id: If67b90e5edaecfa2daa14cea9f610377b376799b
parent 7aff969d
Loading
Loading
Loading
Loading
+0 −23
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.server.wm;

import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
@@ -116,9 +115,6 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
    private Task mRootPinnedTask;
    private Task mRootSplitScreenPrimaryTask;

    // TODO(b/159029784): Remove when getStack() behavior is cleaned-up
    private Task mRootRecentsTask;

    private final ArrayList<WindowContainer> mTmpAlwaysOnTopChildren = new ArrayList<>();
    private final ArrayList<WindowContainer> mTmpNormalChildren = new ArrayList<>();
    private final ArrayList<WindowContainer> mTmpHomeChildren = new ArrayList<>();
@@ -227,8 +223,6 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
    Task getRootTask(int windowingMode, int activityType) {
        if (activityType == ACTIVITY_TYPE_HOME) {
            return mRootHomeTask;
        } else if (activityType == ACTIVITY_TYPE_RECENTS) {
            return mRootRecentsTask;
        }
        if (windowingMode == WINDOWING_MODE_PINNED) {
            return mRootPinnedTask;
@@ -256,11 +250,6 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
        return mRootHomeTask;
    }

    @Nullable
    Task getRootRecentsTask() {
        return mRootRecentsTask;
    }

    Task getRootPinnedTask() {
        return mRootPinnedTask;
    }
@@ -310,16 +299,6 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
            } else {
                mRootHomeTask = rootTask;
            }
        } else if (rootTask.isActivityTypeRecents()) {
            if (mRootRecentsTask != null) {
                if (!rootTask.isDescendantOf(mRootRecentsTask)) {
                    throw new IllegalArgumentException("addRootTaskReferenceIfNeeded: root recents"
                            + " task=" + mRootRecentsTask + " already exist on display=" + this
                            + " rootTask=" + rootTask);
                }
            } else {
                mRootRecentsTask = rootTask;
            }
        }

        if (!rootTask.isRootTask()) {
@@ -347,8 +326,6 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
    void removeRootTaskReferenceIfNeeded(Task rootTask) {
        if (rootTask == mRootHomeTask) {
            mRootHomeTask = null;
        } else if (rootTask == mRootRecentsTask) {
            mRootRecentsTask = null;
        } else if (rootTask == mRootPinnedTask) {
            mRootPinnedTask = null;
        } else if (rootTask == mRootSplitScreenPrimaryTask) {