Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d624a329 authored by Massimo Carli's avatar Massimo Carli Committed by Automerger Merge Worker
Browse files

Merge "[2/n] Add adb command for override user aspect ratio settings flag"...

Merge "[2/n] Add adb command for override user aspect ratio settings flag" into udc-qpr-dev am: 149c2ccf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23733075



Change-Id: If66d5db8d3baa0c31b9925484277ec9eac000310
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 12a61604 149c2ccf
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -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;
@@ -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);
    }
}
+18 −12
Original line number Diff line number Diff line
@@ -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(
@@ -1084,6 +1087,9 @@ public class WindowManagerShellCommand extends ShellCommand {
                    case "isTranslucentLetterboxingEnabled":
                        mLetterboxConfiguration.resetTranslucentLetterboxingEnabled();
                        break;
                    case "isUserAppAspectRatioSettingsEnabled":
                        mLetterboxConfiguration.resetUserAppAspectRatioSettingsEnabled();
                        break;
                    case "isCameraCompatRefreshEnabled":
                        mLetterboxConfiguration.resetCameraCompatRefreshEnabled();
                        break;
@@ -1194,6 +1200,7 @@ public class WindowManagerShellCommand extends ShellCommand {
            mLetterboxConfiguration.resetIsSplitScreenAspectRatioForUnresizableAppsEnabled();
            mLetterboxConfiguration.resetIsDisplayAspectRatioEnabledForFixedOrientationLetterbox();
            mLetterboxConfiguration.resetTranslucentLetterboxingEnabled();
            mLetterboxConfiguration.resetUserAppAspectRatioSettingsEnabled();
            mLetterboxConfiguration.resetCameraCompatRefreshEnabled();
            mLetterboxConfiguration.resetCameraCompatRefreshCycleThroughStopEnabled();
        }
@@ -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()));
@@ -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;
    }
@@ -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]");
@@ -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'.");