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

Commit d724cb18 authored by Emil Bengtsson's avatar Emil Bengtsson Committed by Cherrypicker Worker
Browse files

Handle case in WindowManagerShellComand

Do not print an error message when fixedToUserRotationMode is
FIXED_TO_USER_ROTATION_IF_NO_AUTO_ROTATION.

Test: atest AppConfigurationTests
Bug: 329026457
(cherry picked from https://partner-android-review.googlesource.com/q/commit:1b545d1104fbfcf4d8ddac847224844bca112fdd)
Merged-In: Ifa5a4755f72b9b548c42c60e89fdc0e57e932593
Change-Id: Ifa5a4755f72b9b548c42c60e89fdc0e57e932593
parent 049a3539
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -519,6 +519,9 @@ public class WindowManagerShellCommand extends ShellCommand {
            case "default":
                fixedToUserRotation = IWindowManager.FIXED_TO_USER_ROTATION_DEFAULT;
                break;
            case "enabled_if_no_auto_rotation":
                fixedToUserRotation = IWindowManager.FIXED_TO_USER_ROTATION_IF_NO_AUTO_ROTATION;
                break;
            default:
                getErrPrintWriter().println("Error: expecting enabled, disabled or default, but we "
                        + "get " + arg);
@@ -538,6 +541,9 @@ public class WindowManagerShellCommand extends ShellCommand {
            case IWindowManager.FIXED_TO_USER_ROTATION_DISABLED:
                pw.println("disabled");
                return 0;
            case IWindowManager.FIXED_TO_USER_ROTATION_IF_NO_AUTO_ROTATION:
                pw.println("enabled_if_no_auto_rotation");
                return 0;
            case IWindowManager.FIXED_TO_USER_ROTATION_ENABLED:
                pw.println("enabled");
                return 0;
@@ -1494,7 +1500,8 @@ public class WindowManagerShellCommand extends ShellCommand {
        pw.println("    Print or set user rotation mode and user rotation.");
        pw.println("  dump-visible-window-views");
        pw.println("    Dumps the encoded view hierarchies of visible windows");
        pw.println("  fixed-to-user-rotation [-d DISPLAY_ID] [enabled|disabled|default]");
        pw.println("  fixed-to-user-rotation [-d DISPLAY_ID] [enabled|disabled|default");
        pw.println("      |enabled_if_no_auto_rotation]");
        pw.println("    Print or set rotating display for app requested orientation.");
        pw.println("  set-ignore-orientation-request [-d DISPLAY_ID] [true|1|false|0]");
        pw.println("  get-ignore-orientation-request [-d DISPLAY_ID] ");