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
This commit is contained in:
Jorim Jaggi
2016-02-03 19:24:31 -08:00
parent 067e817585
commit 8202b2a5db
2 changed files with 5 additions and 3 deletions

View File

@@ -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);

View File

@@ -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() {