From bd521bfaf8db82f2301f4537fb03d474f06a859a Mon Sep 17 00:00:00 2001 From: JinWang An Date: Mon, 5 Apr 2021 14:54:43 +0900 Subject: [PATCH] Fix input value check of screen backlight time - To support setting 0(== always on) for Change-Id: I8ccbe0d2151b68ca5fb0e1d0d92c7f7df20a4c91 Signed-off-by: JinWang An --- src/sst_screen.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sst_screen.c b/src/sst_screen.c index 8825e76..7f1d4ab 100644 --- a/src/sst_screen.c +++ b/src/sst_screen.c @@ -26,14 +26,16 @@ int sst_screen_set_backlight_time(sst_interface *iface, int value) { - if (value <= 0 || 600 < value) { + if (value < 0 || 600 < value) { ERR("Invalid Value(%d)", value); return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER; } if (vconf_set_int(iface->vconf_key, value)) { ERR("vconf_set_int(%s, %d) Fail", iface->vconf_key, value); - return SYSTEM_SETTINGS_ERROR_IO_ERROR; + /* vconf_set_int returns error with 0 value, + that means there is no write privilege about lcd back light time */ + return value? SYSTEM_SETTINGS_ERROR_IO_ERROR: SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER; } return SYSTEM_SETTINGS_ERROR_NONE; -- 2.7.4