system/core
修订版 | c6b07ec0953af6ab9acf430ff57fe61c5130c3b8 (tree) |
---|---|
时间 | 2017-06-14 11:13:50 |
作者 | Hung-ying Tyan <tyanh@goog...> |
Commiter | Android (Google) Code Review |
Merge changes from topic 'move-default-prop-v2' into oc-dev
* changes:
@@ -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,13 @@ 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 | + // Try recovery path | |
598 | + if (!load_properties_from_file("/prop.default", NULL)) { | |
599 | + // Try legacy path | |
600 | + load_properties_from_file("/default.prop", NULL); | |
601 | + } | |
602 | + } | |
596 | 603 | load_properties_from_file("/odm/default.prop", NULL); |
597 | 604 | load_properties_from_file("/vendor/default.prop", NULL); |
598 | 605 |
@@ -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 }, |