Skip to content
Snippets Groups Projects
Commit c8e014f8 authored by dianlujitao's avatar dianlujitao Committed by Artem Borisov
Browse files

msm8953-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
parent 89fc67ec
No related branches found
No related tags found
No related merge requests found
/* /*
Copyright (c) 2016, The CyanogenMod Project Copyright (c) 2016, The CyanogenMod Project
Copyright (C) 2019 The LineageOS Project.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are modification, are permitted provided that the following conditions are
met: met:
...@@ -25,8 +27,6 @@ ...@@ -25,8 +27,6 @@
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <fcntl.h>
#include <stdlib.h>
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#include "vendor_init.h" #include "vendor_init.h"
...@@ -38,37 +38,6 @@ char const *heapminfree; ...@@ -38,37 +38,6 @@ char const *heapminfree;
using android::init::property_set; using android::init::property_set;
static void init_alarm_boot_properties()
{
int boot_reason;
FILE *fp;
fp = fopen("/proc/sys/kernel/boot_reason", "r");
fscanf(fp, "%d", &boot_reason);
fclose(fp);
/*
* 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 (boot_reason == 3) {
property_set("ro.alarm_boot", "true");
} else {
property_set("ro.alarm_boot", "false");
}
}
void check_device() void check_device()
{ {
struct sysinfo sys; struct sysinfo sys;
...@@ -88,7 +57,6 @@ void check_device() ...@@ -88,7 +57,6 @@ void check_device()
void vendor_load_properties() void vendor_load_properties()
{ {
init_alarm_boot_properties();
check_device(); check_device();
property_set("dalvik.vm.heapstartsize", "16m"); property_set("dalvik.vm.heapstartsize", "16m");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment