Yakun Xu | 07429e3 | 2023-06-02 03:36:01 +0000 | [diff] [blame] | 1 | # |
| 2 | # ot_daemon is the native Thread network stack on the host (Android) side. |
| 3 | # Refer to https://www.threadgroup.org for Thread network knowledge. |
| 4 | # |
| 5 | |
| 6 | # ot_daemon |
| 7 | type ot_daemon, domain, coredomain; |
| 8 | type ot_daemon_exec, exec_type, file_type, system_file_type; |
| 9 | |
| 10 | # Allow init ot_daemon |
| 11 | init_daemon_domain(ot_daemon) |
| 12 | # Allow the ot_daemon to use the net domain. |
| 13 | net_domain(ot_daemon) |
| 14 | |
Kangping Dong | e21496b | 2024-01-02 15:10:27 +0800 | [diff] [blame] | 15 | # Allow ot_daemon to find /data/misc/apexdata/com.android.tethering |
| 16 | allow ot_daemon apex_module_data_file:dir search; |
| 17 | |
| 18 | # Allow the ot_daemon to access files and subdirectories under |
| 19 | # /data/misc/apexdata/com\.android\.tethering |
| 20 | allow ot_daemon apex_tethering_data_file:dir {create rw_dir_perms}; |
| 21 | allow ot_daemon apex_tethering_data_file:file create_file_perms; |
Yakun Xu | 07429e3 | 2023-06-02 03:36:01 +0000 | [diff] [blame] | 22 | |
Kangping Dong | 0b3e8c6 | 2022-10-28 15:56:02 +0800 | [diff] [blame] | 23 | # Allow OT daemon to read/write the Thread tunnel interface |
| 24 | allow ot_daemon tun_device:chr_file {read write}; |
| 25 | |
Handa Wang | 8612e80 | 2023-08-23 15:40:49 +0800 | [diff] [blame] | 26 | # Allow OT daemon to read/write on the socket created by System Server |
| 27 | allow ot_daemon system_server:rawip_socket rw_socket_perms_no_ioctl; |
| 28 | |
Zhanglong Xia | b2d1fbb | 2023-06-14 05:26:15 +0000 | [diff] [blame] | 29 | hal_client_domain(ot_daemon, hal_threadnetwork) |
Kangping Dong | 0b3e8c6 | 2022-10-28 15:56:02 +0800 | [diff] [blame] | 30 | |
| 31 | # Only ot_daemon can publish the binder service |
| 32 | binder_use(ot_daemon) |
| 33 | add_service(ot_daemon, ot_daemon_service) |
| 34 | binder_call(ot_daemon, system_server) |
Tony Zhou | 4ed6a0d | 2023-10-26 13:43:59 +0800 | [diff] [blame] | 35 | |
| 36 | # Allow OT daemon to write to statsd |
| 37 | unix_socket_send(ot_daemon, statsdw, statsd) |
Kangping Dong | e1ee768 | 2023-12-01 13:02:38 +0800 | [diff] [blame] | 38 | |
| 39 | # For collecting bugreports. |
| 40 | allow ot_daemon dumpstate:fd use; |
| 41 | allow ot_daemon dumpstate:fifo_file write; |