new email notification was not coming. 23/94023/4
authorSan Cho <san.cho@samsung.com>
Tue, 7 Jun 2016 03:05:08 +0000 (12:05 +0900)
committerintae jeon <intae.jeon@samsung.com>
Thu, 27 Oct 2016 00:05:55 +0000 (17:05 -0700)
[Problem] new email notification was not coming.
[Cause & Measure] Cause: many partial body download operations are queued, so new mail notification did not occur.
Measure: change the time of occuring notification from finishing partial body downlad to finishing sync header.

Change-Id: I87e2f71698613d6068795f06550cbc5d15cf364d

email-daemon/email-daemon-event.c

index 9553b41..cef3a18 100644 (file)
@@ -704,10 +704,8 @@ static int event_handler_EMAIL_EVENT_SYNC_HEADER(char *multi_user_name, int inpu
                        EM_DEBUG_EXCEPTION("emstorage_get_account_by_id failed [ %d ] ", err);
                }
 
-               if (account_tbl_array && account_tbl_array->auto_download_size == 0) {
-                       if (!emdaemon_finalize_sync(multi_user_name, input_account_id, 0, 0, 0, 0, true, NULL))
-                               EM_DEBUG_EXCEPTION("emdaemon_finalize_sync failed");
-               }
+               if (!emdaemon_finalize_sync(multi_user_name, input_account_id, 0, 0, 0, 0, true, NULL))
+                       EM_DEBUG_EXCEPTION("emdaemon_finalize_sync failed");
 
                if (account_tbl_array)
                        emstorage_free_account(&account_tbl_array, 1, NULL);
@@ -858,10 +856,8 @@ static int event_handler_EMAIL_EVENT_SYNC_HEADER(char *multi_user_name, int inpu
                                        EM_DEBUG_EXCEPTION("emcore_update_sync_status_of_account failed [%d]", err);
                        }
 
-                       if (account_tbl_array[account_index].auto_download_size == 0) {
-                               if (!emdaemon_finalize_sync(multi_user_name, account_tbl_array[account_index].account_id, 0, 0, 0, 0, true, NULL))
-                                       EM_DEBUG_EXCEPTION("emdaemon_finalize_sync failed");
-                       }
+                       if (!emdaemon_finalize_sync(multi_user_name, account_tbl_array[account_index].account_id, 0, 0, 0, 0, true, NULL))
+                               EM_DEBUG_EXCEPTION("emdaemon_finalize_sync failed");
 
 #ifndef __FEATURE_KEEP_CONNECTION__
                        if (stream)
@@ -2123,10 +2119,12 @@ static gpointer partial_body_download_thread(gpointer data)
                                        EM_DEBUG_EXCEPTION("emstorage_get_account_list failed : [%d]", err);
                                }
 
+#if 0
                                for (i = 0; i < account_count; i++) {
                                        if (!emdaemon_finalize_sync(partial_body_thd_event.multi_user_name, account_list[i].account_id, 0, 0, 0, 0, true, NULL))
                                                EM_DEBUG_EXCEPTION("emdaemon_finalize_sync failed");
                                }
+#endif
 
                                if (account_list)
                                        emstorage_free_account(&account_list, account_count, NULL);