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

Commit 81724211 authored by Chris Li's avatar Chris Li Committed by Automerger Merge Worker
Browse files

Merge "Use getOrCreateRootHomeTask in ActivityStartController" into rvc-dev am: eafbb325

Change-Id: I595a3ba852d027cc8c88de4b02a624acd5fd8032
parents 9ef2ba7e eafbb325
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.server.wm;
import static android.app.ActivityManager.START_SUCCESS;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.os.FactoryTest.FACTORY_TEST_LOW_LEVEL;

@@ -193,9 +192,7 @@ public class ActivityStartController {
        final ActivityStack homeStack;
        try {
            // Make sure home stack exists on display area.
            // TODO(b/153624902): Replace with TaskDisplayArea#getOrCreateRootHomeTask()
            homeStack = taskDisplayArea.getOrCreateStack(WINDOWING_MODE_UNDEFINED,
                    ACTIVITY_TYPE_HOME, ON_TOP);
            homeStack = taskDisplayArea.getOrCreateRootHomeTask(ON_TOP);
        } finally {
            mSupervisor.endDeferResume();
        }
+4 −2
Original line number Diff line number Diff line
@@ -4700,9 +4700,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
    boolean supportsSystemDecorations() {
        return (mWmService.mDisplayWindowSettings.shouldShowSystemDecorsLocked(this)
                || (mDisplay.getFlags() & FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS) != 0
                || (mWmService.mForceDesktopModeOnExternalDisplays && !isUntrustedVirtualDisplay()))
                || mWmService.mForceDesktopModeOnExternalDisplays)
                // VR virtual display will be used to run and render 2D app within a VR experience.
                && mDisplayId != mWmService.mVr2dDisplayId;
                && mDisplayId != mWmService.mVr2dDisplayId
                // Do not show system decorations on untrusted virtual display.
                && !isUntrustedVirtualDisplay();
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -1369,7 +1369,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
        calculateDefaultMinimalSizeOfResizeableTasks();

        final TaskDisplayArea defaultTaskDisplayArea = getDefaultTaskDisplayArea();
        defaultTaskDisplayArea.getOrCreateRootHomeTask();
        defaultTaskDisplayArea.getOrCreateRootHomeTask(ON_TOP);
        positionChildAt(POSITION_TOP, defaultTaskDisplayArea.mDisplayContent,
                false /* includingParents */);
    }
+9 −2
Original line number Diff line number Diff line
@@ -1461,16 +1461,23 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> {
        return mChildren.get(index);
    }

    @Nullable
    ActivityStack getOrCreateRootHomeTask() {
        return getOrCreateRootHomeTask(false /* onTop */);
    }

    /**
     * Returns the existing home stack or creates and returns a new one if it should exist for the
     * display.
     * @param onTop Only be used when there is no existing home stack. If true the home stack will
     *              be created at the top of the display, else at the bottom.
     */
    @Nullable
    ActivityStack getOrCreateRootHomeTask() {
    ActivityStack getOrCreateRootHomeTask(boolean onTop) {
        ActivityStack homeTask = getRootHomeTask();
        if (homeTask == null && mDisplayContent.supportsSystemDecorations()
                && !mDisplayContent.isUntrustedVirtualDisplay()) {
            homeTask = createStack(WINDOWING_MODE_UNDEFINED, ACTIVITY_TYPE_HOME, false /* onTop */);
            homeTask = createStack(WINDOWING_MODE_UNDEFINED, ACTIVITY_TYPE_HOME, onTop);
        }
        return homeTask;
    }