Merge "Change Size Compat mode resizability heuristic to look at top activity" into tm-qpr-dev am: b5bf8a73d2 am: 35db892ed5

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

Change-Id: I0bd7b7fc09c91ab8e171bef2240ec213ebfb6cfe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Vali Calinescu
2023-03-02 11:43:06 +00:00
committed by Automerger Merge Worker
2 changed files with 4 additions and 8 deletions

View File

@@ -8084,11 +8084,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
return false; return false;
} }
} }
// Activity should be resizable if the task is. return !isResizeable() && (info.isFixedOrientation() || hasFixedAspectRatio())
final boolean isResizeable = task != null
? task.isResizeable() || isResizeable()
: isResizeable();
return !isResizeable && (info.isFixedOrientation() || hasFixedAspectRatio())
// The configuration of non-standard type should be enforced by system. // The configuration of non-standard type should be enforced by system.
// {@link WindowConfiguration#ACTIVITY_TYPE_STANDARD} is set when this activity is // {@link WindowConfiguration#ACTIVITY_TYPE_STANDARD} is set when this activity is
// added to a task, but this function is called when resolving the launch params, at // added to a task, but this function is called when resolving the launch params, at

View File

@@ -974,7 +974,7 @@ public class SizeCompatTests extends WindowTestsBase {
.setResizeMode(ActivityInfo.RESIZE_MODE_UNRESIZEABLE) .setResizeMode(ActivityInfo.RESIZE_MODE_UNRESIZEABLE)
.setScreenOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) .setScreenOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
.build(); .build();
assertFalse(activity.shouldCreateCompatDisplayInsets()); assertTrue(activity.shouldCreateCompatDisplayInsets());
// The non-resizable activity should not be size compat because it is on a resizable task // The non-resizable activity should not be size compat because it is on a resizable task
// in multi-window mode. // in multi-window mode.
@@ -1007,7 +1007,7 @@ public class SizeCompatTests extends WindowTestsBase {
} }
@Test @Test
public void testShouldNotCreateCompatDisplayInsetsWhenRootActivityIsResizeable() { public void testShouldCreateCompatDisplayInsetsWhenUnresizeableAndSupportsSizeChangesFalse() {
setUpDisplaySizeWithApp(1000, 2500); setUpDisplaySizeWithApp(1000, 2500);
// Make the task root resizable. // Make the task root resizable.
@@ -1016,7 +1016,7 @@ public class SizeCompatTests extends WindowTestsBase {
// Create an activity on the same task. // Create an activity on the same task.
final ActivityRecord activity = buildActivityRecord(/* supportsSizeChanges= */false, final ActivityRecord activity = buildActivityRecord(/* supportsSizeChanges= */false,
RESIZE_MODE_UNRESIZEABLE, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); RESIZE_MODE_UNRESIZEABLE, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
assertFalse(activity.shouldCreateCompatDisplayInsets()); assertTrue(activity.shouldCreateCompatDisplayInsets());
} }
@Test @Test