Merge "use dalvik.vm.boot-dex2oat-threads inside microdroid"
diff --git a/microdroid/system/private/compos.te b/microdroid/system/private/compos.te
index 41dd91a..6730a37 100644
--- a/microdroid/system/private/compos.te
+++ b/microdroid/system/private/compos.te
@@ -44,3 +44,6 @@
# TODO(b/209008712): Remove dex2oat once the migration is done.
domain_auto_trans(compos, odrefresh_exec, odrefresh)
domain_auto_trans(compos, dex2oat_exec, dex2oat)
+
+# Allow compos to set dalvik.vm.boot-dex2oat-threads
+set_prop(compos, dalvik_config_prop)
diff --git a/microdroid/system/private/dex2oat.te b/microdroid/system/private/dex2oat.te
index c7c53c2..d4d369a 100644
--- a/microdroid/system/private/dex2oat.te
+++ b/microdroid/system/private/dex2oat.te
@@ -28,7 +28,10 @@
# Allow dex2oat to read /apex/apex-info-list.xml
allow dex2oat apex_info_file:file r_file_perms;
+# dex2oat gets the concurrency level via this property which is set by compos
+get_prop(dex2oat, dalvik_config_prop)
+
# Don't audit because we don't configure the compiler through system properties
-# in the VM.
-dontaudit dex2oat dalvik_config_prop:file { open read getattr map };
+# in the VM except for dalvik.vm.boot-dex2oat-threads
+dontaudit dex2oat dalvik_config_ignored_prop:file { open read getattr map };
dontaudit dex2oat device_config_runtime_native_prop:file { open read getattr map };
diff --git a/microdroid/system/private/property.te b/microdroid/system/private/property.te
index 7911753..4bf99c9 100644
--- a/microdroid/system/private/property.te
+++ b/microdroid/system/private/property.te
@@ -1,4 +1,5 @@
# Declare ART properties for CompOS
+system_public_prop(dalvik_config_ignored_prop)
system_public_prop(dalvik_config_prop)
system_restricted_prop(device_config_runtime_native_prop)
diff --git a/microdroid/system/private/property_contexts b/microdroid/system/private/property_contexts
index 7b63cae..eb2b9e8 100644
--- a/microdroid/system/private/property_contexts
+++ b/microdroid/system/private/property_contexts
@@ -163,7 +163,8 @@
heapprofd.enable u:object_r:heapprofd_prop:s0 exact bool
# ART properties for CompOS
-dalvik.vm. u:object_r:dalvik_config_prop:s0 prefix
+dalvik.vm. u:object_r:dalvik_config_ignored_prop:s0 prefix
persist.device_config.runtime_native. u:object_r:device_config_runtime_native_prop:s0 prefix
+dalvik.vm.boot-dex2oat-threads u:object_r:dalvik_config_prop:s0 exact int
apexd.payload_metadata.path u:object_r:apexd_payload_metadata_prop:s0 exact string