diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-14 07:13:11 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-14 07:13:11 +0000 |
commit | bf609888a50132069d7b35715ff752fbb5adf02a (patch) | |
tree | 72c38cef222fc302b6a5881ff5b403c27360a718 | |
parent | f8be4a35445ae74d18cb24d9d3365e36478f5c66 (diff) | |
parent | c6b07ec0953af6ab9acf430ff57fe61c5130c3b8 (diff) | |
download | core-bf609888a50132069d7b35715ff752fbb5adf02a.tar.gz |
release-request-0b3ce0b0-0f38-494b-a590-b594ba11c2d2-for-git_oc-release-4098933 snap-temp-L41500000074000728
Change-Id: I65f09867239188cfcb2addfcec52eadb4e7b837a
-rw-r--r-- | init/property_service.cpp | 15 | ||||
-rw-r--r-- | libcutils/fs_config.c | 3 |
2 files changed, 13 insertions, 5 deletions
diff --git a/init/property_service.cpp b/init/property_service.cpp index 5884cb60c..73954fe4f 100644 --- a/init/property_service.cpp +++ b/init/property_service.cpp @@ -444,7 +444,7 @@ static void handle_property_set_fd() { } } -static void load_properties_from_file(const char *, const char *); +static bool load_properties_from_file(const char *, const char *); /* * Filter is used to decide which properties to load: NULL loads all keys, @@ -508,16 +508,17 @@ static void load_properties(char *data, const char *filter) // Filter is used to decide which properties to load: NULL loads all keys, // "ro.foo.*" is a prefix match, and "ro.foo.bar" is an exact match. -static void load_properties_from_file(const char* filename, const char* filter) { +static bool load_properties_from_file(const char* filename, const char* filter) { Timer t; std::string data; if (!read_file(filename, &data)) { PLOG(WARNING) << "Couldn't load properties from " << filename; - return; + return false; } data.push_back('\n'); load_properties(&data[0], filter); LOG(VERBOSE) << "(Loading properties from " << filename << " took " << t << ".)"; + return true; } static void load_persistent_properties() { @@ -592,7 +593,13 @@ static void update_sys_usb_config() { } void property_load_boot_defaults() { - load_properties_from_file("/default.prop", NULL); + if (!load_properties_from_file("/system/etc/prop.default", NULL)) { + // Try recovery path + if (!load_properties_from_file("/prop.default", NULL)) { + // Try legacy path + load_properties_from_file("/default.prop", NULL); + } + } load_properties_from_file("/odm/default.prop", NULL); load_properties_from_file("/vendor/default.prop", NULL); diff --git a/libcutils/fs_config.c b/libcutils/fs_config.c index d98a923c9..5b9d17429 100644 --- a/libcutils/fs_config.c +++ b/libcutils/fs_config.c @@ -135,7 +135,8 @@ static const struct fs_path_config android_files[] = { { 00640, AID_ROOT, AID_SHELL, 0, "data/nativetest64/tests.txt" }, { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest/*" }, { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest64/*" }, - { 00600, AID_ROOT, AID_ROOT, 0, "default.prop" }, + { 00600, AID_ROOT, AID_ROOT, 0, "default.prop" }, // legacy + { 00600, AID_ROOT, AID_ROOT, 0, "system/etc/prop.default" }, { 00600, AID_ROOT, AID_ROOT, 0, "odm/build.prop" }, { 00600, AID_ROOT, AID_ROOT, 0, "odm/default.prop" }, { 00444, AID_ROOT, AID_ROOT, 0, odm_conf_dir + 1 }, |