diff options
author | Lokesh <l.kasana@samsung.com> | 2019-12-05 15:06:15 +0530 |
---|---|---|
committer | saerome.kim <saerome.kim@samsung.com> | 2019-12-05 21:16:02 +0900 |
commit | e6056018cf33e9a9dac1f4c1741b554179354c50 (patch) | |
tree | d93683320604471bce77faab962bd02379c56765 | |
parent | 8c9c2a2feda1fb6742a8314f4334ed3dad1cf651 (diff) | |
download | user-awareness-e6056018cf33e9a9dac1f4c1741b554179354c50.tar.gz user-awareness-e6056018cf33e9a9dac1f4c1741b554179354c50.tar.bz2 user-awareness-e6056018cf33e9a9dac1f4c1741b554179354c50.zip |
[Fix] Send user_cb for every usersubmit/tizen_5.5_wearable_hotfix/20201026.184302submit/tizen_5.5/20191205.122148accepted/tizen/5.5/unified/wearable/hotfix/20201027.121639accepted/tizen/5.5/unified/20191206.013117tizen_5.5_wearable_hotfixtizen_5.5_tvtizen_5.5accepted/tizen_5.5_unified_wearable_hotfixaccepted/tizen_5.5_unified
And send user_cb with null user, in case AND_OR conditions have env sensors only
Change-Id: Iad6f15d38589a13a0bdef8499a8ffc182c15fc18
Signed-off-by: Lokesh <l.kasana@samsung.com>
-rw-r--r-- | packaging/capi-network-ua.spec | 2 | ||||
-rw-r--r-- | src/user-awareness-monitors.c | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/packaging/capi-network-ua.spec b/packaging/capi-network-ua.spec index 6ead266..33f3eda 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.13.4 +Version: 0.13.5 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 04f69ce..8b86e8d 100644 --- a/src/user-awareness-monitors.c +++ b/src/user-awareness-monitors.c @@ -29,6 +29,13 @@ GSList *ua_monitor_list; static ua_monitor_h scanning_monitor = NULL; +static gboolean __ua_monitor_is_only_env_in_conditions( + ua_monitor_s *monitor) +{ + return !((monitor->presence_bitmask_and | monitor->presence_bitmask_or) & + (UA_SENSOR_WIFI | UA_SENSOR_BLE | UA_SENSOR_BT)); +} + static int __ua_stop_monitoring(unsigned int bitmask, char *service, ua_detection_type_e detect) { @@ -278,9 +285,9 @@ static void __ua_monitor_send_user_presence_cb(ua_monitor_s *monitor, ret_if(NULL == user_state); - /** Block user callback if environmental callback already sent*/ - if (monitor->env_user_cb_sent) { - UA_DBG("Environmental User presence cb already sent"); + /** Block user callback if only environmental sensors in AND/OR conditions*/ + if (__ua_monitor_is_only_env_in_conditions(monitor)) { + UA_DBG("AND/OR conditions have env sensors only, so no user cb"); FUNC_EXIT; return; } @@ -494,8 +501,8 @@ static void __ua_monitor_send_sensor_presence_cb(ua_monitor_s *monitor, } static void __ua_sensor_presence_detected(ua_monitor_s *monitor, - ua_sensor_info_s *sensor_info, char *account, unsigned long long last_seen, - char *device_id) + ua_sensor_info_s *sensor_info, char *account, + unsigned long long last_seen, char *device_id) { FUNC_ENTRY; |