Skip to content

Commit

Permalink
[tklock] Move cached datapipe values in one place
Browse files Browse the repository at this point in the history
Inter dependencies make it hard to have the variables next to the
datapipe callback functions.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Sep 18, 2018
1 parent 6633e34 commit 7106103
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions tklock.c
Expand Up @@ -610,6 +610,30 @@ static display_state_t display_state_curr = MCE_DISPLAY_UNDEF;
/** Next Display state; undefined initially, can't assume anything */
static display_state_t display_state_next = MCE_DISPLAY_UNDEF;

/** Call state; assume no active calls */
static call_state_t call_state = CALL_STATE_NONE;

/** Actual proximity state; assume not covered */
static cover_state_t proximity_sensor_actual = COVER_OPEN;

/** Effective proximity state; assume not covered */
static cover_state_t proximity_sensor_effective = COVER_OPEN;

/** Lid cover sensor state; assume unkown
*
* When in covered state, it is assumed that it is not physically
* possible to see/interact with the display and thus it should
* stay powered off.
*
* Originally was used to track Nokia N770 slidable cover. Now
* it is used also for things like the hammerhead magnetic lid
* sensor.
*/
static cover_state_t lid_sensor_actual = COVER_UNDEF;

/** Lid cover policy state; assume unknown */
static cover_state_t lid_sensor_filtered = COVER_UNDEF;

/** Change notifications for system_state
*/
static void tklock_datapipe_system_state_cb(gconstpointer data)
Expand Down Expand Up @@ -919,30 +943,6 @@ static void tklock_datapipe_display_state_next_cb(gconstpointer data)

}

/** Call state; assume no active calls */
static call_state_t call_state = CALL_STATE_NONE;

/** Actual proximity state; assume not covered */
static cover_state_t proximity_sensor_actual = COVER_OPEN;

/** Effective proximity state; assume not covered */
static cover_state_t proximity_sensor_effective = COVER_OPEN;

/** Lid cover sensor state; assume unkown
*
* When in covered state, it is assumed that it is not physically
* possible to see/interact with the display and thus it should
* stay powered off.
*
* Originally was used to track Nokia N770 slidable cover. Now
* it is used also for things like the hammerhead magnetic lid
* sensor.
*/
static cover_state_t lid_sensor_actual = COVER_UNDEF;

/** Lid cover policy state; assume unknown */
static cover_state_t lid_sensor_filtered = COVER_UNDEF;

/** Timer id for delayed proximity uncovering */
static guint tklock_datapipe_proximity_uncover_id = 0;

Expand Down

0 comments on commit 7106103

Please sign in to comment.