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