Skip to content

Commit

Permalink
Add enablers for proximity based LPM display states
Browse files Browse the repository at this point in the history
Re-use legacy N9 low power display states for proximity based one
that lights up the display briefly when proximity sensor input matches
a) device is taken out of pocket / flipped front side up on table
b) hand hovers over device that is lying on table

Both legacy D-Bus method calls and freshly added signals are used to
tell ui side whether lpm states are active or not.

New datapipe display_state_next_pipe allows tracking of the next stable
display state - this is used to make sure tklock and lpm state data is
sent to lipstick before display powerup starts so that final ui state
is known when the first rendering after display power up happens.

The ambient light sensor is powered up in parallel with display - and
kept powered up in the lpm display states.

Leds that are active in display off, are active also during lpm states.

[mce] Add enablers for proximity based LPM display states. Fixes JB#17735
  • Loading branch information
spiiroin committed May 8, 2014
1 parent efebdd8 commit 360706a
Show file tree
Hide file tree
Showing 10 changed files with 768 additions and 110 deletions.
3 changes: 3 additions & 0 deletions event-input.c
Expand Up @@ -1763,6 +1763,9 @@ static gboolean touchscreen_iomon_cb(gpointer data, gsize bytes_read)
}
break;
default:
case MCE_DISPLAY_ON:
case MCE_DISPLAY_DIM:
case MCE_DISPLAY_UNDEF:
case MCE_DISPLAY_POWER_UP:
case MCE_DISPLAY_POWER_DOWN:
break;
Expand Down
4 changes: 4 additions & 0 deletions mce.c
Expand Up @@ -292,6 +292,7 @@ static void mce_cleanup_wakelocks(void)
wakelock_unlock("mce_proximity_stm");
wakelock_unlock("mce_bluez_wait");
wakelock_unlock("mce_led_breathing");
wakelock_unlock("mce_lpm_off");
}
#endif // ENABLE_WAKELOCKS

Expand Down Expand Up @@ -942,6 +943,8 @@ int main(int argc, char **argv)
0, GINT_TO_POINTER(MCE_DISPLAY_UNDEF));
setup_datapipe(&display_state_req_pipe, READ_WRITE, DONT_FREE_CACHE,
0, GINT_TO_POINTER(MCE_DISPLAY_UNDEF));
setup_datapipe(&display_state_next_pipe, READ_WRITE, DONT_FREE_CACHE,
0, GINT_TO_POINTER(MCE_DISPLAY_UNDEF));
setup_datapipe(&exception_state_pipe, READ_WRITE, DONT_FREE_CACHE,
0, GINT_TO_POINTER(UIEXC_NONE));
setup_datapipe(&display_brightness_pipe, READ_WRITE, DONT_FREE_CACHE,
Expand Down Expand Up @@ -1135,6 +1138,7 @@ int main(int argc, char **argv)
free_datapipe(&display_brightness_pipe);
free_datapipe(&display_state_pipe);
free_datapipe(&display_state_req_pipe);
free_datapipe(&display_state_next_pipe);
free_datapipe(&exception_state_pipe);
free_datapipe(&submode_pipe);
free_datapipe(&alarm_ui_state_pipe);
Expand Down
6 changes: 6 additions & 0 deletions mce.h
Expand Up @@ -281,10 +281,16 @@ datapipe_struct led_pattern_activate_pipe;
datapipe_struct led_pattern_deactivate_pipe;
/** Non-synthetized user activity; read only */
datapipe_struct user_activity_pipe;

/** State of display; read only */
datapipe_struct display_state_pipe;

/** Desired state of display; write only */
datapipe_struct display_state_req_pipe;

/** Next (non-transitional) state of display; read only */
datapipe_struct display_state_next_pipe;

/** exceptional ui state; read write */
datapipe_struct exception_state_pipe;
/**
Expand Down

0 comments on commit 360706a

Please sign in to comment.