Peiyong Lin | 7924dc6 | 2018-11-01 13:47:51 -0700 | [diff] [blame] | 1 | # gpu service |
| 2 | type gpuservice, domain, coredomain; |
| 3 | type gpuservice_exec, system_file_type, exec_type, file_type; |
| 4 | |
| 5 | init_daemon_domain(gpuservice) |
| 6 | |
| 7 | binder_call(gpuservice, adbd) |
| 8 | binder_call(gpuservice, shell) |
| 9 | binder_use(gpuservice) |
| 10 | |
| 11 | # Access the GPU. |
| 12 | allow gpuservice gpu_device:chr_file rw_file_perms; |
| 13 | |
| 14 | # GPU service will need to load GPU driver, for example Vulkan driver in order |
| 15 | # to get the capability of the driver. |
| 16 | allow gpuservice same_process_hal_file:file { open read getattr execute map }; |
| 17 | allow gpuservice ion_device:chr_file r_file_perms; |
| 18 | get_prop(gpuservice, hwservicemanager_prop) |
| 19 | hwbinder_use(gpuservice) |
| 20 | |
| 21 | # Access /dev/graphics/fb0. |
| 22 | allow gpuservice graphics_device:dir search; |
| 23 | allow gpuservice graphics_device:chr_file rw_file_perms; |
| 24 | |
Yiwei Zhang | ff0f79c | 2018-11-27 15:21:43 -0800 | [diff] [blame] | 25 | # Needed for dumpsys pipes. |
| 26 | allow gpuservice shell:fifo_file write; |
| 27 | |
Peiyong Lin | 7924dc6 | 2018-11-01 13:47:51 -0700 | [diff] [blame] | 28 | # Use socket supplied by adbd, for cmd gpu vkjson etc. |
| 29 | allow gpuservice adbd:unix_stream_socket { read write getattr }; |
| 30 | |
Yiwei Zhang | 6e8191e | 2019-01-23 14:28:56 -0800 | [diff] [blame] | 31 | # Needed for interactive shell |
| 32 | allow gpuservice devpts:chr_file { read write getattr }; |
| 33 | |
Peiyong Lin | 7924dc6 | 2018-11-01 13:47:51 -0700 | [diff] [blame] | 34 | add_service(gpuservice, gpu_service) |
| 35 | |
| 36 | # Only uncomment below line when in development |
| 37 | # userdebug_or_eng(`permissive gpuservice;') |