Prefetch: Add sepolicy to control prefetch properties
1: Add prefetch tunable property
2: Default path to store the prefetch record is in /metadata/prefetch/
3: Add policy to control the service
4: Allow init to start/stop the service
Bug: 362507272
Test: Test prefetch record/replay with enforcing mode
Change-Id: I55cbf4f2110da298a8d7df52daad08eaedebd061
Signed-off-by: Akilesh Kailash <akailash@google.com>
diff --git a/private/property_contexts b/private/property_contexts
index 6c74fb0..23c2399 100644
--- a/private/property_contexts
+++ b/private/property_contexts
@@ -203,6 +203,11 @@
ctl.stop$snapuserd u:object_r:ctl_snapuserd_prop:s0
ctl.restart$snapuserd u:object_r:ctl_snapuserd_prop:s0
+# Restrict access to control prefetch
+ctl.start$prefetch u:object_r:ctl_prefetch_prop:s0
+ctl.stop$prefetch u:object_r:ctl_prefetch_prop:s0
+ctl.restart$prefetch u:object_r:ctl_prefetch_prop:s0
+
# Restrict access to control uprobestats
ctl.start$uprobestats u:object_r:ctl_uprobestats_prop:s0
ctl.stop$uprobestats u:object_r:ctl_uprobestats_prop:s0
@@ -355,6 +360,13 @@
ro.enable_boot_charger_mode u:object_r:charger_config_prop:s0 exact bool
ro.product.charger.unplugged_shutdown_time u:object_r:charger_config_prop:s0 exact int
+# Prefetch boot properties
+ro.prefetch_boot.enabled u:object_r:prefetch_boot_prop:s0 exact bool
+ro.prefetch_boot.trace_buffer_size_kib u:object_r:prefetch_boot_prop:s0 exact int
+ro.prefetch_boot.duration_s u:object_r:prefetch_boot_prop:s0 exact int
+ro.prefetch_boot.io_depth u:object_r:prefetch_boot_prop:s0 exact int
+ro.prefetch_boot.max_fds u:object_r:prefetch_boot_prop:s0 exact int
+
# Virtual A/B and snapuserd properties
ro.virtual_ab.enabled u:object_r:virtual_ab_prop:s0 exact bool
ro.virtual_ab.retrofit u:object_r:virtual_ab_prop:s0 exact bool