#include <notification_internal.h>
#include <pwd.h>
#include <gum/gum-user.h>
+#include <app_contents.h>
#include "data_home.h"
#include "datamgr.h"
static inline void _get_notification_count(notification_type_e type, int *count)
{
+ int basis_time, r;
+ time_t noti_time;
notification_list_h list = NULL;
+ notification_h noti;
+
+ app_contents_get_basis_time(CONTENTS_NOTI, &basis_time);
+ if (basis_time < 0) {
+ _ERR("failed to get basis time");
+ return;
+ }
notification_get_list(type, -1, &list);
if (!list)
return;
while (list) {
+ noti = notification_list_get_data(list);
+ if (!noti) {
+ _ERR("failed to get noti data");
+ list = notification_list_get_next(list);
+ continue;
+ }
+
+ r = notification_get_insert_time(noti, ¬i_time);
+ if (r != NOTIFICATION_ERROR_NONE) {
+ _ERR("failed to get time of notification");
+ list = notification_list_get_next(list);
+ continue;
+ }
+
+ if (noti_time < basis_time)
+ break;
+
(*count)++;
list = notification_list_get_next(list);
}