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
This commit is contained in:
Chong Zhang
2016-01-13 10:29:24 -08:00
parent f3b34603de
commit 7d5f510e6c

View File

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