diff --git a/universal7885-common/bin/hardware/interfaces/hardware/fmradio/1.2/default/Android.bp b/universal7885-common/bin/hardware/interfaces/hardware/fmradio/1.2/default/Android.bp index 2d5b2ea..187c2a3 100644 --- a/universal7885-common/bin/hardware/interfaces/hardware/fmradio/1.2/default/Android.bp +++ b/universal7885-common/bin/hardware/interfaces/hardware/fmradio/1.2/default/Android.bp @@ -2,7 +2,6 @@ cc_binary { name: "vendor.eureka.hardware.fmradio@1.2-service", - proprietary: true, srcs: [ "FMRadio.cpp", "service.cpp", diff --git a/universal7885-common/bin/hardware/interfaces/hardware/fmradio/1.2/default/vendor.eureka.hardware.fmradio@1.2-service.rc b/universal7885-common/bin/hardware/interfaces/hardware/fmradio/1.2/default/vendor.eureka.hardware.fmradio@1.2-service.rc index f747b3f..f5a6245 100644 --- a/universal7885-common/bin/hardware/interfaces/hardware/fmradio/1.2/default/vendor.eureka.hardware.fmradio@1.2-service.rc +++ b/universal7885-common/bin/hardware/interfaces/hardware/fmradio/1.2/default/vendor.eureka.hardware.fmradio@1.2-service.rc @@ -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.1::IFMRadio default interface vendor.eureka.hardware.fmradio@1.2::IFMRadio default diff --git a/universal7885-common/bin/hardware/interfaces/hardware/fmradio/1.2/default/vendor.eureka.hardware.fmradio@1.2.xml b/universal7885-common/bin/hardware/interfaces/hardware/fmradio/1.2/default/vendor.eureka.hardware.fmradio@1.2.xml index b3d42cd..542a982 100644 --- a/universal7885-common/bin/hardware/interfaces/hardware/fmradio/1.2/default/vendor.eureka.hardware.fmradio@1.2.xml +++ b/universal7885-common/bin/hardware/interfaces/hardware/fmradio/1.2/default/vendor.eureka.hardware.fmradio@1.2.xml @@ -1,6 +1,6 @@ - - + + vendor.eureka.hardware.fmradio hwbinder 1.2 diff --git a/universal7885-common/bin/hardware/interfaces/hardware/parts/1.0/default/Android.bp b/universal7885-common/bin/hardware/interfaces/hardware/parts/1.0/default/Android.bp index 11b4e2e..3b26309 100644 --- a/universal7885-common/bin/hardware/interfaces/hardware/parts/1.0/default/Android.bp +++ b/universal7885-common/bin/hardware/interfaces/hardware/parts/1.0/default/Android.bp @@ -2,7 +2,6 @@ cc_binary { name: "vendor.eureka.hardware.parts@1.0-service", - proprietary: true, srcs: [ "Battery.cpp", "FlashLight.cpp", diff --git a/universal7885-common/bin/hardware/interfaces/hardware/parts/1.0/default/vendor.eureka.hardware.parts@1.0-service.rc b/universal7885-common/bin/hardware/interfaces/hardware/parts/1.0/default/vendor.eureka.hardware.parts@1.0-service.rc index 9b75a93..39d9fe3 100644 --- a/universal7885-common/bin/hardware/interfaces/hardware/parts/1.0/default/vendor.eureka.hardware.parts@1.0-service.rc +++ b/universal7885-common/bin/hardware/interfaces/hardware/parts/1.0/default/vendor.eureka.hardware.parts@1.0-service.rc @@ -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::IDisplayConfigs default interface vendor.eureka.hardware.parts@1.0::IFlashBrightness default diff --git a/universal7885-common/bin/hardware/interfaces/hardware/parts/1.0/default/vendor.eureka.hardware.parts@1.0.xml b/universal7885-common/bin/hardware/interfaces/hardware/parts/1.0/default/vendor.eureka.hardware.parts@1.0.xml index 3f190ab..f239de7 100644 --- a/universal7885-common/bin/hardware/interfaces/hardware/parts/1.0/default/vendor.eureka.hardware.parts@1.0.xml +++ b/universal7885-common/bin/hardware/interfaces/hardware/parts/1.0/default/vendor.eureka.hardware.parts@1.0.xml @@ -1,6 +1,6 @@ - - + + vendor.eureka.hardware.parts hwbinder 1.0 diff --git a/universal7885-common/sepolicy/private/device.te b/universal7885-common/sepolicy/private/device.te new file mode 100644 index 0000000..c08235b --- /dev/null +++ b/universal7885-common/sepolicy/private/device.te @@ -0,0 +1,2 @@ +# FM Radio +type fm_radio_device, dev_type; diff --git a/universal7885-common/sepolicy/private/file.te b/universal7885-common/sepolicy/private/file.te new file mode 100644 index 0000000..bc095b1 --- /dev/null +++ b/universal7885-common/sepolicy/private/file.te @@ -0,0 +1 @@ +type sysfs_fmradio_tune, sysfs_type, rw_fs_type, fs_type; \ No newline at end of file diff --git a/universal7885-common/sepolicy/private/file_contexts b/universal7885-common/sepolicy/private/file_contexts index 13c8268..971f45d 100644 --- a/universal7885-common/sepolicy/private/file_contexts +++ b/universal7885-common/sepolicy/private/file_contexts @@ -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 \ No newline at end of file diff --git a/universal7885-common/sepolicy/private/genfscon_contexts b/universal7885-common/sepolicy/private/genfscon_contexts new file mode 100644 index 0000000..5f4d6d2 --- /dev/null +++ b/universal7885-common/sepolicy/private/genfscon_contexts @@ -0,0 +1,2 @@ +## FMRadio +genfscon sysfs /devices/virtual/s610_radio/s610_radio/ u:object_r:sysfs_fmradio_tune:s0 diff --git a/universal7885-common/sepolicy/vendor/hal_fmradio_default.te b/universal7885-common/sepolicy/private/hal_fmradio_default.te similarity index 86% rename from universal7885-common/sepolicy/vendor/hal_fmradio_default.te rename to universal7885-common/sepolicy/private/hal_fmradio_default.te index c1d36bd..af5960a 100644 --- a/universal7885-common/sepolicy/vendor/hal_fmradio_default.te +++ b/universal7885-common/sepolicy/private/hal_fmradio_default.te @@ -1,5 +1,5 @@ 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); init_daemon_domain(hal_fmradio_default); diff --git a/universal7885-common/sepolicy/vendor/hal_parts_default.te b/universal7885-common/sepolicy/private/hal_parts_default.te similarity index 81% rename from universal7885-common/sepolicy/vendor/hal_parts_default.te rename to universal7885-common/sepolicy/private/hal_parts_default.te index 153c03f..e820a56 100644 --- a/universal7885-common/sepolicy/vendor/hal_parts_default.te +++ b/universal7885-common/sepolicy/private/hal_parts_default.te @@ -1,5 +1,5 @@ -type hal_parts_default, domain; -type hal_parts_default_exec, exec_type, file_type, vendor_file_type; +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); @@ -26,10 +26,10 @@ 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; +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 vendor_shell_exec:file rx_file_perms; -allow hal_parts_default vendor_toolbox_exec:file rx_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; diff --git a/universal7885-common/sepolicy/private/hwservice.te b/universal7885-common/sepolicy/private/hwservice.te new file mode 100644 index 0000000..a1a1bc3 --- /dev/null +++ b/universal7885-common/sepolicy/private/hwservice.te @@ -0,0 +1,2 @@ +type hal_parts_hwservice, hwservice_manager_type; +type hal_fmradio_hwservice, hwservice_manager_type; \ No newline at end of file diff --git a/universal7885-common/sepolicy/private/hwservice_contexts b/universal7885-common/sepolicy/private/hwservice_contexts new file mode 100644 index 0000000..2a5743f --- /dev/null +++ b/universal7885-common/sepolicy/private/hwservice_contexts @@ -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 diff --git a/universal7885-common/sepolicy/private/system_app.te b/universal7885-common/sepolicy/private/system_app.te new file mode 100644 index 0000000..f545e9a --- /dev/null +++ b/universal7885-common/sepolicy/private/system_app.te @@ -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 }; + diff --git a/universal7885-common/sepolicy/vendor/device.te b/universal7885-common/sepolicy/vendor/device.te index 55c2674..e548fc4 100644 --- a/universal7885-common/sepolicy/vendor/device.te +++ b/universal7885-common/sepolicy/vendor/device.te @@ -5,9 +5,6 @@ type tz_user_device, dev_type; # /dev/m2m1shot_scaler0 type m2m1shot_device, dev_type; -# FM Radio -type fm_radio_device, dev_type; - # gps type gps_device, dev_type; diff --git a/universal7885-common/sepolicy/vendor/file.te b/universal7885-common/sepolicy/vendor/file.te index 85d09d1..edf073d 100644 --- a/universal7885-common/sepolicy/vendor/file.te +++ b/universal7885-common/sepolicy/vendor/file.te @@ -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_sensors, 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_battery_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_camera_writable, sysfs_type, rw_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_fmradio_tune, sysfs_type, rw_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_smfc, sysfs_type, r_fs_type, fs_type; diff --git a/universal7885-common/sepolicy/vendor/file_contexts b/universal7885-common/sepolicy/vendor/file_contexts index 9c854ea..e562259 100644 --- a/universal7885-common/sepolicy/vendor/file_contexts +++ b/universal7885-common/sepolicy/vendor/file_contexts @@ -24,7 +24,6 @@ /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/secradio(/.*)? u:object_r:radio_vendor_data_file:s0 -/data/swap(/.*)? u:object_r:parts_data_file:s0 ### DEV /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)/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 diff --git a/universal7885-common/sepolicy/vendor/genfs_contexts b/universal7885-common/sepolicy/vendor/genfs_contexts index 961b354..f0dda2a 100644 --- a/universal7885-common/sepolicy/vendor/genfs_contexts +++ b/universal7885-common/sepolicy/vendor/genfs_contexts @@ -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 # SYSFS -## FMRadio -genfscon sysfs /devices/virtual/s610_radio/s610_radio/ u:object_r:sysfs_fmradio_tune:s0 # class genfscon sysfs /class/video4linux u:object_r:sysfs_v4l:s0 diff --git a/universal7885-common/sepolicy/vendor/hwservice.te b/universal7885-common/sepolicy/vendor/hwservice.te index 79e50df..b94a1b6 100644 --- a/universal7885-common/sepolicy/vendor/hwservice.te +++ b/universal7885-common/sepolicy/vendor/hwservice.te @@ -1,5 +1,3 @@ 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_surfaceflinger_hwservice, hwservice_manager_type; diff --git a/universal7885-common/sepolicy/vendor/hwservice_contexts b/universal7885-common/sepolicy/vendor/hwservice_contexts index 37f8918..2209fbb 100644 --- a/universal7885-common/sepolicy/vendor/hwservice_contexts +++ b/universal7885-common/sepolicy/vendor/hwservice_contexts @@ -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.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.configstore::IExynosHWCConfigs u:object_r:hal_vendor_configstore_hwservice:s0 diff --git a/universal7885-common/sepolicy/vendor/system_app.te b/universal7885-common/sepolicy/vendor/system_app.te index 4009f80..adfe4c6 100644 --- a/universal7885-common/sepolicy/vendor/system_app.te +++ b/universal7885-common/sepolicy/vendor/system_app.te @@ -11,18 +11,4 @@ allow system_app sysfs_battery_info:file { read open getattr }; 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 }; -