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

Commit a2bf7616 authored by Tim Kilbourn's avatar Tim Kilbourn Committed by Android (Google) Code Review
Browse files

Merge "Add a wm command to dismiss the keyguard." into mnc-dev

parents 607bc34f f40c66d1
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -65,7 +65,10 @@ public class Wm extends BaseCommand {
                "\n" +
                "wm scaling: set display scaling mode.\n" +
                "\n" +
                "wm screen-capture: enable/disable screen capture.\n"
                "wm screen-capture: enable/disable screen capture.\n" +
                "\n" +
                "wm dismiss-keyguard: dismiss the keyguard, prompting the user for auth if " +
                "necessary.\n"
                );
    }

@@ -90,6 +93,8 @@ public class Wm extends BaseCommand {
            runDisplayScaling();
        } else if (op.equals("screen-capture")) {
            runSetScreenCapture();
        } else if (op.equals("dismiss-keyguard")) {
            runDismissKeyguard();
        } else {
            showError("Error: unknown command '" + op + "'");
            return;
@@ -240,6 +245,10 @@ public class Wm extends BaseCommand {
        }
    }

    private void runDismissKeyguard() throws Exception {
        mWm.dismissKeyguard();
    }

    private int parseDimension(String s) throws NumberFormatException {
        if (s.endsWith("px")) {
            return Integer.parseInt(s.substring(0, s.length() - 2));