diff options
author | saerome.kim <saerome.kim@samsung.com> | 2019-11-05 08:47:21 +0900 |
---|---|---|
committer | saerome.kim <saerome.kim@samsung.com> | 2019-11-05 10:53:03 +0900 |
commit | 9c4dc0025e3eb7307c12b0d833780440eefc8366 (patch) | |
tree | 6a27f3ef7a240f58131c95ebfeb29b0909913663 | |
parent | d4dbed0fba519e01346859f4730a97637158b8ae (diff) | |
download | user-awareness-9c4dc0025e3eb7307c12b0d833780440eefc8366.tar.gz user-awareness-9c4dc0025e3eb7307c12b0d833780440eefc8366.tar.bz2 user-awareness-9c4dc0025e3eb7307c12b0d833780440eefc8366.zip |
Fix the issue that always notifies that ABSENCE has been detected
- Problem: If ABSENCE is detected immediately after starting and stopping
PRESENCE.
- Cause: If user_state is 0, then it is considered as an ABSENCE.
- Solution: Modified checking user_state condition if user_state is 0
then it is not an ABSENCE.
Change-Id: I815ff4b36498d34f23a02a60da0d64c2fb3f5791
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
-rw-r--r-- | packaging/capi-network-ua.spec | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | src/user-awareness-monitors.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/packaging/capi-network-ua.spec b/packaging/capi-network-ua.spec index 3024c0c..38f5c9f 100644 --- a/packaging/capi-network-ua.spec +++ b/packaging/capi-network-ua.spec @@ -1,6 +1,6 @@ Name: capi-network-ua Summary: User Awareness Framework CAPI -Version: 0.12.8 +Version: 0.12.9 Release: 1 License: Apache-2.0 Source0: %{name}-%{version}.tar.gz diff --git a/src/user-awareness-monitors.c b/src/user-awareness-monitors.c index ba890ad..15a1de5 100755..100644 --- a/src/user-awareness-monitors.c +++ b/src/user-awareness-monitors.c @@ -178,6 +178,11 @@ static bool __ua_check_all_users_absence_state(GSList *user_state, unsigned int GSList *l; ua_user_state_info_s *u; + if (0 == g_slist_length(user_state)) { + UA_INFO("user_state is empty"); + return false; + } + for (l = user_state; l; l = g_slist_next(l)) { u = (ua_user_state_info_s *)l->data; |