1# Qualcomm MSM camera
2type camera, domain;
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 camera_device:dir search;
10allow camera { gpu_device video_device camera_device }:chr_file rw_file_perms;
11allow camera { 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
19# Create front and back camera sockets (/data/cam_socket[23])
20# TODO: create these sockets elsewhere, apps shouldn't be putting sockets
21# directly under /data.
22type_transition camera system_data_file:sock_file camera_socket "cam_socket2";
23type_transition camera system_data_file:sock_file camera_socket "cam_socket3";
24allow camera camera_socket:sock_file { create unlink };
25allow camera system_data_file:dir w_dir_perms;
26allow camera system_data_file:sock_file unlink;
27