diff --git a/init.common.diag.rc.userdebug b/init.common.diag.rc.userdebug index a678b810d..d792b498d 100644 --- a/init.common.diag.rc.userdebug +++ b/init.common.diag.rc.userdebug @@ -125,3 +125,12 @@ on property:persist.sys.crash_rcu=true on property:persist.sys.crash_rcu=false write /proc/sys/kernel/panic_on_rcu_stall 0 + + +on property:sys.logger.bluetooth=true + setprop persist.service.bdroid.snooplog true + setprop persist.service.bdroid.fwsnoop true + +on property:sys.logger.bluetooth=false + setprop persist.service.bdroid.snooplog false + setprop persist.service.bdroid.fwsnoop false diff --git a/sepolicy/file.te b/sepolicy/file.te index a7f02af0d..b18705b44 100644 --- a/sepolicy/file.te +++ b/sepolicy/file.te @@ -36,6 +36,7 @@ type sysfs_soc, sysfs_type, fs_type, mlstrustedobject; type sysfs_timestamp_switch, sysfs_type, fs_type; type sysfs_video, sysfs_type, fs_type; type sysfs_wifi, sysfs_type, fs_type, mlstrustedobject; +type sysfs_diag, fs_type, sysfs_type; # debugfs type debugfs_msm_core, debugfs_type, fs_type; diff --git a/sepolicy/genfs_contexts b/sepolicy/genfs_contexts index 2517b9011..9e1bee18b 100644 --- a/sepolicy/genfs_contexts +++ b/sepolicy/genfs_contexts @@ -54,6 +54,7 @@ genfscon sysfs /devices/soc/qpnp-smbcharger-16/power_supply/battery/capacity u:o genfscon sysfs /devices/virtual/timed_output/vibrator/voltage_level u:object_r:sysfs_vibrator:s0 genfscon sysfs /module/diagchar/parameters/timestamp_switch u:object_r:sysfs_timestamp_switch:s0 genfscon sysfs /devices/soc/qpnp-smbcharger-16/power_supply/battery/system_temp_level u:object_r:sysfs_msm_subsys:s0 +genfscon sysfs /module/diagchar u:object_r:sysfs_diag:s0 # debugfs genfscon debugfs /kgsl/proc u:object_r:debugfs_kgsl:s0 diff --git a/sepolicy/logger_app.te b/sepolicy/logger_app.te index 2813feb2d..5d87df77f 100644 --- a/sepolicy/logger_app.te +++ b/sepolicy/logger_app.te @@ -17,4 +17,5 @@ userdebug_or_eng(` allow logger_app cnss_vendor_data_file:file create_file_perms; set_prop(logger_app, cnss_diag_prop); + set_prop(logger_app, bluetooth_log_prop) ') diff --git a/sepolicy/property.te b/sepolicy/property.te index 5866416b3..91bb598ca 100644 --- a/sepolicy/property.te +++ b/sepolicy/property.te @@ -9,3 +9,4 @@ type thermal_prop, property_type; type ramdump_prop, property_type; type sys_time_prop, property_type; type post_boot_prop, property_type; +type bluetooth_log_prop, property_type; diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts index 325b4cde1..68e9df431 100644 --- a/sepolicy/property_contexts +++ b/sepolicy/property_contexts @@ -14,3 +14,4 @@ sys.qcom.thermalcfg u:object_r:thermal_prop:s0 ctl.thermal-engine u:object_r:thermal_prop:s0 sys.time.set u:object_r:sys_time_prop:s0 sys.post_boot.parsed u:object_r:post_boot_prop:s0 +sys.logger.bluetooth u:object_r:bluetooth_log_prop:s0 diff --git a/sepolicy/wcnss_filter.te b/sepolicy/wcnss_filter.te index 2b949b33e..e96fa320f 100644 --- a/sepolicy/wcnss_filter.te +++ b/sepolicy/wcnss_filter.te @@ -15,6 +15,8 @@ allow wcnss_filter proc_sysrq:file w_file_perms; # access to /dev/diag on debug builds userdebug_or_eng(` allow wcnss_filter diag_device:chr_file rw_file_perms; + allow wcnss_filter sysfs_timestamp_switch:file r_file_perms; + r_dir_file(wcnss_filter, sysfs_diag) ') # Allow reading Bluetooth-related system properties