summaryrefslogtreecommitdiff
path: root/odrefresh/odr_config.h
diff options
context:
space:
mode:
Diffstat (limited to 'odrefresh/odr_config.h')
-rw-r--r--odrefresh/odr_config.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/odrefresh/odr_config.h b/odrefresh/odr_config.h
index ec0290ccfe..c3f3c8010a 100644
--- a/odrefresh/odr_config.h
+++ b/odrefresh/odr_config.h
@@ -19,9 +19,11 @@
#include <optional>
#include <string>
+#include <unordered_map>
#include <vector>
#include "android-base/file.h"
+#include "android-base/no_destructor.h"
#include "arch/instruction_set.h"
#include "base/file_utils.h"
#include "base/globals.h"
@@ -32,6 +34,17 @@
namespace art {
namespace odrefresh {
+struct SystemPropertyConfig {
+ const char* name;
+ const char* default_value;
+};
+
+// The system properties that odrefresh keeps track of. Odrefresh will recompile everything if any
+// property changes.
+const android::base::NoDestructor<std::vector<SystemPropertyConfig>> kSystemProperties{
+ {SystemPropertyConfig{.name = "persist.device_config.runtime_native_boot.enable_uffd_gc",
+ .default_value = "false"}}};
+
// An enumeration of the possible zygote configurations on Android.
enum class ZygoteKind : uint8_t {
// 32-bit primary zygote, no secondary zygote.
@@ -66,6 +79,9 @@ class OdrConfig final {
bool compilation_os_mode_ = false;
bool minimal_ = false;
+ // The current values of system properties listed in `kSystemProperties`.
+ std::unordered_map<std::string, std::string> system_properties_;
+
// Staging directory for artifacts. The directory must exist and will be automatically removed
// after compilation. If empty, use the default directory.
std::string staging_dir_;
@@ -148,6 +164,9 @@ class OdrConfig final {
}
bool GetCompilationOsMode() const { return compilation_os_mode_; }
bool GetMinimal() const { return minimal_; }
+ const std::unordered_map<std::string, std::string>& GetSystemProperties() const {
+ return system_properties_;
+ }
void SetApexInfoListFile(const std::string& file_path) { apex_info_list_file_ = file_path; }
void SetArtBinDir(const std::string& art_bin_dir) { art_bin_dir_ = art_bin_dir; }
@@ -199,6 +218,10 @@ class OdrConfig final {
void SetMinimal(bool value) { minimal_ = value; }
+ std::unordered_map<std::string, std::string>* MutableSystemProperties() {
+ return &system_properties_;
+ }
+
private:
// Returns a pair for the possible instruction sets for the configured instruction set
// architecture. The first item is the 32-bit architecture and the second item is the 64-bit