1# HwBinder IPC from clients to server and callbacks
2binder_call(hal_camera_client, hal_camera_server)
3binder_call(hal_camera_server, hal_camera_client)
4
5add_hwservice(hal_camera_server, hal_camera_hwservice)
6allow hal_camera_client hal_camera_hwservice:hwservice_manager find;
7
8allow hal_camera device:dir r_dir_perms;
9allow hal_camera video_device:dir r_dir_perms;
10allow hal_camera video_device:chr_file rw_file_perms;
11allow hal_camera camera_device:chr_file rw_file_perms;
12allow hal_camera ion_device:chr_file rw_file_perms;
13# Both the client and the server need to use the graphics allocator
14allow { hal_camera_client hal_camera_server } hal_graphics_allocator:fd use;
15
16# Allow hal_camera to use fd from app,gralloc,and ashmem HAL
17allow hal_camera { appdomain -isolated_app }:fd use;
18allow hal_camera surfaceflinger:fd use;
19allow hal_camera hal_allocator_server:fd use;
20
21###
22### neverallow rules
23###
24
25# hal_camera should never execute any executable without a
26# domain transition
27neverallow hal_camera_server { file_type fs_type }:file execute_no_trans;
28
29# hal_camera should never need network access. Disallow network sockets.
30neverallow hal_camera_server domain:{ tcp_socket udp_socket rawip_socket } *;
31
32# Only camera HAL may directly access the camera hardware
33neverallow { halserverdomain -hal_camera_server } camera_device:chr_file *;
34