Skip to content

Commit

Permalink
Merge pull request #33 from plundstr/master
Browse files Browse the repository at this point in the history
Made direct transfer from USER to ACTDEAD optional
  • Loading branch information
Pekka Lundstrom committed Oct 22, 2013
2 parents 653542e + 1b1eff8 commit 0b96c37
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configure.ac
@@ -1,5 +1,5 @@
# Package name and version
AC_INIT(dsme, 0.62.25)
AC_INIT(dsme, 0.63.0)

AM_INIT_AUTOMAKE

Expand Down
16 changes: 15 additions & 1 deletion modules/state.c
Expand Up @@ -128,7 +128,9 @@ static void deny_state_change_request(dsme_state_t denied_state,

static void start_delayed_shutdown_timer(unsigned seconds);
static int delayed_shutdown_fn(void* unused);
#ifdef DSME_SUPPORT_DIRECT_USER_ACTDEAD
static bool start_delayed_actdead_timer(unsigned seconds);
#endif
static int delayed_actdead_fn(void* unused);
static bool start_delayed_user_timer(unsigned seconds);
static int delayed_user_fn(void* unused);
Expand Down Expand Up @@ -302,7 +304,16 @@ static void try_to_change_state(dsme_state_t new_state)
}
} else if (current_state == DSME_STATE_USER) {
actdead_switch_done = false;

#ifndef DSME_SUPPORT_DIRECT_USER_ACTDEAD
/* We don't support direct transfer from USER to ACTDEAD
* but do it via shutdown. Usb cable will wakeup the device again
* and then we will boot to ACTDEAD
* Force SHUTDOWN
*/
dsme_log(LOG_DEBUG, "ACTDEAD state requested, we do it via SHUTDOWN");
change_state(DSME_STATE_SHUTDOWN);
start_delayed_shutdown_timer(SHUTDOWN_TIMER_TIMEOUT);
#else
if (user_switch_done) {
/* user init done; runlevel change from user to actdead state */
if (start_delayed_actdead_timer(ACTDEAD_TIMER_MIN_TIMEOUT)) {
Expand All @@ -314,6 +325,7 @@ static void try_to_change_state(dsme_state_t new_state)
change_state(new_state);
}
}
#endif /* DSME_SUPPORT_DIRECT_USER_ACTDEAD */
}
break;

Expand Down Expand Up @@ -421,6 +433,7 @@ static int delayed_shutdown_fn(void* unused)
return 0; /* stop the interval */
}

#ifdef DSME_SUPPORT_DIRECT_USER_ACTDEAD
static bool start_delayed_actdead_timer(unsigned seconds)
{
bool success = false;
Expand All @@ -438,6 +451,7 @@ static bool start_delayed_actdead_timer(unsigned seconds)
}
return success;
}
#endif /* DSME_SUPPORT_DIRECT_USER_ACTDEAD */

static int delayed_actdead_fn(void* unused)
{
Expand Down
2 changes: 1 addition & 1 deletion rpm/dsme.spec
Expand Up @@ -13,7 +13,7 @@ Name: dsme
# << macros

Summary: Device State Management Entity
Version: 0.62.25
Version: 0.63.0
Release: 0
Group: System/System Control
License: LGPLv2+
Expand Down
2 changes: 1 addition & 1 deletion rpm/dsme.yaml
@@ -1,6 +1,6 @@
Name: dsme
Summary: Device State Management Entity
Version: 0.62.25
Version: 0.63.0
Release: 0
Group: System/System Control
License: LGPLv2+
Expand Down

0 comments on commit 0b96c37

Please sign in to comment.