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

@ -2,7 +2,6 @@
cc_binary { cc_binary {
name: "vendor.eureka.hardware.fmradio@1.2-service", name: "vendor.eureka.hardware.fmradio@1.2-service",
proprietary: true,
srcs: [ srcs: [
"FMRadio.cpp", "FMRadio.cpp",
"service.cpp", "service.cpp",

View file

@ -1,4 +1,4 @@
service vendor.fm-hal /vendor/bin/vendor.eureka.hardware.fmradio@1.2-service service fm-hal /system/bin/vendor.eureka.hardware.fmradio@1.2-service
interface vendor.eureka.hardware.fmradio@1.0::IFMRadio default interface vendor.eureka.hardware.fmradio@1.0::IFMRadio default
interface vendor.eureka.hardware.fmradio@1.1::IFMRadio default interface vendor.eureka.hardware.fmradio@1.1::IFMRadio default
interface vendor.eureka.hardware.fmradio@1.2::IFMRadio default interface vendor.eureka.hardware.fmradio@1.2::IFMRadio default

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<manifest version="1.0" type="device"> <manifest version="1.0" type="framework">
<hal format="hidl"> <hal>
<name>vendor.eureka.hardware.fmradio</name> <name>vendor.eureka.hardware.fmradio</name>
<transport>hwbinder</transport> <transport>hwbinder</transport>
<version>1.2</version> <version>1.2</version>

View file

@ -2,7 +2,6 @@
cc_binary { cc_binary {
name: "vendor.eureka.hardware.parts@1.0-service", name: "vendor.eureka.hardware.parts@1.0-service",
proprietary: true,
srcs: [ srcs: [
"Battery.cpp", "Battery.cpp",
"FlashLight.cpp", "FlashLight.cpp",

View file

@ -1,4 +1,4 @@
service vendor.parts-hal /vendor/bin/vendor.eureka.hardware.parts@1.0-service service parts-hal /system/bin/vendor.eureka.hardware.parts@1.0-service
interface vendor.eureka.hardware.parts@1.0::IBatteryStats default interface vendor.eureka.hardware.parts@1.0::IBatteryStats default
interface vendor.eureka.hardware.parts@1.0::IDisplayConfigs default interface vendor.eureka.hardware.parts@1.0::IDisplayConfigs default
interface vendor.eureka.hardware.parts@1.0::IFlashBrightness default interface vendor.eureka.hardware.parts@1.0::IFlashBrightness default

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<manifest version="1.0" type="device"> <manifest version="1.0" type="framework">
<hal format="hidl"> <hal>
<name>vendor.eureka.hardware.parts</name> <name>vendor.eureka.hardware.parts</name>
<transport>hwbinder</transport> <transport>hwbinder</transport>
<version>1.0</version> <version>1.0</version>

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
/data/zram(/.*)? u:object_r:zram_data_file:s0 /data/zram(/.*)? u:object_r:zram_data_file:s0
/data/swap(/.*)? u:object_r:parts_data_file:s0
# Eureka Bootlogger # Eureka Bootlogger
/system/bin/eklogger u:object_r:eklogger_exec:s0 /system/bin/eklogger u:object_r:eklogger_exec:s0
/data/debug(/.*)? u:object_r:eklogger_data_file: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

@ -1,5 +1,5 @@
type hal_fmradio_default, domain; type hal_fmradio_default, domain;
type hal_fmradio_default_exec, exec_type, file_type, vendor_file_type; type hal_fmradio_default_exec, exec_type, file_type, system_file_type;
add_hwservice(hal_fmradio_default, hal_fmradio_hwservice); add_hwservice(hal_fmradio_default, hal_fmradio_hwservice);
init_daemon_domain(hal_fmradio_default); init_daemon_domain(hal_fmradio_default);

View file

@ -1,5 +1,5 @@
type hal_parts_default, domain; type hal_parts_default, domain, coredomain;
type hal_parts_default_exec, exec_type, file_type, vendor_file_type; type hal_parts_default_exec, exec_type, file_type, system_file_type;
add_hwservice(hal_parts_default, hal_parts_hwservice); add_hwservice(hal_parts_default, hal_parts_hwservice);
init_daemon_domain(hal_parts_default); init_daemon_domain(hal_parts_default);
@ -26,10 +26,10 @@ allow hal_parts_default sysfs_sec_touchscreen:dir search;
allow hal_parts_default sysfs_touchscreen_writable:file rw_file_perms; allow hal_parts_default sysfs_touchscreen_writable:file rw_file_perms;
# Swap # Swap
type parts_data_file, file_type, data_file_type; 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:dir rw_dir_perms;
allow hal_parts_default parts_data_file:file rw_file_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 parts_data_file:file create_file_perms;
allow hal_parts_default vendor_shell_exec:file rx_file_perms; allow hal_parts_default shell_exec:file rx_file_perms;
allow hal_parts_default vendor_toolbox_exec:file rx_file_perms; allow hal_parts_default toolbox_exec:file rx_file_perms;
allow hal_parts_default self:capability sys_admin; 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 };

View file

@ -5,9 +5,6 @@ type tz_user_device, dev_type;
# /dev/m2m1shot_scaler0 # /dev/m2m1shot_scaler0
type m2m1shot_device, dev_type; type m2m1shot_device, dev_type;
# FM Radio
type fm_radio_device, dev_type;
# gps # gps
type gps_device, dev_type; type gps_device, dev_type;

View file

@ -41,7 +41,7 @@ type sysfs_sec_touchscreen, sysfs_type, r_fs_type, fs_type;
type sysfs_sim, sysfs_type, r_fs_type, fs_type; type sysfs_sim, sysfs_type, r_fs_type, fs_type;
type sysfs_sensors, sysfs_type, r_fs_type, fs_type; type sysfs_sensors, sysfs_type, r_fs_type, fs_type;
type sysfs_wifi, sysfs_type, r_fs_type, fs_type; type sysfs_wifi, sysfs_type, r_fs_type, fs_type;
type sysfs_gpu, sysfs_type, r_fs_type, fs_type;
type sysfs_backlight_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_backlight_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_battery_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_battery_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_bt_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_bt_writable, sysfs_type, rw_fs_type, fs_type;
@ -100,9 +100,7 @@ type sysfs_input_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_batteryinfo_charger_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_batteryinfo_charger_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_camera_writable, sysfs_type, rw_fs_type, fs_type; type sysfs_camera_writable, sysfs_type, rw_fs_type, fs_type;
type sysfs_decon, sysfs_type, r_fs_type, fs_type; type sysfs_decon, sysfs_type, r_fs_type, fs_type;
type sysfs_gpu, sysfs_type, r_fs_type, fs_type;
type sysfs_socinfo, sysfs_type, r_fs_type, fs_type; type sysfs_socinfo, sysfs_type, r_fs_type, fs_type;
type sysfs_fmradio_tune, sysfs_type, rw_fs_type, fs_type;
type sysfs_v4l, sysfs_type, r_fs_type, fs_type; type sysfs_v4l, sysfs_type, r_fs_type, fs_type;
type sysfs_v4l_mfc, sysfs_type, r_fs_type, fs_type; type sysfs_v4l_mfc, sysfs_type, r_fs_type, fs_type;
type sysfs_v4l_smfc, sysfs_type, r_fs_type, fs_type; type sysfs_v4l_smfc, sysfs_type, r_fs_type, fs_type;

View file

@ -24,7 +24,6 @@
/data/vendor/log(/.*)? u:object_r:log_vendor_data_file:s0 /data/vendor/log(/.*)? u:object_r:log_vendor_data_file:s0
/data/vendor/log/cbd(/.*)? u:object_r:log_cbd_vendor_data_file:s0 /data/vendor/log/cbd(/.*)? u:object_r:log_cbd_vendor_data_file:s0
/data/vendor/secradio(/.*)? u:object_r:radio_vendor_data_file:s0 /data/vendor/secradio(/.*)? u:object_r:radio_vendor_data_file:s0
/data/swap(/.*)? u:object_r:parts_data_file:s0
### DEV ### DEV
/dev/block/platform/.+/by-name/boot u:object_r:boot_block_device:s0 /dev/block/platform/.+/by-name/boot u:object_r:boot_block_device:s0
@ -216,11 +215,5 @@
/(vendor|system/vendor)/bin/hw/vendor\.samsung\.hardware\.gnss@[0-9]\.[0-9]-service u:object_r:hal_gnss_default_exec:s0 /(vendor|system/vendor)/bin/hw/vendor\.samsung\.hardware\.gnss@[0-9]\.[0-9]-service u:object_r:hal_gnss_default_exec:s0
/(vendor|system/vendor)/firmware(/.*)? u:object_r:vendor_firmware_file:s0 /(vendor|system/vendor)/firmware(/.*)? u:object_r:vendor_firmware_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
/factory(/.*)? u:object_r:sec_efs_file:s0 /factory(/.*)? u:object_r:sec_efs_file:s0

View file

@ -77,8 +77,6 @@ genfscon proc /reset_reason u:object_r:proc_reset_reason:s
genfscon proc /sys/vm/swappiness u:object_r:proc_swapiness:s0 genfscon proc /sys/vm/swappiness u:object_r:proc_swapiness:s0
# SYSFS # SYSFS
## FMRadio
genfscon sysfs /devices/virtual/s610_radio/s610_radio/ u:object_r:sysfs_fmradio_tune:s0
# class # class
genfscon sysfs /class/video4linux u:object_r:sysfs_v4l:s0 genfscon sysfs /class/video4linux u:object_r:sysfs_v4l:s0

View file

@ -1,5 +1,3 @@
type rild_hwservice, hwservice_manager_type; type rild_hwservice, hwservice_manager_type;
type hal_parts_hwservice, hwservice_manager_type;
type hal_fmradio_hwservice, hwservice_manager_type;
type hal_vendor_configstore_hwservice, hwservice_manager_type; type hal_vendor_configstore_hwservice, hwservice_manager_type;
type hal_vendor_surfaceflinger_hwservice, hwservice_manager_type; type hal_vendor_surfaceflinger_hwservice, hwservice_manager_type;

View file

@ -4,14 +4,5 @@ vendor.samsung.hardware.radio.bridge::ISehBridge u:object_r:rild_hwse
vendor.samsung.hardware.radio.channel::ISehChannel u:object_r:rild_hwservice:s0 vendor.samsung.hardware.radio.channel::ISehChannel u:object_r:rild_hwservice:s0
vendor.lineage.power::ILineagePower u:object_r:hal_power_hwservice:s0 vendor.lineage.power::ILineagePower u:object_r:hal_power_hwservice:s0
# 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
vendor.samsung_slsi.hardware.ExynosHWCServiceTW::IExynosHWCServiceTW u:object_r:hal_vendor_surfaceflinger_hwservice:s0 vendor.samsung_slsi.hardware.ExynosHWCServiceTW::IExynosHWCServiceTW u:object_r:hal_vendor_surfaceflinger_hwservice:s0
vendor.samsung_slsi.hardware.configstore::IExynosHWCConfigs u:object_r:hal_vendor_configstore_hwservice:s0 vendor.samsung_slsi.hardware.configstore::IExynosHWCConfigs u:object_r:hal_vendor_configstore_hwservice:s0

View file

@ -11,18 +11,4 @@ allow system_app sysfs_battery_info:file { read open getattr };
r_dir_file(system_app, sysfs_battery_info) r_dir_file(system_app, sysfs_battery_info)
# 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 };