Merge "property_contexts: split into platform and non-platform components"
This commit is contained in:
commit
93e272d00a
1 changed files with 23 additions and 3 deletions
|
@ -988,9 +988,8 @@ 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;
|
||||
}
|
||||
|
@ -1034,6 +1033,27 @@ static bool initialize_properties() {
|
|||
|
||||
free(buffer);
|
||||
fclose(file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool initialize_properties() {
|
||||
// If we do find /property_contexts, then this is being
|
||||
// run as part of the OTA updater on older release that had
|
||||
// /property_contexts - b/34370523
|
||||
if (initialize_properties_from_file("/property_contexts")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue