releasing notification
authoryoungsub ko <ys4610.ko@samsung.com>
Fri, 28 Jun 2013 04:59:42 +0000 (13:59 +0900)
committeryoungsub ko <ys4610.ko@samsung.com>
Fri, 28 Jun 2013 04:59:42 +0000 (13:59 +0900)
include/notification_debug.h
packaging/notification.spec
src/notification_noti.c
src/notification_ongoing.c

index 519d3ae2f2d144ca7472ecd0f87415741a3e9b79..114a2eee1e126d1074835a98db2a26cbd178e29c 100755 (executable)
@@ -22,7 +22,7 @@
 #ifndef __NOTIFICATION_DEBUG_H__
 #define __NOTIFICATION_DEBUG_H__
 
-#define LOG_TAG "notification"
+#define LOG_TAG "NOTIFICATION"
 #include <dlog.h>
 
 #ifndef EXPORT_API
index 74b1befd24d601fdbcd2c1a49e270f0b3224e5cf..56e858b293563806c4c9925219b1ab57a6ffc64c 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       notification
 Summary:    notification library
-Version:    0.2.7
+Version:    0.2.9
 Release:    1
 Group:      TBD
 License:    Apache-2.0
index 9743069480c319b40dfc084e2523e775c0365836..825b0dd1af0da163e7aede43b1598b795671f1c1 100755 (executable)
@@ -31,6 +31,8 @@
 #include <notification_debug.h>
 #include <notification_internal.h>
 
+#define NOTI_BURST_DELETE_UNIT 10
+
 static int _notification_noti_bind_query_text(sqlite3_stmt * stmt, const char *name,
                                         const char *str)
 {
@@ -980,6 +982,7 @@ err:
 EXPORT_API int notification_noti_delete_all(notification_type_e type, const char *pkgname, int *num_deleted, int **list_deleted_rowid)
 {
        int ret = NOTIFICATION_ERROR_NONE;
+       int ret_tmp = NOTIFICATION_ERROR_NONE;
        int i = 0, data_cnt = 0;
        sqlite3 *db = NULL;
        sqlite3_stmt *stmt = NULL;
@@ -1058,15 +1061,26 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type, const char
 
                if (data_cnt > 0) {
                        query_where[0] = '\0';
+                       snprintf(query_base, sizeof(query_base) - 1, "delete from noti_list");
                        for (i = 0; i < data_cnt ; i++) {
-                               snprintf(buf, sizeof(buf), "%s%d", (i == 0) ? "" : ",", *((*list_deleted_rowid) + i));
+                               if (i % NOTI_BURST_DELETE_UNIT == 0 && i != 0) {
+                                       snprintf(query, sizeof(query) - 1, "%s where priv_id in (%s)", query_base, query_where);
+                                       ret_tmp = notification_db_exec(db, query, NULL);
+                                       query_where[0] = '\0';
+                                       if (ret == NOTIFICATION_ERROR_NONE) {
+                                               ret = ret_tmp;
+                                       }
+                               }
+                               snprintf(buf, sizeof(buf) - 1, "%s%d", (i % NOTI_BURST_DELETE_UNIT == 0) ? "" : ",", *((*list_deleted_rowid) + i));
                                strncat(query_where, buf,sizeof(query_where) - strlen(query_where) - 1);
                        }
-                       snprintf(query_base, sizeof(query_base), "delete from noti_list");
-                       snprintf(query, sizeof(query), "%s where priv_id in (%s)", query_base, query_where);
-
-                       NOTIFICATION_ERR("check : %s", query);
-                       ret = notification_db_exec(db, query, NULL);
+                       if ((i <= NOTI_BURST_DELETE_UNIT) || ((i % NOTI_BURST_DELETE_UNIT) > 0) ) {
+                               snprintf(query, sizeof(query) - 1, "%s where priv_id in (%s)", query_base, query_where);
+                               ret_tmp = notification_db_exec(db, query, NULL);
+                               if (ret == NOTIFICATION_ERROR_NONE) {
+                                       ret = ret_tmp;
+                               }
+                       }
                } else {
                        free(*list_deleted_rowid);
                        *list_deleted_rowid = NULL;
@@ -1103,6 +1117,7 @@ int notification_noti_delete_group_by_group_id(const char *pkgname,
                                               int group_id, int *num_deleted, int **list_deleted_rowid)
 {
        int ret = NOTIFICATION_ERROR_NONE;
+       int ret_tmp = NOTIFICATION_ERROR_NONE;
        sqlite3 *db = NULL;
        int i = 0, data_cnt = 0;
        sqlite3_stmt *stmt = NULL;
@@ -1167,15 +1182,26 @@ int notification_noti_delete_group_by_group_id(const char *pkgname,
 
                if (data_cnt > 0) {
                        query_where[0] = '\0';
+                       snprintf(query_base, sizeof(query_base) - 1, "delete from noti_list");
                        for (i = 0; i < data_cnt ; i++) {
-                               snprintf(buf, sizeof(buf), "%s%d", (i == 0) ? "" : ",", *((*list_deleted_rowid) + i));
+                               if (i % NOTI_BURST_DELETE_UNIT == 0 && i != 0) {
+                                       snprintf(query, sizeof(query) - 1, "%s where priv_id in (%s)", query_base, query_where);
+                                       ret_tmp = notification_db_exec(db, query, NULL);
+                                       query_where[0] = '\0';
+                                       if (ret == NOTIFICATION_ERROR_NONE) {
+                                               ret = ret_tmp;
+                                       }
+                               }
+                               snprintf(buf, sizeof(buf) - 1, "%s%d", (i % NOTI_BURST_DELETE_UNIT == 0) ? "" : ",", *((*list_deleted_rowid) + i));
                                strncat(query_where, buf,sizeof(query_where) - strlen(query_where) - 1);
                        }
-                       snprintf(query_base, sizeof(query_base), "delete from noti_list");
-                       snprintf(query, sizeof(query), "%s where priv_id in (%s)", query_base, query_where);
-
-                       NOTIFICATION_ERR("check : %s", query);
-                       ret = notification_db_exec(db, query, NULL);
+                       if ((i <= NOTI_BURST_DELETE_UNIT) || ((i % NOTI_BURST_DELETE_UNIT) > 0) ) {
+                               snprintf(query, sizeof(query) - 1, "%s where priv_id in (%s)", query_base, query_where);
+                               ret_tmp = notification_db_exec(db, query, NULL);
+                               if (ret == NOTIFICATION_ERROR_NONE) {
+                                       ret = ret_tmp;
+                               }
+                       }
                } else {
                        free(*list_deleted_rowid);
                        *list_deleted_rowid = NULL;
index 38fb58541cd8c623c7992137e9f7c19b6e307b74..eea1860e32515087d6cd09d5a2c9edabecd2c9b3 100755 (executable)
@@ -115,8 +115,6 @@ notification_error_e notification_ongoing_update_size(const char *caller_pkgname
        dbus_message_unref(signal);
 
        if (ret) {
-               NOTIFICATION_INFO("Send size info : %s(%d) %.2f",
-                                 caller_pkgname, priv_id, size);
                return NOTIFICATION_ERROR_NONE;
        }