diff options
author | Davide Garberi <dade.garberi@gmail.com> | 2017-12-02 17:56:12 +0100 |
---|---|---|
committer | Davide Garberi <dade.garberi@gmail.com> | 2017-12-02 17:56:12 +0100 |
commit | f51aca7fc89ddad5d26c63add450ab0de3f17fe4 (patch) | |
tree | 91f0f4c33ecd8d1bbf06c103f2d9ed0c538b234d /init/init_msm8996.cpp | |
parent | 7506314fed4bd92835c5b5ce7118c17863392e33 (diff) |
msm8996-common: init: Checkout to N
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
Diffstat (limited to 'init/init_msm8996.cpp')
-rw-r--r-- | init/init_msm8996.cpp | 52 |
1 files changed, 14 insertions, 38 deletions
diff --git a/init/init_msm8996.cpp b/init/init_msm8996.cpp index 04f02a7..fd30f51 100644 --- a/init/init_msm8996.cpp +++ b/init/init_msm8996.cpp @@ -32,15 +32,9 @@ #include <stdlib.h> #include <sys/sysinfo.h> #include <cutils/properties.h> -#include <android-base/properties.h> -#include "property_service.h" #include "vendor_init.h" - -using android::base::GetProperty; -using android::base::SetProperty; - -std::string heapminfree; -std::string heapmaxfree; +#include "log.h" +#include "util.h" static void init_alarm_boot_properties() { @@ -66,41 +60,23 @@ static void init_alarm_boot_properties() * 7 -> CBLPWR_N pin toggled (for external power supply) * 8 -> KPDPWR_N pin toggled (power key pressed) */ - SetProperty("ro.alarm_boot", boot_reason == 3 ? "true" : "false"); -} - -void check_ram() -{ - struct sysinfo sys; - - sysinfo(&sys); - - if (sys.totalram > 3072ull * 1024 * 1024) { - // from - phone-xxxhdpi-4096-dalvik-heap.mk - heapminfree = "4m"; - heapmaxfree = "16m"; - } else { - // from - phone-xxhdpi-3072-dalvik-heap.mk - heapminfree = "512k"; - heapmaxfree = "8m"; - } + if (boot_reason == 3) { + property_set("ro.alarm_boot", "true"); + } else { + property_set("ro.alarm_boot", "false"); + } } void vendor_load_properties() { - std::string platform; - - platform = GetProperty("ro.board.platform", ""); - if (platform != ANDROID_TARGET) + char device[PROP_VALUE_MAX]; + char rf_version[PROP_VALUE_MAX]; + int rc; + + rc = property_get("ro.product.device", device, NULL); + if (!rc || strncmp(device, "z2_plus", PROP_VALUE_MAX)) return; - - check_ram(); - SetProperty("dalvik.vm.heapstartsize", "8m"); - SetProperty("dalvik.vm.heapgrowthlimit", "256m"); - SetProperty("dalvik.vm.heapsize", "512m"); - SetProperty("dalvik.vm.heaptargetutilization", "0.75"); - SetProperty("dalvik.vm.heapminfree", heapminfree); - SetProperty("dalvik.vm.heapmaxfree", heapmaxfree); + property_set("ro.product.model", "Z2 Plus"); init_alarm_boot_properties(); } |