1# Qualcomm MSM camera
2type camera, domain, domain_deprecated;
3type camera_exec, exec_type, file_type;
4
5# Started by init
6init_daemon_domain(camera)
7
8# Interact with other media devices
9allow camera video_device:dir search;
10allow camera { gpu_device video_device }:chr_file rw_file_perms;
11allow camera { audioserver cameraserver surfaceflinger mediaserver }:fd use;
12
13# Connect to sensor socket (/dev/sensor/sensor_ctl_socket)
14unix_socket_connect(camera, sensors, sensors)
15allow camera sensors_socket:sock_file read;
16
17allow camera sensors_device:chr_file rw_file_perms;
18
19allow camera self:capability { sys_nice };
20
21# Create front and back camera sockets (/data/cam_socket[23])
22# TODO: create these sockets elsewhere, apps shouldn't be putting sockets
23# directly under /data.
24type_transition camera system_data_file:sock_file camera_socket "cam_socket2";
25type_transition camera system_data_file:sock_file camera_socket "cam_socket3";
26allow camera camera_socket:sock_file { create unlink };
27allow camera system_data_file:dir w_dir_perms;
28allow camera system_data_file:sock_file unlink;
29