From: Yunhee Seo Date: Mon, 12 Jun 2023 12:46:48 +0000 (+0900) Subject: display: Relocate touch_event_blocked() X-Git-Tag: accepted/tizen/unified/dev/20230726.115933~26^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb986c8d42dd107f15cfb14b4ac7220d79fcc455;p=platform%2Fcore%2Fsystem%2Fdeviced.git display: Relocate touch_event_blocked() touch_event_blocked() checks touch event blocking during lcd_on/off_procedure(). For relocating lcd_on/off_procedure(), touch_event_blocked() is also relocated. This functions are added below display-misc. - int display_misc_set_touch_event_blocked(bool blocked); - bool display_misc_is_touch_event_blocked(void); -> This replaces touch_event_blocked() Change-Id: Icaa609ad4a4e168663dd85556dea2c448b5747bd Signed-off-by: Yunhee Seo --- diff --git a/plugins/iot-headed/display/core.c b/plugins/iot-headed/display/core.c index 240eb3b..772b225 100644 --- a/plugins/iot-headed/display/core.c +++ b/plugins/iot-headed/display/core.c @@ -107,8 +107,6 @@ static struct timeval lcdon_tv; */ static bool lcdon_broadcast = true; -static bool touch_blocked = false; - /* default transition, action fuctions */ static int default_action(int timeout); @@ -201,11 +199,6 @@ static const char* __device_flags_to_string(enum device_flags flags) return UNKNOWN_STR; } -bool touch_event_blocked(void) -{ - return touch_blocked; -} - void lcd_on_procedure(int state, enum device_flags flag) { unsigned long flags = NORMAL_MODE; @@ -252,7 +245,7 @@ void lcd_on_procedure(int state, enum device_flags flag) touchled_control_backlight(TOUCHLED_DIRECT_ON); - touch_blocked = false; + display_misc_set_touch_event_blocked(false); } inline void lcd_off_procedure(enum device_flags flag) @@ -285,7 +278,7 @@ inline void lcd_off_procedure(enum device_flags flag) /* operation */ - touch_blocked = true; + display_misc_set_touch_event_blocked(true); set_setting_pmstate(S_LCDOFF); diff --git a/plugins/iot-headed/display/key-filter.c b/plugins/iot-headed/display/key-filter.c index 5361e0e..e0e0ae9 100644 --- a/plugins/iot-headed/display/key-filter.c +++ b/plugins/iot-headed/display/key-filter.c @@ -37,6 +37,7 @@ #include "display-backlight.h" #include "display-ops.h" #include "display-config.h" +#include "display-misc.h" #include "display-state-transition.h" #include "shared/common.h" #include "shared/devices.h" @@ -693,7 +694,7 @@ static void check_key_filter(struct timeval time, unsigned short type, unsigned ignore = false; break; case EV_ABS: - if (touch_event_blocked() + if (display_misc_is_touch_event_blocked() && !g_display_plugin.config->touch_wakeup && pinput->value == KEY_BEING_PRESSED) return; diff --git a/plugins/mobile/display/core.c b/plugins/mobile/display/core.c index 51daaac..5206550 100644 --- a/plugins/mobile/display/core.c +++ b/plugins/mobile/display/core.c @@ -109,8 +109,6 @@ static struct timeval lcdon_tv; */ static bool lcdon_broadcast = true; -static bool touch_blocked = false; - /* default transition, action fuctions */ static int default_action(int timeout); @@ -208,11 +206,6 @@ static const char* __device_flags_to_string(enum device_flags flags) return UNKNOWN_STR; } -bool touch_event_blocked(void) -{ - return touch_blocked; -} - void lcd_on_procedure(int state, enum device_flags flag) { unsigned long flags = NORMAL_MODE; @@ -259,7 +252,7 @@ void lcd_on_procedure(int state, enum device_flags flag) touchled_control_backlight(TOUCHLED_DIRECT_ON); - touch_blocked = false; + display_misc_set_touch_event_blocked(false); } inline void lcd_off_procedure(enum device_flags flag) @@ -292,7 +285,7 @@ inline void lcd_off_procedure(enum device_flags flag) /* operation */ - touch_blocked = true; + display_misc_set_touch_event_blocked(true); set_setting_pmstate(S_LCDOFF); diff --git a/plugins/mobile/display/key-filter.c b/plugins/mobile/display/key-filter.c index 65a0de2..11d6dfb 100644 --- a/plugins/mobile/display/key-filter.c +++ b/plugins/mobile/display/key-filter.c @@ -37,6 +37,7 @@ #include "display-backlight.h" #include "display-ops.h" #include "display-config.h" +#include "display-misc.h" #include "display-state-transition.h" #include "shared/common.h" #include "shared/devices.h" @@ -720,7 +721,7 @@ static void check_key_filter(struct timeval time, unsigned short type, unsigned ignore = false; break; case EV_ABS: - if (touch_event_blocked() + if (display_misc_is_touch_event_blocked() && !g_display_plugin.config->touch_wakeup && pinput->value == KEY_BEING_PRESSED) return; diff --git a/plugins/tv/display/core.c b/plugins/tv/display/core.c index 05826a9..a66afaa 100644 --- a/plugins/tv/display/core.c +++ b/plugins/tv/display/core.c @@ -107,8 +107,6 @@ static struct timeval lcdon_tv; */ static bool lcdon_broadcast = true; -static bool touch_blocked = false; - /* default transition, action fuctions */ static int default_action(int timeout); @@ -201,11 +199,6 @@ static const char* __device_flags_to_string(enum device_flags flags) return UNKNOWN_STR; } -bool touch_event_blocked(void) -{ - return touch_blocked; -} - void lcd_on_procedure(int state, enum device_flags flag) { unsigned long flags = NORMAL_MODE; @@ -252,7 +245,7 @@ void lcd_on_procedure(int state, enum device_flags flag) touchled_control_backlight(TOUCHLED_DIRECT_ON); - touch_blocked = false; + display_misc_set_touch_event_blocked(false); } inline void lcd_off_procedure(enum device_flags flag) @@ -285,7 +278,7 @@ inline void lcd_off_procedure(enum device_flags flag) /* operation */ - touch_blocked = true; + display_misc_set_touch_event_blocked(true); set_setting_pmstate(S_LCDOFF); diff --git a/plugins/tv/display/key-filter.c b/plugins/tv/display/key-filter.c index 6a44187..50fb6d6 100644 --- a/plugins/tv/display/key-filter.c +++ b/plugins/tv/display/key-filter.c @@ -37,6 +37,7 @@ #include "display-backlight.h" #include "display-ops.h" #include "display-config.h" +#include "display-misc.h" #include "display-state-transition.h" #include "shared/common.h" #include "shared/devices.h" @@ -687,7 +688,7 @@ static void check_key_filter(struct timeval time, unsigned short type, unsigned ignore = false; break; case EV_ABS: - if (touch_event_blocked() + if (display_misc_is_touch_event_blocked() && !g_display_plugin.config->touch_wakeup && pinput->value == KEY_BEING_PRESSED) return; diff --git a/plugins/wearable/display/core.c b/plugins/wearable/display/core.c index a47192f..5a8f2bf 100644 --- a/plugins/wearable/display/core.c +++ b/plugins/wearable/display/core.c @@ -120,8 +120,6 @@ static struct timeval lcdon_tv; */ static bool lcdon_broadcast = true; -static bool touch_blocked = false; - /* default transition, action fuctions */ static int default_trans(int evt); static int default_action(int timeout); @@ -452,11 +450,6 @@ static int get_device_flags(unsigned long *device_flags) return 0; } -bool touch_event_blocked(void) -{ - return touch_blocked; -} - static gboolean late_transit_on(void *data) { if (!transit_timer) @@ -532,7 +525,7 @@ void lcd_on_procedure(int state, enum device_flags flag) lcdon_broadcast = true; } - touch_blocked = false; + display_misc_set_touch_event_blocked(false); } inline void lcd_off_procedure(enum device_flags flag) @@ -565,7 +558,7 @@ inline void lcd_off_procedure(enum device_flags flag) /* operation */ - touch_blocked = true; + display_misc_set_touch_event_blocked(true); if (flags & AMBIENT_MODE) { if (ambient_get_state() == true) diff --git a/plugins/wearable/display/key-filter.c b/plugins/wearable/display/key-filter.c index 2658612..701041a 100644 --- a/plugins/wearable/display/key-filter.c +++ b/plugins/wearable/display/key-filter.c @@ -37,6 +37,7 @@ #include "display-panel.h" #include "display-backlight.h" #include "display-config.h" +#include "display-misc.h" #include "display-state-transition.h" #include "shared/common.h" #include "shared/devices.h" @@ -647,7 +648,7 @@ static void check_key_filter(struct timeval time, unsigned short type, unsigned ignore = false; break; case EV_ABS: - if (touch_event_blocked() && !ambient_get_state() + if (display_misc_is_touch_event_blocked() && !ambient_get_state() && !g_display_plugin.config->touch_wakeup && pinput->value == KEY_BEING_PRESSED) return; diff --git a/src/display/core.h b/src/display/core.h index 6a11082..0b5d791 100644 --- a/src/display/core.h +++ b/src/display/core.h @@ -130,7 +130,6 @@ int custom_lcdon(int timeout); void lcd_on_direct(enum device_flags flags); void lcd_on_procedure(int state, enum device_flags flag); void lcd_off_procedure(enum device_flags flag); -bool touch_event_blocked(void); void broadcast_lcd_off_late(enum device_flags flags); /* auto-brightness.c */ diff --git a/src/display/display-misc.c b/src/display/display-misc.c index ec3cc91..e1d02af 100644 --- a/src/display/display-misc.c +++ b/src/display/display-misc.c @@ -38,6 +38,7 @@ #include "poll.h" static bool stay_touchscreen_off = false; +static bool touch_event_blocked = false; /* FIXME: This fucntion should be relocated under the battery module */ bool display_misc_is_low_battery_state(int val) @@ -97,6 +98,17 @@ void display_misc_get_stay_touchscreen_off(bool *on) *on = stay_touchscreen_off; } +int display_misc_set_touch_event_blocked(bool blocked) +{ + touch_event_blocked = blocked; + return 0; +} + +bool display_misc_is_touch_event_blocked(void) +{ + return touch_event_blocked; +} + /* FIXME: This fucntion should be relocated under the battery module or redefined */ static int changed_battery_health(void *data) { diff --git a/src/display/display-misc.h b/src/display/display-misc.h index 3176350..e213f81 100644 --- a/src/display/display-misc.h +++ b/src/display/display-misc.h @@ -34,5 +34,7 @@ void display_misc_get_stay_touchscreen_off(bool *on); void display_misc_register_battery_health_notifier(void); void display_misc_unregister_battery_health_notifier(void); void display_misc_save_display_log(const char *path); +int display_misc_set_touch_event_blocked(bool blocked); +bool display_misc_is_touch_event_blocked(void); #endif /* __DISPLAY_MISC_H__ */ \ No newline at end of file