system/core
Revision | 12ea2d12ef3f708832facef96f5cf9bd84894928 (tree) |
---|---|
Time | 2017-06-13 22:22:06 |
Author | Hung-ying Tyan <tyanh@goog...> |
Commiter | Hung-ying Tyan |
Revert "Revert "Load default prop from /system/etc/prop.default""
This reverts commit 98a73a2ce10df46bc8d095413b415e284206836b.
Bug: 37815285
Bug: 62525809
Test: Tested with ag/2398663 and ag/2400524. Booted pixel phones,
Change-Id: I407412a7002b898ffb352cb5f331cab9c15be39a
@@ -444,7 +444,7 @@ static void handle_property_set_fd() { | ||
444 | 444 | } |
445 | 445 | } |
446 | 446 | |
447 | -static void load_properties_from_file(const char *, const char *); | |
447 | +static bool load_properties_from_file(const char *, const char *); | |
448 | 448 | |
449 | 449 | /* |
450 | 450 | * 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) | ||
508 | 508 | |
509 | 509 | // Filter is used to decide which properties to load: NULL loads all keys, |
510 | 510 | // "ro.foo.*" is a prefix match, and "ro.foo.bar" is an exact match. |
511 | -static void load_properties_from_file(const char* filename, const char* filter) { | |
511 | +static bool load_properties_from_file(const char* filename, const char* filter) { | |
512 | 512 | Timer t; |
513 | 513 | std::string data; |
514 | 514 | if (!read_file(filename, &data)) { |
515 | 515 | PLOG(WARNING) << "Couldn't load properties from " << filename; |
516 | - return; | |
516 | + return false; | |
517 | 517 | } |
518 | 518 | data.push_back('\n'); |
519 | 519 | load_properties(&data[0], filter); |
520 | 520 | LOG(VERBOSE) << "(Loading properties from " << filename << " took " << t << ".)"; |
521 | + return true; | |
521 | 522 | } |
522 | 523 | |
523 | 524 | static void load_persistent_properties() { |
@@ -592,7 +593,10 @@ static void update_sys_usb_config() { | ||
592 | 593 | } |
593 | 594 | |
594 | 595 | void property_load_boot_defaults() { |
595 | - load_properties_from_file("/default.prop", NULL); | |
596 | + if (!load_properties_from_file("/system/etc/prop.default", NULL)) { | |
597 | + // legacy path | |
598 | + load_properties_from_file("/default.prop", NULL); | |
599 | + } | |
596 | 600 | load_properties_from_file("/odm/default.prop", NULL); |
597 | 601 | load_properties_from_file("/vendor/default.prop", NULL); |
598 | 602 |
@@ -135,7 +135,8 @@ static const struct fs_path_config android_files[] = { | ||
135 | 135 | { 00640, AID_ROOT, AID_SHELL, 0, "data/nativetest64/tests.txt" }, |
136 | 136 | { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest/*" }, |
137 | 137 | { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest64/*" }, |
138 | - { 00600, AID_ROOT, AID_ROOT, 0, "default.prop" }, | |
138 | + { 00600, AID_ROOT, AID_ROOT, 0, "default.prop" }, // legacy | |
139 | + { 00600, AID_ROOT, AID_ROOT, 0, "system/etc/prop.default" }, | |
139 | 140 | { 00600, AID_ROOT, AID_ROOT, 0, "odm/build.prop" }, |
140 | 141 | { 00600, AID_ROOT, AID_ROOT, 0, "odm/default.prop" }, |
141 | 142 | { 00444, AID_ROOT, AID_ROOT, 0, odm_conf_dir + 1 }, |