Fixed duplicate entries for absent users 51/208851/1
authorAbhay agarwal <ay.agarwal@samsung.com>
Thu, 20 Jun 2019 10:16:46 +0000 (15:46 +0530)
committersaerome kim <saerome.kim@samsung.com>
Mon, 1 Jul 2019 02:03:55 +0000 (11:03 +0900)
Change-Id: I820b4c3d3fe6af79629fecd998b253fe615ffed6
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
ua-daemon/src/ua-manager-core.c

index bee54c5..d17cfa9 100644 (file)
@@ -2320,8 +2320,10 @@ static void __send_user_absence_event(uam_tech_type_e type, unsigned int sensor)
                                        present_users = g_slist_prepend(present_users, tech->device->user);
                        } else {
                                /* If user not in the present list then only add it to absent list */
-                               if (!l2)
-                                       absent_users = g_slist_prepend(absent_users, tech->device->user);
+                                if ((NULL == l2) && (NULL == g_slist_find_custom(
+                                                                absent_users, &(tech->device->user->user_id),
+                                                                __compare_user_id)))
+                                        absent_users = g_slist_prepend(absent_users, tech->device->user);
                        }
                }