From a5416259f0e336482e316d375f82a567586fa809 Mon Sep 17 00:00:00 2001 From: Zhao Wei Liew Date: Thu, 10 Nov 2016 20:31:47 +0800 Subject: msm8916: init: Check boot reason prop when setting alarm_boot prop This is missed out from init.qcom.early_boot.sh. Change-Id: Iab5b0d7782a53b97315d2aa9d0c301ed7725e01d (cherry picked from commit 013cd47bc8eb1c2c245c606d4990e33ff3a170fd) --- init/init_msm8916.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init/init_msm8916.cpp b/init/init_msm8916.cpp index c804647..a84ac02 100644 --- a/init/init_msm8916.cpp +++ b/init/init_msm8916.cpp @@ -72,6 +72,9 @@ static void init_alarm_boot_properties() { char const *alarm_file = "/proc/sys/kernel/boot_reason"; char buf[64]; + char tmp[PROP_VALUE_MAX]; + + property_get("ro.boot.alarmboot", tmp); if (read_file2(alarm_file, buf, sizeof(buf))) { /* @@ -89,7 +92,7 @@ static void init_alarm_boot_properties() * 7 -> CBLPWR_N pin toggled (for external power supply) * 8 -> KPDPWR_N pin toggled (power key pressed) */ - if (buf[0] == '3') + if (buf[0] == '3' || !strcmp(tmp, "true")) property_set("ro.alarm_boot", "true"); else property_set("ro.alarm_boot", "false"); -- cgit v1.2.3