Skip to content

Commit

Permalink
[display] enable display on/off handling in actdead
Browse files Browse the repository at this point in the history
Signed-off-by: Pekka Lundstrom <pekka.lundstrom@jollamobile.com>
  • Loading branch information
Pekka Lundstrom authored and spiiroin committed Oct 28, 2013
1 parent 91fe436 commit 822118a
Showing 1 changed file with 8 additions and 37 deletions.
45 changes: 8 additions & 37 deletions modules/display.c
Expand Up @@ -1969,11 +1969,6 @@ static void setup_dim_timeout(void)
return;
}

if( system_state == MCE_STATE_ACTDEAD ) {
mce_log(LL_DEBUG, "DIM timer skipped; STATE_ACTDEAD");
return;
}

if( dimming_inhibited ) {
mce_log(LL_DEBUG, "DIM timer skipped; dimming_inhibited");
return;
Expand Down Expand Up @@ -4186,7 +4181,7 @@ static gpointer display_state_filter(gpointer data)
}

/* Ignore display on requests during transition to shutdown
* and reboot, when in acting dead and when system state is unknown
* and reboot, and when system state is unknown
*/
if (((cached_display_state == MCE_DISPLAY_UNDEF) ||
(cached_display_state == MCE_DISPLAY_OFF) ||
Expand All @@ -4195,14 +4190,11 @@ static gpointer display_state_filter(gpointer data)
(display_state != MCE_DISPLAY_OFF)) &&
((system_state == MCE_STATE_UNDEF) ||
((submode & MCE_TRANSITION_SUBMODE) &&
(((system_state == MCE_STATE_SHUTDOWN) ||
(system_state == MCE_STATE_REBOOT)) ||
((system_state == MCE_STATE_ACTDEAD) &&
((alarm_ui_state != MCE_ALARM_UI_VISIBLE_INT32) &&
(alarm_ui_state != MCE_ALARM_UI_RINGING_INT32))))))) {
((system_state == MCE_STATE_SHUTDOWN) ||
(system_state == MCE_STATE_REBOOT))))) {
mce_log(LL_DEBUG,
"Ignoring display state change request %d "
"due to shutdown/reboot/acting dead",
"due to shutdown/reboot",
display_state);
display_state = cached_display_state;
} else if ((use_low_power_mode == FALSE) ||
Expand Down Expand Up @@ -4461,15 +4453,6 @@ static void submode_trigger(gconstpointer data)
if( old_trans && !new_trans ) {
/* End of transition; stable state reached */
switch( system_state ) {
case MCE_STATE_ACTDEAD:
/* Blank the screen unless we have alarm ui on */
if( alarm_ui_state != MCE_ALARM_UI_RINGING_INT32 &&
alarm_ui_state != MCE_ALARM_UI_VISIBLE_INT32 ) {
execute_datapipe(&display_state_req_pipe,
GINT_TO_POINTER(MCE_DISPLAY_OFF),
USE_INDATA, CACHE_INDATA);
}
break;
default:
break;
}
Expand Down Expand Up @@ -4512,13 +4495,10 @@ static void device_inactive_trigger(gconstpointer data)
submode_t submode = mce_get_submode_int32();

/* Unblank screen on device activity,
* unless the device is in acting dead and no alarm is visible
* or if the tklock is active
* unless the tklock is active
*/
if (((system_state == MCE_STATE_USER) ||
((system_state == MCE_STATE_ACTDEAD) &&
((alarm_ui_state == MCE_ALARM_UI_VISIBLE_INT32) ||
(alarm_ui_state == MCE_ALARM_UI_RINGING_INT32)))) &&
(system_state == MCE_STATE_ACTDEAD)) &&
(device_inactive == FALSE) &&
((submode & MCE_TKLOCK_SUBMODE) == 0)) {
/* Adjust the adaptive dimming timeouts,
Expand Down Expand Up @@ -4592,22 +4572,13 @@ static void system_state_trigger(gconstpointer data)
system_state_t system_state = GPOINTER_TO_INT(data);

switch (system_state) {
case MCE_STATE_ACTDEAD:
case MCE_STATE_USER:
(void)execute_datapipe(&display_state_req_pipe,
(void)execute_datapipe(&display_state_req_pipe,
GINT_TO_POINTER(MCE_DISPLAY_ON),
USE_INDATA, CACHE_INDATA);
break;

case MCE_STATE_ACTDEAD:
if ((alarm_ui_state == MCE_ALARM_UI_RINGING_INT32) ||
(alarm_ui_state == MCE_ALARM_UI_VISIBLE_INT32)) {
(void)execute_datapipe(&display_state_req_pipe,
GINT_TO_POINTER(MCE_DISPLAY_ON),
USE_INDATA, CACHE_INDATA);
}

break;

case MCE_STATE_SHUTDOWN:
case MCE_STATE_REBOOT:
case MCE_STATE_UNDEF:
Expand Down

0 comments on commit 822118a

Please sign in to comment.