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

Commit 0312c6e9 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Correct argument order of wm density" into main

parents 45279986 dedce719
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -283,24 +283,28 @@ public class WindowManagerShellCommand extends ShellCommand {
    }

    private int runDisplayDensity(PrintWriter pw) throws RemoteException {
        String densityStr = getNextArg();
        String densityStr = null;
        String arg = getNextArg();
        int density;
        int displayId = Display.DEFAULT_DISPLAY;
        if ("-d".equals(densityStr) && arg != null) {
        if (!"-d".equals(arg) && !"-u".equals(arg)) {
            densityStr = arg;
            arg = getNextArg();
        }
        if ("-d".equals(arg)) {
            arg = getNextArg();
            try {
                displayId = Integer.parseInt(arg);
            } catch (NumberFormatException e) {
                getErrPrintWriter().println("Error: bad number " + e);
            }
            densityStr = getNextArg();
        } else if ("-u".equals(densityStr) && arg != null) {
        } else if ("-u".equals(arg)) {
            arg = getNextArg();
            displayId = mInterface.getDisplayIdByUniqueId(arg);
            if (displayId == Display.INVALID_DISPLAY) {
                getErrPrintWriter().println("Error: the uniqueId is invalid ");
                return -1;
            }
            densityStr = getNextArg();
        }

        if (densityStr == null) {