diff --git a/sepolicy/qti/vendor/device.te b/sepolicy/qti/vendor/device.te index e4e6bba..e641c83 100644 --- a/sepolicy/qti/vendor/device.te +++ b/sepolicy/qti/vendor/device.te @@ -4,6 +4,9 @@ type oplus_awsmartpa_device, dev_type; # Camera type vendor_camera_turbo_device, dev_type; +# Charging +type oplus_charger_device, dev_type; + # Fingerprint type fingerprint_device, dev_type; diff --git a/sepolicy/qti/vendor/file_contexts b/sepolicy/qti/vendor/file_contexts index 99553cb..c29ace5 100644 --- a/sepolicy/qti/vendor/file_contexts +++ b/sepolicy/qti/vendor/file_contexts @@ -15,6 +15,7 @@ /vendor/lib64/libipebpsstriping(170)?\.so u:object_r:same_process_hal_file:s0 # Charging +/dev/oplus_chg u:object_r:oplus_charger_device:s0 /(odm|vendor/odm)/bin/hw/vendor\.oplus\.hardware\.charger-V[0-9]+-service u:object_r:hal_oplus_charger_aidl_exec:s0 /vendor/bin/hw/vendor\.lineage\.powershare-service\.oplus u:object_r:hal_lineage_powershare_default_exec:s0 diff --git a/sepolicy/qti/vendor/hal_oplus_charger_aidl.te b/sepolicy/qti/vendor/hal_oplus_charger_aidl.te index 06f99e0..f9a2ff1 100644 --- a/sepolicy/qti/vendor/hal_oplus_charger_aidl.te +++ b/sepolicy/qti/vendor/hal_oplus_charger_aidl.te @@ -12,6 +12,8 @@ hal_attribute_service(vendor_hal_oplus_charger, hal_oplus_charger_aidl_service) allow hal_oplus_charger_aidl self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl; +allow hal_oplus_charger_aidl oplus_charger_device:chr_file rw_file_perms; + allow hal_oplus_charger_aidl block_device:dir search; allow hal_oplus_charger_aidl vendor_reserve_partition:blk_file rw_file_perms;