Vadim Caen | d64cf75 | 2022-11-04 12:51:18 +0000 | [diff] [blame] | 1 | # virtual_camera - virtual camera daemon |
| 2 | |
| 3 | type virtual_camera, domain, coredomain; |
Vadim Caen | f6e88ec | 2023-09-29 16:15:23 +0200 | [diff] [blame] | 4 | type virtual_camera_exec, system_file_type, exec_type, file_type; |
Vadim Caen | d64cf75 | 2022-11-04 12:51:18 +0000 | [diff] [blame] | 5 | |
Vadim Caen | f6e88ec | 2023-09-29 16:15:23 +0200 | [diff] [blame] | 6 | init_daemon_domain(virtual_camera) |
Vadim Caen | d64cf75 | 2022-11-04 12:51:18 +0000 | [diff] [blame] | 7 | |
Vadim Caen | f6e88ec | 2023-09-29 16:15:23 +0200 | [diff] [blame] | 8 | # Since virtual_camera is not a real HAL we don't set the |
| 9 | # hal_server_domain(virtual_camera, hal_camera) macro but only the rules that |
| 10 | # we actually need from halserverdomain and hal_camera_server: |
| 11 | binder_use(virtual_camera) |
Ján Sebechlebský | 5d6b66c | 2023-11-20 09:39:22 +0000 | [diff] [blame] | 12 | binder_call(virtual_camera, cameraserver) |
| 13 | binder_call(virtual_camera, system_server) |
Vadim Caen | d64cf75 | 2022-11-04 12:51:18 +0000 | [diff] [blame] | 14 | |
Jan Sebechlebsky | 6e1795c | 2023-12-06 09:31:17 +0100 | [diff] [blame] | 15 | |
| 16 | # Allow virtualCamera to call apps via binder. |
| 17 | binder_call(virtual_camera, appdomain) |
| 18 | |
Vadim Caen | f6e88ec | 2023-09-29 16:15:23 +0200 | [diff] [blame] | 19 | # Allow virtual_camera to use fd from apps |
| 20 | allow virtual_camera { appdomain -isolated_app }:fd use; |
Vadim Caen | d64cf75 | 2022-11-04 12:51:18 +0000 | [diff] [blame] | 21 | |
Vadim Caen | f6e88ec | 2023-09-29 16:15:23 +0200 | [diff] [blame] | 22 | # Only allow virtual_camera to add a virtual_camera_service and no one else. |
| 23 | add_service(virtual_camera, virtual_camera_service); |
| 24 | |
| 25 | # Allow virtual_camera to map graphic buffers |
| 26 | hal_client_domain(virtual_camera, hal_graphics_allocator) |
Jan Sebechlebsky | 267b6a9 | 2023-11-17 10:08:16 +0100 | [diff] [blame] | 27 | |
| 28 | # Allow virtual_camera to use GPU |
| 29 | allow virtual_camera gpu_device:chr_file rw_file_perms; |
| 30 | allow virtual_camera gpu_device:dir r_dir_perms; |
Jan Sebechlebsky | de64417 | 2023-11-30 10:57:16 +0100 | [diff] [blame] | 31 | |
| 32 | # For collecting bugreports. |
| 33 | allow virtual_camera dumpstate:fd use; |
| 34 | allow virtual_camera dumpstate:fifo_file write; |
Jan Sebechlebsky | 0959bef | 2023-12-05 14:17:07 +0100 | [diff] [blame] | 35 | |
| 36 | # Needed for permission checks. |
| 37 | allow virtual_camera permission_service:service_manager find; |