1###
2### A domain for further sandboxing the MediaProvider mainline module.
3###
4type mediaprovider_app, domain, coredomain;
5
6app_domain(mediaprovider_app)
7
8# Access to /mnt/pass_through.
9r_dir_file(mediaprovider_app, mnt_pass_through_file)
10
11# Allow MediaProvider to host a FUSE daemon for external storage
12allow mediaprovider_app fuse_device:chr_file { read write ioctl getattr };
13
14# Allow MediaProvider to read/write media_rw_data_file files and dirs
15allow mediaprovider_app media_rw_data_file:file create_file_perms;
16allow mediaprovider_app media_rw_data_file:dir create_dir_perms;
17
18# Talk to the DRM service
19allow mediaprovider_app drmserver_service:service_manager find;
20
21# Talk to the MediaServer service
22allow mediaprovider_app mediaserver_service:service_manager find;
23
24# Talk to the MediaCodec APIs that log media metrics
25allow mediaprovider_app mediametrics_service:service_manager find;
26
27# Talk to regular app services
28allow mediaprovider_app app_api_service:service_manager find;
29
30# Talk to the GPU service
31binder_call(mediaprovider_app, gpuservice)
32
33# Talk to statsd
34allow mediaprovider_app statsmanager_service:service_manager find;
35binder_call(mediaprovider_app, statsd)
36
37# read pipe-max-size configuration
38allow mediaprovider_app proc_pipe_conf:file r_file_perms;
39
40# Allow MediaProvider to set extended attributes (such as quota project ID)
41# on media files.
42allowxperm mediaprovider_app media_rw_data_file:{ dir file } ioctl {
43  FS_IOC_FSGETXATTR
44  FS_IOC_FSSETXATTR
45  FS_IOC_GETFLAGS
46  FS_IOC_SETFLAGS
47};
48
49# Access external sdcards through /mnt/media_rw
50allow mediaprovider_app { mnt_media_rw_file }:dir search;
51
52allow mediaprovider_app proc_filesystems:file r_file_perms;
53
54#Allow MediaProvider to see if sdcardfs is in use
55get_prop(mediaprovider_app, storage_config_prop)
56
57get_prop(mediaprovider_app, drm_service_config_prop)
58
59allow mediaprovider_app gpu_device:dir search;
60
61dontaudit mediaprovider_app sysfs_vendor_sched:dir search;
62