summaryrefslogtreecommitdiff
path: root/sepolicy/camera.te
blob: 4f8406fd4d8e2e4c022250255c71649b97712d1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Qualcomm MSM camera
type camera, domain;
type camera_exec, exec_type, file_type;

# Started by init
init_daemon_domain(camera)

allow camera self:process execmem;

# Interact with other media devices
allow camera camera_device:dir search;
allow camera { video_device camera_device }:chr_file rw_file_perms;
allow camera { surfaceflinger mediaserver }:fd use;

# Create front and back camera sockets (/data/cam_socket[01])
type_transition camera system_data_file:sock_file camera_socket "cam_socket0";
type_transition camera system_data_file:sock_file camera_socket "cam_socket1";
allow camera camera_socket:sock_file { create unlink };
allow camera system_data_file:dir w_dir_perms;
allow camera system_data_file:sock_file unlink;

type_transition camera system_data_file:file camera_calibration_file "fdAlbum";
allow camera camera_calibration_file:file create_file_perms;

# Connect to sensor socket (/data/app/sensor_ctl_socket)
unix_socket_connect(camera, sensors, sensors)
allow camera sensors_socket:sock_file read;