Merge "Let adbd set service.adb.tcp.port."

This commit is contained in:
Josh Gao 2020-11-10 00:32:25 +00:00 committed by Gerrit Code Review
commit 1fcd3d9e8c
4 changed files with 16 additions and 5 deletions

View file

@ -87,8 +87,9 @@ set_prop(adbd, powerctl_prop)
get_prop(adbd, ffs_config_prop)
set_prop(adbd, ffs_control_prop)
# Set service.adb.tls.port, persist.adb.wifi. properties
# Set service.adb.tcp.port, service.adb.tls.port, persist.adb.wifi.* properties
set_prop(adbd, adbd_prop)
set_prop(adbd, adbd_config_prop)
# Allow adbd start/stop mdnsd via ctl.start
set_prop(adbd, ctl_mdnsd_prop)
@ -105,9 +106,6 @@ get_prop(adbd, test_harness_prop)
# 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)

View file

@ -325,6 +325,16 @@ neverallow {
system_adbd_prop
}:property_service set;
# Let (vendor_)init, adbd, and system_server set service.adb.tcp.port
neverallow {
-init
-vendor_init
-adbd
-system_server
} {
adbd_config_prop
}:property_service set;
neverallow {
# Only allow init and adbd to set adbd_prop
-init

View file

@ -5,3 +5,6 @@ dontaudit vendor_init sysfs:dir write;
# TODO(b/140259336) We want to remove vendor_init in the long term but allow for now
allow vendor_init system_data_root_file:dir rw_dir_perms;
# Let vendor_init set service.adb.tcp.port.
set_prop(vendor_init, adbd_config_prop)

View file

@ -112,7 +112,6 @@ compatible_property_only(`
# 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)
@ -160,6 +159,7 @@ system_vendor_config_prop(zram_config_prop)
system_vendor_config_prop(zygote_config_prop)
# Properties with no restrictions
system_public_prop(adbd_config_prop)
system_public_prop(audio_prop)
system_public_prop(bluetooth_a2dp_offload_prop)
system_public_prop(bluetooth_audio_hal_prop)