• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1type hal_camera_default_tmpfs, file_type;
2
3allow hal_camera_default self:global_capability_class_set sys_nice;
4allow hal_camera_default kernel:process setsched;
5
6binder_use(hal_camera_default);
7vndbinder_use(hal_camera_default);
8
9allow hal_camera_default lwis_device:chr_file rw_file_perms;
10allow hal_camera_default gpu_device:chr_file rw_file_perms;
11allow hal_camera_default sysfs_chip_id:file r_file_perms;
12
13# Face authentication code that is part of the camera HAL needs to allocate
14# dma_bufs and access the Trusted Execution Environment device node
15allow hal_camera_default dmabuf_system_heap_device:chr_file r_file_perms;
16allow hal_camera_default tee_device:chr_file rw_file_perms;
17
18# Allow the camera hal to access the EdgeTPU service and the
19# Android shared memory allocated by the EdgeTPU service for
20# on-device compilation.
21allow hal_camera_default edgetpu_device:chr_file rw_file_perms;
22allow hal_camera_default sysfs_edgetpu:dir r_dir_perms;
23allow hal_camera_default sysfs_edgetpu:file r_file_perms;
24allow hal_camera_default edgetpu_vendor_service:service_manager find;
25binder_call(hal_camera_default, edgetpu_vendor_server)
26# Allow edgetpu_app_service as well, due to the EdgeTpu metrics logging
27# library has a dependency on edgetpu_app_service, see b/275016466.
28allow hal_camera_default edgetpu_app_service:service_manager find;
29binder_call(hal_camera_default, edgetpu_app_server)
30
31# Allow access to data files used by the camera HAL
32allow hal_camera_default mnt_vendor_file:dir search;
33allow hal_camera_default persist_file:dir search;
34allow hal_camera_default persist_camera_file:dir rw_dir_perms;
35allow hal_camera_default persist_camera_file:file create_file_perms;
36allow hal_camera_default vendor_camera_data_file:dir rw_dir_perms;
37allow hal_camera_default vendor_camera_data_file:file create_file_perms;
38
39# Allow creating dump files for debugging in non-release builds
40userdebug_or_eng(`
41  allow hal_camera_default vendor_camera_data_file:dir create_dir_perms;
42  allow hal_camera_default vendor_camera_data_file:file create_file_perms;
43')
44
45# tmpfs is used by google3 prebuilts linked by the HAL to unpack data files
46# compiled into the shared libraries with cc_embed_data rules
47tmpfs_domain(hal_camera_default);
48
49# Allow access to camera-related system properties
50set_prop(hal_camera_default, vendor_camera_prop);
51set_prop(hal_camera_default, log_tag_prop);
52get_prop(hal_camera_default, vendor_camera_debug_prop);
53userdebug_or_eng(`
54  set_prop(hal_camera_default, vendor_camera_fatp_prop);
55  set_prop(hal_camera_default, vendor_camera_debug_prop);
56')
57
58# For camera hal to talk with rlsservice
59allow hal_camera_default rls_service:service_manager find;
60binder_call(hal_camera_default, rlsservice)
61
62hal_client_domain(hal_camera_default, hal_graphics_allocator);
63hal_client_domain(hal_camera_default, hal_graphics_composer)
64hal_client_domain(hal_camera_default, hal_power);
65hal_client_domain(hal_camera_default, hal_thermal);
66
67# Allow access to sensor service for sensor_listener
68binder_call(hal_camera_default, system_server);
69
70# Allow Binder calls to ECO service, needed by Entropy-Aware Filtering
71allow hal_camera_default eco_service:service_manager find;
72binder_call(hal_camera_default, mediacodec_samsung);
73
74# Allow camera HAL to query preferred camera frequencies from the radio HAL
75# extensions to avoid interference with cellular antennas.
76allow hal_camera_default hal_radioext_hwservice:hwservice_manager find;
77binder_call(hal_camera_default, hal_radioext_default);
78
79# Allow camera HAL to connect to the stats service.
80allow hal_camera_default fwk_stats_service:service_manager find;
81
82# For observing apex file changes
83allow hal_camera_default apex_info_file:file r_file_perms;
84
85# Allow camera HAL to query current device clock frequencies.
86allow hal_camera_default sysfs_devfreq_cur:file r_file_perms;
87
88# Allow camera HAL to read backlight of display
89allow hal_camera_default sysfs_leds:dir r_dir_perms;
90allow hal_camera_default sysfs_leds:file r_file_perms;
91
92# Allow camera HAL to send trace packets to Perfetto
93userdebug_or_eng(`perfetto_producer(hal_camera_default)')
94
95# Some file searches attempt to access system data and are denied.
96# This is benign and can be ignored.
97dontaudit hal_camera_default system_data_file:dir { search };
98
99# google3 prebuilts attempt to connect to the wrong trace socket, ignore them.
100dontaudit hal_camera_default traced:unix_stream_socket { connectto };
101dontaudit hal_camera_default traced_producer_socket:sock_file { write };
102
103# Allow access to always-on compute device node
104allow hal_camera_default aoc_device:chr_file rw_file_perms;
105
106# Allow the Camera HAL to acquire wakelocks
107wakelock_use(hal_camera_default)
108