summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-05-25 18:05:37 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-05-25 18:05:39 +0000
commitf9259b59e8442373955257a1ae066ff924d40468 (patch)
treef91e402e26e547b978b1ae96d417297b57b32b53
parent34cfb3cbc6969b4584fb4d95a878dc317b2b7880 (diff)
parent3346338919caef7861860ecef74795e9188817e0 (diff)
downloadcore-f9259b59e8442373955257a1ae066ff924d40468.tar.gz
core-f9259b59e8442373955257a1ae066ff924d40468.tar.bz2
core-f9259b59e8442373955257a1ae066ff924d40468.zip
Merge "Revert "Load {default,build}.prop from /{system,vendor,odm}/etc/""
-rw-r--r--init/property_service.cpp34
-rw-r--r--libcutils/fs_config.cpp15
2 files changed, 17 insertions, 32 deletions
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 7fa37c8a9..18e47e3df 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -443,7 +443,7 @@ static void handle_property_set_fd() {
}
}
-static bool load_properties_from_file(const char *, const char *);
+static void load_properties_from_file(const char *, const char *);
/*
* Filter is used to decide which properties to load: NULL loads all keys,
@@ -507,18 +507,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 bool load_properties_from_file(const char* filename, const char* filter) {
+static void load_properties_from_file(const char* filename, const char* filter) {
Timer t;
std::string data;
std::string err;
if (!ReadFile(filename, &data, &err)) {
- PLOG(WARNING) << "Couldn't load property file: " << filename << ": " << err;
- return false;
+ PLOG(WARNING) << "Couldn't load property file: " << err;
+ return;
}
data.push_back('\n');
load_properties(&data[0], filter);
LOG(VERBOSE) << "(Loading properties from " << filename << " took " << t << ".)";
- return true;
}
static void load_persistent_properties() {
@@ -593,21 +592,16 @@ static void update_sys_usb_config() {
}
void property_load_boot_defaults() {
- if (!load_properties_from_file("/system/etc/prop.default", nullptr)) {
- // for legacy devices
- if (!load_properties_from_file("/default.prop", nullptr)) {
- PLOG(ERROR) << "Failed to load default prop";
- }
- }
- load_properties_from_file("/odm/etc/prop.default", nullptr);
- load_properties_from_file("/vendor/etc/prop.default", nullptr);
+ load_properties_from_file("/default.prop", NULL);
+ load_properties_from_file("/odm/default.prop", NULL);
+ load_properties_from_file("/vendor/default.prop", NULL);
update_sys_usb_config();
}
static void load_override_properties() {
if (ALLOW_LOCAL_PROP_OVERRIDE) {
- load_properties_from_file("/data/local.prop", nullptr);
+ load_properties_from_file("/data/local.prop", NULL);
}
}
@@ -655,15 +649,9 @@ void load_recovery_id_prop() {
}
void load_system_props() {
- if (!load_properties_from_file("/system/etc/prop.build", nullptr)) {
- // for legacy devices
- load_properties_from_file("/system/build.prop", nullptr);
- }
- load_properties_from_file("/odm/etc/prop.build", nullptr);
- if (!load_properties_from_file("/vendor/etc/prop.build", nullptr)) {
- // for legacy devices
- load_properties_from_file("/vendor/build.prop", nullptr);
- }
+ load_properties_from_file("/system/build.prop", NULL);
+ load_properties_from_file("/odm/build.prop", NULL);
+ load_properties_from_file("/vendor/build.prop", NULL);
load_properties_from_file("/factory/factory.prop", "ro.*");
load_recovery_id_prop();
}
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
index dd1ad3a38..919b65bc3 100644
--- a/libcutils/fs_config.cpp
+++ b/libcutils/fs_config.cpp
@@ -134,10 +134,9 @@ 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" }, // legacy
- { 00600, AID_ROOT, AID_ROOT, 0, "system/etc/prop.default" },
- { 00600, AID_ROOT, AID_ROOT, 0, "odm/etc/prop.build" },
- { 00600, AID_ROOT, AID_ROOT, 0, "odm/etc/prop.default" },
+ { 00600, AID_ROOT, AID_ROOT, 0, "default.prop" },
+ { 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 },
{ 00444, AID_ROOT, AID_ROOT, 0, odm_conf_file + 1 },
{ 00444, AID_ROOT, AID_ROOT, 0, oem_conf_dir + 1 },
@@ -149,8 +148,7 @@ static const struct fs_path_config android_files[] = {
{ 00750, AID_ROOT, AID_ROOT, 0, "system/bin/install-recovery.sh" },
{ 00700, AID_ROOT, AID_ROOT, 0, "system/bin/secilc" },
{ 00750, AID_ROOT, AID_ROOT, 0, "system/bin/uncrypt" },
- { 00600, AID_ROOT, AID_ROOT, 0, "system/build.prop" }, // legacy
- { 00600, AID_ROOT, AID_ROOT, 0, "system/etc/prop.build" },
+ { 00600, AID_ROOT, AID_ROOT, 0, "system/build.prop" },
{ 00444, AID_ROOT, AID_ROOT, 0, sys_conf_dir + 1 },
{ 00444, AID_ROOT, AID_ROOT, 0, sys_conf_file + 1 },
{ 00440, AID_ROOT, AID_SHELL, 0, "system/etc/init.goldfish.rc" },
@@ -159,9 +157,8 @@ static const struct fs_path_config android_files[] = {
{ 00555, AID_ROOT, AID_ROOT, 0, "system/etc/ppp/*" },
{ 00555, AID_ROOT, AID_ROOT, 0, "system/etc/rc.*" },
{ 00440, AID_ROOT, AID_ROOT, 0, "system/etc/recovery.img" },
- { 00600, AID_ROOT, AID_ROOT, 0, "vendor/build.prop" }, // legacy
- { 00600, AID_ROOT, AID_ROOT, 0, "vendor/etc/prop.build" },
- { 00600, AID_ROOT, AID_ROOT, 0, "vendor/etc/prop.default" },
+ { 00600, AID_ROOT, AID_ROOT, 0, "vendor/build.prop" },
+ { 00600, AID_ROOT, AID_ROOT, 0, "vendor/default.prop" },
{ 00444, AID_ROOT, AID_ROOT, 0, ven_conf_dir + 1 },
{ 00444, AID_ROOT, AID_ROOT, 0, ven_conf_file + 1 },