Rename system_radio_prop

For whatever reason sys.usb.config* has been labeled as
system_radio_prop, which doesn't make sense. Changing context name as
usb_prop. For the same reason exported_system_radio_prop is also
renamed to usb-related names.

Bug: 71814576
Bug: 154885206
Test: m selinux_policy
Change-Id: If30bc620dbeac926a8b9bcde908357fda739a6c1
Merged-In: If30bc620dbeac926a8b9bcde908357fda739a6c1
(cherry picked from commit 44fbcdb677d040a7ff9949db8457347a5299b4a0)
diff --git a/private/charger.te b/private/charger.te
index 13d1b14..719ae3c 100644
--- a/private/charger.te
+++ b/private/charger.te
@@ -4,7 +4,6 @@
 # process when running in charger mode.
 set_prop(charger, system_prop)
 set_prop(charger, exported_system_prop)
-set_prop(charger, exported2_system_prop)
 set_prop(charger, exported3_system_prop)
 
 get_prop(charger, charger_prop)
diff --git a/private/compat/27.0/27.0.ignore.cil b/private/compat/27.0/27.0.ignore.cil
index 504d0b6..3d649a0 100644
--- a/private/compat/27.0/27.0.ignore.cil
+++ b/private/compat/27.0/27.0.ignore.cil
@@ -187,6 +187,8 @@
     untrusted_app_all_devpts
     update_engine_log_data_file
     uri_grants_service
+    usb_config_prop
+    usb_control_prop
     usbd
     usbd_exec
     usbd_tmpfs
diff --git a/private/compat/30.0/30.0.cil b/private/compat/30.0/30.0.cil
index 767324d..973d580 100644
--- a/private/compat/30.0/30.0.cil
+++ b/private/compat/30.0/30.0.cil
@@ -3,10 +3,12 @@
 (type exported_dalvik_prop)
 (type exported_ffs_prop)
 (type exported_fingerprint_prop)
+(type exported_system_radio_prop)
 (type exported_vold_prop)
 (type exported2_config_prop)
 (type exported2_vold_prop)
 (type ffs_prop)
+(type system_radio_prop)
 
 (expandtypeattribute (DockObserver_service_30_0) true)
 (expandtypeattribute (IProxyService_service_30_0) true)
@@ -1379,7 +1381,10 @@
 (typeattributeset exported_radio_prop_30_0 (exported_radio_prop))
 (typeattributeset exported_secure_prop_30_0 (exported_secure_prop))
 (typeattributeset exported_system_prop_30_0 (exported_system_prop))
-(typeattributeset exported_system_radio_prop_30_0 (exported_system_radio_prop))
+(typeattributeset exported_system_radio_prop_30_0
+  ( exported_system_radio_prop
+    usb_config_prop
+    usb_control_prop))
 (typeattributeset exported_vold_prop_30_0 (exported_vold_prop vold_status_prop))
 (typeattributeset exported_wifi_prop_30_0 (exported_wifi_prop))
 (typeattributeset external_vibrator_service_30_0 (external_vibrator_service))
@@ -2008,7 +2013,7 @@
 (typeattributeset system_net_netd_hwservice_30_0 (system_net_netd_hwservice))
 (typeattributeset system_passwd_file_30_0 (system_passwd_file))
 (typeattributeset system_prop_30_0 (system_prop))
-(typeattributeset system_radio_prop_30_0 (system_radio_prop))
+(typeattributeset system_radio_prop_30_0 (system_radio_prop usb_prop))
 (typeattributeset system_seccomp_policy_file_30_0 (system_seccomp_policy_file))
 (typeattributeset system_security_cacerts_file_30_0 (system_security_cacerts_file))
 (typeattributeset system_server_30_0 (system_server))
diff --git a/private/coredomain.te b/private/coredomain.te
index bf6cdd5..887f51a 100644
--- a/private/coredomain.te
+++ b/private/coredomain.te
@@ -6,6 +6,9 @@
 get_prop(coredomain, hdmi_config_prop)
 get_prop(coredomain, dalvik_runtime_prop)
 
+get_prop(coredomain, usb_config_prop)
+get_prop(coredomain, usb_control_prop)
+
 full_treble_only(`
 neverallow {
     coredomain
diff --git a/private/domain.te b/private/domain.te
index 5bbb8d4..bdf5ebd 100644
--- a/private/domain.te
+++ b/private/domain.te
@@ -75,7 +75,6 @@
     get_prop(domain, boot_status_prop)
     get_prop(domain, core_property_type)
     get_prop(domain, dalvik_config_prop)
-    get_prop(domain, exported_system_radio_prop)
     get_prop(domain, exported2_radio_prop)
     get_prop(domain, exported2_system_prop)
     get_prop(domain, exported3_default_prop)
@@ -90,7 +89,6 @@
     get_prop({coredomain appdomain shell}, boot_status_prop)
     get_prop({coredomain appdomain shell}, core_property_type)
     get_prop({coredomain appdomain shell}, dalvik_config_prop)
-    get_prop({coredomain appdomain shell}, exported_system_radio_prop)
     get_prop({coredomain appdomain shell}, exported2_radio_prop)
     get_prop({coredomain appdomain shell}, exported2_system_prop)
     get_prop({coredomain appdomain shell}, exported3_default_prop)
diff --git a/private/property.te b/private/property.te
index 0ea7a40..fd8ea3b 100644
--- a/private/property.te
+++ b/private/property.te
@@ -86,7 +86,7 @@
   -restorecon_prop
   -shell_prop
   -system_prop
-  -system_radio_prop
+  -usb_prop
   -vold_prop
 }:file no_rw_file_perms;
 
@@ -137,11 +137,11 @@
     exported_default_prop
     exported_dumpstate_prop
     exported_system_prop
-    exported_system_radio_prop
     exported2_default_prop
     exported2_system_prop
     exported3_default_prop
     exported3_system_prop
+    usb_control_prop
     -nfc_prop
     -powerctl_prop
     -radio_prop
@@ -235,7 +235,6 @@
     core_property_type
     dalvik_config_prop
     extended_core_property_type
-    exported_system_radio_prop
     exported2_system_prop
     exported3_default_prop
     exported3_system_prop
@@ -361,3 +360,11 @@
   -system_server
   -vendor_init
 } dalvik_runtime_prop:property_service set;
+
+neverallow {
+  -coredomain
+  -vendor_init
+} {
+  usb_config_prop
+  usb_control_prop
+}:property_service set;
diff --git a/private/property_contexts b/private/property_contexts
index 93e9845..3d10cad 100644
--- a/private/property_contexts
+++ b/private/property_contexts
@@ -9,7 +9,6 @@
 net.lte                 u:object_r:net_radio_prop:s0
 net.cdma                u:object_r:net_radio_prop:s0
 net.dns                 u:object_r:net_dns_prop:s0
-sys.usb.config          u:object_r:system_radio_prop:s0
 ril.                    u:object_r:radio_prop:s0
 ro.ril.                 u:object_r:radio_prop:s0
 gsm.                    u:object_r:radio_prop:s0
@@ -481,9 +480,16 @@
 
 sendbug.preferred.domain u:object_r:exported3_default_prop:s0 exact string
 
-sys.usb.controller      u:object_r:exported2_system_prop:s0 exact string
-sys.usb.mtp.device_type u:object_r:exported2_system_prop:s0 exact int
-sys.usb.state           u:object_r:exported2_system_prop:s0 exact string
+persist.sys.usb.usbradio.config u:object_r:usb_control_prop:s0 exact string
+
+sys.usb.config     u:object_r:usb_control_prop:s0 exact string
+sys.usb.configfs   u:object_r:usb_control_prop:s0 exact int
+sys.usb.controller u:object_r:usb_control_prop:s0 exact string
+sys.usb.state      u:object_r:usb_control_prop:s0 exact string
+
+sys.usb.mtp.device_type u:object_r:usb_config_prop:s0 exact int
+
+sys.usb.config. u:object_r:usb_prop:s0
 
 sys.usb.ffs.aio_compat u:object_r:ffs_config_prop:s0 exact bool
 sys.usb.ffs.max_read   u:object_r:ffs_config_prop:s0 exact int
@@ -510,14 +516,10 @@
 
 persist.sys.device_provisioned  u:object_r:exported3_system_prop:s0 exact string
 persist.sys.theme               u:object_r:theme_prop:s0 exact string
-persist.sys.usb.usbradio.config u:object_r:exported3_system_prop:s0 exact string
 
 sys.retaildemo.enabled  u:object_r:exported3_system_prop:s0 exact int
 sys.user.0.ce_available u:object_r:exported3_system_prop:s0 exact bool
 
-sys.usb.config   u:object_r:exported_system_radio_prop:s0 exact string
-sys.usb.configfs u:object_r:exported_system_radio_prop:s0 exact int
-
 aac_drc_boost            u:object_r:aac_drc_prop:s0 exact int
 aac_drc_cut              u:object_r:aac_drc_prop:s0 exact int
 aac_drc_enc_target_level u:object_r:aac_drc_prop:s0 exact int
diff --git a/private/recovery.te b/private/recovery.te
index e1151a4..bb22914 100644
--- a/private/recovery.te
+++ b/private/recovery.te
@@ -14,8 +14,8 @@
   set_prop(recovery, ffs_control_prop)
 
   # Set sys.usb.config when switching into fastboot.
-  set_prop(recovery, system_radio_prop)
-  set_prop(recovery, exported_system_radio_prop)
+  set_prop(recovery, usb_control_prop)
+  set_prop(recovery, usb_prop)
 
   # Read ro.boot.bootreason
   get_prop(recovery, bootloader_boot_reason_prop)
diff --git a/private/system_app.te b/private/system_app.te
index 73acb95..e160ff4 100644
--- a/private/system_app.te
+++ b/private/system_app.te
@@ -48,13 +48,13 @@
 set_prop(system_app, exported3_system_prop)
 set_prop(system_app, logd_prop)
 set_prop(system_app, net_radio_prop)
-set_prop(system_app, system_radio_prop)
-set_prop(system_app, exported_system_radio_prop)
+set_prop(system_app, usb_control_prop)
+set_prop(system_app, usb_prop)
 set_prop(system_app, log_tag_prop)
 userdebug_or_eng(`set_prop(system_app, logpersistd_logging_prop)')
 auditallow system_app net_radio_prop:property_service set;
-auditallow system_app system_radio_prop:property_service set;
-auditallow system_app exported_system_radio_prop:property_service set;
+auditallow system_app usb_control_prop:property_service set;
+auditallow system_app usb_prop:property_service set;
 # Allow Settings to enable Dynamic System Update
 set_prop(system_app, dynamic_system_prop)
 
diff --git a/private/system_server.te b/private/system_server.te
index 67af9be..a049696 100644
--- a/private/system_server.te
+++ b/private/system_server.te
@@ -605,8 +605,8 @@
 set_prop(system_server, dhcp_prop)
 set_prop(system_server, net_radio_prop)
 set_prop(system_server, net_dns_prop)
-set_prop(system_server, system_radio_prop)
-set_prop(system_server, exported_system_radio_prop)
+set_prop(system_server, usb_control_prop)
+set_prop(system_server, usb_prop)
 set_prop(system_server, debug_prop)
 set_prop(system_server, powerctl_prop)
 set_prop(system_server, fingerprint_prop)
diff --git a/public/property.te b/public/property.te
index 063672a..108c78e 100644
--- a/public/property.te
+++ b/public/property.te
@@ -91,9 +91,9 @@
     system_restricted_prop(pan_result_prop)
     system_restricted_prop(persist_debug_prop)
     system_restricted_prop(shell_prop)
-    system_restricted_prop(system_radio_prop)
     system_restricted_prop(test_harness_prop)
     system_restricted_prop(theme_prop)
+    system_restricted_prop(usb_prop)
     system_restricted_prop(use_memfd_prop)
     system_restricted_prop(vold_prop)
 ')
@@ -117,6 +117,7 @@
 system_vendor_config_prop(storage_config_prop)
 system_vendor_config_prop(surfaceflinger_prop)
 system_vendor_config_prop(systemsound_config_prop)
+system_vendor_config_prop(usb_config_prop)
 system_vendor_config_prop(userspace_reboot_config_prop)
 system_vendor_config_prop(vehicle_hal_prop)
 system_vendor_config_prop(vendor_security_patch_level_prop)
@@ -146,7 +147,6 @@
 system_public_prop(exported_overlay_prop)
 system_public_prop(exported_pm_prop)
 system_public_prop(exported_radio_prop)
-system_public_prop(exported_system_radio_prop)
 system_public_prop(exported_wifi_prop)
 system_public_prop(ffs_control_prop)
 system_public_prop(sota_prop)
@@ -164,6 +164,7 @@
 system_public_prop(serialno_prop)
 system_public_prop(surfaceflinger_color_prop)
 system_public_prop(system_prop)
+system_public_prop(usb_control_prop)
 system_public_prop(wifi_log_prop)
 system_public_prop(wifi_prop)
 system_public_prop(zram_control_prop)
@@ -227,9 +228,9 @@
     system_public_prop(pan_result_prop)
     system_public_prop(persist_debug_prop)
     system_public_prop(shell_prop)
-    system_public_prop(system_radio_prop)
     system_public_prop(test_harness_prop)
     system_public_prop(theme_prop)
+    system_public_prop(usb_prop)
     system_public_prop(use_memfd_prop)
     system_public_prop(vold_prop)
 ')
@@ -269,5 +270,5 @@
 typeattribute restorecon_prop    core_property_type;
 typeattribute shell_prop         core_property_type;
 typeattribute system_prop        core_property_type;
-typeattribute system_radio_prop  core_property_type;
+typeattribute usb_prop           core_property_type;
 typeattribute vold_prop          core_property_type;
diff --git a/public/vendor_init.te b/public/vendor_init.te
index a745e52..6c9a8b8 100644
--- a/public/vendor_init.te
+++ b/public/vendor_init.te
@@ -219,7 +219,6 @@
 set_prop(vendor_init, exported_overlay_prop)
 set_prop(vendor_init, exported_pm_prop)
 set_prop(vendor_init, exported_radio_prop)
-set_prop(vendor_init, exported_system_radio_prop)
 set_prop(vendor_init, exported_wifi_prop)
 set_prop(vendor_init, exported2_system_prop)
 set_prop(vendor_init, exported3_default_prop)
@@ -233,6 +232,7 @@
 set_prop(vendor_init, rebootescrow_hal_prop)
 set_prop(vendor_init, serialno_prop)
 set_prop(vendor_init, surfaceflinger_color_prop)
+set_prop(vendor_init, usb_control_prop)
 set_prop(vendor_init, userspace_reboot_config_prop)
 set_prop(vendor_init, vehicle_hal_prop)
 set_prop(vendor_init, vendor_default_prop)