diff --git a/whitechapel_pro/battery_mitigation.te b/whitechapel_pro/battery_mitigation.te new file mode 100644 index 00000000..59af9d53 --- /dev/null +++ b/whitechapel_pro/battery_mitigation.te @@ -0,0 +1,16 @@ +type battery_mitigation, domain; +type battery_mitigation_exec, exec_type, vendor_file_type, file_type; +init_daemon_domain(battery_mitigation) +get_prop(battery_mitigation, boot_status_prop) + +hal_client_domain(battery_mitigation, hal_thermal); +hal_client_domain(battery_mitigation, hal_health); + +r_dir_file(battery_mitigation, sysfs_batteryinfo) +r_dir_file(battery_mitigation, sysfs_iio_devices) +r_dir_file(battery_mitigation, sysfs_thermal) +r_dir_file(battery_mitigation, thermal_link_device) +r_dir_file(battery_mitigation, sysfs_odpm) +allow battery_mitigation sysfs_thermal:lnk_file r_file_perms; +allow battery_mitigation mitigation_vendor_data_file:dir rw_dir_perms; +allow battery_mitigation mitigation_vendor_data_file:file create_file_perms; diff --git a/whitechapel_pro/file.te b/whitechapel_pro/file.te index a9f38963..9ec86284 100644 --- a/whitechapel_pro/file.te +++ b/whitechapel_pro/file.te @@ -15,6 +15,7 @@ type per_boot_file, file_type, data_file_type, core_data_file_type; type uwb_vendor_data_file, file_type, data_file_type, app_data_file_type; type uwb_data_vendor, file_type, data_file_type; type powerstats_vendor_data_file, file_type, data_file_type; +type mitigation_vendor_data_file, file_type, data_file_type; userdebug_or_eng(` typeattribute tcpdump_vendor_data_file mlstrustedobject; typeattribute vendor_slog_file mlstrustedobject; diff --git a/whitechapel_pro/file_contexts b/whitechapel_pro/file_contexts index adba0274..09b28259 100644 --- a/whitechapel_pro/file_contexts +++ b/whitechapel_pro/file_contexts @@ -41,6 +41,7 @@ /vendor/bin/hw/android\.hardware\.qorvo\.uwb\.service u:object_r:hal_uwb_vendor_default_exec:s0 /vendor/bin/rlsservice u:object_r:rlsservice_exec:s0 /vendor/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.1-service\.fpc u:object_r:fingerprint_factory_service_exec:s0 +/vendor/bin/hw/battery_mitigation u:object_r:battery_mitigation_exec:s0 # Vendor Firmwares /vendor/firmware(/.*)? u:object_r:vendor_fw_file:s0 @@ -207,6 +208,7 @@ /data/vendor/uwb(/.*)? u:object_r:uwb_data_vendor:s0 /dev/battery_history u:object_r:battery_history_device:s0 /data/vendor/powerstats(/.*)? u:object_r:powerstats_vendor_data_file:s0 +/data/vendor/mitigation(/.*)? u:object_r:mitigation_vendor_data_file:s0 # Persist /mnt/vendor/persist/battery(/.*)? u:object_r:persist_battery_file:s0