Revert "Move sepolicy files to gs-common."
Revert submission 26288713-twoshay-sepolicy-24
Reason for revert: DroidMonitor: Potential culprit for b/327235315 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Bug:327235315
Reverted changes: /q/submissionid:26288713-twoshay-sepolicy-24
Change-Id: I63316d2d5a5cc35a844f7f282ac0bf76b9b557fa
diff --git a/input/device.te b/input/device.te
new file mode 100644
index 0000000..d3ce622
--- /dev/null
+++ b/input/device.te
@@ -0,0 +1 @@
+type touch_offload_device, dev_type;
diff --git a/input/dumpstate.te b/input/dumpstate.te
new file mode 100644
index 0000000..38aa25e
--- /dev/null
+++ b/input/dumpstate.te
@@ -0,0 +1,2 @@
+binder_call(dumpstate, twoshay)
+allow dumpstate touch_context_service:service_manager find;
diff --git a/input/file_contexts b/input/file_contexts
new file mode 100644
index 0000000..53b5edc
--- /dev/null
+++ b/input/file_contexts
@@ -0,0 +1,5 @@
+/dev/touch_offload u:object_r:touch_offload_device:s0
+/dev/touch_offload_fts u:object_r:touch_offload_device:s0
+/dev/touch_offload_fts_ext u:object_r:touch_offload_device:s0
+/dev/touch_offload_outer u:object_r:touch_offload_device:s0
+/vendor/bin/twoshay u:object_r:twoshay_exec:s0
diff --git a/input/hal_dumpstate_default.te b/input/hal_dumpstate_default.te
new file mode 100644
index 0000000..81edc36
--- /dev/null
+++ b/input/hal_dumpstate_default.te
@@ -0,0 +1,2 @@
+allow hal_dumpstate_default touch_context_service:service_manager find;
+binder_call(hal_dumpstate_default, twoshay)
diff --git a/input/platform_app.te b/input/platform_app.te
new file mode 100644
index 0000000..9b4a7af
--- /dev/null
+++ b/input/platform_app.te
@@ -0,0 +1,4 @@
+allow platform_app screen_protector_detector_service:service_manager find;
+allow platform_app touch_context_service:service_manager find;
+allow platform_app gril_antenna_tuning_service:service_manager find;
+binder_call(platform_app, twoshay)
diff --git a/input/service.te b/input/service.te
new file mode 100644
index 0000000..d59328b
--- /dev/null
+++ b/input/service.te
@@ -0,0 +1,3 @@
+type gril_antenna_tuning_service, service_manager_type, hal_service_type;
+type touch_context_service, service_manager_type, hal_service_type;
+type screen_protector_detector_service, service_manager_type, hal_service_type;
diff --git a/input/service_contexts b/input/service_contexts
new file mode 100644
index 0000000..f48eee4
--- /dev/null
+++ b/input/service_contexts
@@ -0,0 +1,3 @@
+com.google.input.algos.gril.IGrilAntennaTuningService/default u:object_r:gril_antenna_tuning_service:s0
+com.google.input.ITouchContextService/default u:object_r:touch_context_service:s0
+com.google.input.algos.spd.IScreenProtectorDetectorService/default u:object_r:screen_protector_detector_service:s0
diff --git a/input/touchflow_debug/file_contexts b/input/touchflow_debug/file_contexts
new file mode 100644
index 0000000..ff6aa22
--- /dev/null
+++ b/input/touchflow_debug/file_contexts
@@ -0,0 +1,3 @@
+/vendor/bin/hw/android\.hardware\.input\.processor-reflector u:object_r:hal_input_processor_default_exec:s0
+/vendor/bin/twoshay_touchflow u:object_r:twoshay_exec:s0
+
diff --git a/input/twoshay.te b/input/twoshay.te
new file mode 100644
index 0000000..1cbbbc6
--- /dev/null
+++ b/input/twoshay.te
@@ -0,0 +1,26 @@
+type twoshay, domain;
+type twoshay_exec, exec_type, vendor_file_type, file_type;
+
+init_daemon_domain(twoshay)
+
+allow twoshay touch_offload_device:chr_file rw_file_perms;
+allow twoshay twoshay:capability sys_nice;
+
+binder_use(twoshay)
+add_service(twoshay, screen_protector_detector_service)
+add_service(twoshay, touch_context_service)
+add_service(twoshay, gril_antenna_tuning_service)
+binder_call(twoshay, platform_app)
+
+allow twoshay fwk_stats_service:service_manager find;
+binder_call(twoshay, stats_service_server)
+
+# Allow dumpsys output in bugreports.
+allow twoshay dumpstate:fd use;
+allow twoshay dumpstate:fifo_file write;
+
+# b/198755236
+dontaudit twoshay twoshay:capability dac_override;
+
+# b/226830650
+dontaudit twoshay boot_status_prop:file read;