Vivekbalachandar M | 7af3d83 | 2020-02-12 15:56:09 +0530 | [diff] [blame] | 1 | type camera_detect, domain, mlstrustedsubject; |
| 2 | type camera_detect_exec, exec_type, file_type; |
| 3 | |
| 4 | # Allow for transition from init domain to camera_detect |
| 5 | init_daemon_domain(camera_detect) |
| 6 | |
| 7 | # Allow executing a shell script |
| 8 | allow camera_detect shell_exec:file { rx_file_perms entrypoint }; |
| 9 | allow camera_detect toolbox_exec:file { rx_file_perms }; |
| 10 | |
| 11 | # Allow reading name of camera driver from /sys/class/video4linux |
| 12 | r_dir_file(camera_detect, sysfs) |
Karsten Tausche | b1f1c3e | 2021-02-26 09:55:31 +0100 | [diff] [blame] | 13 | r_dir_file(camera_detect, sysfs_graphics) |
Vivekbalachandar M | 7af3d83 | 2020-02-12 15:56:09 +0530 | [diff] [blame] | 14 | |
| 15 | # Allow wiping of cached resolutions in shared_prefs of GoogleCamera |
| 16 | allow camera_detect rootfs:dir { r_dir_perms }; |
| 17 | allow camera_detect system_data_file:dir { r_dir_perms }; |
| 18 | allow camera_detect app_data_file:dir { rw_dir_perms }; |
Bharath | 4726d00 | 2020-03-18 11:39:42 +0530 | [diff] [blame] | 19 | allow camera_detect self:capability { fowner chown fsetid }; |
Vivekbalachandar M | 7af3d83 | 2020-02-12 15:56:09 +0530 | [diff] [blame] | 20 | |
| 21 | # Allow executing /system/etc/init.fp.camera_*.sh scripts |
| 22 | allow camera_detect system_file:file execute_no_trans; |
| 23 | |
| 24 | # Allow access to camera_detect properties |
| 25 | set_prop(camera_detect, camera_detect_prop) |
| 26 | get_prop(system_app, camera_detect_prop) |
| 27 | get_prop(priv_app, camera_detect_prop) |
| 28 | get_prop(shell, camera_detect_prop) |