1*e4a36f41SAndroid Build Coastguard Worker# virtual_camera - virtual camera daemon 2*e4a36f41SAndroid Build Coastguard Worker 3*e4a36f41SAndroid Build Coastguard Workertype virtual_camera, domain, coredomain; 4*e4a36f41SAndroid Build Coastguard Workertype virtual_camera_exec, system_file_type, exec_type, file_type; 5*e4a36f41SAndroid Build Coastguard Worker 6*e4a36f41SAndroid Build Coastguard Workerinit_daemon_domain(virtual_camera) 7*e4a36f41SAndroid Build Coastguard Worker 8*e4a36f41SAndroid Build Coastguard Worker# Since virtual_camera is not a real HAL we don't set the 9*e4a36f41SAndroid Build Coastguard Worker# hal_server_domain(virtual_camera, hal_camera) macro but only the rules that 10*e4a36f41SAndroid Build Coastguard Worker# we actually need from halserverdomain and hal_camera_server: 11*e4a36f41SAndroid Build Coastguard Workerbinder_use(virtual_camera) 12*e4a36f41SAndroid Build Coastguard Workerbinder_call(virtual_camera, cameraserver) 13*e4a36f41SAndroid Build Coastguard Workerbinder_call(virtual_camera, system_server) 14*e4a36f41SAndroid Build Coastguard Worker 15*e4a36f41SAndroid Build Coastguard Worker# Allow virtual_camera to communicate with 16*e4a36f41SAndroid Build Coastguard Worker# mediaserver (required for using Surface originating 17*e4a36f41SAndroid Build Coastguard Worker# from virtual camera in mediaserver). 18*e4a36f41SAndroid Build Coastguard Workerbinder_call(virtual_camera, mediaserver) 19*e4a36f41SAndroid Build Coastguard Worker 20*e4a36f41SAndroid Build Coastguard Worker# Required for the codecs to be able to decode 21*e4a36f41SAndroid Build Coastguard Worker# video into surface provided by virtual camera. 22*e4a36f41SAndroid Build Coastguard Workerhal_client_domain(virtual_camera, hal_codec2) 23*e4a36f41SAndroid Build Coastguard Workerhal_client_domain(virtual_camera, hal_omx) 24*e4a36f41SAndroid Build Coastguard Worker 25*e4a36f41SAndroid Build Coastguard Worker# Allow virtualCamera to call apps via binder. 26*e4a36f41SAndroid Build Coastguard Workerbinder_call(virtual_camera, appdomain) 27*e4a36f41SAndroid Build Coastguard Worker 28*e4a36f41SAndroid Build Coastguard Worker# Allow virtual_camera to use fd from apps 29*e4a36f41SAndroid Build Coastguard Workerallow virtual_camera { appdomain -isolated_app }:fd use; 30*e4a36f41SAndroid Build Coastguard Worker 31*e4a36f41SAndroid Build Coastguard Workerbinder_call(virtual_camera, surfaceflinger); 32*e4a36f41SAndroid Build Coastguard Worker 33*e4a36f41SAndroid Build Coastguard Worker# Only allow virtual_camera to add a virtual_camera_service and no one else. 34*e4a36f41SAndroid Build Coastguard Workeradd_service(virtual_camera, virtual_camera_service); 35*e4a36f41SAndroid Build Coastguard Worker 36*e4a36f41SAndroid Build Coastguard Worker# Allow virtual_camera to map graphic buffers 37*e4a36f41SAndroid Build Coastguard Workerhal_client_domain(virtual_camera, hal_graphics_allocator) 38*e4a36f41SAndroid Build Coastguard Worker 39*e4a36f41SAndroid Build Coastguard Worker# Allow virtual_camera to use GPU 40*e4a36f41SAndroid Build Coastguard Workerallow virtual_camera gpu_device:chr_file rw_file_perms; 41*e4a36f41SAndroid Build Coastguard Workerallow virtual_camera gpu_device:dir r_dir_perms; 42*e4a36f41SAndroid Build Coastguard Workerr_dir_file(virtual_camera, sysfs_gpu) 43*e4a36f41SAndroid Build Coastguard Worker 44*e4a36f41SAndroid Build Coastguard Worker# Allow virtual camera to use graphics composer fd-s (fences). 45*e4a36f41SAndroid Build Coastguard Workerallow virtual_camera hal_graphics_composer:fd use; 46*e4a36f41SAndroid Build Coastguard Worker 47*e4a36f41SAndroid Build Coastguard Worker# For collecting bugreports. 48*e4a36f41SAndroid Build Coastguard Workerallow virtual_camera dumpstate:fd use; 49*e4a36f41SAndroid Build Coastguard Workerallow virtual_camera dumpstate:fifo_file write; 50*e4a36f41SAndroid Build Coastguard Worker 51*e4a36f41SAndroid Build Coastguard Worker# Needed for permission checks. 52*e4a36f41SAndroid Build Coastguard Workerallow virtual_camera permission_service:service_manager find; 53*e4a36f41SAndroid Build Coastguard Worker 54*e4a36f41SAndroid Build Coastguard Worker# Allow 'adb shell cmd' to configure test instances of camera. 55*e4a36f41SAndroid Build Coastguard Workerallow virtual_camera adbd:fd use; 56*e4a36f41SAndroid Build Coastguard Workerallow virtual_camera adbd:unix_stream_socket { getattr read write }; 57*e4a36f41SAndroid Build Coastguard Workerallow virtual_camera shell:fifo_file { getattr read write }; 58