Merge "Change Size Compat mode resizability heuristic to look at top activity" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b5bf8a73d2
@@ -7973,11 +7973,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
|
||||||
|
|||||||
@@ -961,7 +961,7 @@ public class SizeCompatTests extends WindowTestsBase {
|
|||||||
.setResizeMode(ActivityInfo.RESIZE_MODE_UNRESIZEABLE)
|
.setResizeMode(ActivityInfo.RESIZE_MODE_UNRESIZEABLE)
|
||||||
.setScreenOrientation(SCREEN_ORIENTATION_PORTRAIT)
|
.setScreenOrientation(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.
|
||||||
@@ -994,7 +994,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.
|
||||||
@@ -1003,7 +1003,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
|
||||||
|
|||||||
Reference in New Issue
Block a user