Skip to content

Commit

Permalink
Merge branch 'jb46072_ignore_alarms_on_shutdown' into 'master'
Browse files Browse the repository at this point in the history
Ignore imminent  alarms on shutdown when home is encrypted

See merge request mer-core/dsme!31
  • Loading branch information
spiiroin committed Jun 12, 2019
2 parents 5dd2347 + 1a3db09 commit ba0d02a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .depend
Expand Up @@ -481,6 +481,7 @@ modules/startup.pic.o:\
modules/state.o:\
modules/state.c\
dsme/dsme-rd-mode.h\
dsme/utility.h\
include/dsme/logging.h\
include/dsme/modulebase.h\
include/dsme/modules.h\
Expand All @@ -496,6 +497,7 @@ modules/state.o:\
modules/state.pic.o:\
modules/state.c\
dsme/dsme-rd-mode.h\
dsme/utility.h\
include/dsme/logging.h\
include/dsme/modulebase.h\
include/dsme/modules.h\
Expand Down
8 changes: 6 additions & 2 deletions modules/state.c
Expand Up @@ -48,6 +48,7 @@
#include <dsme/state.h>

#include "../dsme/dsme-rd-mode.h"
#include "../dsme/utility.h"

#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -365,9 +366,12 @@ static dsme_state_t select_state(void)
/* favor normal shutdown over reboot over actdead */
if (shutdown_requested &&
(charger_state == CHARGER_DISCONNECTED) &&
!alarm_set)
(!alarm_set || dsme_home_is_encrypted()))
{
dsme_log(LOG_NOTICE, PFIX"Normal shutdown");
dsme_log(LOG_NOTICE, PFIX"Normal shutdown%s",
alarm_set
? " (alarm set, but ignored due to encrypted home)"
: "");
state = DSME_STATE_SHUTDOWN;
} else if (reboot_requested) {
dsme_log(LOG_NOTICE, PFIX"Reboot");
Expand Down

0 comments on commit ba0d02a

Please sign in to comment.