Jerry Zhang | 9f152d9 | 2017-04-10 16:57:48 -0700 | [diff] [blame] | 1 | ### |
| 2 | ### A domain for android.process.media, which contains both |
| 3 | ### MediaProvider and DownloadProvider and associated services. |
| 4 | ### |
| 5 | |
| 6 | typeattribute mediaprovider coredomain; |
| 7 | app_domain(mediaprovider) |
| 8 | |
| 9 | # DownloadProvider accesses the network. |
| 10 | net_domain(mediaprovider) |
| 11 | |
| 12 | # DownloadProvider uses /cache. |
| 13 | allow mediaprovider cache_file:dir create_dir_perms; |
| 14 | allow mediaprovider cache_file:file create_file_perms; |
| 15 | # /cache is a symlink to /data/cache on some devices. Allow reading the link. |
| 16 | allow mediaprovider cache_file:lnk_file r_file_perms; |
Jeff Vander Stoep | 182dbeb | 2017-06-26 16:58:51 -0700 | [diff] [blame] | 17 | # mediaprovider searches through /cache looking for orphans |
| 18 | # Ignore denials to /cache/recovery and /cache/backup. |
| 19 | dontaudit mediaprovider cache_private_backup_file:dir getattr; |
| 20 | dontaudit mediaprovider cache_recovery_file:dir getattr; |
| 21 | |
Jerry Zhang | ddb89ab | 2018-05-11 18:35:55 -0700 | [diff] [blame] | 22 | # Access external sdcards through /mnt/media_rw |
| 23 | allow mediaprovider { mnt_media_rw_file }:dir search; |
Jerry Zhang | 9f152d9 | 2017-04-10 16:57:48 -0700 | [diff] [blame] | 24 | |
| 25 | allow mediaprovider app_api_service:service_manager find; |
| 26 | allow mediaprovider audioserver_service:service_manager find; |
Krzysztof KosiĆski | a04ecbf | 2021-04-14 18:41:28 -0700 | [diff] [blame] | 27 | allow mediaprovider cameraserver_service:service_manager find; |
Jerry Zhang | 6f9ac6e | 2017-04-26 10:18:30 -0700 | [diff] [blame] | 28 | allow mediaprovider drmserver_service:service_manager find; |
Chong Zhang | 8e3fef3 | 2018-03-16 15:52:15 -0700 | [diff] [blame] | 29 | allow mediaprovider mediaextractor_service:service_manager find; |
Jerry Zhang | 9f152d9 | 2017-04-10 16:57:48 -0700 | [diff] [blame] | 30 | allow mediaprovider mediaserver_service:service_manager find; |
Jerry Zhang | 9f152d9 | 2017-04-10 16:57:48 -0700 | [diff] [blame] | 31 | |
| 32 | # Allow MediaProvider to read/write cached ringtones (opened by system). |
| 33 | allow mediaprovider ringtone_file:file { getattr read write }; |
| 34 | |
| 35 | # MtpServer uses /dev/mtp_usb |
| 36 | allow mediaprovider mtp_device:chr_file rw_file_perms; |
| 37 | |
| 38 | # MtpServer uses /dev/usb-ffs/mtp |
| 39 | allow mediaprovider functionfs:dir search; |
| 40 | allow mediaprovider functionfs:file rw_file_perms; |
Nick Kralevich | a73f58a | 2018-10-17 10:13:25 -0700 | [diff] [blame] | 41 | allowxperm mediaprovider functionfs:file ioctl FUNCTIONFS_ENDPOINT_DESC; |
Macpaul Lin | 641c5ae | 2021-07-12 15:53:54 +0800 | [diff] [blame] | 42 | allowxperm mediaprovider functionfs:file ioctl FUNCTIONFS_ENDPOINT_ALLOC; |
Jerry Zhang | 9f152d9 | 2017-04-10 16:57:48 -0700 | [diff] [blame] | 43 | |
| 44 | # MtpServer sets sys.usb.ffs.mtp.ready |
Inseob Kim | bfb3708 | 2020-04-27 23:49:15 +0900 | [diff] [blame] | 45 | get_prop(mediaprovider, ffs_config_prop) |
| 46 | set_prop(mediaprovider, ffs_control_prop) |
Martijn Coenen | 4555c92 | 2021-03-09 11:09:06 +0100 | [diff] [blame] | 47 | |
| 48 | # DownloadManager may retrieve DRM status |
| 49 | get_prop(mediaprovider, drm_service_config_prop) |