Load {default,build}.prop from /{system,vendor,odm}/etc/
/default.prop may be moved to /system/etc/ and renamed as prop.default.
/{system,vendor,odm}/build.prop may be moved to /{system,vendor,odm}/etc/
and renamed as prop.build.
This patch makes property_service load prop.* from the new locations
first. Also replaces NULL with nullptr for C++ cleanup.
Bug: 37815285
Test: Booted pixel phones, checked the locations of prop.*, verified
symlinks, checked a few properties (via adb shell getprop)
and manually tested a few apps (Camera, Maps etc).
ODM is not tested as it does not exist on the tested device.
Change-Id: Id8eeb3c1a5728dd04005dfad4733b8e6336f9093
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
index 919b65b..dd1ad3a 100644
--- a/libcutils/fs_config.cpp
+++ b/libcutils/fs_config.cpp
@@ -134,9 +134,10 @@
{ 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" },
- { 00600, AID_ROOT, AID_ROOT, 0, "odm/build.prop" },
- { 00600, AID_ROOT, AID_ROOT, 0, "odm/default.prop" },
+ { 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" },
{ 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 },
@@ -148,7 +149,8 @@
{ 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" },
+ { 00600, AID_ROOT, AID_ROOT, 0, "system/build.prop" }, // legacy
+ { 00600, AID_ROOT, AID_ROOT, 0, "system/etc/prop.build" },
{ 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" },
@@ -157,8 +159,9 @@
{ 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" },
- { 00600, AID_ROOT, AID_ROOT, 0, "vendor/default.prop" },
+ { 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" },
{ 00444, AID_ROOT, AID_ROOT, 0, ven_conf_dir + 1 },
{ 00444, AID_ROOT, AID_ROOT, 0, ven_conf_file + 1 },