diff options
author | Youngjae Cho <y0.cho@samsung.com> | 2020-06-03 15:35:57 +0900 |
---|---|---|
committer | Youngjae Cho <y0.cho@samsung.com> | 2020-06-04 10:01:58 +0900 |
commit | c8161c31ac08fb1b9a802dbae1d099152736727b (patch) | |
tree | 38d387b8f0d0898d6bcca1489e46bbf4d0738337 | |
parent | 21b773c04b01638caff419bbfa813a9b442e01fe (diff) | |
download | deviced-c8161c31ac08fb1b9a802dbae1d099152736727b.tar.gz deviced-c8161c31ac08fb1b9a802dbae1d099152736727b.tar.bz2 deviced-c8161c31ac08fb1b9a802dbae1d099152736727b.zip |
Fix lcd_on_direct() not to update old state
As updating old state within lcd_on_direct() causes several problems,
this patch reverts the parts related to state update of lcd_on_direct()
from the following patches.
- 613ecd25da136c6cf210e00a15a21783f7ecdf5b
- 32a6e47d137a00c2a8b037b23ef4387f2ebecb23
- 6e04a05360c0a77a1e4d0275d967acb89719d3e1
In general, lcd_on_direct() is followed by
default_proc_change_state_action(), and the subroutine is like below.
- lcd_on_direct() : update old state
-> ... (do something)
-> default_proc_change_state_action() : update old state once more
-> default_action()
So for the default_action(), if it is called through lcd_on_direct(),
pm_old_state and pm_cur_state is always same because old state is
updated twice. This makes below code in default_action() unreachable.
device_notify(DEVICE_NOTIFIER_LCD, (void *)&pm_cur_state);
As a result, lcd_on_direct() should not update the pm_old_state.
Change-Id: I98a02b8b57651792c5e0a6265fbd4784a7c69c85
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
-rw-r--r-- | plugins/iot/display/core.c | 3 | ||||
-rw-r--r-- | plugins/mobile/display/core.c | 3 | ||||
-rw-r--r-- | plugins/tv/display/core.c | 3 | ||||
-rw-r--r-- | plugins/wearable/display/core.c | 4 | ||||
-rw-r--r-- | plugins/wearable/display/key-filter.c | 3 |
5 files changed, 4 insertions, 12 deletions
diff --git a/plugins/iot/display/core.c b/plugins/iot/display/core.c index 9a3f2a9b..3d457391 100644 --- a/plugins/iot/display/core.c +++ b/plugins/iot/display/core.c @@ -1141,10 +1141,9 @@ void lcd_on_direct(enum device_flags flags) && pm_cur_state == S_SLEEP) { broadcast_pm_wakeup(); power_ops.power_lock(); + pm_cur_state = S_NORMAL; } - pm_cur_state = S_NORMAL; - _D("lcd is on directly"); gettimeofday(&lcdon_tv, NULL); lcd_on_procedure(LCD_NORMAL, flags); diff --git a/plugins/mobile/display/core.c b/plugins/mobile/display/core.c index d7aa518f..d50cbb31 100644 --- a/plugins/mobile/display/core.c +++ b/plugins/mobile/display/core.c @@ -1147,10 +1147,9 @@ void lcd_on_direct(enum device_flags flags) && pm_cur_state == S_SLEEP) { broadcast_pm_wakeup(); power_ops.power_lock(); + pm_cur_state = S_NORMAL; } - pm_cur_state = S_NORMAL; - _D("lcd is on directly"); gettimeofday(&lcdon_tv, NULL); lcd_on_procedure(LCD_NORMAL, flags); diff --git a/plugins/tv/display/core.c b/plugins/tv/display/core.c index 2a0d9903..5f3d47ef 100644 --- a/plugins/tv/display/core.c +++ b/plugins/tv/display/core.c @@ -1138,10 +1138,9 @@ void lcd_on_direct(enum device_flags flags) && pm_cur_state == S_SLEEP) { broadcast_pm_wakeup(); power_ops.power_lock(); + pm_cur_state = S_NORMAL; } - pm_cur_state = S_NORMAL; - _D("lcd is on directly"); gettimeofday(&lcdon_tv, NULL); lcd_on_procedure(LCD_NORMAL, flags); diff --git a/plugins/wearable/display/core.c b/plugins/wearable/display/core.c index 71025bb3..1c5e8a51 100644 --- a/plugins/wearable/display/core.c +++ b/plugins/wearable/display/core.c @@ -1169,6 +1169,7 @@ void lcd_on_direct(enum device_flags flags) && pm_cur_state == S_SLEEP) { broadcast_pm_wakeup(); power_ops.power_lock(); + pm_cur_state = S_NORMAL; } /* only for factory mode */ @@ -1177,9 +1178,6 @@ void lcd_on_direct(enum device_flags flags) return; } - pm_old_state = pm_cur_state; - pm_cur_state = S_NORMAL; - _D("lcd is on directly"); gettimeofday(&lcdon_tv, NULL); lcd_on_procedure(LCD_NORMAL, flags); diff --git a/plugins/wearable/display/key-filter.c b/plugins/wearable/display/key-filter.c index bc5e0840..3c33c32e 100644 --- a/plugins/wearable/display/key-filter.c +++ b/plugins/wearable/display/key-filter.c @@ -211,9 +211,6 @@ static inline bool switch_on_lcd(enum device_flags flags) lcd_on_direct(flags); - if (pm_cur_state == S_NORMAL) - reset_timeout(states[S_NORMAL].timeout); - return true; } |