Merge "Renames nonplat_property_contexts to vendor_property_contexts"
diff --git a/libc/system_properties/contexts_split.cpp b/libc/system_properties/contexts_split.cpp
index b8afa29..92baedd 100644
--- a/libc/system_properties/contexts_split.cpp
+++ b/libc/system_properties/contexts_split.cpp
@@ -274,12 +274,22 @@
// Don't check for failure here, so we always have a sane list of properties.
// E.g. In case of recovery, the vendor partition will not have mounted and we
// still need the system / platform properties to function.
- InitializePropertiesFromFile("/vendor/etc/selinux/nonplat_property_contexts");
+ if (access("/vendor/etc/selinux/vendor_property_contexts", R_OK) != -1) {
+ InitializePropertiesFromFile("/vendor/etc/selinux/vendor_property_contexts");
+ } else {
+ // Fallback to nonplat_* if vendor_* doesn't exist.
+ InitializePropertiesFromFile("/vendor/etc/selinux/nonplat_property_contexts");
+ }
} else {
if (!InitializePropertiesFromFile("/plat_property_contexts")) {
return false;
}
- InitializePropertiesFromFile("/nonplat_property_contexts");
+ if (access("/vendor_property_contexts", R_OK) != -1) {
+ InitializePropertiesFromFile("/vendor_property_contexts");
+ } else {
+ // Fallback to nonplat_* if vendor_* doesn't exist.
+ InitializePropertiesFromFile("/nonplat_property_contexts");
+ }
}
return true;