From 1d8f5ee60ee41e3775731c3e4eceb54d6d0c1a22 Mon Sep 17 00:00:00 2001 From: "sh.pi" Date: Thu, 23 May 2013 00:06:42 +0900 Subject: [PATCH] Add error logging code to check that press/release of power key is unpair. Change-Id: I9a6906128f9268696fa7c44899cc2d24bcad3758 Signed-off-by: Krzysztof Sasiak --- src/display/key-filter.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/display/key-filter.c b/src/display/key-filter.c index 873f96b..24ea6ff 100644 --- a/src/display/key-filter.c +++ b/src/display/key-filter.c @@ -126,12 +126,22 @@ static void stop_key_combination(void) } } +static inline void check_key_pair(int code, int new, int *old) +{ + if (new == *old) + _E("key pair is not matched! (%d, %d)", code, new); + else + *old = new; +} + static int process_power_key(struct input_event *pinput) { int ignore = true; + static int value = KEY_RELEASED; switch (pinput->value) { case KEY_RELEASED: + check_key_pair(pinput->code, pinput->value, &value); if (current_state_in_on() && !cancel_lcdoff && !(key_combination == KEY_COMBINATION_SCREENCAPTURE)) { check_processes(S_LCDOFF); @@ -159,6 +169,7 @@ static int process_power_key(struct input_event *pinput) } break; case KEY_PRESSED: + check_key_pair(pinput->code, pinput->value, &value); if (timediff_usec(pressed_time, pinput->time) < (POWER_KEY_PRESS_IGNORE_TIME * USEC_PER_SEC)) { _I("power key double pressed ignored"); -- 2.7.4