Loading core/java/android/window/flags/large_screen_experiences_app_compat.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,16 @@ flag { is_fixed_read_only: true } flag { name: "immersive_app_repositioning" namespace: "large_screen_experiences_app_compat" description: "Fix immersive apps changing size when repositioning" bug: "334076352" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "camera_compat_for_freeform" namespace: "large_screen_experiences_app_compat" Loading services/core/java/com/android/server/wm/ActivityRecord.java +18 −4 Original line number Diff line number Diff line Loading @@ -8538,7 +8538,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // If activity in fullscreen mode is letterboxed because of fixed orientation then bounds // are already calculated in resolveFixedOrientationConfiguration. // Don't apply aspect ratio if app is overridden to fullscreen by device user/manufacturer. if (!isLetterboxedForFixedOrientationAndAspectRatio() if (Flags.immersiveAppRepositioning() && !isLetterboxedForFixedOrientationAndAspectRatio() && !mLetterboxUiController.hasFullscreenOverride()) { resolveAspectRatioRestriction(newParentConfiguration); } Loading @@ -8555,6 +8555,14 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A computeConfigByResolveHint(resolvedConfig, newParentConfiguration); } } // If activity in fullscreen mode is letterboxed because of fixed orientation then bounds // are already calculated in resolveFixedOrientationConfiguration, or if in size compat // mode, it should already be calculated in resolveSizeCompatModeConfiguration. // Don't apply aspect ratio if app is overridden to fullscreen by device user/manufacturer. if (!Flags.immersiveAppRepositioning() && !isLetterboxedForFixedOrientationAndAspectRatio() && !mInSizeCompatModeForBounds && !mLetterboxUiController.hasFullscreenOverride()) { resolveAspectRatioRestriction(newParentConfiguration); } if (isFixedOrientationLetterboxAllowed || compatDisplayInsets != null // In fullscreen, can be letterboxed for aspect ratio. Loading Loading @@ -8880,7 +8888,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } boolean isImmersiveMode(@NonNull Rect parentBounds) { if (!mResolveConfigHint.mUseOverrideInsetsForStableBounds) { if (!Flags.immersiveAppRepositioning()) { return false; } if (!mResolveConfigHint.mUseOverrideInsetsForStableBounds && mWmService.mFlags.mInsetsDecoupledConfiguration) { return false; } final Insets navBarInsets = mDisplayContent.getInsetsStateController() Loading Loading @@ -9229,10 +9241,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // orientation bounds (stored in resolved bounds) instead of parent bounds since the // activity will be displayed within them even if it is in size compat mode. They should be // saved here before resolved bounds are overridden below. final Rect containerBounds = isAspectRatioApplied() final boolean useResolvedBounds = Flags.immersiveAppRepositioning() ? isAspectRatioApplied() : isLetterboxedForFixedOrientationAndAspectRatio(); final Rect containerBounds = useResolvedBounds ? new Rect(resolvedBounds) : newParentConfiguration.windowConfiguration.getBounds(); final Rect containerAppBounds = isAspectRatioApplied() final Rect containerAppBounds = useResolvedBounds ? new Rect(resolvedConfig.windowConfiguration.getAppBounds()) : newParentConfiguration.windowConfiguration.getAppBounds(); Loading services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java +3 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ import android.graphics.Rect; import android.os.Binder; import android.os.RemoteException; import android.os.UserHandle; import android.platform.test.annotations.EnableFlags; import android.platform.test.annotations.Presubmit; import android.platform.test.annotations.RequiresFlagsDisabled; import android.provider.DeviceConfig; Loading Loading @@ -401,6 +402,7 @@ public class SizeCompatTests extends WindowTestsBase { // TODO(b/333663877): Enable test after fix @Test @RequiresFlagsDisabled({Flags.FLAG_INSETS_DECOUPLED_CONFIGURATION}) @EnableFlags(Flags.FLAG_IMMERSIVE_APP_REPOSITIONING) public void testRepositionLandscapeImmersiveAppWithDisplayCutout() { final int dw = 2100; final int dh = 2000; Loading Loading @@ -4020,6 +4022,7 @@ public class SizeCompatTests extends WindowTestsBase { } @Test @EnableFlags(Flags.FLAG_IMMERSIVE_APP_REPOSITIONING) public void testImmersiveLetterboxAlignedToBottom_OverlappingNavbar() { assertLandscapeActivityAlignedToBottomWithNavbar(true /* immersive */); } Loading Loading
core/java/android/window/flags/large_screen_experiences_app_compat.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,16 @@ flag { is_fixed_read_only: true } flag { name: "immersive_app_repositioning" namespace: "large_screen_experiences_app_compat" description: "Fix immersive apps changing size when repositioning" bug: "334076352" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "camera_compat_for_freeform" namespace: "large_screen_experiences_app_compat" Loading
services/core/java/com/android/server/wm/ActivityRecord.java +18 −4 Original line number Diff line number Diff line Loading @@ -8538,7 +8538,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // If activity in fullscreen mode is letterboxed because of fixed orientation then bounds // are already calculated in resolveFixedOrientationConfiguration. // Don't apply aspect ratio if app is overridden to fullscreen by device user/manufacturer. if (!isLetterboxedForFixedOrientationAndAspectRatio() if (Flags.immersiveAppRepositioning() && !isLetterboxedForFixedOrientationAndAspectRatio() && !mLetterboxUiController.hasFullscreenOverride()) { resolveAspectRatioRestriction(newParentConfiguration); } Loading @@ -8555,6 +8555,14 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A computeConfigByResolveHint(resolvedConfig, newParentConfiguration); } } // If activity in fullscreen mode is letterboxed because of fixed orientation then bounds // are already calculated in resolveFixedOrientationConfiguration, or if in size compat // mode, it should already be calculated in resolveSizeCompatModeConfiguration. // Don't apply aspect ratio if app is overridden to fullscreen by device user/manufacturer. if (!Flags.immersiveAppRepositioning() && !isLetterboxedForFixedOrientationAndAspectRatio() && !mInSizeCompatModeForBounds && !mLetterboxUiController.hasFullscreenOverride()) { resolveAspectRatioRestriction(newParentConfiguration); } if (isFixedOrientationLetterboxAllowed || compatDisplayInsets != null // In fullscreen, can be letterboxed for aspect ratio. Loading Loading @@ -8880,7 +8888,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } boolean isImmersiveMode(@NonNull Rect parentBounds) { if (!mResolveConfigHint.mUseOverrideInsetsForStableBounds) { if (!Flags.immersiveAppRepositioning()) { return false; } if (!mResolveConfigHint.mUseOverrideInsetsForStableBounds && mWmService.mFlags.mInsetsDecoupledConfiguration) { return false; } final Insets navBarInsets = mDisplayContent.getInsetsStateController() Loading Loading @@ -9229,10 +9241,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // orientation bounds (stored in resolved bounds) instead of parent bounds since the // activity will be displayed within them even if it is in size compat mode. They should be // saved here before resolved bounds are overridden below. final Rect containerBounds = isAspectRatioApplied() final boolean useResolvedBounds = Flags.immersiveAppRepositioning() ? isAspectRatioApplied() : isLetterboxedForFixedOrientationAndAspectRatio(); final Rect containerBounds = useResolvedBounds ? new Rect(resolvedBounds) : newParentConfiguration.windowConfiguration.getBounds(); final Rect containerAppBounds = isAspectRatioApplied() final Rect containerAppBounds = useResolvedBounds ? new Rect(resolvedConfig.windowConfiguration.getAppBounds()) : newParentConfiguration.windowConfiguration.getAppBounds(); Loading
services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java +3 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ import android.graphics.Rect; import android.os.Binder; import android.os.RemoteException; import android.os.UserHandle; import android.platform.test.annotations.EnableFlags; import android.platform.test.annotations.Presubmit; import android.platform.test.annotations.RequiresFlagsDisabled; import android.provider.DeviceConfig; Loading Loading @@ -401,6 +402,7 @@ public class SizeCompatTests extends WindowTestsBase { // TODO(b/333663877): Enable test after fix @Test @RequiresFlagsDisabled({Flags.FLAG_INSETS_DECOUPLED_CONFIGURATION}) @EnableFlags(Flags.FLAG_IMMERSIVE_APP_REPOSITIONING) public void testRepositionLandscapeImmersiveAppWithDisplayCutout() { final int dw = 2100; final int dh = 2000; Loading Loading @@ -4020,6 +4022,7 @@ public class SizeCompatTests extends WindowTestsBase { } @Test @EnableFlags(Flags.FLAG_IMMERSIVE_APP_REPOSITIONING) public void testImmersiveLetterboxAlignedToBottom_OverlappingNavbar() { assertLandscapeActivityAlignedToBottomWithNavbar(true /* immersive */); } Loading