1type sdcardd, domain, domain_deprecated;
2type sdcardd_exec, exec_type, file_type;
3
4allow sdcardd cgroup:dir create_dir_perms;
5allow sdcardd fuse_device:chr_file rw_file_perms;
6allow sdcardd rootfs:dir mounton;  # TODO: deprecated in M
7allow sdcardd tmpfs:dir r_dir_perms;
8allow sdcardd mnt_media_rw_file:dir r_dir_perms;
9allow sdcardd storage_file:dir search;
10allow sdcardd storage_stub_file:dir { search mounton };
11allow sdcardd sdcard_type:filesystem { mount unmount };
12allow sdcardd self:capability { setuid setgid dac_override sys_admin sys_resource };
13
14allow sdcardd sdcard_type:dir create_dir_perms;
15allow sdcardd sdcard_type:file create_file_perms;
16
17type_transition sdcardd system_data_file:{ dir file } media_rw_data_file;
18allow sdcardd media_rw_data_file:dir create_dir_perms;
19allow sdcardd media_rw_data_file:file create_file_perms;
20
21# Read /data/system/packages.list.
22allow sdcardd system_data_file:file r_file_perms;
23
24# Read /data/.layout_version
25allow sdcardd install_data_file:file r_file_perms;
26
27# Allow stdin/out back to vold
28allow sdcardd vold:fd use;
29allow sdcardd vold:fifo_file { read write getattr };
30
31# Allow running on top of expanded storage
32allow sdcardd mnt_expand_file:dir search;
33
34###
35### neverallow rules
36###
37
38# The sdcard daemon should no longer be started from init
39neverallow init sdcardd_exec:file execute;
40neverallow init sdcardd:process { transition dyntransition };
41