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

Commit 7d5f510e authored by Chong Zhang's avatar Chong Zhang
Browse files

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

This case could happen in real world if a non-resizeable activity opens
another activity (eg. Messenger app opens an activity to write up the
message). Need to make sure the new activity is not resized.

Change-Id: I222985fa7ee2cbd94c843ac1190239cce31d3c0c
parent f3b34603
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;
        }