diff options
Diffstat (limited to 'init/init_msm8996.cpp')
-rw-r--r-- | init/init_msm8996.cpp | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/init/init_msm8996.cpp b/init/init_msm8996.cpp index 61d3b31..08c4345 100644 --- a/init/init_msm8996.cpp +++ b/init/init_msm8996.cpp @@ -1,6 +1,7 @@ /* - Copyright (C) 2013-2016, The CyanogenMod Project - Copyright (C) 2017, The LineageOS Project + Copyright (c) 2015, The Linux Foundation. All rights reserved. + Copyright (C) 2016 The CyanogenMod Project. + Copyright (C) 2017-2018 The LineageOS Project. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -28,59 +29,19 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <stdio.h> -#include <stdlib.h> #include <sys/sysinfo.h> -#include <android-base/file.h> #include <android-base/properties.h> -#include <android-base/strings.h> #include "property_service.h" #include "vendor_init.h" using android::base::GetProperty; -using android::base::ReadFileToString; -using android::base::Trim; using android::init::property_set; char const *heapminfree; char const *heapmaxfree; -static void init_alarm_boot_properties() -{ - char const *boot_reason_file = "/proc/sys/kernel/boot_reason"; - char const *power_off_alarm_file = "/persist/alarm/powerOffAlarmSet"; - std::string boot_reason; - std::string power_off_alarm; - std::string reboot_reason = GetProperty("ro.boot.alarmboot", ""); - - if (ReadFileToString(boot_reason_file, &boot_reason) - && ReadFileToString(power_off_alarm_file, &power_off_alarm)) { - /* - * Setup ro.alarm_boot value to true when it is RTC triggered boot up - * For existing PMIC chips, the following mapping applies - * for the value of boot_reason: - * - * 0 -> unknown - * 1 -> hard reset - * 2 -> sudden momentary power loss (SMPL) - * 3 -> real time clock (RTC) - * 4 -> DC charger inserted - * 5 -> USB charger inserted - * 6 -> PON1 pin toggled (for secondary PMICs) - * 7 -> CBLPWR_N pin toggled (for external power supply) - * 8 -> KPDPWR_N pin toggled (power key pressed) - */ - if ((Trim(boot_reason) == "3" || reboot_reason == "true") - && Trim(power_off_alarm) == "1") { - property_set("ro.alarm_boot", "true"); - } else { - property_set("ro.alarm_boot", "false"); - } - } -} - void check_device() { struct sysinfo sys; @@ -115,6 +76,5 @@ void vendor_load_properties() property_set("dalvik.vm.heapminfree", heapminfree); property_set("dalvik.vm.heapmaxfree", heapmaxfree); - init_alarm_boot_properties(); } |