Skip to content

Commit

Permalink
cupid: sepolicy: Bring back ALS correction service rules
Browse files Browse the repository at this point in the history
Change-Id: Ifa589b3f08be63aa8b2cf1e4ae69a09b5ea53f0c
  • Loading branch information
luk1337 authored and pjgowtham committed Dec 16, 2023
1 parent 3a836d4 commit 4eb1f2e
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 0 deletions.
5 changes: 5 additions & 0 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop
# Recovery
TARGET_RECOVERY_UI_MARGIN_HEIGHT := 103

# SEpolicy
BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/private
SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/public

# Touch
SOONG_CONFIG_NAMESPACES += OPLUS_LINEAGE_TOUCH_HAL
SOONG_CONFIG_OPLUS_LINEAGE_TOUCH_HAL := INCLUDE_DIR
Expand Down
23 changes: 23 additions & 0 deletions sepolicy/private/als_correction_service.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type als_correction_service_exec, system_file_type, exec_type, file_type;

init_daemon_domain(als_correction_service)

typeattribute als_correction_service system_writes_vendor_properties_violators;

hal_client_domain(als_correction_service, hal_graphics_allocator)

binder_use(als_correction_service)

binder_call(als_correction_service, surfaceflinger)
binder_call(surfaceflinger, als_correction_service)

allow als_correction_service hal_graphics_allocator_hwservice:hwservice_manager find;
allow als_correction_service hal_graphics_mapper_hwservice:hwservice_manager find;

allow als_correction_service surfaceflinger_service:service_manager find;

allow als_correction_service same_process_hal_file:file r_file_perms;

allow als_correction_service ion_device:chr_file rw_file_perms;

set_prop(als_correction_service, vendor_sensors_als_prop)
2 changes: 2 additions & 0 deletions sepolicy/private/file_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Sensors
/(system_ext|system/system_ext)/bin/als_correction_service u:object_r:als_correction_service_exec:s0
2 changes: 2 additions & 0 deletions sepolicy/private/property_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Sensors
vendor.sensors.als_correction. u:object_r:vendor_sensors_als_prop:s0
1 change: 1 addition & 0 deletions sepolicy/public/als_correction_service.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type als_correction_service, domain, coredomain;
1 change: 1 addition & 0 deletions sepolicy/public/property.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
system_public_prop(vendor_sensors_als_prop)
5 changes: 5 additions & 0 deletions sepolicy/vendor/hal_sensors_default.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
allow hal_sensors_default als_correction_service:process signal;

get_prop(hal_sensors_default, vendor_sensors_als_prop)

r_dir_file(als_correction_service, vendor_proc_oplus_als_file)

0 comments on commit 4eb1f2e

Please sign in to comment.