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

Commit fcbb6555 authored by Harry Cutts's avatar Harry Cutts Committed by Android (Google) Code Review
Browse files

Merge "uinput: pass Commands to Event.Builder.setCommand" into main

parents a481cc28 766ff01f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ import src.com.android.commands.uinput.InputAbsInfo;
public class Event {
    private static final String TAG = "UinputEvent";

    enum Command {
    public enum Command {
        REGISTER,
        DELAY,
        INJECT,
@@ -188,8 +188,8 @@ public class Event {
            mEvent.mId = id;
        }

        public void setCommand(String command) {
            mEvent.mCommand = Command.valueOf(command.toUpperCase());
        public void setCommand(Command command) {
            mEvent.mCommand = command;
        }

        public void setName(String name) {
+2 −1
Original line number Diff line number Diff line
@@ -57,7 +57,8 @@ public class JsonStyleParser {
                    String name = mReader.nextName();
                    switch (name) {
                        case "id" -> eb.setId(readInt());
                        case "command" -> eb.setCommand(mReader.nextString());
                        case "command" -> eb.setCommand(
                                Event.Command.valueOf(mReader.nextString().toUpperCase()));
                        case "name" -> eb.setName(mReader.nextString());
                        case "vid" -> eb.setVid(readInt());
                        case "pid" -> eb.setPid(readInt());