• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/core


Commit MetaInfo

修订版c6b07ec0953af6ab9acf430ff57fe61c5130c3b8 (tree)
时间2017-06-14 11:13:50
作者Hung-ying Tyan <tyanh@goog...>
CommiterAndroid (Google) Code Review

Log Message

Merge changes from topic 'move-default-prop-v2' into oc-dev

* changes:

Load /prop.default in recovery mode
Revert "Revert "Load default prop from /system/etc/prop.default""

更改概述

差异

--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -444,7 +444,7 @@ static void handle_property_set_fd() {
444444 }
445445 }
446446
447-static void load_properties_from_file(const char *, const char *);
447+static bool load_properties_from_file(const char *, const char *);
448448
449449 /*
450450 * 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)
508508
509509 // Filter is used to decide which properties to load: NULL loads all keys,
510510 // "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) {
512512 Timer t;
513513 std::string data;
514514 if (!read_file(filename, &data)) {
515515 PLOG(WARNING) << "Couldn't load properties from " << filename;
516- return;
516+ return false;
517517 }
518518 data.push_back('\n');
519519 load_properties(&data[0], filter);
520520 LOG(VERBOSE) << "(Loading properties from " << filename << " took " << t << ".)";
521+ return true;
521522 }
522523
523524 static void load_persistent_properties() {
@@ -592,7 +593,13 @@ static void update_sys_usb_config() {
592593 }
593594
594595 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+ }
596603 load_properties_from_file("/odm/default.prop", NULL);
597604 load_properties_from_file("/vendor/default.prop", NULL);
598605
--- a/libcutils/fs_config.c
+++ b/libcutils/fs_config.c
@@ -135,7 +135,8 @@ static const struct fs_path_config android_files[] = {
135135 { 00640, AID_ROOT, AID_SHELL, 0, "data/nativetest64/tests.txt" },
136136 { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest/*" },
137137 { 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" },
139140 { 00600, AID_ROOT, AID_ROOT, 0, "odm/build.prop" },
140141 { 00600, AID_ROOT, AID_ROOT, 0, "odm/default.prop" },
141142 { 00444, AID_ROOT, AID_ROOT, 0, odm_conf_dir + 1 },