Skip to content

Commit

Permalink
[powerkey] Elevate logging of powerkey, homekey and gesture events. J…
Browse files Browse the repository at this point in the history
…B#36274

Powerkey, homekey and touchscreen gestures such as doubletaps can cause
display wakeups.
  • Loading branch information
spiiroin committed Oct 11, 2016
1 parent 0166a24 commit 898605b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions powerkey.c
Expand Up @@ -2861,6 +2861,7 @@ pwrkey_datapipes_keypress_cb(gconstpointer const data)
switch( ev->code ) {
case KEY_POWER:
if( ev->value == 1 ) {
mce_log(LL_CRUCIAL, "powerkey pressed");
/* Detect repeated power key pressing while
* proximity sensor is covered; assume it means
* the sensor is stuck and user wants to be able
Expand All @@ -2872,6 +2873,7 @@ pwrkey_datapipes_keypress_cb(gconstpointer const data)
pwrkey_stm_powerkey_pressed();
}
else if( ev->value == 0 ) {
mce_log(LL_CRUCIAL, "powerkey released");
/* Power key released */
pwrkey_stm_powerkey_released();
}
Expand All @@ -2880,10 +2882,14 @@ pwrkey_datapipes_keypress_cb(gconstpointer const data)
break;

case KEY_HOME:
if( ev->value == 1 )
if( ev->value == 1 ) {
mce_log(LL_CRUCIAL, "homekey pressed");
homekey_stm_set_pressed(true);
else if( ev->value == 0 )
}
else if( ev->value == 0 ) {
mce_log(LL_CRUCIAL, "homekey released");
homekey_stm_set_pressed(false);
}
break;

default:
Expand All @@ -2893,7 +2899,7 @@ pwrkey_datapipes_keypress_cb(gconstpointer const data)

case EV_MSC:
if( ev->code == MSC_GESTURE ) {
mce_log(LL_DEBUG, "gesture(%d)", ev->value);
mce_log(LL_CRUCIAL, "gesture(%d)", ev->value);
pwrkey_actions_do_gesture(ev->value);
}
break;
Expand Down

0 comments on commit 898605b

Please sign in to comment.