diff options
author | taeyoung <ty317.kim@samsung.com> | 2017-01-06 18:36:02 +0900 |
---|---|---|
committer | Taeyoung Kim <ty317.kim@samsung.com> | 2017-01-19 18:43:12 -0800 |
commit | adbd810625c06f556ef7902e85e60672d9b7a043 (patch) | |
tree | 05385128c5cf2393b957e0530d2bee420b756d90 | |
parent | 7a2ee8c44d78b4c78a046f5ce984012a84b15544 (diff) | |
download | deviced-adbd810625c06f556ef7902e85e60672d9b7a043.tar.gz deviced-adbd810625c06f556ef7902e85e60672d9b7a043.tar.bz2 deviced-adbd810625c06f556ef7902e85e60672d9b7a043.zip |
display: set vconf key only if the value is changed
Previously, the vconf key could be set with same value.
Thus the display state callback of the capi-system-device
could be called several times with same state.
Now, the vconf key is updated only if the value is changed.
Thus the callback of the api will be called once
for a certain display state.
Change-Id: I35a89dc6a882b58fb86c21a2b8a8b570231db97c
Signed-off-by: taeyoung <ty317.kim@samsung.com>
-rw-r--r-- | src/display/setting.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/display/setting.c b/src/display/setting.c index eacb720f..f45c40e8 100644 --- a/src/display/setting.c +++ b/src/display/setting.c @@ -125,6 +125,12 @@ int get_usb_status(int *val) int set_setting_pmstate(int val) { + static int old = -1; + + if (old == val) + return 0; + old = val; + display_state_send_system_event(val); return vconf_set_int(VCONFKEY_PM_STATE, val); } |