Support trackpad in VM
It handles single touch and tap event for now.
Bug: 347253952
Test: add trackpad, and then check if it works
Change-Id: Ifec4219036b4baa66c84faffa9d3b22f99fdddd4
diff --git a/virtualizationmanager/src/aidl.rs b/virtualizationmanager/src/aidl.rs
index 671a012..425beed 100644
--- a/virtualizationmanager/src/aidl.rs
+++ b/virtualizationmanager/src/aidl.rs
@@ -808,6 +808,12 @@
InputDevice::Switches(switches) => InputDeviceOption::Switches(clone_file(
switches.pfd.as_ref().ok_or(anyhow!("pfd should have value"))?,
)?),
+ InputDevice::Trackpad(trackpad) => InputDeviceOption::MultiTouchTrackpad {
+ file: clone_file(trackpad.pfd.as_ref().ok_or(anyhow!("pfd should have value"))?)?,
+ height: u32::try_from(trackpad.height)?,
+ width: u32::try_from(trackpad.width)?,
+ name: if !trackpad.name.is_empty() { Some(trackpad.name.clone()) } else { None },
+ },
})
}
/// Given the configuration for a disk image, assembles the `DiskFile` to pass to crosvm.