universal7885: parts: hidl: Move to /system

* Sepolicy issues, need to be in /system to write data to files. While we're on it, move fm radio hal too
This commit is contained in:
roynatech2544 2022-04-27 13:30:58 +09:00
commit af754b5f92
No known key found for this signature in database
GPG key ID: 50ABF73F0D19445D
22 changed files with 50 additions and 54 deletions

View file

@ -0,0 +1,2 @@
# FM Radio
type fm_radio_device, dev_type;

View file

@ -0,0 +1 @@
type sysfs_fmradio_tune, sysfs_type, rw_fs_type, fs_type;

View file

@ -2,7 +2,15 @@
### DATA
/data/zram(/.*)? u:object_r:zram_data_file:s0
/data/swap(/.*)? u:object_r:parts_data_file:s0
# Eureka Bootlogger
/system/bin/eklogger u:object_r:eklogger_exec:s0
/data/debug(/.*)? u:object_r:eklogger_data_file:s0
# SamsungParts
/(vendor|system/vendor)/bin/vendor\.eureka\.hardware\.parts@[0-9]\.[0-9]-service u:object_r:hal_parts_default_exec:s0
# FMRadio
/(vendor|system/vendor)/bin/vendor\.eureka\.hardware\.fmradio@[0-9]\.[0-9]-service u:object_r:hal_fmradio_default_exec:s0
/dev/radio0 u:object_r:fm_radio_device:s0

View file

@ -0,0 +1,2 @@
## FMRadio
genfscon sysfs /devices/virtual/s610_radio/s610_radio/ u:object_r:sysfs_fmradio_tune:s0

View file

@ -0,0 +1,12 @@
type hal_fmradio_default, domain;
type hal_fmradio_default_exec, exec_type, file_type, system_file_type;
add_hwservice(hal_fmradio_default, hal_fmradio_hwservice);
init_daemon_domain(hal_fmradio_default);
hwbinder_use(hal_fmradio_default);
get_prop(hal_fmradio_default, hwservicemanager_prop);
allow hal_fmradio_default sysfs_fmradio_tune:file rw_file_perms;
allow hal_fmradio_default sysfs_fmradio_tune:dir search;
allow hal_fmradio_default sysfs_virtual:dir search;

View file

@ -0,0 +1,35 @@
type hal_parts_default, domain, coredomain;
type hal_parts_default_exec, exec_type, file_type, system_file_type;
add_hwservice(hal_parts_default, hal_parts_hwservice);
init_daemon_domain(hal_parts_default);
hwbinder_use(hal_parts_default);
get_prop(hal_parts_default, hwservicemanager_prop);
# Battery
allow hal_parts_default sysfs_sec_switch:dir { search };
allow hal_parts_default sysfs_sec_switch_writable:file rw_file_perms;
allow hal_parts_default sysfs_battery_writable:file rw_file_perms;
allow hal_parts_default sysfs_sec_switch_writable:dir { search };
allow hal_parts_default sysfs_battery_writable:dir { search };
allow hal_parts_default sysfs_battery:dir { search };
allow hal_parts_default sysfs_virtual:dir search;
allow hal_parts_default self:capability setuid;
# FlashLight
allow hal_parts_default sysfs_flashlight:file { read open write getattr };
allow hal_parts_default sysfs_flashlight:dir search;
allow hal_parts_default sysfs_virtual:dir search;
# Display
allow hal_parts_default sysfs_sec_touchscreen:dir search;
allow hal_parts_default sysfs_touchscreen_writable:file rw_file_perms;
# Swap
type parts_data_file, file_type, data_file_type, core_data_file_type;
allow hal_parts_default parts_data_file:dir rw_dir_perms;
allow hal_parts_default parts_data_file:file rw_file_perms;
allow hal_parts_default parts_data_file:file create_file_perms;
allow hal_parts_default shell_exec:file rx_file_perms;
allow hal_parts_default toolbox_exec:file rx_file_perms;
allow hal_parts_default self:capability sys_admin;

View file

@ -0,0 +1,2 @@
type hal_parts_hwservice, hwservice_manager_type;
type hal_fmradio_hwservice, hwservice_manager_type;

View file

@ -0,0 +1,8 @@
# SamsungParts
vendor.eureka.hardware.parts::IBatteryStats u:object_r:hal_parts_hwservice:s0
vendor.eureka.hardware.parts::IFlashBrightness u:object_r:hal_parts_hwservice:s0
vendor.eureka.hardware.parts::IDisplayConfigs u:object_r:hal_parts_hwservice:s0
vendor.eureka.hardware.parts::ISwapOnData u:object_r:hal_parts_hwservice:s0
# FMRadio
vendor.eureka.hardware.fmradio::IFMRadio u:object_r:hal_fmradio_hwservice:s0

View file

@ -0,0 +1,14 @@
# SamsungParts
allow system_app hal_parts_hwservice:hwservice_manager find;
allow system_app hal_parts_default:binder call;
r_dir_file(system_app, parts_data_file)
# FMRadio
allow system_app hal_fmradio_hwservice:hwservice_manager find;
allow system_app hal_fmradio_default:binder call;
allow system_app fm_radio_device:chr_file { read write open ioctl };