land: Check reboot reason when setting alarm_boot prop

Originally in early_boot.sh

Change-Id: If2ce845a28d363a2336f61cf3debac659f953172
This commit is contained in:
Zhao Wei Liew 2016-11-06 21:25:09 +08:00
parent 36a430bf60
commit 411294e83f
2 changed files with 4 additions and 2 deletions

View file

@ -62,6 +62,9 @@ static void init_alarm_boot_properties()
{ {
char const *alarm_file = "/proc/sys/kernel/boot_reason"; char const *alarm_file = "/proc/sys/kernel/boot_reason";
char buf[64]; char buf[64];
char tmp[PROP_VALUE_MAX];
property_get("ro.boot.alarmboot", tmp);
if (read_file2(alarm_file, buf, sizeof(buf))) { if (read_file2(alarm_file, buf, sizeof(buf))) {
/* /*
@ -79,7 +82,7 @@ static void init_alarm_boot_properties()
* 7 -> CBLPWR_N pin toggled (for external power supply) * 7 -> CBLPWR_N pin toggled (for external power supply)
* 8 -> KPDPWR_N pin toggled (power key pressed) * 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"); property_set("ro.alarm_boot", "true");
else else
property_set("ro.alarm_boot", "false"); property_set("ro.alarm_boot", "false");

View file

@ -234,7 +234,6 @@ on early-boot
# Allow subsystem (modem etc) debugging # Allow subsystem (modem etc) debugging
write /sys/kernel/boot_adsp/boot 1 write /sys/kernel/boot_adsp/boot 1
write /sys/kernel/boot_slpi/boot 1 write /sys/kernel/boot_slpi/boot 1
exec u:r:qti_init_shell:s0 -- /init.qcom.early_boot.sh
# Graphics # Graphics
chown system graphics /sys/class/graphics/fb0/idle_time chown system graphics /sys/class/graphics/fb0/idle_time