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

Commit 8202b2a5 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Use separate flag to suppress resizes

When moving a task between stacks, we temporarily suppress resize
changes because while moving, the task is still in another stack
which might get resized by the docked stack because when fetching
the stack, we might create it and thus resize the other stack.

Introduce mTemporarilyUnresizable which makes it really not resizable,
regardless of whether we are force resizing our activities.

Change-Id: Ib51163a0606106fd55f5bdeecf8e53f08add4b4b
parent 067e8175
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2208,9 +2208,9 @@ public final class ActivityStackSupervisor implements DisplayListener {
        // Temporarily disable resizeablility of task we are moving. We don't want it to be resized
        // if a docked stack is created below which will lead to the stack we are moving from and
        // its resizeable tasks being resized.
        task.mResizeMode = RESIZE_MODE_UNRESIZEABLE;
        task.mTemporarilyUnresizable = true;
        final ActivityStack stack = getStack(stackId, CREATE_IF_NEEDED, toTop);
        task.mResizeMode = resizeMode;
        task.mTemporarilyUnresizable = false;
        mWindowManager.moveTaskToStack(task.taskId, stack.mStackId, toTop);
        stack.addTask(task, toTop, reason);

+3 −1
Original line number Diff line number Diff line
@@ -162,6 +162,8 @@ final class TaskRecord {

    int mResizeMode;        // The resize mode of this task and its activities.
                            // Based on the {@link ActivityInfo#resizeMode} of the root activity.
    boolean mTemporarilyUnresizable; // Separate flag from mResizeMode used to suppress resize
                                     // changes on a temporary basis.
    int mLockTaskMode;      // Which tasklock mode to launch this task in. One of
                            // ActivityManager.LOCK_TASK_LAUNCH_MODE_*
    private boolean mPrivileged;    // The root activity application of this task holds
@@ -939,7 +941,7 @@ final class TaskRecord {

    boolean isResizeable() {
        return !isHomeTask() && (mService.mForceResizableActivities
                || ActivityInfo.isResizeableMode(mResizeMode));
                || ActivityInfo.isResizeableMode(mResizeMode)) && !mTemporarilyUnresizable;
    }

    boolean inCropWindowsResizeMode() {