diff options
author | dianlujitao <dianlujitao@lineageos.org> | 2018-10-15 16:06:26 +0800 |
---|---|---|
committer | Davide Garberi <dade.garberi@gmail.com> | 2018-11-18 15:23:03 +0100 |
commit | 5787f2a7ed6dd88c5e930d3466bb2ca9d1a8fc71 (patch) | |
tree | 5f14dc7b9e250da654c8af3982ece30e6a3ba9cc /init/init_msm8996.cpp | |
parent | a7905ae45b2aa4d44e343eb32112ceff8b6dc0ea (diff) |
msm8996-common: Remove power-off alarm stuff from init extension
* CAF's init.qcom.early_boot.sh checks /persist/alarm/powerOffAlarmSet
before setting ro.alarm_boot, but on Oreo nothing writes to that
file, thus code is never executed and the prop is never set.
* Without ro.alarm_boot=true, the system will boot normally instead of
boot to min framework even on rtc, and alarm will ring after boot
completed.
Change-Id: Ie4d30358314337c229a66a16195f675198ef7d52
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
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(); } |