Add selinux policies for traced_relay.relay_port sysprop

Define the traced_relay.relay_port sysprop as system internal
property and allowed traced_relay to read it. This property should only
be settable in debug builds.

Test: build perfetto in Android tree and use it
Bug: 393210308
Change-Id: I7f44eef6216cd83876f675737e288b9cab6905d1
diff --git a/private/property.te b/private/property.te
index dec43e1..45a7041 100644
--- a/private/property.te
+++ b/private/property.te
@@ -58,6 +58,7 @@
 system_internal_prop(system_audio_config_prop)
 system_internal_prop(timezone_metadata_prop)
 system_internal_prop(traced_perf_enabled_prop)
+system_internal_prop(traced_relay_relay_port_prop)
 system_internal_prop(uprobestats_start_with_config_prop)
 system_internal_prop(tuner_server_ctl_prop)
 system_internal_prop(userspace_reboot_log_prop)
diff --git a/private/property_contexts b/private/property_contexts
index fa82e29..0fd4399 100644
--- a/private/property_contexts
+++ b/private/property_contexts
@@ -88,6 +88,7 @@
 persist.security.       u:object_r:system_prop:s0
 persist.traced.enable   u:object_r:traced_enabled_prop:s0
 traced.lazy.            u:object_r:traced_lazy_prop:s0
+traced_relay.relay_port u:object_r:traced_relay_relay_port_prop:s0
 persist.heapprofd.enable u:object_r:heapprofd_enabled_prop:s0
 persist.traced_perf.enable u:object_r:traced_perf_enabled_prop:s0
 uprobestats.start_with_config u:object_r:uprobestats_start_with_config_prop:s0
diff --git a/private/traced.te b/private/traced.te
index 8a29541..1aaf0d1 100644
--- a/private/traced.te
+++ b/private/traced.te
@@ -56,6 +56,9 @@
 # Allow traced to detect if a process is frozen (b/381089063).
 allow traced cgroup_v2:file r_file_perms;
 
+# Allow traced_relay to read the relay port being used
+get_prop(traced, traced_relay_relay_port_prop)
+
 # Allow setting debug properties which guard initialization of the Perfetto SDK
 # in SurfaceFlinger and HWUI's copy of Skia.
 # Required for the android.sdk_sysprop_guard data source.