• 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

修订版12ea2d12ef3f708832facef96f5cf9bd84894928 (tree)
时间2017-06-13 22:22:06
作者Hung-ying Tyan <tyanh@goog...>
CommiterHung-ying Tyan

Log Message

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,

checked the location of pro.default, verified the symlink
at /default.prop, checked a few properties via adb shell and
manually tested a few apps.
Booted to recovery mode and ran 'adb sideload' successfully.

Change-Id: I407412a7002b898ffb352cb5f331cab9c15be39a

更改概述

差异

--- 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,10 @@ 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+ // legacy path
598+ load_properties_from_file("/default.prop", NULL);
599+ }
596600 load_properties_from_file("/odm/default.prop", NULL);
597601 load_properties_from_file("/vendor/default.prop", NULL);
598602
--- 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 },