Fix the problem that status_changed_cb is not reported
authorsaerome.kim <saerome.kim@samsung.com>
Fri, 25 Oct 2019 03:38:59 +0000 (12:38 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Fri, 25 Oct 2019 05:13:46 +0000 (14:13 +0900)
- Problem: Without ABSENCE detection, status_changed_cb never be
  notified.
- Cause: Make decision whether ABSNECE detection is started or not.
- Solution: When at least one more detection started, make
  status_changed_cb be called continously.

Change-Id: Ic98982884b51b887619bb14259ae1d662be76d26
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
packaging/capi-network-ua.spec
src/user-awareness-monitors.c

index 577837efdaa0926a1639127c554d7d7b59f13d4c..4a4e4066b9cd732ad3c2885dfb0164e8fe5b2263 100644 (file)
@@ -1,6 +1,6 @@
 Name: capi-network-ua
 Summary: User Awareness Framework CAPI
-Version: 0.12.4
+Version: 0.12.5
 Release: 1
 License: Apache-2.0
 Source0: %{name}-%{version}.tar.gz
index 5be4551190f43e71b0dda1b344ca0ebf706d5911..ba890ad447c1b57a0401aabda808093e41a7963b 100644 (file)
@@ -1016,16 +1016,28 @@ void _ua_monitor_handle_sensor_status_changed(uam_sensor_info_s *info)
                                _ua_get_error_string(ret));
        }
 
+       UA_INFO("sensor which state has changed [%x]", sensor_info->bitmask);
        for (l = ua_monitor_list; l; l = g_slist_next(l)) {
                ua_monitor_s *monitor = l->data;
 
-               if (!monitor || (!monitor->presence_detection_started
-                               && !monitor->internal_presence_started)
-                               || (!monitor->absence_detection_started))
+               if (!monitor) {
+                       UA_WARN("skip!! monitor is null");
+                       continue;
+               }
+
+               if (!monitor->internal_presence_started ||
+                       (!monitor->presence_detection_started &&
+                        !monitor->internal_presence_started)) {
+                       UA_WARN("skip!! because detection does not start [%x]",
+                               monitor->sensor_bitmask);
                        continue;
+               }
 
-               if (0 == (sensor_info->bitmask & monitor->sensor_bitmask))
+               if (0 == (sensor_info->bitmask & monitor->sensor_bitmask)) {
+                       UA_WARN("skip!! the reported sensor is not added [%x]",
+                               monitor->sensor_bitmask);
                        continue;
+               }
 
                if (monitor->sensor_status_cb.callback)
                        ((ua_sensor_status_changed_cb)monitor->sensor_status_cb.callback)(