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

Commit 71888e9f authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "Launch non-resizeable task with fullscreen bounds in docked stack."

parents 3cfc3731 7d5f510e
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.am;

import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.HOME_STACK_ID;
@@ -1386,17 +1387,20 @@ final class TaskRecord {

    /** Returns the bounds that should be used to launch this task. */
    Rect getLaunchBounds() {
        final int stackId = stack.mStackId;

        // If we're over lockscreen, forget about stack bounds and use fullscreen.
        if (mService.mLockScreenShown == LOCK_SCREEN_SHOWN) {
            return null;
        }

        if (stack == null
                || stackId == HOME_STACK_ID
                || stackId == FULLSCREEN_WORKSPACE_STACK_ID) {
            return (mResizeable && stack != null) ? stack.mBounds : null;
        if (stack == null) {
            return null;
        }

        final int stackId = stack.mStackId;
        if (stackId == HOME_STACK_ID
                || stackId == FULLSCREEN_WORKSPACE_STACK_ID
                || (stackId == DOCKED_STACK_ID && !mResizeable)) {
            return mResizeable ? stack.mBounds : null;
        } else if (!StackId.persistTaskBounds(stackId)) {
            return stack.mBounds;
        }