Add properties to configure whether the lazy tuner is enabled.
ro.tuner.lazyhal: system_vendor_config_prop to decide whether the lazy
tuner HAL is enabled.
tuner.server.enable: system_internal_prop to decide whether tuner server
should be enabled.
Bug: 236002754
Test: Check tuner HAL and framework behavior
Change-Id: I6a2ebced0e0261f669e7bda466f46556dedca016
diff --git a/private/compat/33.0/33.0.ignore.cil b/private/compat/33.0/33.0.ignore.cil
index e943a6d..a032401 100644
--- a/private/compat/33.0/33.0.ignore.cil
+++ b/private/compat/33.0/33.0.ignore.cil
@@ -12,6 +12,8 @@
permissive_mte_prop
servicemanager_prop
system_net_netd_service
+ tuner_config_prop
+ tuner_server_ctl_prop
virtual_face_hal_prop
virtual_fingerprint_hal_prop
))
diff --git a/private/mediatuner.te b/private/mediatuner.te
index 413d2e5..bfb264e 100644
--- a/private/mediatuner.te
+++ b/private/mediatuner.te
@@ -17,6 +17,9 @@
allow mediatuner package_native_service:service_manager find;
binder_call(mediatuner, system_server)
+# Read ro.tuner.lazyhal
+get_prop(mediatuner, tuner_config_prop)
+
###
### neverallow rules
###
diff --git a/private/property.te b/private/property.te
index 871b673..ddb427d 100644
--- a/private/property.te
+++ b/private/property.te
@@ -38,6 +38,7 @@
system_internal_prop(snapuserd_prop)
system_internal_prop(system_adbd_prop)
system_internal_prop(traced_perf_enabled_prop)
+system_internal_prop(tuner_server_ctl_prop)
system_internal_prop(userspace_reboot_log_prop)
system_internal_prop(userspace_reboot_test_prop)
system_internal_prop(verity_status_prop)
diff --git a/private/property_contexts b/private/property_contexts
index 34bd80e..5cf27aa 100644
--- a/private/property_contexts
+++ b/private/property_contexts
@@ -1422,3 +1422,7 @@
vendor.fingerprint.virtual.operation_detect_interaction_latency u:object_r:virtual_fingerprint_hal_prop:s0 exact int
vendor.fingerprint.virtual.operation_enroll_latency u:object_r:virtual_fingerprint_hal_prop:s0 exact int
vendor.fingerprint.virtual.operation_authenticate_duration u:object_r:virtual_fingerprint_hal_prop:s0 exact int
+
+# properties for tuner
+ro.tuner.lazyhal u:object_r:tuner_config_prop:s0 exact bool
+tuner.server.enable u:object_r:tuner_server_ctl_prop:s0 exact bool
diff --git a/private/system_server.te b/private/system_server.te
index a7be343..b783446 100644
--- a/private/system_server.te
+++ b/private/system_server.te
@@ -820,6 +820,11 @@
# Read persist.wm.debug. properties
get_prop(system_server, persist_wm_debug_prop)
+# Read ro.tuner.lazyhal
+get_prop(system_server, tuner_config_prop)
+# Write tuner.server.enable
+set_prop(system_server, tuner_server_ctl_prop)
+
# Create a socket for connections from debuggerd.
allow system_server system_ndebug_socket:sock_file create_file_perms;
@@ -1291,6 +1296,13 @@
device_config_window_manager_native_boot_prop
}:property_service set;
+# Only allow system_server and init to set tuner_server_ctl_prop
+neverallow {
+ domain
+ -system_server
+ -init
+} tuner_server_ctl_prop:property_service set;
+
# system_server should never be executing dex2oat. This is either
# a bug (for example, bug 16317188), or represents an attempt by
# system server to dynamically load a dex file, something we do not