Return bounds when it's in fullscreen display.
These bounds won't be applied to the task when the windowing mode isn't freeform. Rather, they will be applied to the last non-fullscreen bounds which would be used to restore it back to the old bounds when display changes to freeform. Also fixed the unit test for this particular case. Bug: 135941344 Bug: 135780225 Test: Manual tests on devices where display windowing mode may change at runtime. Test: atest WmTests:TaskLaunchParamsModifierTests Change-Id: I137c9ab754fae6d50f61e55a19f931d03477d9b2
This commit is contained in:
@@ -278,7 +278,7 @@ class TaskLaunchParamsModifier implements LaunchParamsModifier {
|
||||
// an existing task.
|
||||
adjustBoundsToAvoidConflictInDisplay(display, outParams.mBounds);
|
||||
}
|
||||
} else {
|
||||
} else if (display.inFreeformWindowingMode()) {
|
||||
if (source != null && source.inFreeformWindowingMode()
|
||||
&& resolvedMode == WINDOWING_MODE_FREEFORM
|
||||
&& outParams.mBounds.isEmpty()
|
||||
|
||||
@@ -1196,7 +1196,7 @@ public class TaskLaunchParamsModifierTests extends ActivityTestsBase {
|
||||
mActivity, /* source */ null, /* options */ null, mCurrent, mResult));
|
||||
|
||||
// Returned bounds with in fullscreen mode will be set to last non-fullscreen bounds.
|
||||
assertEquals(new Rect(0, 0, 200, 100), mCurrent.mBounds);
|
||||
assertEquals(new Rect(0, 0, 200, 100), mResult.mBounds);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user