1 # otapreopt_slot 2 # 3 # This command set moves the artifact corresponding to the current slot 4 # from /data/ota to /data/dalvik-cache. 5 6 type otapreopt_slot, domain, mlstrustedsubject; 7 type otapreopt_slot_exec, exec_type, file_type; 8 9 # Technically not a daemon but we do want the transition from init domain to 10 # cppreopts to occur. 11 init_daemon_domain(otapreopt_slot) 12 13 # The otapreopt_slot renames the OTA dalvik-cache to the regular dalvik-cache, and cleans up 14 # the directory afterwards. For logging of aggregate size, we need getattr. 15 allow otapreopt_slot ota_data_file:dir { rw_dir_perms rename reparent rmdir }; 16 allow otapreopt_slot ota_data_file:file { getattr }; 17 18 # Delete old content of the dalvik-cache. 19 allow otapreopt_slot dalvikcache_data_file:dir { add_name getattr open read remove_name rmdir search write }; 20 allow otapreopt_slot dalvikcache_data_file:file { getattr unlink }; 21 allow otapreopt_slot dalvikcache_data_file:lnk_file { getattr read unlink }; 22 23 # Allow cppreopts to execute itself using #!/system/bin/sh 24 allow otapreopt_slot shell_exec:file rx_file_perms; 25 26 # Allow running the mv and rm/rmdir commands using otapreopt_slot permissions. 27 # Needed so we can move artifacts into /data/dalvik-cache/dalvik-cache. 28 allow otapreopt_slot toolbox_exec:file rx_file_perms; 29