dumpstate: touch: Add touch_predump for gti

go/touch_predump

Test: b/318578275
Test: Locally flash and check dump logs on dogfood device
Bug: 287907308
Change-Id: I4a35a9a57c1331d67dfcd1863b57d75a9b804c32
diff --git a/touch/gti/predump_sepolicy/file.te b/touch/gti/predump_sepolicy/file.te
new file mode 100644
index 0000000..c3900f0
--- /dev/null
+++ b/touch/gti/predump_sepolicy/file.te
@@ -0,0 +1,3 @@
+type proc_touch_gti, proc_type, fs_type;
+type sysfs_touch_gti, sysfs_type, fs_type;
+
diff --git a/touch/gti/predump_sepolicy/file_contexts b/touch/gti/predump_sepolicy/file_contexts
new file mode 100644
index 0000000..6d8ca17
--- /dev/null
+++ b/touch/gti/predump_sepolicy/file_contexts
@@ -0,0 +1 @@
+/vendor/bin/dump_touch/predump_gti0\.sh      u:object_r:predump_touch_exec:s0
diff --git a/touch/gti/predump_sepolicy/genfs_contexts b/touch/gti/predump_sepolicy/genfs_contexts
new file mode 100644
index 0000000..45d3b53
--- /dev/null
+++ b/touch/gti/predump_sepolicy/genfs_contexts
@@ -0,0 +1,4 @@
+# Touch
+genfscon sysfs /devices/virtual/goog_touch_interface                            u:object_r:sysfs_touch_gti:s0
+genfscon proc  /goog_touch_interface                                            u:object_r:proc_touch_gti:s0
+
diff --git a/touch/gti/predump_sepolicy/predump_touch.te b/touch/gti/predump_sepolicy/predump_touch.te
new file mode 100644
index 0000000..7c1f408
--- /dev/null
+++ b/touch/gti/predump_sepolicy/predump_touch.te
@@ -0,0 +1,4 @@
+allow predump_touch proc_touch_gti:dir r_dir_perms;
+allow predump_touch proc_touch_gti:file rw_file_perms;
+allow predump_touch sysfs_touch_gti:dir r_dir_perms;
+allow predump_touch sysfs_touch_gti:file rw_file_perms;
\ No newline at end of file