property_contexts: split into platform and non-platform components

Bug: 33746484
Test: Successfully boot with original service and property contexts.
Test: Successfully boot with split serivce and property contexts.

Change-Id: Id1acb8c4273c6f93396e8cf7a063571a2bf08786
Signed-off-by: Sandeep Patil <sspatil@google.com>
This commit is contained in:
Sandeep Patil 2016-12-27 17:37:44 -08:00
parent fb07c36bc0
commit 8213615461

View file

@ -941,9 +941,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;
}
@ -987,6 +987,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;
}