return ignore;
}
-static bool key_check_display_on(void)
-{
- if (current_state_in_on())
- return false;
-
- if (backlight_ops.get_lcd_power() == DPMS_ON) {
- _W("display power was on");
- return false;
- }
-
- return true;
-}
-
-static gboolean display_on_cb(void *data)
-{
- if (displayon_by_powerkey_timeout_id == 0)
- return G_SOURCE_REMOVE;
-
- displayon_by_powerkey_timeout_id = 0;
- if (backlight_ops.get_lcd_power() != DPMS_ON ||
- current_state_in_on() == false) {
- broadcast_lcdon_by_powerkey();
- lcd_on_direct(LCD_ON_BY_POWER_KEY);
-
- if (pm_callback)
- (*pm_callback) (INPUT_POLL_EVENT, NULL);
- }
-
- return G_SOURCE_REMOVE;
-}
-
static int process_back_key(struct input_event *pinput)
{
int ignore = true;
break;
case KEY_PRESSED:
if (display_has_caps(caps, DISPLAY_CAPA_LCDON)) {
- if (wearable_mode())
- skip_lcd_off = switch_on_lcd(LCD_ON_BY_POWER_KEY);
- else {
- /*
- * LCD does not turn on immediately at mobile.
- * It will be turned on after 0.1 second because of torch concept.
- */
- skip_lcd_off = key_check_display_on();
- ignore = true;
-
- if (!displayon_by_powerkey_timeout_id &&
- backlight_ops.get_lcd_power() != DPMS_ON &&
- key_combination != COMBINATION_TORCH) {
- displayon_by_powerkey_timeout_id = g_timeout_add(
- 100,
- display_on_cb, NULL);
- }
- }
+ skip_lcd_off = switch_on_lcd(LCD_ON_BY_POWER_KEY);
} else {
_D("No lcdon capability!");
skip_lcd_off = false;
_E("pinput->value : %d", pinput->value);
if (pinput->value == KEY_PRESSED) {
- if (!wearable_mode()) {
/* Sound & Vibrate only in unlock state */
if (__get_lock_screen_state() == VCONFKEY_IDLE_UNLOCK
|| get_lock_screen_bg_state())
sound_vibrate_hardkey();
- }
if (touchled && touchled->execute) {
opt = TOUCHLED_PRESS;
break;
case KEY_PRESSED:
if (display_has_caps(caps, DISPLAY_CAPA_LCDON)) {
- if (wearable_mode())
- skip_lcd_off = switch_on_lcd(LCD_ON_BY_POWER_KEY);
- else {
- /*
- * LCD does not turn on immediately at mobile.
- * It will be turned on after 0.1 second because of torch concept.
- */
- skip_lcd_off = key_check_display_on();
- ignore = true;
-
- if (!displayon_by_powerkey_timeout_id &&
- backlight_ops.get_lcd_power() != DPMS_ON &&
- key_combination != COMBINATION_TORCH) {
- displayon_by_powerkey_timeout_id = g_timeout_add(
- 100,
- display_on_cb, NULL);
- }
+ /*
+ * LCD does not turn on immediately at mobile.
+ * It will be turned on after 0.1 second because of torch concept.
+ */
+ skip_lcd_off = key_check_display_on();
+ ignore = true;
+
+ if (!displayon_by_powerkey_timeout_id &&
+ backlight_ops.get_lcd_power() != DPMS_ON &&
+ key_combination != COMBINATION_TORCH) {
+ displayon_by_powerkey_timeout_id = g_timeout_add(
+ 100,
+ display_on_cb, NULL);
}
} else {
_D("No lcdon capability!");
_E("pinput->value : %d", pinput->value);
if (pinput->value == KEY_PRESSED) {
- if (!wearable_mode()) {
/* Sound & Vibrate only in unlock state */
if (__get_lock_screen_state() == VCONFKEY_IDLE_UNLOCK
|| get_lock_screen_bg_state())
sound_vibrate_hardkey();
- }
if (touchled && touchled->execute) {
opt = TOUCHLED_PRESS;
return ignore;
}
-static bool key_check_display_on(void)
-{
- if (current_state_in_on())
- return false;
-
- if (backlight_ops.get_lcd_power() == DPMS_ON) {
- _W("display power was on");
- return false;
- }
-
- return true;
-}
-
-static gboolean display_on_cb(void *data)
-{
- if (displayon_by_powerkey_timeout_id == 0)
- return G_SOURCE_REMOVE;
-
- displayon_by_powerkey_timeout_id = 0;
- if (backlight_ops.get_lcd_power() != DPMS_ON ||
- current_state_in_on() == false) {
- broadcast_lcdon_by_powerkey();
- lcd_on_direct(LCD_ON_BY_POWER_KEY);
-
- if (pm_callback)
- (*pm_callback) (INPUT_POLL_EVENT, NULL);
- }
-
- return G_SOURCE_REMOVE;
-}
-
static int process_back_key(struct input_event *pinput)
{
int ignore = true;
break;
case KEY_PRESSED:
if (display_has_caps(caps, DISPLAY_CAPA_LCDON)) {
- if (wearable_mode())
- skip_lcd_off = switch_on_lcd(LCD_ON_BY_POWER_KEY);
- else {
- /*
- * LCD does not turn on immediately at mobile.
- * It will be turned on after 0.1 second because of torch concept.
- */
- skip_lcd_off = key_check_display_on();
- ignore = true;
-
- if (!displayon_by_powerkey_timeout_id &&
- backlight_ops.get_lcd_power() != DPMS_ON &&
- key_combination != COMBINATION_TORCH) {
- displayon_by_powerkey_timeout_id = g_timeout_add(
- 100,
- display_on_cb, NULL);
- }
- }
+ skip_lcd_off = switch_on_lcd(LCD_ON_BY_POWER_KEY);
} else {
_D("No lcdon capability!");
skip_lcd_off = false;
_E("pinput->value : %d", pinput->value);
if (pinput->value == KEY_PRESSED) {
- if (!wearable_mode()) {
/* Sound & Vibrate only in unlock state */
if (__get_lock_screen_state() == VCONFKEY_IDLE_UNLOCK
|| get_lock_screen_bg_state())
sound_vibrate_hardkey();
- }
if (touchled && touchled->execute) {
opt = TOUCHLED_PRESS;
return ignore;
}
-static bool key_check_display_on(void)
-{
- if (current_state_in_on())
- return false;
-
- if (backlight_ops.get_lcd_power() == DPMS_ON) {
- _W("display power was on");
- return false;
- }
-
- return true;
-}
-
-static gboolean display_on_cb(void *data)
-{
- if (displayon_by_powerkey_timeout_id == 0)
- return G_SOURCE_REMOVE;
-
- displayon_by_powerkey_timeout_id = 0;
- if (backlight_ops.get_lcd_power() != DPMS_ON ||
- current_state_in_on() == false) {
- broadcast_lcdon_by_powerkey();
- lcd_on_direct(LCD_ON_BY_POWER_KEY);
-
- if (pm_callback)
- (*pm_callback) (INPUT_POLL_EVENT, NULL);
- }
-
- return G_SOURCE_REMOVE;
-}
-
static int process_back_key(struct input_event *pinput)
{
int ignore = true;
break;
case KEY_PRESSED:
if (display_has_caps(caps, DISPLAY_CAPA_LCDON)) {
- if (wearable_mode())
- skip_lcd_off = switch_on_lcd(LCD_ON_BY_POWER_KEY);
- else {
- /*
- * LCD does not turn on immediately at mobile.
- * It will be turned on after 0.1 second because of torch concept.
- */
- skip_lcd_off = key_check_display_on();
- ignore = true;
-
- if (!displayon_by_powerkey_timeout_id &&
- backlight_ops.get_lcd_power() != DPMS_ON &&
- key_combination != COMBINATION_TORCH) {
- displayon_by_powerkey_timeout_id = g_timeout_add(
- 100,
- display_on_cb, NULL);
- }
- }
+ skip_lcd_off = switch_on_lcd(LCD_ON_BY_POWER_KEY);
} else {
_D("No lcdon capability!");
skip_lcd_off = false;
return true;
}
-static void sound_vibrate_hardkey(void)
-{
- /* device notify(vibrator) */
- /* sound(dbus) */
- /* Need to notify to deviced-vibrator. deviced-vibrator receives ChangedHardKey signal */
- dbus_handle_emit_dbus_signal(NULL,
- DEVICED_PATH_KEY,
- DEVICED_INTERFACE_KEY,
- SIGNAL_CHANGE_HARDKEY,
- NULL);
-}
-
static void process_hardkey_backlight(struct input_event *pinput)
{
int opt;
_E("pinput->value : %d", pinput->value);
if (pinput->value == KEY_PRESSED) {
- if (!wearable_mode()) {
- /* Sound & Vibrate only in unlock state */
- if (__get_lock_screen_state() == VCONFKEY_IDLE_UNLOCK
- || get_lock_screen_bg_state())
- sound_vibrate_hardkey();
- }
-
if (touchled && touchled->execute) {
opt = TOUCHLED_PRESS;
touchled->execute(&opt);
extern "C" {
#endif
-#ifdef MICRO_DD
-#define wearable_mode() 1
-#else
-#define wearable_mode() 0
-#endif
-
#ifndef API
#define API __attribute__ ((visibility("default")))
#endif