Add cvd input_devices subcommand - #3131
Conversation
9a58325 to
1566eb7
Compare
Databean
left a comment
There was a problem hiding this comment.
Reviewed only the last commit.
| if (cmd == kListCommand || cmd == kLsAlias) { | ||
| CF_EXPECT(ListDevices(request, std::move(args))); | ||
| } else if (cmd == kCaptureCommand) { | ||
| CF_EXPECT(CaptureEvents(request, std::move(args))); | ||
| } else if (cmd == kInjectCommand) { | ||
| CF_EXPECT(InjectEvents(request, std::move(args))); | ||
| } else { |
There was a problem hiding this comment.
If only CommandHandler had a CanHandle method, then these all could have been separate CommandHandlers.
Maybe they still can, the inner subcommands could still be separate CommandHandler classes that are only created inside the CvdInputDevicesHandler.
There was a problem hiding this comment.
If only CommandHandler had a CanHandle method, then these all could have been separate CommandHandlers.
But then the arguments parsing would have to be repeated 3 times (at worst)
Maybe they still can, the inner subcommands could still be separate CommandHandler classes that are only created inside the CvdInputDevicesHandler.
That would complicate the help output though. I'd rather have three different commands: list_input_devices, capture_input_events and inject_input_events. But I still prefer this implementation over that one. If you're worried about the file being too long I can make it a directory and split it like monitor does. WDYT?
b079749 to
55bbbf9
Compare
The vhost-user-input backend accepts connections on an extra unix socket. Events received through the main server are sent to any client connected to this server in addition to the frontend. At most one connection is allowed through this server at a time. Bug: b/554190370
55bbbf9 to
211538e
Compare
The new subcommand allows listing input devices as well as capturing and injecting input events. Bug: b/554190370
211538e to
bba88ff
Compare
Bug: b/554190370