blob: dd61e3935335f16fcc4fefb0a891446a3aea1bf4 [file] [log] [blame]
Alan Stokesd376e202021-09-09 17:08:15 +01001type composd, domain, coredomain;
2type composd_exec, system_file_type, exec_type, file_type;
3
Alan Stokes8788f7a2021-11-19 17:33:34 +00004# Host dynamic AIDL services
Alan Stokesd376e202021-09-09 17:08:15 +01005init_daemon_domain(composd)
6binder_use(composd)
7add_service(composd, compos_service)
Alan Stokes8788f7a2021-11-19 17:33:34 +00008add_service(composd, compos_internal_service)
Alan Stokesd376e202021-09-09 17:08:15 +01009
Alan Stokes9112c9a2021-10-19 16:50:24 +010010# Call back into system server
11binder_call(composd, system_server)
12
Alan Stokesd376e202021-09-09 17:08:15 +010013# Start a VM
14virtualizationservice_use(composd)
15
Alan Stokes29146102021-12-16 14:31:14 +000016# Prepare staging directory for odrefresh
Victor Hsieh33aa1a32021-12-03 16:46:18 -080017allow composd apex_art_data_file:dir { create_dir_perms relabelfrom };
18allow composd apex_art_staging_data_file:dir { create_dir_perms relabelto };
Alan Stokesce6e2982021-12-21 14:43:39 +000019allow composd apex_art_staging_data_file:file { getattr unlink };
Victor Hsieh33aa1a32021-12-03 16:46:18 -080020
Alan Stokes29146102021-12-16 14:31:14 +000021# Delete files in the odrefresh target directory
22allow composd apex_art_data_file:file unlink;
23
Alan Stokesd376e202021-09-09 17:08:15 +010024# Access our APEX data files
25allow composd apex_module_data_file:dir search;
26allow composd apex_compos_data_file:dir create_dir_perms;
27allow composd apex_compos_data_file:file create_file_perms;
Alan Stokesd3438b02021-09-15 14:28:12 +010028
Alan Stokes29146102021-12-16 14:31:14 +000029# TODO(b/209008712): Remove these when we run odrefresh in the VM
Alan Stokes9112c9a2021-10-19 16:50:24 +010030# Run odrefresh to refresh ART artifacts, and kill it if we need to
Alan Stokesd3438b02021-09-15 14:28:12 +010031domain_auto_trans(composd, odrefresh_exec, odrefresh)
Alan Stokes9112c9a2021-10-19 16:50:24 +010032allow composd odrefresh:process sigkill;
Victor Hsieh1f117c262021-12-01 15:25:23 -080033
Victor Hsieh90b7b002021-11-30 14:21:06 -080034# Run fd_server in its own domain, and send SIGTERM when finished.
35domain_auto_trans(composd, fd_server_exec, compos_fd_server)
36allow composd compos_fd_server:process signal;
37
Victor Hsieh1f117c262021-12-01 15:25:23 -080038# Read ART's properties
39get_prop(composd, dalvik_config_prop)
Alan Stokes29146102021-12-16 14:31:14 +000040
41# We never create any artifact files directly
42neverallow composd apex_art_data_file:file ~unlink;