Skip to content

Commit

Permalink
[event-input] Do not skip volume key processing. JB#43764
Browse files Browse the repository at this point in the history
Previously grabbing input devices was used as means for implementing
touchscreen and volume key policies. This should not be necessary anymore,
but unless volume key grabbing is allowed, pressing volume keys always
wakes up display.

Instead of skipping volume key event processing altogether when keypad
input devices have been grabbed by mce, check keypad policy state when
processing volume key events to decide whether display wake up is desired
or not.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Nov 12, 2018
1 parent f8f3581 commit 455073d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 0 additions & 10 deletions event-input.c
Expand Up @@ -2152,16 +2152,6 @@ evin_iomon_keypress_cb(mce_io_mon_t *iomon, gpointer data, gsize bytes_read)
}

if (ev->type == EV_KEY) {
if( datapipe_get_gint(keypad_grab_active_pipe) ) {
switch( ev->code ) {
case KEY_VOLUMEUP:
case KEY_VOLUMEDOWN:
mce_log(LL_DEVEL, "ignore volume key event");
goto EXIT;
default:
break;
}
}
if ((ev->code == KEY_SCREENLOCK) && (ev->value != 2)) {
key_state_t key_state = ev->value ?
KEY_STATE_PRESSED : KEY_STATE_RELEASED;
Expand Down
4 changes: 4 additions & 0 deletions tklock.c
Expand Up @@ -1455,6 +1455,10 @@ static void tklock_datapipe_keypress_event_cb(gconstpointer const data)

case KEY_VOLUMEDOWN:
case KEY_VOLUMEUP:
if( datapipe_get_gint(keypad_grab_wanted_pipe) ) {
mce_log(LL_DEVEL, "volume key ignored");
break;
}
mce_log(LL_DEBUG, "volume key");
mce_tklock_begin_notification(0, "mce_volume_key",
exception_length_volume, -1);
Expand Down

0 comments on commit 455073d

Please sign in to comment.