property_contexts: split into platform and non-platform components am: 8213615461

am: 045ba4b249

Change-Id: Ie92f9de186e3ff723e67ee17f4d6224569dee65f
This commit is contained in:
Sandeep Patil 2017-01-18 06:16:51 +00:00 committed by android-build-merger
commit 84ac3e4354

View file

@ -942,9 +942,9 @@ static int read_spec_entries(char *line_buf, int num_args, ...)
return items;
}
static bool initialize_properties() {
FILE* file = fopen("/property_contexts", "re");
static bool initialize_properties_from_file(const char *filename) {
FILE* file = fopen(filename, "re");
if (!file) {
return false;
}
@ -988,6 +988,20 @@ static bool initialize_properties() {
free(buffer);
fclose(file);
return true;
}
static bool initialize_properties() {
// TODO: Change path to /system/property_contexts after b/27805372
if (!initialize_properties_from_file("/plat_property_contexts")) {
return false;
}
// TODO: Change path to /vendor/property_contexts after b/27805372
// device-specific property context is optional, so load if it exists.
initialize_properties_from_file("/nonplat_property_contexts");
return true;
}