Loading services/core/java/com/android/server/wm/TaskLaunchParamsModifier.java +9 −3 Original line number Diff line number Diff line Loading @@ -219,12 +219,18 @@ class TaskLaunchParamsModifier implements LaunchParamsModifier { } } if (launchMode == WINDOWING_MODE_FREEFORM && !currentParams.mBounds.isEmpty()) { if (!currentParams.mBounds.isEmpty()) { // Carry over bounds from callers regardless of launch mode because bounds is still // used to restore last non-fullscreen bounds when launch mode is not freeform. // Therefore it's not a resolution step for non-freeform launch mode and only // consider it fully resolved only when launch mode is freeform. outParams.mBounds.set(currentParams.mBounds); if (launchMode == WINDOWING_MODE_FREEFORM) { fullyResolvedCurrentParam = true; if (DEBUG) appendLog("inherit-bounds=" + outParams.mBounds); } } } // STEP 2.3: Adjust launch parameters as needed for freeform display. We enforce the policy // that legacy (pre-D) apps and those apps that can't handle multiple screen density well Loading services/tests/wmtests/src/com/android/server/wm/TaskLaunchParamsModifierTests.java +15 −0 Original line number Diff line number Diff line Loading @@ -786,6 +786,21 @@ public class TaskLaunchParamsModifierTests extends ActivityTestsBase { assertEquals(new Rect(0, 0, 200, 100), mResult.mBounds); } @Test public void testReturnBoundsForFullscreenWindowingMode() { final TestActivityDisplay freeformDisplay = createNewActivityDisplay( WINDOWING_MODE_FREEFORM); mCurrent.mPreferredDisplayId = freeformDisplay.mDisplayId; mCurrent.mWindowingMode = WINDOWING_MODE_FULLSCREEN; mCurrent.mBounds.set(0, 0, 200, 100); assertEquals(RESULT_CONTINUE, mTarget.onCalculate(/* task */ null, /* layout */ null, mActivity, /* source */ null, /* options */ null, mCurrent, mResult)); assertEquals(new Rect(0, 0, 200, 100), mResult.mBounds); } @Test public void testUsesDisplayOrientationForNoSensorOrientation() { final TestActivityDisplay freeformDisplay = createNewActivityDisplay( Loading Loading
services/core/java/com/android/server/wm/TaskLaunchParamsModifier.java +9 −3 Original line number Diff line number Diff line Loading @@ -219,12 +219,18 @@ class TaskLaunchParamsModifier implements LaunchParamsModifier { } } if (launchMode == WINDOWING_MODE_FREEFORM && !currentParams.mBounds.isEmpty()) { if (!currentParams.mBounds.isEmpty()) { // Carry over bounds from callers regardless of launch mode because bounds is still // used to restore last non-fullscreen bounds when launch mode is not freeform. // Therefore it's not a resolution step for non-freeform launch mode and only // consider it fully resolved only when launch mode is freeform. outParams.mBounds.set(currentParams.mBounds); if (launchMode == WINDOWING_MODE_FREEFORM) { fullyResolvedCurrentParam = true; if (DEBUG) appendLog("inherit-bounds=" + outParams.mBounds); } } } // STEP 2.3: Adjust launch parameters as needed for freeform display. We enforce the policy // that legacy (pre-D) apps and those apps that can't handle multiple screen density well Loading
services/tests/wmtests/src/com/android/server/wm/TaskLaunchParamsModifierTests.java +15 −0 Original line number Diff line number Diff line Loading @@ -786,6 +786,21 @@ public class TaskLaunchParamsModifierTests extends ActivityTestsBase { assertEquals(new Rect(0, 0, 200, 100), mResult.mBounds); } @Test public void testReturnBoundsForFullscreenWindowingMode() { final TestActivityDisplay freeformDisplay = createNewActivityDisplay( WINDOWING_MODE_FREEFORM); mCurrent.mPreferredDisplayId = freeformDisplay.mDisplayId; mCurrent.mWindowingMode = WINDOWING_MODE_FULLSCREEN; mCurrent.mBounds.set(0, 0, 200, 100); assertEquals(RESULT_CONTINUE, mTarget.onCalculate(/* task */ null, /* layout */ null, mActivity, /* source */ null, /* options */ null, mCurrent, mResult)); assertEquals(new Rect(0, 0, 200, 100), mResult.mBounds); } @Test public void testUsesDisplayOrientationForNoSensorOrientation() { final TestActivityDisplay freeformDisplay = createNewActivityDisplay( Loading