From: sh.pi Date: Wed, 22 May 2013 15:06:42 +0000 (+0900) Subject: Add error logging code to check that press/release of power key is unpair. X-Git-Tag: submit/tizen_ivi_release/20140401.030119~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d8f5ee60ee41e3775731c3e4eceb54d6d0c1a22;p=platform%2Fcore%2Fsystem%2Fsystem-server.git Add error logging code to check that press/release of power key is unpair. Change-Id: I9a6906128f9268696fa7c44899cc2d24bcad3758 Signed-off-by: Krzysztof Sasiak --- 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");