Revert "Revert "Use Apex sepolicy if it's available""
This reverts commit 5638fcc22bc6d5e31a3e0a7fcf436c8379b1ae48.
Reason for revert: Root cause of b/217252559 fixed.
Change-Id: I8d2fbf0cab23a56dbea1f422608097c48d9288c0
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 70e26ec..bdd5677 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -1171,6 +1171,9 @@
// Don't check for failure here, since we don't always have all of these partitions.
// E.g. In case of recovery, the vendor partition will not have mounted and we
// still need the system / platform properties to function.
+ if (access("/dev/selinux/apex_property_contexts", R_OK) != -1) {
+ LoadPropertyInfoFromFile("/dev/selinux/apex_property_contexts", &property_infos);
+ }
if (access("/system_ext/etc/selinux/system_ext_property_contexts", R_OK) != -1) {
LoadPropertyInfoFromFile("/system_ext/etc/selinux/system_ext_property_contexts",
&property_infos);
@@ -1194,6 +1197,7 @@
LoadPropertyInfoFromFile("/vendor_property_contexts", &property_infos);
LoadPropertyInfoFromFile("/product_property_contexts", &property_infos);
LoadPropertyInfoFromFile("/odm_property_contexts", &property_infos);
+ LoadPropertyInfoFromFile("/dev/selinux/apex_property_contexts", &property_infos);
}
auto serialized_contexts = std::string();