[Virtio Input] Add .idc File for Emulator Multi-Touch Virtio Device

Emulator create an internal virtio input device of which the product and vendor
ID are 0 to avoid conflict with real physical device. To associate the
device with idc file correctly in InpufFlinger, device name on emulator
must match with the name of the idc file.

BUG: 129491066

Change-Id: Ib952020ac5f8322bda059aa38c041994f2a08926
Merged-In: Ib952020ac5f8322bda059aa38c041994f2a08926

Signed-off-by: Weilun Du <wdu@google.com>
(cherry picked from commit c61ab46f29cff67b21878a8fdf8e1bf83343c1d4)
diff --git a/data/etc/advancedFeatures.ini b/data/etc/advancedFeatures.ini
index deb0a96..a44bae0 100644
--- a/data/etc/advancedFeatures.ini
+++ b/data/etc/advancedFeatures.ini
@@ -9,4 +9,5 @@
 Wifi = on
 KernelDeviceTreeBlobSupport = on
 HostComposition = on
-RefCountPipe = on
\ No newline at end of file
+RefCountPipe = on
+VirtioInput = on
diff --git a/data/etc/user/advancedFeatures.ini b/data/etc/user/advancedFeatures.ini
index 4edb062..c26ce39 100644
--- a/data/etc/user/advancedFeatures.ini
+++ b/data/etc/user/advancedFeatures.ini
@@ -11,3 +11,4 @@
 KernelDeviceTreeBlobSupport = on
 HostComposition = on
 RefCountPipe = on
+VirtioInput = on
diff --git a/input/virtio_input_multi_touch_1.idc b/input/virtio_input_multi_touch_1.idc
new file mode 100644
index 0000000..f740c04
--- /dev/null
+++ b/input/virtio_input_multi_touch_1.idc
@@ -0,0 +1,7 @@
+device.internal = 1
+
+touch.deviceType = touchScreen
+touch.orientationAware = 1
+
+cursor.mode = navigation
+cursor.orientationAware = 1
diff --git a/input/virtio_input_multi_touch_2.idc b/input/virtio_input_multi_touch_2.idc
new file mode 100644
index 0000000..baba2dc
--- /dev/null
+++ b/input/virtio_input_multi_touch_2.idc
@@ -0,0 +1,12 @@
+device.internal = 1
+
+touch.deviceType = touchScreen
+touch.orientationAware = 1
+
+cursor.mode = navigation
+cursor.orientationAware = 1
+
+# This displayID matches the unique ID of the virtual display created for Emulator.
+# This will indicate to input flinger than it should link this input device
+# with the virtual display.
+touch.displayId = virtual:android:1234567
diff --git a/vendor.mk b/vendor.mk
index 535d59f..c16f105 100644
--- a/vendor.mk
+++ b/vendor.mk
@@ -147,6 +147,8 @@
     device/generic/goldfish/fstab.ranchu:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.ranchu \
     device/generic/goldfish/ueventd.ranchu.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc \
     device/generic/goldfish/input/goldfish_rotary.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/goldfish_rotary.idc \
+    device/generic/goldfish/input/virtio_input_multi_touch_1.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/virtio_input_multi_touch_1.idc \
+    device/generic/goldfish/input/virtio_input_multi_touch_2.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/virtio_input_multi_touch_2.idc \
     device/generic/goldfish/manifest.xml:$(TARGET_COPY_OUT_VENDOR)/manifest.xml \
     device/generic/goldfish/data/etc/config.ini:config.ini \
     device/generic/goldfish/wifi/simulated_hostapd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/simulated_hostapd.conf \