Adds the vsoc_input_service to the images
Test: run locally
Change-Id: I28f71292f2862f6686b45131f040fef1c26e01d7
diff --git a/shared/config/init.vsoc.rc b/shared/config/init.vsoc.rc
index 7ffd63d..488dd0f 100644
--- a/shared/config/init.vsoc.rc
+++ b/shared/config/init.vsoc.rc
@@ -25,6 +25,9 @@
chown system root /dev/fb_broadcast
chmod 0660 /dev/fb_broadcast
restorecon /dev/fb_broadcast
+ chown system root /dev/input_events
+ chmod 0660 /dev/input_events
+ restorecon /dev/input_events
on fs
@@ -58,6 +61,7 @@
on early-boot
+ start vsoc_input_service
start vnc_server
@@ -75,6 +79,10 @@
oneshot
+service vsoc_input_service /vendor/bin/vsoc_input_service
+ oneshot
+
+
service vnc_server /vendor/bin/vnc_server
oneshot
diff --git a/shared/device.mk b/shared/device.mk
index 4a572de..1658d65 100644
--- a/shared/device.mk
+++ b/shared/device.mk
@@ -62,6 +62,7 @@
wifirouter \
wificlient \
wpa_supplicant.vsoc.conf \
+ vsoc_input_service
#
# Packages for AOSP-available stuff we use from the framework
diff --git a/shared/sepolicy/file_contexts b/shared/sepolicy/file_contexts
index e931594..0a46e4b 100644
--- a/shared/sepolicy/file_contexts
+++ b/shared/sepolicy/file_contexts
@@ -30,6 +30,7 @@
/vendor/bin/gce_fs_monitor u:object_r:gce_fs_monitor_exec:s0
/vendor/bin/usbforward u:object_r:usbforward_exec:s0
/vendor/bin/vnc_server u:object_r:vnc_server_exec:s0
+/vendor/bin/vsoc_input_service u:object_r:vsoc_input_service_exec:s0
/vendor/bin/vsoc_guest_region_e2e_test u:object_r:vsoc_guest_region_e2e_test_exec:s0
/vendor/bin/wificlient u:object_r:wificlient_exec:s0
/vendor/bin/wifirouter u:object_r:wifirouter_exec:s0
diff --git a/shared/sepolicy/vsoc_input_service.te b/shared/sepolicy/vsoc_input_service.te
new file mode 100644
index 0000000..1218519
--- /dev/null
+++ b/shared/sepolicy/vsoc_input_service.te
@@ -0,0 +1,11 @@
+type vsoc_input_service, domain;
+type vsoc_input_service_exec, exec_type, file_type;
+
+init_daemon_domain(vsoc_input_service)
+
+# I/O with /dev/uinput
+allow vsoc_input_service uhid_device:chr_file rw_file_perms;
+
+# Framebuffer I/O (needed to obtain the screen size)
+allow vsoc_input_service fb_ctl_file:file rw_file_perms;
+allow vsoc_input_service userspace_fb_file:file rw_file_perms;