Merge "Add null check on ActivityOptions before using it" into sc-v2-dev am: ecdb3cdbd2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15997427

Change-Id: I7da5b0e756ab2ea5b54e73d65b91ab9102d0f09b
This commit is contained in:
Jorge Gil
2021-10-07 21:20:37 +00:00
committed by Automerger Merge Worker

View File

@@ -261,8 +261,7 @@ class TaskLaunchParamsModifier implements LaunchParamsModifier {
if (launchMode == WINDOWING_MODE_PINNED) { if (launchMode == WINDOWING_MODE_PINNED) {
if (DEBUG) appendLog("picture-in-picture"); if (DEBUG) appendLog("picture-in-picture");
} else if (!root.isResizeable()) { } else if (!root.isResizeable()) {
if (shouldLaunchUnresizableAppInFreeform(root, suggestedDisplayArea, if (shouldLaunchUnresizableAppInFreeform(root, suggestedDisplayArea, options)) {
options.getLaunchWindowingMode())) {
launchMode = WINDOWING_MODE_FREEFORM; launchMode = WINDOWING_MODE_FREEFORM;
if (outParams.mBounds.isEmpty()) { if (outParams.mBounds.isEmpty()) {
getTaskBounds(root, suggestedDisplayArea, layout, launchMode, getTaskBounds(root, suggestedDisplayArea, layout, launchMode,
@@ -618,8 +617,8 @@ class TaskLaunchParamsModifier implements LaunchParamsModifier {
} }
private boolean shouldLaunchUnresizableAppInFreeform(ActivityRecord activity, private boolean shouldLaunchUnresizableAppInFreeform(ActivityRecord activity,
TaskDisplayArea displayArea, int launchWindowingMode) { TaskDisplayArea displayArea, @Nullable ActivityOptions options) {
if (launchWindowingMode == WINDOWING_MODE_FULLSCREEN) { if (options != null && options.getLaunchWindowingMode() == WINDOWING_MODE_FULLSCREEN) {
// Do not launch the activity in freeform if it explicitly requested fullscreen mode. // Do not launch the activity in freeform if it explicitly requested fullscreen mode.
return false; return false;
} }