From 0aa8728d034f7056fc250d79a1899ef44dc30b51 Mon Sep 17 00:00:00 2001 From: Hyotaek Shim Date: Fri, 11 Dec 2020 10:06:33 +0900 Subject: [PATCH] Rearrange device_notify(DEVICE_NOTIFIER_LCD_OFF, ..) And remove ambient_set_state() for other profiles except wearable device_notify(LCD_OFF) is triggered after ambient_set and LCD_OFF_PRE. Change-Id: I04c4608334a9627b0804f796056aa84dba5b567e Signed-off-by: Hyotaek Shim --- plugins/iot/display/core.c | 15 +++++++-------- plugins/mobile/display/core.c | 15 +++++++-------- plugins/tv/display/core.c | 15 +++++++-------- plugins/wearable/display/core.c | 13 +++++++++---- 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/plugins/iot/display/core.c b/plugins/iot/display/core.c index 8c5803e..cfdbb67 100644 --- a/plugins/iot/display/core.c +++ b/plugins/iot/display/core.c @@ -436,20 +436,19 @@ inline void lcd_off_procedure(enum device_flags flag) */ _I("[lcdstep] 0x%lx", flags); - device_notify(DEVICE_NOTIFIER_LCD_OFF, NULL); - - touch_blocked = true; + /* notification */ - if (flags & AMBIENT_MODE) { - if (ambient_get_state() == true) - return; - ambient_set_state(true); - } + device_notify(DEVICE_NOTIFIER_LCD_OFF, NULL); if (lcdon_broadcast) { broadcast_lcd_off(SIGNAL_PRE, flags); lcdon_broadcast = false; } + + /* operation */ + + touch_blocked = true; + set_setting_pmstate(S_LCDOFF); if (CHECK_OPS(keyfilter_ops, backlight_enable)) diff --git a/plugins/mobile/display/core.c b/plugins/mobile/display/core.c index 0a615c8..cf8ab3d 100644 --- a/plugins/mobile/display/core.c +++ b/plugins/mobile/display/core.c @@ -444,20 +444,19 @@ inline void lcd_off_procedure(enum device_flags flag) */ _I("[lcdstep] 0x%lx", flags); - device_notify(DEVICE_NOTIFIER_LCD_OFF, NULL); - - touch_blocked = true; + /* notification */ - if (flags & AMBIENT_MODE) { - if (ambient_get_state() == true) - return; - ambient_set_state(true); - } + device_notify(DEVICE_NOTIFIER_LCD_OFF, NULL); if (lcdon_broadcast) { broadcast_lcd_off(SIGNAL_PRE, flags); lcdon_broadcast = false; } + + /* operation */ + + touch_blocked = true; + set_setting_pmstate(S_LCDOFF); if (CHECK_OPS(keyfilter_ops, backlight_enable)) diff --git a/plugins/tv/display/core.c b/plugins/tv/display/core.c index 923e95a..35265fd 100644 --- a/plugins/tv/display/core.c +++ b/plugins/tv/display/core.c @@ -437,20 +437,19 @@ inline void lcd_off_procedure(enum device_flags flag) */ _I("[lcdstep] 0x%lx", flags); - device_notify(DEVICE_NOTIFIER_LCD_OFF, NULL); - - touch_blocked = true; + /* notification */ - if (flags & AMBIENT_MODE) { - if (ambient_get_state() == true) - return; - ambient_set_state(true); - } + device_notify(DEVICE_NOTIFIER_LCD_OFF, NULL); if (lcdon_broadcast) { broadcast_lcd_off(SIGNAL_PRE, flags); lcdon_broadcast = false; } + + /* operation */ + + touch_blocked = true; + set_setting_pmstate(S_LCDOFF); if (CHECK_OPS(keyfilter_ops, backlight_enable)) diff --git a/plugins/wearable/display/core.c b/plugins/wearable/display/core.c index 6a8e27f..f5e1b69 100644 --- a/plugins/wearable/display/core.c +++ b/plugins/wearable/display/core.c @@ -652,8 +652,17 @@ inline void lcd_off_procedure(enum device_flags flag) */ _I("[lcdstep] 0x%lx", flags); + /* notification */ + device_notify(DEVICE_NOTIFIER_LCD_OFF, NULL); + if (lcdon_broadcast) { + broadcast_lcd_off(SIGNAL_PRE, flags); + lcdon_broadcast = false; + } + + /* operation */ + touch_blocked = true; if (flags & AMBIENT_MODE) { @@ -662,10 +671,6 @@ inline void lcd_off_procedure(enum device_flags flag) ambient_set_state(true); } - if (lcdon_broadcast) { - broadcast_lcd_off(SIGNAL_PRE, flags); - lcdon_broadcast = false; - } set_setting_pmstate(S_LCDOFF); if (CHECK_OPS(keyfilter_ops, backlight_enable)) -- 2.7.4