Move virtual device infra to libinput
These pieces should be part of libinput, because they are needed to
create uinput devices efficiently.
Bug: 335496563
Test: build only
Flag: EXEMPT refactor
Change-Id: I506a592b83f549e6db9a03bc9bb86c047f31f872
diff --git a/include/input/VirtualInputDevice.h b/include/input/VirtualInputDevice.h
index dabe45c..b6c6305 100644
--- a/include/input/VirtualInputDevice.h
+++ b/include/input/VirtualInputDevice.h
@@ -17,14 +17,30 @@
#pragma once
#include <android-base/unique_fd.h>
+#include <input/Input.h>
+#include <map>
namespace android {
+enum class DeviceType {
+ KEYBOARD,
+ MOUSE,
+ TOUCHSCREEN,
+ DPAD,
+ STYLUS,
+ ROTARY_ENCODER,
+};
+
+android::base::unique_fd openUinput(const char* readableName, int32_t vendorId, int32_t productId,
+ const char* phys, DeviceType deviceType, int32_t screenHeight,
+ int32_t screenWidth);
+
enum class UinputAction {
RELEASE = 0,
PRESS = 1,
MOVE = 2,
CANCEL = 3,
+ ftl_last = CANCEL,
};
class VirtualInputDevice {