summaryrefslogtreecommitdiffstats
path: root/common/mm-pp-daemon.te
blob: 7f7bd897f9ff01f17b5b04af08a24f6e771c0638 (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
type mm-pp-daemon, domain;
type mm-pp-daemon_exec, exec_type, file_type;

init_daemon_domain(mm-pp-daemon)

#============= mm-pp-daemon ==============
#Need to use fb ioctls to communicate with kernel
allow mm-pp-daemon graphics_device:chr_file rw_file_perms;
allow mm-pp-daemon graphics_device:dir search;

# Allow reading/writing to persist
# The color config file is dynamically created
allow mm-pp-daemon persist_file:dir rw_dir_perms;
allow mm-pp-daemon persist_file:file create_file_perms;

# Allow reading/writing data config files
allow mm-pp-daemon display_config:dir create_dir_perms;
allow mm-pp-daemon display_config:file create_file_perms;

# Allow read to sensor device and read/write to sensor socket
allow mm-pp-daemon sensors_device:chr_file r_file_perms;
allow mm-pp-daemon sensors_socket:sock_file rw_file_perms;
allow mm-pp-daemon sensors:unix_stream_socket connectto;

allow mm-pp-daemon system_prop:property_service set;
#Calibration can only be done on userdebug or eng builds
#Enable on user builds too. This is causing mayhem for gfx
#userdebug_or_eng(`
    # Display calibration service opens /dev/diag in order to communicate with the
    # target device
    allow mm-pp-daemon diag_device:chr_file rw_file_perms;

    # QDCM needs to trigger screen refreshes in some cases to reach the
    # convergent state
    binder_use(mm-pp-daemon)
    binder_call(mm-pp-daemon, system_server)
    binder_call(mm-pp-daemon, surfaceflinger)

    # This allows pp-daemon to use shell commands to blank
    # the display - it uses input keyevent to do this
    allow mm-pp-daemon shell_exec:file rx_file_perms;
    allow mm-pp-daemon system_file:file execute_no_trans;
    allow mm-pp-daemon zygote_exec:file rx_file_perms;
    allow mm-pp-daemon self:process ptrace;

# Allow mm-pp-daemon to change the brightness of the target during display
# calibration
allow mm-pp-daemon sysfs:file rw_file_perms;

#')

# Allow socket calls in pp-daemon
unix_socket_connect(mm-pp-daemon, property, init)
unix_socket_connect(mm-pp-daemon, pps, init)
allow mm-pp-daemon init:unix_stream_socket listen;
allow mm-pp-daemon init:unix_stream_socket accept;