Implement basic keyboard input
It doesn't support some key combination, but basically works.
It might be an interim solution for a while until evdev is avilable.
And also refactored the code about sending evts to the socket
Bug: 325930433
Bug: 331191129
Test: connect keyboard
Change-Id: I4fb0f62fd705b52b6557737a70575f9769f864e0
diff --git a/virtualizationmanager/src/aidl.rs b/virtualizationmanager/src/aidl.rs
index c5f1ab7..99a0078 100644
--- a/virtualizationmanager/src/aidl.rs
+++ b/virtualizationmanager/src/aidl.rs
@@ -751,6 +751,9 @@
InputDevice::EvDev(evdev) => InputDeviceOption::EvDev(clone_file(
evdev.pfd.as_ref().ok_or(anyhow!("pfd should have value"))?,
)?),
+ InputDevice::Keyboard(keyboard) => InputDeviceOption::Keyboard(clone_file(
+ keyboard.pfd.as_ref().ok_or(anyhow!("pfd should have value"))?,
+ )?),
})
}
/// Given the configuration for a disk image, assembles the `DiskFile` to pass to crosvm.