Do not change launch mode to FF is FS explicitly requested

When a non-resizable activity is launched in a freeform display,
it is launched in freeform windowing mode when its orientation
is different than that of its parent. This always happens even
if the activity requested to be launched in fullscreen mode
explicitly.

This CL changes the launch parameters so that the windowing mode
is only changed to freeform if it was not explicitly requested
that it be fullscreen.

Bug: 200058556
Test: atest CompatChangeTests
Change-Id: I0ad673a6a93c8e1cb1787d12feb49124f7d9c171
This commit is contained in:
jorgegil@google.com
2021-09-24 15:56:49 -07:00
parent 55290e4d16
commit fe7c92ec40

View File

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