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