Skip to content

Commit

Permalink
[datapipe] Cache ambient_light_poll_pipe output value
Browse files Browse the repository at this point in the history
Ambient light poll state can be modified by the filter, thus caching the
original input can lead to subtle errors in case the datapipe value is
queried directly.

Switch to caching filtered output value.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Jan 18, 2017
1 parent b406333 commit 7ab44fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/filter-brightness-als.c
Expand Up @@ -1854,7 +1854,7 @@ fba_sensorpoll_timer_cb(gpointer aptr)
fba_sensorpoll_timer_id = 0;
execute_datapipe(&ambient_light_poll_pipe,
GINT_TO_POINTER(false),
USE_INDATA, CACHE_INDATA);
USE_INDATA, CACHE_OUTDATA);
EXIT:
return FALSE;
}
Expand Down
2 changes: 1 addition & 1 deletion tklock.c
Expand Up @@ -2608,7 +2608,7 @@ static void tklock_lidfilter_rethink_lid_state(void)
if( lid_cover_sensor_state != COVER_UNDEF ) {
execute_datapipe(&ambient_light_poll_pipe,
GINT_TO_POINTER(TRUE),
USE_INDATA, CACHE_INDATA);
USE_INDATA, CACHE_OUTDATA);
}

switch( lid_cover_sensor_state ) {
Expand Down

0 comments on commit 7ab44fc

Please sign in to comment.