Letterbox apps in multi-window if resizeable only due to supportsPictureInPicture.
Test: atest WmTests:ActivityRecordTests Fix: 204453314 Fix: 204784257 Change-Id: I664742b033ad49a77ae21b28c7ade4011d123c74
This commit is contained in:
@@ -2722,9 +2722,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean isResizeable() {
|
boolean isResizeable() {
|
||||||
|
return isResizeable(/* checkPictureInPictureSupport */ true);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isResizeable(boolean checkPictureInPictureSupport) {
|
||||||
return mAtmService.mForceResizableActivities
|
return mAtmService.mForceResizableActivities
|
||||||
|| ActivityInfo.isResizeableMode(info.resizeMode)
|
|| ActivityInfo.isResizeableMode(info.resizeMode)
|
||||||
|| info.supportsPictureInPicture()
|
|| (info.supportsPictureInPicture() && checkPictureInPictureSupport)
|
||||||
// If the activity can be embedded, it should inherit the bounds of task fragment.
|
// If the activity can be embedded, it should inherit the bounds of task fragment.
|
||||||
|| isEmbedded();
|
|| isEmbedded();
|
||||||
}
|
}
|
||||||
@@ -7679,10 +7683,16 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
// orientation with insets applied.
|
// orientation with insets applied.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Activity should be resizable if the task is.
|
// Not using Task#isResizeable() or ActivityRecord#isResizeable() directly because app
|
||||||
|
// compatibility testing showed that android:supportsPictureInPicture="true" alone is not
|
||||||
|
// sufficient signal for not letterboxing an app.
|
||||||
|
// TODO(214602463): Remove multi-window check since orientation and aspect ratio
|
||||||
|
// restrictions should always be applied in multi-window.
|
||||||
final boolean isResizeable = task != null
|
final boolean isResizeable = task != null
|
||||||
? task.isResizeable() || isResizeable()
|
// Activity should be resizable if the task is.
|
||||||
: isResizeable();
|
? task.isResizeable(/* checkPictureInPictureSupport */ false)
|
||||||
|
|| isResizeable(/* checkPictureInPictureSupport */ false)
|
||||||
|
: isResizeable(/* checkPictureInPictureSupport */ false);
|
||||||
if (WindowConfiguration.inMultiWindowMode(windowingMode) && isResizeable) {
|
if (WindowConfiguration.inMultiWindowMode(windowingMode) && isResizeable) {
|
||||||
// Ignore orientation request for resizable apps in multi window.
|
// Ignore orientation request for resizable apps in multi window.
|
||||||
return;
|
return;
|
||||||
@@ -8211,8 +8221,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
final float maxAspectRatio = info.getMaxAspectRatio();
|
final float maxAspectRatio = info.getMaxAspectRatio();
|
||||||
final Task rootTask = getRootTask();
|
final Task rootTask = getRootTask();
|
||||||
final float minAspectRatio = getMinAspectRatio();
|
final float minAspectRatio = getMinAspectRatio();
|
||||||
|
// Not using ActivityRecord#isResizeable() directly because app compatibility testing
|
||||||
|
// showed that android:supportsPictureInPicture="true" alone is not sufficient signal for
|
||||||
|
// not letterboxing an app.
|
||||||
|
// TODO(214602463): Remove multi-window check since orientation and aspect ratio
|
||||||
|
// restrictions should always be applied in multi-window.
|
||||||
if (task == null || rootTask == null
|
if (task == null || rootTask == null
|
||||||
|| (inMultiWindowMode() && !shouldCreateCompatDisplayInsets()
|
|| (inMultiWindowMode() && isResizeable(/* checkPictureInPictureSupport */ false)
|
||||||
&& !fixedOrientationLetterboxed)
|
&& !fixedOrientationLetterboxed)
|
||||||
|| (maxAspectRatio < 1 && minAspectRatio < 1 && desiredAspectRatio < 1)
|
|| (maxAspectRatio < 1 && minAspectRatio < 1 && desiredAspectRatio < 1)
|
||||||
|| isInVrUiMode(getConfiguration())) {
|
|| isInVrUiMode(getConfiguration())) {
|
||||||
|
|||||||
@@ -2728,10 +2728,14 @@ class Task extends TaskFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean isResizeable() {
|
boolean isResizeable() {
|
||||||
|
return isResizeable(/* checkPictureInPictureSupport */ true);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isResizeable(boolean checkPictureInPictureSupport) {
|
||||||
final boolean forceResizable = mAtmService.mForceResizableActivities
|
final boolean forceResizable = mAtmService.mForceResizableActivities
|
||||||
&& getActivityType() == ACTIVITY_TYPE_STANDARD;
|
&& getActivityType() == ACTIVITY_TYPE_STANDARD;
|
||||||
return forceResizable || ActivityInfo.isResizeableMode(mResizeMode)
|
return forceResizable || ActivityInfo.isResizeableMode(mResizeMode)
|
||||||
|| mSupportsPictureInPicture;
|
|| (mSupportsPictureInPicture && checkPictureInPictureSupport);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user