Write appcompat_override system properties
Create a second set of system properties, that can be overlaid over the
real ones if necessary, for appcompat purposes.
Bug: 291814949
Ignore-AOSP-First: Aosp -> internal merge conflict
Test: manual, treehugger, system_properties_test
Change-Id: I541d3658cab7753c16970957c6ab4fc8bd68d8f3
Merged-In: I884a78b67679c1f0b90a6c0159b17ab007f8cc60
diff --git a/libc/bionic/system_property_api.cpp b/libc/bionic/system_property_api.cpp
index a641f12..847473a 100644
--- a/libc/bionic/system_property_api.cpp
+++ b/libc/bionic/system_property_api.cpp
@@ -45,7 +45,7 @@
__BIONIC_WEAK_FOR_NATIVE_BRIDGE
int __system_properties_init() {
- return system_properties.Init(PROP_FILENAME) ? 0 : -1;
+ return system_properties.Init(PROP_DIRNAME) ? 0 : -1;
}
__BIONIC_WEAK_FOR_NATIVE_BRIDGE
@@ -55,8 +55,8 @@
__BIONIC_WEAK_FOR_NATIVE_BRIDGE
int __system_property_area_init() {
- bool fsetxattr_failed = false;
- return system_properties.AreaInit(PROP_FILENAME, &fsetxattr_failed) && !fsetxattr_failed ? 0 : -1;
+ bool fsetxattr_fail = false;
+ return system_properties.AreaInit(PROP_DIRNAME, &fsetxattr_fail) && !fsetxattr_fail ? 0 : -1;
}
__BIONIC_WEAK_FOR_NATIVE_BRIDGE
@@ -129,3 +129,8 @@
int __system_property_foreach(void (*propfn)(const prop_info* pi, void* cookie), void* cookie) {
return system_properties.Foreach(propfn, cookie);
}
+
+__BIONIC_WEAK_FOR_NATIVE_BRIDGE
+int __system_properties_reload() {
+ return system_properties.Reload(false) ? 0 : -1;
+}