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

Commit c0c37b57 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: I295e6d23ae0c4287be98db6e04f8c2138fc4b67f
parents e46c0db9 eafbb325
Loading
Loading
Loading
Loading
+1 −4
Original line number Original line 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.ActivityManager.START_SUCCESS;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
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.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.os.FactoryTest.FACTORY_TEST_LOW_LEVEL;
import static android.os.FactoryTest.FACTORY_TEST_LOW_LEVEL;


@@ -193,9 +192,7 @@ public class ActivityStartController {
        final ActivityStack homeStack;
        final ActivityStack homeStack;
        try {
        try {
            // Make sure home stack exists on display area.
            // Make sure home stack exists on display area.
            // TODO(b/153624902): Replace with TaskDisplayArea#getOrCreateRootHomeTask()
            homeStack = taskDisplayArea.getOrCreateRootHomeTask(ON_TOP);
            homeStack = taskDisplayArea.getOrCreateStack(WINDOWING_MODE_UNDEFINED,
                    ACTIVITY_TYPE_HOME, ON_TOP);
        } finally {
        } finally {
            mSupervisor.endDeferResume();
            mSupervisor.endDeferResume();
        }
        }
+4 −2
Original line number Original line Diff line number Diff line
@@ -4700,9 +4700,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
    boolean supportsSystemDecorations() {
    boolean supportsSystemDecorations() {
        return (mWmService.mDisplayWindowSettings.shouldShowSystemDecorsLocked(this)
        return (mWmService.mDisplayWindowSettings.shouldShowSystemDecorsLocked(this)
                || (mDisplay.getFlags() & FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS) != 0
                || (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.
                // 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 Original line Diff line number Diff line
@@ -1369,7 +1369,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
        calculateDefaultMinimalSizeOfResizeableTasks();
        calculateDefaultMinimalSizeOfResizeableTasks();


        final TaskDisplayArea defaultTaskDisplayArea = getDefaultTaskDisplayArea();
        final TaskDisplayArea defaultTaskDisplayArea = getDefaultTaskDisplayArea();
        defaultTaskDisplayArea.getOrCreateRootHomeTask();
        defaultTaskDisplayArea.getOrCreateRootHomeTask(ON_TOP);
        positionChildAt(POSITION_TOP, defaultTaskDisplayArea.mDisplayContent,
        positionChildAt(POSITION_TOP, defaultTaskDisplayArea.mDisplayContent,
                false /* includingParents */);
                false /* includingParents */);
    }
    }
+9 −2
Original line number Original line Diff line number Diff line
@@ -1461,16 +1461,23 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> {
        return mChildren.get(index);
        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
     * Returns the existing home stack or creates and returns a new one if it should exist for the
     * display.
     * 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
    @Nullable
    ActivityStack getOrCreateRootHomeTask() {
    ActivityStack getOrCreateRootHomeTask(boolean onTop) {
        ActivityStack homeTask = getRootHomeTask();
        ActivityStack homeTask = getRootHomeTask();
        if (homeTask == null && mDisplayContent.supportsSystemDecorations()
        if (homeTask == null && mDisplayContent.supportsSystemDecorations()
                && !mDisplayContent.isUntrustedVirtualDisplay()) {
                && !mDisplayContent.isUntrustedVirtualDisplay()) {
            homeTask = createStack(WINDOWING_MODE_UNDEFINED, ACTIVITY_TYPE_HOME, false /* onTop */);
            homeTask = createStack(WINDOWING_MODE_UNDEFINED, ACTIVITY_TYPE_HOME, onTop);
        }
        }
        return homeTask;
        return homeTask;
    }
    }