summaryrefslogtreecommitdiff
path: root/libc/system_properties/system_properties.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2017-12-14 01:57:37 +0000
committerTom Cherry <tomcherry@google.com>2017-12-14 01:58:49 +0000
commit8be995b6ac69100996e55e1d24c1398a19916436 (patch)
treee9f19eaab6d54c42730a8fb3fe96a455ac008b11 /libc/system_properties/system_properties.cpp
parente149f3c1d7b6848af6a27e4089d5f0c915e1437d (diff)
Revert "Don't use serialized propertyinfo"
This reverts commit e149f3c1d7b6848af6a27e4089d5f0c915e1437d. Reason for revert: This is ready to be enabled now. Bug: 36001741 Change-Id: I418d3a498ff0712ce9a1857924c6d0039026a664
Diffstat (limited to 'libc/system_properties/system_properties.cpp')
-rw-r--r--libc/system_properties/system_properties.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
index 93184a322..f67fc4d4a 100644
--- a/libc/system_properties/system_properties.cpp
+++ b/libc/system_properties/system_properties.cpp
@@ -285,11 +285,19 @@ int __system_properties_init() {
}
contexts = nullptr;
if (is_dir(property_filename)) {
- new (&contexts_union.contexts_split) ContextsSplit();
- if (!contexts_union.contexts_split.Initialize(false)) {
- return -1;
+ if (access("/dev/__properties__/property_info", R_OK) == 0) {
+ new (&contexts_union.contexts_serialized) ContextsSerialized();
+ if (!contexts_union.contexts_serialized.Initialize(false)) {
+ return -1;
+ }
+ contexts = &contexts_union.contexts_serialized;
+ } else {
+ new (&contexts_union.contexts_split) ContextsSplit();
+ if (!contexts_union.contexts_split.Initialize(false)) {
+ return -1;
+ }
+ contexts = &contexts_union.contexts_split;
}
- contexts = &contexts_union.contexts_split;
} else {
new (&contexts_union.contexts_pre_split) ContextsPreSplit();
if (!contexts_union.contexts_pre_split.Initialize(false)) {
@@ -316,9 +324,9 @@ int __system_property_area_init() {
}
// We set this unconditionally as we want tests to continue on regardless of if this failed
// and property_service will abort on an error condition, so no harm done.
- new (&contexts_union.contexts_split) ContextsSplit;
- contexts = &contexts_union.contexts_split;
- if (!contexts_union.contexts_split.Initialize(true)) {
+ new (&contexts_union.contexts_serialized) ContextsSerialized;
+ contexts = &contexts_union.contexts_serialized;
+ if (!contexts_union.contexts_serialized.Initialize(true)) {
return -1;
}
return 0;