From a0c7e0c3c94f51f81a17e40bcad3e54a0494f1f8 Mon Sep 17 00:00:00 2001 From: Demon000 Date: Sat, 18 Jul 2020 05:17:41 +0300 Subject: [PATCH] sm6250-common: init: group dalvik property initialization together --- init/init.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/init/init.cpp b/init/init.cpp index 6196206..170adae 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -30,15 +30,13 @@ using android::base::GetProperty; using android::init::property_set; -char const *heapstartsize; -char const *heapgrowthlimit; -char const *heapsize; -char const *heapminfree; -char const *heapmaxfree; -char const *heaptargetutilization; - -void check_device() -{ +void load_dalvik_properties() { + char const *heapstartsize; + char const *heapgrowthlimit; + char const *heapsize; + char const *heapminfree; + char const *heapmaxfree; + char const *heaptargetutilization; struct sysinfo sys; sysinfo(&sys); @@ -59,12 +57,9 @@ void check_device() heaptargetutilization = "0.6"; heapminfree = "8m"; heapmaxfree = "16m"; + } else { + return; } -} - -void vendor_load_properties() -{ - check_device(); property_set("dalvik.vm.heapstartsize", heapstartsize); property_set("dalvik.vm.heapgrowthlimit", heapgrowthlimit); @@ -73,3 +68,7 @@ void vendor_load_properties() property_set("dalvik.vm.heapminfree", heapminfree); property_set("dalvik.vm.heapmaxfree", heapmaxfree); } + +void vendor_load_properties() { + load_dalvik_properties(); +}