• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1###
2### A domain for android.process.media, which contains both
3### MediaProvider and DownloadProvider and associated services.
4###
5
6typeattribute mediaprovider coredomain;
7app_domain(mediaprovider)
8
9# DownloadProvider accesses the network.
10net_domain(mediaprovider)
11
12# DownloadProvider uses /cache.
13allow mediaprovider cache_file:dir create_dir_perms;
14allow mediaprovider cache_file:file create_file_perms;
15# /cache is a symlink to /data/cache on some devices. Allow reading the link.
16allow mediaprovider cache_file:lnk_file r_file_perms;
17# mediaprovider searches through /cache looking for orphans
18# Ignore denials to /cache/recovery and /cache/backup.
19dontaudit mediaprovider cache_private_backup_file:dir getattr;
20dontaudit mediaprovider cache_recovery_file:dir getattr;
21
22# Access external sdcards through /mnt/media_rw
23allow mediaprovider { mnt_media_rw_file }:dir search;
24
25allow mediaprovider app_api_service:service_manager find;
26allow mediaprovider audioserver_service:service_manager find;
27allow mediaprovider cameraserver_service:service_manager find;
28allow mediaprovider drmserver_service:service_manager find;
29allow mediaprovider mediaextractor_service:service_manager find;
30allow mediaprovider mediaserver_service:service_manager find;
31
32# Allow MediaProvider to read/write cached ringtones (opened by system).
33allow mediaprovider ringtone_file:file { getattr read write };
34
35# MtpServer uses /dev/mtp_usb
36allow mediaprovider mtp_device:chr_file rw_file_perms;
37
38# MtpServer uses /dev/usb-ffs/mtp
39allow mediaprovider functionfs:dir search;
40allow mediaprovider functionfs:file rw_file_perms;
41allowxperm mediaprovider functionfs:file ioctl FUNCTIONFS_ENDPOINT_DESC;
42allowxperm mediaprovider functionfs:file ioctl FUNCTIONFS_ENDPOINT_ALLOC;
43
44# MtpServer sets sys.usb.ffs.mtp.ready
45get_prop(mediaprovider, ffs_config_prop)
46set_prop(mediaprovider, ffs_control_prop)
47
48# DownloadManager may retrieve DRM status
49get_prop(mediaprovider, drm_service_config_prop)
50