summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--init/property_service.cpp15
-rw-r--r--libcutils/fs_config.cpp3
2 files changed, 13 insertions, 5 deletions
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 925cc9bd7..fd14bd66f 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -520,7 +520,7 @@ static void handle_property_set_fd() {
520 } 520 }
521} 521}
522 522
523static void load_properties_from_file(const char *, const char *); 523static bool load_properties_from_file(const char *, const char *);
524 524
525/* 525/*
526 * Filter is used to decide which properties to load: NULL loads all keys, 526 * Filter is used to decide which properties to load: NULL loads all keys,
@@ -584,17 +584,18 @@ static void load_properties(char *data, const char *filter)
584 584
585// Filter is used to decide which properties to load: NULL loads all keys, 585// Filter is used to decide which properties to load: NULL loads all keys,
586// "ro.foo.*" is a prefix match, and "ro.foo.bar" is an exact match. 586// "ro.foo.*" is a prefix match, and "ro.foo.bar" is an exact match.
587static void load_properties_from_file(const char* filename, const char* filter) { 587static bool load_properties_from_file(const char* filename, const char* filter) {
588 Timer t; 588 Timer t;
589 std::string data; 589 std::string data;
590 std::string err; 590 std::string err;
591 if (!ReadFile(filename, &data, &err)) { 591 if (!ReadFile(filename, &data, &err)) {
592 PLOG(WARNING) << "Couldn't load property file: " << err; 592 PLOG(WARNING) << "Couldn't load property file: " << err;
593 return; 593 return false;
594 } 594 }
595 data.push_back('\n'); 595 data.push_back('\n');
596 load_properties(&data[0], filter); 596 load_properties(&data[0], filter);
597 LOG(VERBOSE) << "(Loading properties from " << filename << " took " << t << ".)"; 597 LOG(VERBOSE) << "(Loading properties from " << filename << " took " << t << ".)";
598 return true;
598} 599}
599 600
600static void load_persistent_properties() { 601static void load_persistent_properties() {
@@ -669,7 +670,13 @@ static void update_sys_usb_config() {
669} 670}
670 671
671void property_load_boot_defaults() { 672void property_load_boot_defaults() {
672 load_properties_from_file("/default.prop", NULL); 673 if (!load_properties_from_file("/system/etc/prop.default", NULL)) {
674 // Try recovery path
675 if (!load_properties_from_file("/prop.default", NULL)) {
676 // Try legacy path
677 load_properties_from_file("/default.prop", NULL);
678 }
679 }
673 load_properties_from_file("/odm/default.prop", NULL); 680 load_properties_from_file("/odm/default.prop", NULL);
674 load_properties_from_file("/vendor/default.prop", NULL); 681 load_properties_from_file("/vendor/default.prop", NULL);
675 682
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
index a1dbd7881..cc96ff854 100644
--- a/libcutils/fs_config.cpp
+++ b/libcutils/fs_config.cpp
@@ -134,7 +134,8 @@ static const struct fs_path_config android_files[] = {
134 { 00640, AID_ROOT, AID_SHELL, 0, "data/nativetest64/tests.txt" }, 134 { 00640, AID_ROOT, AID_SHELL, 0, "data/nativetest64/tests.txt" },
135 { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest/*" }, 135 { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest/*" },
136 { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest64/*" }, 136 { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest64/*" },
137 { 00600, AID_ROOT, AID_ROOT, 0, "default.prop" }, 137 { 00600, AID_ROOT, AID_ROOT, 0, "default.prop" }, // legacy
138 { 00600, AID_ROOT, AID_ROOT, 0, "system/etc/prop.default" },
138 { 00600, AID_ROOT, AID_ROOT, 0, "odm/build.prop" }, 139 { 00600, AID_ROOT, AID_ROOT, 0, "odm/build.prop" },
139 { 00600, AID_ROOT, AID_ROOT, 0, "odm/default.prop" }, 140 { 00600, AID_ROOT, AID_ROOT, 0, "odm/default.prop" },
140 { 00444, AID_ROOT, AID_ROOT, 0, odm_conf_dir + 1 }, 141 { 00444, AID_ROOT, AID_ROOT, 0, odm_conf_dir + 1 },