Allow vendor_init to set service.adb.tcp.port

adbd and apps (SystemUI and CTS test apps) need to read it.

BUG: 162205386
Test: Connect to device which sets service.adb.tcp.port in vendor
      partition through TCP adb.

Change-Id: Ia37dd0dd3239381feb2a4484179a0c7847166b29
diff --git a/private/adbd.te b/private/adbd.te
index b03c62e..f2bf3b3 100644
--- a/private/adbd.te
+++ b/private/adbd.te
@@ -105,6 +105,9 @@
 # Read persist.adb.tls_server.enable property
 get_prop(adbd, system_adbd_prop)
 
+# Read service.adb.tcp.port property
+get_prop(adbd, adbd_config_prop)
+
 # Read device's overlayfs related properties and files
 userdebug_or_eng(`
   get_prop(adbd, persistent_properties_ready_prop)
diff --git a/private/app.te b/private/app.te
index 5b079c2..21a6b82 100644
--- a/private/app.te
+++ b/private/app.te
@@ -11,6 +11,7 @@
 get_prop(appdomain, telephony_config_prop)
 get_prop(appdomain, userspace_reboot_config_prop)
 get_prop(appdomain, vold_config_prop)
+get_prop(appdomain, adbd_config_prop)
 
 userdebug_or_eng(`perfetto_producer({ appdomain })')
 
diff --git a/private/compat/30.0/30.0.ignore.cil b/private/compat/30.0/30.0.ignore.cil
index 44a6799..e5e3b5a 100644
--- a/private/compat/30.0/30.0.ignore.cil
+++ b/private/compat/30.0/30.0.ignore.cil
@@ -5,6 +5,7 @@
 (typeattribute new_objects)
 (typeattributeset new_objects
   ( new_objects
+    adbd_config_prop
     apex_info_file
     debugfs_kprobes
     gnss_device
diff --git a/private/property_contexts b/private/property_contexts
index 357a56c..795aee6 100644
--- a/private/property_contexts
+++ b/private/property_contexts
@@ -45,7 +45,6 @@
 log.tag.WifiHAL         u:object_r:wifi_log_prop:s0
 security.perf_harden    u:object_r:shell_prop:s0
 service.adb.root        u:object_r:shell_prop:s0
-service.adb.tcp.port    u:object_r:shell_prop:s0
 service.adb.tls.port    u:object_r:adbd_prop:s0
 persist.adb.wifi.       u:object_r:adbd_prop:s0
 persist.adb.tls_server.enable  u:object_r:system_adbd_prop:s0
@@ -98,6 +97,9 @@
 # Fastbootd protocol control property
 fastbootd.protocol    u:object_r:fastbootd_protocol_prop:s0 exact enum usb tcp
 
+# adbd protoctl configuration property
+service.adb.tcp.port    u:object_r:adbd_config_prop:s0 exact int
+
 # Boolean property set by system server upon boot indicating
 # if device is fully owned by organization instead of being
 # a personal device.
diff --git a/public/property.te b/public/property.te
index 0d46625..7b28745 100644
--- a/public/property.te
+++ b/public/property.te
@@ -107,6 +107,7 @@
 
 # Properties which can be written only by vendor_init
 system_vendor_config_prop(aaudio_config_prop)
+system_vendor_config_prop(adbd_config_prop)
 system_vendor_config_prop(apk_verity_prop)
 system_vendor_config_prop(audio_config_prop)
 system_vendor_config_prop(build_odm_prop)