Lei Ju | f7f93da | 2023-12-15 14:48:25 -0800 | [diff] [blame] | 1 | # Allow context hub HAL to communicate with daemon via socket |
| 2 | unix_socket_connect(hal_contexthub_default, chre, chre) |
| 3 | |
| 4 | # Permit communication with AoC |
| 5 | allow hal_contexthub_default aoc_device:chr_file rw_file_perms; |
| 6 | |
| 7 | # Allow context hub HAL to determine AoC's current clock |
| 8 | allow hal_contexthub_default sysfs_aoc:dir search; |
| 9 | allow hal_contexthub_default sysfs_aoc_boottime:file r_file_perms; |
| 10 | |
| 11 | # Allow context hub HAL to create thread to watch AOC's device |
Lei Ju | 403baea | 2023-12-20 16:36:18 -0800 | [diff] [blame^] | 12 | allow hal_contexthub_default device:dir r_dir_perms; |
Lei Ju | f7f93da | 2023-12-15 14:48:25 -0800 | [diff] [blame] | 13 | |
| 14 | # Allow context hub HAL to use the USF low latency transport |
| 15 | usf_low_latency_transport(hal_contexthub_default) |
| 16 | |
| 17 | # Allow context hub HAL to talk to the WiFi HAL |
| 18 | binder_call(hal_contexthub_default, hal_wifi_ext) |
| 19 | allow hal_contexthub_default hal_wifi_ext_service:service_manager find; |
| 20 | |
| 21 | # Allow context hub HAL to talk to stats service |
| 22 | binder_call(hal_contexthub_default, stats_service_server) |
| 23 | allow hal_contexthub_default fwk_stats_service:service_manager find; |
| 24 | |
Lei Ju | 403baea | 2023-12-20 16:36:18 -0800 | [diff] [blame^] | 25 | # Allow context hub HAL to write data to /data/vendor/chre/ directory |
| 26 | allow hal_contexthub_default chre_data_file:dir create_dir_perms; |
| 27 | allow hal_contexthub_default chre_data_file:file create_file_perms; |
| 28 | |
Lei Ju | f7f93da | 2023-12-15 14:48:25 -0800 | [diff] [blame] | 29 | # Allow context hub HAL to use WakeLock |
| 30 | wakelock_use(hal_contexthub_default) |
| 31 | |
| 32 | # Allow context hub HAL to block suspend, which is required to use EPOLLWAKEUP |
| 33 | allow hal_contexthub_default self:global_capability2_class_set block_suspend; |