typeattribute vendor_init data_between_core_and_vendor_violators;

allow vendor_init {
  dhcp_data_file
  elabel_data_file
  media_rw_data_file
  system_data_file
  tombstone_data_file
  wifi_data_file
}:dir { create search getattr open read setattr ioctl write add_name remove_name rmdir relabelfrom };

allow vendor_init debugfs_clk:file w_file_perms;
allow vendor_init proc_uid_cpupower:file write;
allow vendor_init proc_swappiness:file w_file_perms;
dontaudit vendor_init kernel:system module_request;

# Allow vendor_init to write to /proc/sysrq-trigger on userdebug and eng builds
userdebug_or_eng(`
  allow vendor_init proc_sysrq:file w_file_perms;
')

set_prop(vendor_init, vendor_bluetooth_prop)
set_prop(vendor_init, camera_prop)
set_prop(vendor_init, modem_diag_prop)
set_prop(vendor_init, power_prop)
set_prop(vendor_init, public_vendor_default_prop)
set_prop(vendor_init, vendor_radio_prop)
set_prop(vendor_init, thermal_prop)
set_prop(vendor_init, vendor_charge_prop)

dontaudit vendor_init unlabeled:dir getattr;
dontaudit vendor_init unlabeled:file getattr;

allow vendor_init debugfs_tracing_instances:dir create_dir_perms;
allow vendor_init debugfs_tracing_instances:file w_file_perms;

# Write to touch vrmode node
allow vendor_init sysfs_touch:file w_file_perms;