summaryrefslogtreecommitdiffstats
path: root/common/mm-qcamerad.te
blob: 9c5093aa7f7f8bc42a1ec488d548e5a95de28170 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
type mm-qcamerad, domain;
type mm-qcamerad_exec, exec_type, file_type;
init_daemon_domain(mm-qcamerad)

#added to support EZTune for camera
userdebug_or_eng(`
  allow mm-qcamerad debugfs:dir r_dir_perms;
  allow mm-qcamerad camera_data_file:file create_file_perms;
  allow mm-qcamerad self:tcp_socket create_stream_socket_perms;
  allow mm-qcamerad node:tcp_socket node_bind;

  # IMS use camera daemon to make VT call
  allow mm-qcamerad port:tcp_socket name_bind;
  allow mm-qcamerad self:tcp_socket { accept listen };
  allow mm-qcamerad camera_data_file:file create_file_perms;

  # mm-qcamerad needs to set persist.camera. property
  allow mm-qcamerad camera_prop:property_service set;

')

#Communicate with user land process through domain socket
allow mm-qcamerad camera_socket:sock_file { create unlink write };
allow mm-qcamerad camera_socket:dir w_dir_perms;
unix_socket_connect(mm-qcamerad, sensors, sensors)

#Allow connections between sensor manager and mm-qcamerad
allow mm-qcamerad system_server:unix_stream_socket rw_socket_perms;
binder_call(mm-qcamerad, system_server);
binder_use(mm-qcamerad);

allow mm-qcamerad self:process execmem;

# Interact with other media devices
allow mm-qcamerad camera_device:dir r_dir_perms;
allow mm-qcamerad { gpu_device video_device camera_device sensors_device }:chr_file rw_file_perms;

allow mm-qcamerad { surfaceflinger mediaserver }:fd use;

allow mm-qcamerad camera_data_file:dir w_dir_perms;
allow mm-qcamerad camera_data_file:sock_file { create unlink };

#Allows camera to call ADSP QDSP6 functionality
allow mm-qcamerad qdsp_device:chr_file rw_file_perms;

#Allows sensor service(running in camera daemon) to invoke service manager API
allow mm-qcamerad sensorservice_service:service_manager find;

#allow mm-qcamerad to access /dsp
r_dir_file(mm-qcamerad, adsprpcd_file);

r_dir_file(mm-qcamerad, firmware_file)
allow mm-qcamerad graphics_device:dir r_dir_perms;

#Allow access to /dev/graphics/fb* for screen capture
allow mm-qcamerad graphics_device:chr_file rw_file_perms;
unix_socket_connect(mm-qcamerad, property, init)

#Allow camera work normally in FFBM
binder_call(mm-qcamerad, mmi);