Loading services/core/java/com/android/server/wm/LetterboxConfiguration.java +17 −1 Original line number Diff line number Diff line Loading @@ -249,6 +249,9 @@ final class LetterboxConfiguration { // Allows to enable letterboxing strategy for translucent activities ignoring flags. private boolean mTranslucentLetterboxingOverrideEnabled; // Allows to enable user aspect ratio settings ignoring flags. private boolean mUserAppAspectRatioSettingsOverrideEnabled; // Whether we should use split screen aspect ratio for the activity when camera compat treatment // is enabled and activity is connected to the camera in fullscreen. private final boolean mIsCameraCompatSplitScreenAspectRatioEnabled; Loading Loading @@ -1223,6 +1226,19 @@ final class LetterboxConfiguration { * Whether per-app user aspect ratio override settings is enabled */ boolean isUserAppAspectRatioSettingsEnabled() { return mDeviceConfig.getFlagValue(KEY_ENABLE_USER_ASPECT_RATIO_SETTINGS); return mUserAppAspectRatioSettingsOverrideEnabled || mDeviceConfig.getFlagValue(KEY_ENABLE_USER_ASPECT_RATIO_SETTINGS); } void setUserAppAspectRatioSettingsOverrideEnabled(boolean enabled) { mUserAppAspectRatioSettingsOverrideEnabled = enabled; } /** * Resets whether per-app user aspect ratio override settings is enabled * {@code mDeviceConfig.getFlagValue(KEY_ENABLE_USER_ASPECT_RATIO_SETTINGS)}. */ void resetUserAppAspectRatioSettingsEnabled() { setUserAppAspectRatioSettingsOverrideEnabled(false); } } services/core/java/com/android/server/wm/WindowManagerShellCommand.java +18 −12 Original line number Diff line number Diff line Loading @@ -1006,13 +1006,16 @@ public class WindowManagerShellCommand extends ShellCommand { runSetBooleanFlag(pw, mLetterboxConfiguration ::setTranslucentLetterboxingOverrideEnabled); break; case "--isUserAppAspectRatioSettingsEnabled": runSetBooleanFlag(pw, mLetterboxConfiguration ::setUserAppAspectRatioSettingsOverrideEnabled); break; case "--isCameraCompatRefreshEnabled": runSetBooleanFlag(pw, enabled -> mLetterboxConfiguration .setCameraCompatRefreshEnabled(enabled)); runSetBooleanFlag(pw, mLetterboxConfiguration::setCameraCompatRefreshEnabled); break; case "--isCameraCompatRefreshCycleThroughStopEnabled": runSetBooleanFlag(pw, enabled -> mLetterboxConfiguration .setCameraCompatRefreshCycleThroughStopEnabled(enabled)); runSetBooleanFlag(pw, mLetterboxConfiguration::setCameraCompatRefreshCycleThroughStopEnabled); break; default: getErrPrintWriter().println( Loading Loading @@ -1084,6 +1087,9 @@ public class WindowManagerShellCommand extends ShellCommand { case "isTranslucentLetterboxingEnabled": mLetterboxConfiguration.resetTranslucentLetterboxingEnabled(); break; case "isUserAppAspectRatioSettingsEnabled": mLetterboxConfiguration.resetUserAppAspectRatioSettingsEnabled(); break; case "isCameraCompatRefreshEnabled": mLetterboxConfiguration.resetCameraCompatRefreshEnabled(); break; Loading Loading @@ -1194,6 +1200,7 @@ public class WindowManagerShellCommand extends ShellCommand { mLetterboxConfiguration.resetIsSplitScreenAspectRatioForUnresizableAppsEnabled(); mLetterboxConfiguration.resetIsDisplayAspectRatioEnabledForFixedOrientationLetterbox(); mLetterboxConfiguration.resetTranslucentLetterboxingEnabled(); mLetterboxConfiguration.resetUserAppAspectRatioSettingsEnabled(); mLetterboxConfiguration.resetCameraCompatRefreshEnabled(); mLetterboxConfiguration.resetCameraCompatRefreshCycleThroughStopEnabled(); } Loading Loading @@ -1249,7 +1256,6 @@ public class WindowManagerShellCommand extends ShellCommand { + mLetterboxConfiguration.isCameraCompatRefreshEnabled()); pw.println(" Refresh using \"stopped -> resumed\" cycle: " + mLetterboxConfiguration.isCameraCompatRefreshCycleThroughStopEnabled()); pw.println("Background type: " + LetterboxConfiguration.letterboxBackgroundTypeToString( mLetterboxConfiguration.getLetterboxBackgroundType())); Loading @@ -1259,12 +1265,10 @@ public class WindowManagerShellCommand extends ShellCommand { + mLetterboxConfiguration.getLetterboxBackgroundWallpaperBlurRadius()); pw.println(" Wallpaper dark scrim alpha: " + mLetterboxConfiguration.getLetterboxBackgroundWallpaperDarkScrimAlpha()); if (mLetterboxConfiguration.isTranslucentLetterboxingEnabled()) { pw.println("Letterboxing for translucent activities: enabled"); } else { pw.println("Letterboxing for translucent activities: disabled"); } pw.println("Is letterboxing for translucent activities enabled: " + mLetterboxConfiguration.isTranslucentLetterboxingEnabled()); pw.println("Is the user aspect ratio settings enabled: " + mLetterboxConfiguration.isUserAppAspectRatioSettingsEnabled()); } return 0; } Loading Loading @@ -1462,6 +1466,8 @@ public class WindowManagerShellCommand extends ShellCommand { pw.println(" unresizable apps."); pw.println(" --isTranslucentLetterboxingEnabled [true|1|false|0]"); pw.println(" Whether letterboxing for translucent activities is enabled."); pw.println(" --isUserAppAspectRatioSettingsEnabled [true|1|false|0]"); pw.println(" Whether user aspect ratio settings are enabled."); pw.println(" --isCameraCompatRefreshEnabled [true|1|false|0]"); pw.println(" Whether camera compatibility refresh is enabled."); pw.println(" --isCameraCompatRefreshCycleThroughStopEnabled [true|1|false|0]"); Loading @@ -1473,7 +1479,7 @@ public class WindowManagerShellCommand extends ShellCommand { pw.println(" |horizontalPositionMultiplier|verticalPositionMultiplier"); pw.println(" |isHorizontalReachabilityEnabled|isVerticalReachabilityEnabled"); pw.println(" |isEducationEnabled||defaultPositionMultiplierForHorizontalReachability"); pw.println(" |isTranslucentLetterboxingEnabled"); pw.println(" |isTranslucentLetterboxingEnabled|isUserAppAspectRatioSettingsEnabled"); pw.println(" |defaultPositionMultiplierForVerticalReachability]"); pw.println(" Resets overrides to default values for specified properties separated"); pw.println(" by space, e.g. 'reset-letterbox-style aspectRatio cornerRadius'."); Loading Loading
services/core/java/com/android/server/wm/LetterboxConfiguration.java +17 −1 Original line number Diff line number Diff line Loading @@ -249,6 +249,9 @@ final class LetterboxConfiguration { // Allows to enable letterboxing strategy for translucent activities ignoring flags. private boolean mTranslucentLetterboxingOverrideEnabled; // Allows to enable user aspect ratio settings ignoring flags. private boolean mUserAppAspectRatioSettingsOverrideEnabled; // Whether we should use split screen aspect ratio for the activity when camera compat treatment // is enabled and activity is connected to the camera in fullscreen. private final boolean mIsCameraCompatSplitScreenAspectRatioEnabled; Loading Loading @@ -1223,6 +1226,19 @@ final class LetterboxConfiguration { * Whether per-app user aspect ratio override settings is enabled */ boolean isUserAppAspectRatioSettingsEnabled() { return mDeviceConfig.getFlagValue(KEY_ENABLE_USER_ASPECT_RATIO_SETTINGS); return mUserAppAspectRatioSettingsOverrideEnabled || mDeviceConfig.getFlagValue(KEY_ENABLE_USER_ASPECT_RATIO_SETTINGS); } void setUserAppAspectRatioSettingsOverrideEnabled(boolean enabled) { mUserAppAspectRatioSettingsOverrideEnabled = enabled; } /** * Resets whether per-app user aspect ratio override settings is enabled * {@code mDeviceConfig.getFlagValue(KEY_ENABLE_USER_ASPECT_RATIO_SETTINGS)}. */ void resetUserAppAspectRatioSettingsEnabled() { setUserAppAspectRatioSettingsOverrideEnabled(false); } }
services/core/java/com/android/server/wm/WindowManagerShellCommand.java +18 −12 Original line number Diff line number Diff line Loading @@ -1006,13 +1006,16 @@ public class WindowManagerShellCommand extends ShellCommand { runSetBooleanFlag(pw, mLetterboxConfiguration ::setTranslucentLetterboxingOverrideEnabled); break; case "--isUserAppAspectRatioSettingsEnabled": runSetBooleanFlag(pw, mLetterboxConfiguration ::setUserAppAspectRatioSettingsOverrideEnabled); break; case "--isCameraCompatRefreshEnabled": runSetBooleanFlag(pw, enabled -> mLetterboxConfiguration .setCameraCompatRefreshEnabled(enabled)); runSetBooleanFlag(pw, mLetterboxConfiguration::setCameraCompatRefreshEnabled); break; case "--isCameraCompatRefreshCycleThroughStopEnabled": runSetBooleanFlag(pw, enabled -> mLetterboxConfiguration .setCameraCompatRefreshCycleThroughStopEnabled(enabled)); runSetBooleanFlag(pw, mLetterboxConfiguration::setCameraCompatRefreshCycleThroughStopEnabled); break; default: getErrPrintWriter().println( Loading Loading @@ -1084,6 +1087,9 @@ public class WindowManagerShellCommand extends ShellCommand { case "isTranslucentLetterboxingEnabled": mLetterboxConfiguration.resetTranslucentLetterboxingEnabled(); break; case "isUserAppAspectRatioSettingsEnabled": mLetterboxConfiguration.resetUserAppAspectRatioSettingsEnabled(); break; case "isCameraCompatRefreshEnabled": mLetterboxConfiguration.resetCameraCompatRefreshEnabled(); break; Loading Loading @@ -1194,6 +1200,7 @@ public class WindowManagerShellCommand extends ShellCommand { mLetterboxConfiguration.resetIsSplitScreenAspectRatioForUnresizableAppsEnabled(); mLetterboxConfiguration.resetIsDisplayAspectRatioEnabledForFixedOrientationLetterbox(); mLetterboxConfiguration.resetTranslucentLetterboxingEnabled(); mLetterboxConfiguration.resetUserAppAspectRatioSettingsEnabled(); mLetterboxConfiguration.resetCameraCompatRefreshEnabled(); mLetterboxConfiguration.resetCameraCompatRefreshCycleThroughStopEnabled(); } Loading Loading @@ -1249,7 +1256,6 @@ public class WindowManagerShellCommand extends ShellCommand { + mLetterboxConfiguration.isCameraCompatRefreshEnabled()); pw.println(" Refresh using \"stopped -> resumed\" cycle: " + mLetterboxConfiguration.isCameraCompatRefreshCycleThroughStopEnabled()); pw.println("Background type: " + LetterboxConfiguration.letterboxBackgroundTypeToString( mLetterboxConfiguration.getLetterboxBackgroundType())); Loading @@ -1259,12 +1265,10 @@ public class WindowManagerShellCommand extends ShellCommand { + mLetterboxConfiguration.getLetterboxBackgroundWallpaperBlurRadius()); pw.println(" Wallpaper dark scrim alpha: " + mLetterboxConfiguration.getLetterboxBackgroundWallpaperDarkScrimAlpha()); if (mLetterboxConfiguration.isTranslucentLetterboxingEnabled()) { pw.println("Letterboxing for translucent activities: enabled"); } else { pw.println("Letterboxing for translucent activities: disabled"); } pw.println("Is letterboxing for translucent activities enabled: " + mLetterboxConfiguration.isTranslucentLetterboxingEnabled()); pw.println("Is the user aspect ratio settings enabled: " + mLetterboxConfiguration.isUserAppAspectRatioSettingsEnabled()); } return 0; } Loading Loading @@ -1462,6 +1466,8 @@ public class WindowManagerShellCommand extends ShellCommand { pw.println(" unresizable apps."); pw.println(" --isTranslucentLetterboxingEnabled [true|1|false|0]"); pw.println(" Whether letterboxing for translucent activities is enabled."); pw.println(" --isUserAppAspectRatioSettingsEnabled [true|1|false|0]"); pw.println(" Whether user aspect ratio settings are enabled."); pw.println(" --isCameraCompatRefreshEnabled [true|1|false|0]"); pw.println(" Whether camera compatibility refresh is enabled."); pw.println(" --isCameraCompatRefreshCycleThroughStopEnabled [true|1|false|0]"); Loading @@ -1473,7 +1479,7 @@ public class WindowManagerShellCommand extends ShellCommand { pw.println(" |horizontalPositionMultiplier|verticalPositionMultiplier"); pw.println(" |isHorizontalReachabilityEnabled|isVerticalReachabilityEnabled"); pw.println(" |isEducationEnabled||defaultPositionMultiplierForHorizontalReachability"); pw.println(" |isTranslucentLetterboxingEnabled"); pw.println(" |isTranslucentLetterboxingEnabled|isUserAppAspectRatioSettingsEnabled"); pw.println(" |defaultPositionMultiplierForVerticalReachability]"); pw.println(" Resets overrides to default values for specified properties separated"); pw.println(" by space, e.g. 'reset-letterbox-style aspectRatio cornerRadius'."); Loading