aboutsummaryrefslogtreecommitdiff
path: root/init/init_msm8996.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'init/init_msm8996.cpp')
-rw-r--r--init/init_msm8996.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/init/init_msm8996.cpp b/init/init_msm8996.cpp
index e2de323..bdaaaa8 100644
--- a/init/init_msm8996.cpp
+++ b/init/init_msm8996.cpp
@@ -1,7 +1,7 @@
/*
Copyright (c) 2015, The Linux Foundation. All rights reserved.
Copyright (C) 2016 The CyanogenMod Project.
- Copyright (C) 2017-2018 The LineageOS Project.
+ Copyright (C) 2017-2021 The LineageOS Project.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -36,8 +36,8 @@
#include "property_service.h"
#include "vendor_init.h"
-using android::base::GetProperty;
-using android::init::property_set;
+#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
+#include <sys/_system_properties.h>
char const *heapminfree;
char const *heapmaxfree;
@@ -59,16 +59,27 @@ void check_device()
}
}
+void property_override(char const prop[], char const value[], bool add = true)
+{
+ auto pi = (prop_info *) __system_property_find(prop);
+
+ if (pi != nullptr) {
+ __system_property_update(pi, value, strlen(value));
+ } else if (add) {
+ __system_property_add(prop, strlen(prop), value, strlen(value));
+ }
+}
+
void vendor_load_properties()
{
check_device();
- property_set("dalvik.vm.heapstartsize", "8m");
- property_set("dalvik.vm.heapgrowthlimit", "256m");
- property_set("dalvik.vm.heapsize", "512m");
- property_set("dalvik.vm.heaptargetutilization", "0.75");
- property_set("dalvik.vm.heapminfree", heapminfree);
- property_set("dalvik.vm.heapmaxfree", heapmaxfree);
+ property_override("dalvik.vm.heapstartsize", "8m");
+ property_override("dalvik.vm.heapgrowthlimit", "256m");
+ property_override("dalvik.vm.heapsize", "512m");
+ property_override("dalvik.vm.heaptargetutilization", "0.75");
+ property_override("dalvik.vm.heapminfree", heapminfree);
+ property_override("dalvik.vm.heapmaxfree", heapmaxfree);
}