diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2024-04-24 22:35:37 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-04-24 22:35:37 +0000 |
commit | b46dcf4fcb54da0f539e235fd7b6ad49a954aed7 (patch) | |
tree | 32bacf3477a9aa45bc8df3de446c974e38288bcd /init | |
parent | ef3679a78ab52068ecab62a2363b40d37bc40577 (diff) | |
parent | 32677ae8f3c93d29ac9ed94be26f8368c0dec0da (diff) | |
download | core-b46dcf4fcb54da0f539e235fd7b6ad49a954aed7.tar.gz |
Merge "Only write appcompat properties if flag is defined" into main
Diffstat (limited to 'init')
-rw-r--r-- | init/Android.bp | 4 | ||||
-rw-r--r-- | init/property_service.cpp | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/init/Android.bp b/init/Android.bp index 6d63e41e2..c4e74d068 100644 --- a/init/Android.bp +++ b/init/Android.bp @@ -96,6 +96,7 @@ soong_config_module_type { config_namespace: "ANDROID", bool_variables: [ "PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT", + "release_write_appcompat_override_system_properties", ], properties: [ "cflags", @@ -159,6 +160,9 @@ libinit_cc_defaults { "-DINSTALL_DEBUG_POLICY_TO_SYSTEM_EXT=1", ], }, + release_write_appcompat_override_system_properties: { + cflags: ["-DWRITE_APPCOMPAT_OVERRIDE_SYSTEM_PROPERTIES"], + } }, static_libs: [ "libavb", diff --git a/init/property_service.cpp b/init/property_service.cpp index 58a0a7faa..5a1b63b2e 100644 --- a/init/property_service.cpp +++ b/init/property_service.cpp @@ -1308,12 +1308,14 @@ void CreateSerializedPropertyInfo() { } selinux_android_restorecon(PROP_TREE_FILE, 0); +#ifdef WRITE_APPCOMPAT_OVERRIDE_SYSTEM_PROPERTIES mkdir(APPCOMPAT_OVERRIDE_PROP_FOLDERNAME, S_IRWXU | S_IXGRP | S_IXOTH); if (!WriteStringToFile(serialized_contexts, APPCOMPAT_OVERRIDE_PROP_TREE_FILE, 0444, 0, 0, false)) { PLOG(ERROR) << "Unable to write appcompat override property infos to file"; } selinux_android_restorecon(APPCOMPAT_OVERRIDE_PROP_TREE_FILE, 0); +#endif } static void ExportKernelBootProps() { |