Use resizeMode integer instead of resizeable boolean.
Changes activity manager and window manager to use resizeMode
as defined by ActivityInfo#resizeMode instead of a boolean.
Bug: 26774816
Change-Id: I8cef46d9fba6bfdd21df7da63ed5d5330ad03d4b
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 3e99558..dac0f7d0 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -1410,10 +1410,11 @@
}
if (mStackId == DOCKED_STACK_ID) {
- // Docked stack is always visible, except in the case where the top running activity in
- // the focus stack doesn't support any form of resizing.
+ // Docked stack is always visible, except in the case where the top running activity
+ // task in the focus stack doesn't support any form of resizing.
final ActivityRecord r = focusedStack.topRunningActivityLocked();
- return r == null || r.isResizeable() || r.cropAppWindows()
+ final TaskRecord task = r != null ? r.task : null;
+ return task == null || task.isResizeable() || task.inCropWindowsResizeMode()
? STACK_VISIBLE : STACK_INVISIBLE;
}
@@ -4751,7 +4752,7 @@
// add the task to stack first, mTaskPositioner might need the stack association
addTask(task, toTop, "createTaskRecord");
final boolean isLockscreenShown = mService.mLockScreenShown == LOCK_SCREEN_SHOWN;
- if (!layoutTaskInStack(task, info.layout) && mBounds != null && task.mResizeable
+ if (!layoutTaskInStack(task, info.layout) && mBounds != null && task.isResizeable()
&& !isLockscreenShown) {
task.updateOverrideConfiguration(mBounds);
}
@@ -4816,8 +4817,7 @@
r.task.taskId, mStackId, r.info.screenOrientation, r.fullscreen,
(r.info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0, r.userId, r.info.configChanges,
task.voiceSession != null, r.mLaunchTaskBehind, bounds, task.mOverrideConfig,
- r.cropAppWindows() | r.isResizeable(), r.isAlwaysFocusable());
- mWindowManager.setTaskResizeable(task.taskId, task.mResizeable);
+ task.mResizeMode, r.isAlwaysFocusable(), task.isHomeTask());
r.taskConfigOverride = task.mOverrideConfig;
}
@@ -4869,9 +4869,8 @@
private void setAppTask(ActivityRecord r, TaskRecord task) {
final Rect bounds = task.updateOverrideConfigurationFromLaunchBounds();
- mWindowManager.setAppTask(
- r.appToken, task.taskId, mStackId, bounds, task.mOverrideConfig);
- mWindowManager.setTaskResizeable(task.taskId, task.mResizeable);
+ mWindowManager.setAppTask(r.appToken, task.taskId, mStackId, bounds, task.mOverrideConfig,
+ task.mResizeMode, task.isHomeTask());
r.taskConfigOverride = task.mOverrideConfig;
}