Skip to content

Commit

Permalink
[tklock] Sync ipc state with submode changes
Browse files Browse the repository at this point in the history
Tklock ipc state changes are reflected to tklock submode, but not the other
way around - which can cause subtle issues in the form of some parts of
mce side logic getting out of sync with UIs view of the tklock status.

Synchronize internal to mce tklock submode changes to externally visible
tklock ipc state.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Aug 15, 2018
1 parent 98f3e7e commit cd122e2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tklock.c
Expand Up @@ -1529,6 +1529,16 @@ static void tklock_datapipe_submode_cb(gconstpointer data)
}
}

/* Synchronize tklock ipc state with submode changes.
*
* As this can cause synchronization attempt to the other
* direction, we must ensure that possibly conflicting rules
* do not induce indefinite state machine ringing. */
static int ringing_depth = 0;
if( ++ringing_depth <= 2 )
tklock_ui_set(tklock_datapipe_have_tklock_submode());
--ringing_depth;

EXIT:
return;
}
Expand Down

0 comments on commit cd122e2

Please sign in to comment.