From 5cef5130ea5bc6a05d6b32b5d39655911fb554ba Mon Sep 17 00:00:00 2001 From: intae jeon Date: Sun, 23 Oct 2016 18:04:05 -0700 Subject: merge for sync Revert "Revert "eml parser API causes crash."" This reverts commit 7d6952649538aa242a989fe509ccee95c4a471ac. Change-Id: Iee8b047ae7a1758b13aeed4950b352facbf481aa (cherry picked from commit b6c6bf64e13ee30f0bf6de60de30047df322a34b) --- email-core/email-core-gmime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/email-core/email-core-gmime.c b/email-core/email-core-gmime.c index 32456f6..ac34b2e 100755 --- a/email-core/email-core-gmime.c +++ b/email-core/email-core-gmime.c @@ -1226,7 +1226,7 @@ static void emcore_gmime_eml_parse_foreach_cb(GMimeObject *parent, GMimeObject * } /*cid replacement for inline attachment*/ - if (content_disposition_type == INLINE_ATTACHMENT) { + if (cnt_info->text.html && content_disposition_type == INLINE_ATTACHMENT) { char *file_content = NULL; char *encoding_file_name = NULL; int html_size = 0; -- cgit v1.2.3 From 0445ed0f89ddbd879586e1bd358fc534a80fab7f Mon Sep 17 00:00:00 2001 From: intae jeon Date: Sun, 23 Oct 2016 18:04:25 -0700 Subject: merge for sync Revert "Revert "Crash occurred when "" is inputted as new mailbox name when creating or renaming folder"" This reverts commit 83bde1cf3ab900da83642881bacb6e939f1f7990. Change-Id: I5bf6fc6875a6d026cda1929982b1ed4e0d25a3aa (cherry picked from commit 24b61ff9792832e52f55eeebd778cb2d25a06d02) --- email-core/email-core-mailbox.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/email-core/email-core-mailbox.c b/email-core/email-core-mailbox.c index 54d569c..a55032a 100755 --- a/email-core/email-core-mailbox.c +++ b/email-core/email-core-mailbox.c @@ -475,7 +475,7 @@ INTERNAL_FUNC int emcore_create_mailbox(char *multi_user_name, email_mailbox_t * int incomming_server_type = 0; int mail_slot_size = 25; - if (new_mailbox == NULL || new_mailbox->mailbox_name == NULL) { + if (new_mailbox == NULL || new_mailbox->mailbox_name == NULL || *(new_mailbox->mailbox_name) == '\0' ) { err = EMAIL_ERROR_INVALID_PARAM; goto FINISH_OFF; } @@ -743,7 +743,7 @@ INTERNAL_FUNC int emcore_rename_mailbox(char *multi_user_name, char *enc_mailbox_name = NULL; char *new_mailbox_name = NULL; - if (input_mailbox_id == 0 || input_new_mailbox_name == NULL || input_new_mailbox_alias == NULL) { + if (input_mailbox_id == 0 || input_new_mailbox_name == NULL || *input_new_mailbox_name == '\0' || input_new_mailbox_alias == NULL || *input_new_mailbox_alias == '\0') { EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM"); err = EMAIL_ERROR_INVALID_PARAM; goto FINISH_OFF; -- cgit v1.2.3 From 8b7172256937c4b27363e50f23b9113e3bf37f80 Mon Sep 17 00:00:00 2001 From: intae jeon Date: Sun, 23 Oct 2016 18:04:37 -0700 Subject: merge for sync Revert "Revert "connection info was maintained even if IDLE command is failed"" This reverts commit a67cfcc03165abb52a34a46c6eb0668f9d0eafe6. Change-Id: I7eb25e99518a3edba7ca6732c46210f03a9f0f2c (cherry picked from commit 71fd1573cc354adf4d05159be2f24ecd94885fa5) --- email-common-use/include/email-internal-types.h | 2 +- email-core/email-core-imap-idle.c | 39 +++++++++++++------------ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/email-common-use/include/email-internal-types.h b/email-common-use/include/email-internal-types.h index 98620b9..a009db3 100755 --- a/email-common-use/include/email-internal-types.h +++ b/email-common-use/include/email-internal-types.h @@ -240,7 +240,7 @@ typedef pthread_t thread_t; #define INLINE_ATTACHMENT 1 #define ATTACHMENT 2 -#define EVENT_QUEUE_MAX 32 +#define EVENT_QUEUE_MAX 64 #define EMAIL_LAUNCHED_BY_UNKNOWN_METHOD 0 #define EMAIL_LAUNCHED_BY_DBUS_ACTIVATION 1 diff --git a/email-core/email-core-imap-idle.c b/email-core/email-core-imap-idle.c index 50f45a1..3d97cb3 100755 --- a/email-core/email-core-imap-idle.c +++ b/email-core/email-core-imap-idle.c @@ -340,7 +340,7 @@ static int emcore_connect_and_idle_on_mailbox(char *multi_user_name, /* Send IDLE command */ if (!imap_local->netstream || !net_sout(imap_local->netstream, cmd, (int)EM_SAFE_STRLEN(cmd))) { - EM_DEBUG_EXCEPTION_SEC("network error - failed to IDLE on Mailbox - %s ", input_mailbox->mailbox_name); + EM_DEBUG_EXCEPTION("network error - failed to IDLE on Mailbox - [%d]", input_mailbox->mailbox_id); err = EMAIL_ERROR_IMAP4_IDLE_FAILURE; goto FINISH_OFF; } @@ -349,36 +349,39 @@ static int emcore_connect_and_idle_on_mailbox(char *multi_user_name, while (imap_local->netstream) { p = net_getline(imap_local->netstream); - EM_DEBUG_LOG("p =[%s]", p); + EM_DEBUG_LOG("IDLE command response: [%s]", p); - if (p && !strncmp(p, "+", 1)) { + if (p && '+' == *p) { EM_DEBUG_LOG("OK. Go."); break; - } else if (p && !strncmp(p, "*", 1)) { + } else if (p && '*' == *p) { EM_SAFE_FREE(p); continue; } else { - EM_DEBUG_LOG("Unsuspected response."); + EM_DEBUG_EXCEPTION("Unsuspected response: [%s]", p); err = EMAIL_ERROR_IMAP4_IDLE_FAILURE; break; } - } + } + EM_SAFE_FREE(p); - connection_info = em_malloc(sizeof(email_imap_idle_connection_info_t)); - if (connection_info == NULL) { - EM_DEBUG_EXCEPTION("EMAIL_ERROR_OUT_OF_MEMORY"); - err = EMAIL_ERROR_OUT_OF_MEMORY; - goto FINISH_OFF; - } + if (err == EMAIL_ERROR_NONE) { + connection_info = em_malloc(sizeof(email_imap_idle_connection_info_t)); + if (connection_info == NULL) { + EM_DEBUG_EXCEPTION("EMAIL_ERROR_OUT_OF_MEMORY"); + err = EMAIL_ERROR_OUT_OF_MEMORY; + goto FINISH_OFF; + } - connection_info->account_id = input_account->account_id; - connection_info->mailbox_id = input_mailbox->mailbox_id; - connection_info->mail_stream = mail_stream; - connection_info->socket_fd = socket_fd; - connection_info->multi_user_name = EM_SAFE_STRDUP(multi_user_name); + connection_info->account_id = input_account->account_id; + connection_info->mailbox_id = input_mailbox->mailbox_id; + connection_info->mail_stream = mail_stream; + connection_info->socket_fd = socket_fd; + connection_info->multi_user_name = EM_SAFE_STRDUP(multi_user_name); - imap_idle_connection_list = g_list_append(imap_idle_connection_list, (gpointer)connection_info); + imap_idle_connection_list = g_list_append(imap_idle_connection_list, (gpointer)connection_info); + } FINISH_OFF: -- cgit v1.2.3 From 5364a83f1c6be9e58f4553fc15a06d0a2cbea97b Mon Sep 17 00:00:00 2001 From: intae jeon Date: Sun, 23 Oct 2016 18:04:46 -0700 Subject: Revert "Revert "not able to refesh INBOX"" This reverts commit 0ef29f5e7b7da6bb9ec96aea1f0ace3108271154. Change-Id: Ib20ba7a8852d9676e28b3977cf256d35552d7340 (cherry picked from commit 78684fc2e897ab2f6258282e99d300cf8a7f2bfd) --- email-core/email-core-imap-mailbox.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/email-core/email-core-imap-mailbox.c b/email-core/email-core-imap-mailbox.c index 6585807..c5fa364 100755 --- a/email-core/email-core-imap-mailbox.c +++ b/email-core/email-core-imap-mailbox.c @@ -734,7 +734,16 @@ int emcore_download_mailbox_list(void *mail_stream, *count = holder.num; *mailbox_list = (email_internal_mailbox_t*) holder.data; - ret = true; + + EM_DEBUG_LOG("count: [%d], mailbox_list[%p]", *count, *mailbox_list); + if (*count <= 0 || *mailbox_list == NULL) { + err = EMAIL_ERROR_MAILBOX_NOT_FOUND; + ret = false; + } else { + ret = true; + } + + FINISH_OFF: if (err_code) -- cgit v1.2.3 From b0266e54a0828633521d86f76c0b8f32722f368c Mon Sep 17 00:00:00 2001 From: intae jeon Date: Sun, 23 Oct 2016 18:04:56 -0700 Subject: Revert "Revert "crash occured when downloading partial body"" This reverts commit ab1230a94e04a95ed58c5a57bb97e56a121bef32. Change-Id: I503bac8a20632e5979795ca18b818b7a640873be (cherry picked from commit 55dc6e5aa099f486657e9e74a4355cb2cdd131ea) --- email-core/email-core-mailbox-sync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/email-core/email-core-mailbox-sync.c b/email-core/email-core-mailbox-sync.c index 859b2b0..116c083 100755 --- a/email-core/email-core-mailbox-sync.c +++ b/email-core/email-core-mailbox-sync.c @@ -3961,10 +3961,10 @@ static int emcore_gmime_download_imap_partial_mail_body(MAILSTREAM *stream, int if (!(imap_response[i].bodystructure) || imap_response[i].bodystructure_len <= 0) continue; /* Search the account id of pbd_event */ - for (temp_count = 0; temp_count <= item_count && pbd_event[temp_count].server_mail_id != imap_response[i].uid_no; temp_count++) + for (temp_count = 0; temp_count < item_count && pbd_event[temp_count].server_mail_id != imap_response[i].uid_no; temp_count++) continue; - if (temp_count > item_count) { + if (temp_count >= item_count) { EM_DEBUG_EXCEPTION("Can't find proper server_mail_id"); goto FINISH_OFF; } -- cgit v1.2.3 From 88104aa5ee74f406cc1e6a5925fb0dd2cac997d6 Mon Sep 17 00:00:00 2001 From: San Cho Date: Fri, 20 May 2016 18:00:17 +0900 Subject: the position of hotmail's UID is at the end of BODYSTRUCTURE [Problem] the position of hotmail's UID is at the end of BODYSTRUCTURE [Cause & Measure] Cause: the position of hotmail's UID is different from other email service provider, so index error occurred Meause: Checking UID string pointer when parsing BODYSTRUCTURE Change-Id: I9cc78af63a51cf422f2c655c8a0b0a6c3f7a4922 (cherry picked from commit 93f11d61053054c257069a3d4bf57bbbdc1f4cf8) --- email-core/email-core-mailbox-sync.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/email-core/email-core-mailbox-sync.c b/email-core/email-core-mailbox-sync.c index 116c083..2a49313 100755 --- a/email-core/email-core-mailbox-sync.c +++ b/email-core/email-core-mailbox-sync.c @@ -3961,6 +3961,7 @@ static int emcore_gmime_download_imap_partial_mail_body(MAILSTREAM *stream, int if (!(imap_response[i].bodystructure) || imap_response[i].bodystructure_len <= 0) continue; /* Search the account id of pbd_event */ + EM_DEBUG_LOG("Find server_mail_id: [%d]", imap_response[i].uid_no); for (temp_count = 0; temp_count < item_count && pbd_event[temp_count].server_mail_id != imap_response[i].uid_no; temp_count++) continue; @@ -4774,15 +4775,14 @@ static email_partial_buffer *emcore_get_response_from_server(NETSTREAM *nstream, if (full_line) p_bodystructure = strcasestr(full_line, "BODYSTRUCTURE"); if (full_line) p_bodystructure_end = strcasestr(full_line, "BODY[TEXT]"); + if (full_line) p_uid = strcasestr(full_line, "UID"); /* check whether full header is received */ - if (p_bodystructure && p_bodystructure_end) { + if (p_bodystructure && p_bodystructure_end && p_uid) { /* get UID */ - if ((p_uid = strcasestr(full_line, "UID")) != NULL) { - p_uid = p_uid + strlen("UID "); - server_response[count].uid_no = atol(p_uid); - } + p_uid = p_uid + strlen("UID "); + server_response[count].uid_no = atol(p_uid); /* get BODYSTRUCTURE */ server_response[count].bodystructure_len = p_bodystructure_end - p_bodystructure; @@ -4820,11 +4820,13 @@ static email_partial_buffer *emcore_get_response_from_server(NETSTREAM *nstream, count++; p_bodystructure = NULL; p_bodystructure_end = NULL; + p_uid = NULL; continue; } else { /* not a full header, accumulate into buffer util get the end of header */ p_bodystructure = NULL; p_bodystructure_end = NULL; + p_uid = NULL; continue; } } -- cgit v1.2.3 From c5b06c51665980204f3ebf838a6e95c66faca97a Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Mon, 10 Oct 2016 15:51:16 +0900 Subject: mailbox_id from "Email Sent" notification was wrong [Problem] mailbox_id was set as OUTBOX in "Email Sent" notification [Cause & Measure] Cause: mailbox_id was set on the notification when the mail was in OUTBOX yet. Measure: Creating "Sent" notification after the mail is moved to Sent box. Change-Id: I6316a83aceb57ad33f1dcc02dd3388865ed10003 Signed-off-by: intae, jeon (cherry picked from commit 4229c6bd60594b2673e2a9526db9e44cc7aa5c59) --- email-core/email-core-smtp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/email-core/email-core-smtp.c b/email-core/email-core-smtp.c index 72bc1ed..4c9cd93 100755 --- a/email-core/email-core-smtp.c +++ b/email-core/email-core-smtp.c @@ -1896,7 +1896,6 @@ INTERNAL_FUNC int emcore_send_mail(char *multi_user_name, int mail_id, int *err_ goto FINISH_OFF; } - emcore_show_user_message(multi_user_name, mail_id, EMAIL_ACTION_SEND_MAIL, err); sent_flag = 1; /* sent mail is moved to 'SENT' box or deleted. */ @@ -2112,9 +2111,7 @@ FINISH_OFF: EM_SAFE_FREE(server_uid); - if (ret == false && sent_flag == 0) { - emcore_show_user_message(multi_user_name, mail_id, EMAIL_ACTION_SEND_MAIL, err); - } + emcore_show_user_message(multi_user_name, mail_id, EMAIL_ACTION_SEND_MAIL, err); if (ret == false && err != EMAIL_ERROR_INVALID_PARAM && mail_tbl_data) { if (err != EMAIL_ERROR_CANCELLED) { -- cgit v1.2.3 From 5cd5d09a17c594c7dc98b284e067eb8ae074453c Mon Sep 17 00:00:00 2001 From: San Cho Date: Mon, 30 May 2016 11:47:40 +0900 Subject: add log for UNKNOWN_APIID Change-Id: I72c5625652ec195d143627c466434a9c052f923d (cherry picked from commit 897dbd70c3f82115f740cf756662b8822c1f9b97) --- email-core/email-core-event.c | 4 +++ .../email-ipc-api/include/email-ipc-api-info.h | 41 +++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/email-core/email-core-event.c b/email-core/email-core-event.c index cc52a43..699443c 100755 --- a/email-core/email-core-event.c +++ b/email-core/email-core-event.c @@ -394,6 +394,7 @@ INTERNAL_FUNC int emcore_insert_event(email_event_t *event_data, int *handle, in q_length = g_queue_get_length(g_event_que); EM_DEBUG_LOG("Q Length : [%d]", q_length); + EM_DEBUG_LOG("Event type: [%d]", event_data->type); if (q_length > EVENT_QUEUE_MAX) { EM_DEBUG_EXCEPTION("event que is full..."); @@ -514,6 +515,7 @@ INTERNAL_FUNC int emcore_retrieve_event(email_event_t **event_data, int *err_cod } } else { head_event->status = EMAIL_EVENT_STATUS_STARTED; + EM_DEBUG_LOG("Event retrieved: [%d]", head_event->type); *event_data = head_event; ret = true; break; @@ -685,6 +687,7 @@ INTERNAL_FUNC int emcore_insert_event_for_sending_mails(email_event_t *event_dat q_length = g_queue_get_length(g_send_event_que); EM_DEBUG_LOG("SEND Q Length : [%d]", q_length); + EM_DEBUG_LOG("SEND Event type: [%d]", event_data->type); if (q_length > EVENT_QUEUE_MAX) { EM_DEBUG_EXCEPTION("send event que is full..."); @@ -757,6 +760,7 @@ INTERNAL_FUNC int emcore_retrieve_send_event(email_event_t **event_data, int *er } } else { head_event->status = EMAIL_EVENT_STATUS_STARTED; + EM_DEBUG_LOG("SEND Event retrieved: [%d]", head_event->type); *event_data = head_event; ret = true; break; diff --git a/email-ipc/email-ipc-api/include/email-ipc-api-info.h b/email-ipc/email-ipc-api/include/email-ipc-api-info.h index 2f98f42..fa04ae9 100755 --- a/email-ipc/email-ipc-api/include/email-ipc-api-info.h +++ b/email-ipc/email-ipc-api/include/email-ipc-api-info.h @@ -123,7 +123,7 @@ EXPORT_API void emipc_free_api_info(emipc_email_api_info *api_info); s = "_EMAIL_API_GET_RULE";\ break;\ case _EMAIL_API_GET_RULE_LIST:\ - s = "_EMAIL_API_GET_RULE";\ + s = "_EMAIL_API_GET_RULE_LIST";\ break;\ case _EMAIL_API_FIND_RULE:\ s = "_EMAIL_API_FIND_RULE";\ @@ -236,6 +236,45 @@ EXPORT_API void emipc_free_api_info(emipc_email_api_info *api_info); case _EMAIL_API_LOAD_DEFAULT_ACCOUNT_ID:\ s = "_EMAIL_API_LOAD_DEFAULT_ACCOUNT_ID";\ break;\ + case _EMAIL_API_GET_ACCOUNT:\ + s = "_EMAIL_API_GET_ACCOUNT";\ + break;\ + case _EMAIL_API_MODIFY_MAIL_EXTRA_FLAG:\ + s = "_EMAIL_API_MODIFY_MAIL_EXTRA_FLAG";\ + break;\ + case _EMAIL_API_ADD_READ_RECEIPT:\ + s = "_EMAIL_API_ADD_READ_RECEIPT";\ + break;\ + case _EMAIL_API_EXPUNGE_MAILS_DELETED_FLAGGED:\ + s = "_EMAIL_API_EXPUNGE_MAILS_DELETED_FLAGGED";\ + break;\ + case _EMAIL_API_DELETE_EMAIL:\ + s = "_EMAIL_API_DELETE_EMAIL";\ + break;\ + case _EMAIL_API_DELETE_EMAIL_ALL:\ + s = "_EMAIL_API_DELETE_EMAIL_ALL";\ + break;\ + case _EMAIL_API_CLEAR_RESULT_OF_SEARCH_MAIL_ON_SERVER:\ + s = "_EMAIL_API_CLEAR_RESULT_OF_SEARCH_MAIL_ON_SERVER";\ + break;\ + case _EMAIL_API_QUERY_SMTP_MAIL_SIZE_LIMIT:\ + s = "_EMAIL_API_QUERY_SMTP_MAIL_SIZE_LIMIT";\ + break;\ + case _EMAIL_API_GET_USER_NAME:\ + s = "_EMAIL_API_GET_USER_NAME";\ + break;\ + case _EMAIL_API_ADD_CERTIFICATE:\ + s = "_EMAIL_API_ADD_CERTIFICATE";\ + break;\ + case _EMAIL_API_DELETE_CERTIFICATE:\ + s = "_EMAIL_API_DELETE_CERTIFICATE";\ + break;\ + case _EMAIL_API_VERIFY_SIGNATURE:\ + s = "_EMAIL_API_VERIFY_SIGNATURE";\ + break;\ + case _EMAIL_API_VERIFY_CERTIFICATE:\ + s = "_EMAIL_API_VERIFY_CERTIFICATE";\ + break;\ default : \ s = "UNKNOWN_APIID";\ }\ -- cgit v1.2.3 From f8c5fced20872ba716b321d609717218650fce9f Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Wed, 26 Oct 2016 16:33:43 +0900 Subject: fix add log for UNKNOWN_API_ID Change-Id: I7edf8e74c404c841c0df6cf656a95313ee32f592 Signed-off-by: intae, jeon (cherry picked from commit 535840a6fd26123aaa5596b4337d4d33d900f127) --- email-ipc/email-ipc-api/include/email-ipc-api-info.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/email-ipc/email-ipc-api/include/email-ipc-api-info.h b/email-ipc/email-ipc-api/include/email-ipc-api-info.h index fa04ae9..57b5595 100755 --- a/email-ipc/email-ipc-api/include/email-ipc-api-info.h +++ b/email-ipc/email-ipc-api/include/email-ipc-api-info.h @@ -4,7 +4,7 @@ * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Kyuho Jo , Sunghyun Kwon -* +* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -263,18 +263,9 @@ EXPORT_API void emipc_free_api_info(emipc_email_api_info *api_info); case _EMAIL_API_GET_USER_NAME:\ s = "_EMAIL_API_GET_USER_NAME";\ break;\ - case _EMAIL_API_ADD_CERTIFICATE:\ - s = "_EMAIL_API_ADD_CERTIFICATE";\ - break;\ - case _EMAIL_API_DELETE_CERTIFICATE:\ - s = "_EMAIL_API_DELETE_CERTIFICATE";\ - break;\ case _EMAIL_API_VERIFY_SIGNATURE:\ s = "_EMAIL_API_VERIFY_SIGNATURE";\ break;\ - case _EMAIL_API_VERIFY_CERTIFICATE:\ - s = "_EMAIL_API_VERIFY_CERTIFICATE";\ - break;\ default : \ s = "UNKNOWN_APIID";\ }\ -- cgit v1.2.3 From 37f9cc43b3412186d8d74fc1868671850e33efc4 Mon Sep 17 00:00:00 2001 From: San Cho Date: Wed, 5 Oct 2016 17:58:41 +0900 Subject: when downloading partial body, hotmail server does not response with UID field so it makes mime parsing operation weird [Problem] downloading partial body operation was fail. [Cause & Measure] Cause: hotmail server does not response with UID field. Measure: specify UID field in request command explicitly. Change-Id: I005ed034ed511c23cf46ecf2a7442394ac44c9fe (cherry picked from commit 962dd9998cafa9418e1a31a03fb7fcc40f31adfa) --- email-core/email-core-mailbox-sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/email-core/email-core-mailbox-sync.c b/email-core/email-core-mailbox-sync.c index 2a49313..d6c8a3d 100755 --- a/email-core/email-core-mailbox-sync.c +++ b/email-core/email-core-mailbox-sync.c @@ -3931,7 +3931,7 @@ static int emcore_gmime_download_imap_partial_mail_body(MAILSTREAM *stream, int } SNPRINTF(imap_tag, TAG_LENGTH, "%08lx", 0xffffffff & (stream->gensym++)); - SNPRINTF(command, COMMAND_LENGTH, "%s UID FETCH %s (RFC822.HEADER BODYSTRUCTURE BODY.PEEK[TEXT]<0.%d>)\015\012", + SNPRINTF(command, COMMAND_LENGTH, "%s UID FETCH %s (UID RFC822.HEADER BODYSTRUCTURE BODY.PEEK[TEXT]<0.%d>)\015\012", imap_tag, uid_range_string_to_be_downloaded, input_download_size); EM_DEBUG_LOG("command : %s", command); -- cgit v1.2.3 From d3a106e9be0d03d490d1cf8c771d013b837ae265 Mon Sep 17 00:00:00 2001 From: San Cho Date: Tue, 7 Jun 2016 12:05:08 +0900 Subject: new email notification was not coming. [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 (cherry picked from commit 87ef70aa756567394703bd3f1c29719554576a70) --- email-daemon/email-daemon-event.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/email-daemon/email-daemon-event.c b/email-daemon/email-daemon-event.c index 9553b41..cef3a18 100644 --- a/email-daemon/email-daemon-event.c +++ b/email-daemon/email-daemon-event.c @@ -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); -- cgit v1.2.3 From dc2ebe0c16af93ba2e052b83e3e9ca597fb0344e Mon Sep 17 00:00:00 2001 From: San Cho Date: Thu, 16 Jun 2016 11:49:55 +0900 Subject: Invitation shown as "Unknown" when sent from EAS account and received sending failure server email and tried to open it from .eml attachment. [Problem] Invitation shown as "Unknown" when sent from EAS account and received sending failure server email and tried to open it from .eml attachment. [Cause & Measure] Cause: In parsing mime, "unknwon" is set as its name before checking content subtype as "calendar". Measure: Checking content subtype first if it is calendar then set its name as "unknown" if it is not calendar type. Change-Id: I2ba5ee8368d397b152d395db1e073e9d290c672d (cherry picked from commit 0b852a62cfab550334d367cf8d5f5f93b71c107f) --- email-core/email-core-gmime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/email-core/email-core-gmime.c b/email-core/email-core-gmime.c index ac34b2e..f16b8b8 100755 --- a/email-core/email-core-gmime.c +++ b/email-core/email-core-gmime.c @@ -1199,8 +1199,8 @@ static void emcore_gmime_eml_parse_foreach_cb(GMimeObject *parent, GMimeObject * if (disposition_filename) file->name = g_strdup(disposition_filename); else if (ctype_name) file->name = g_strdup(ctype_name); else if (content_id) file->name = g_strdup(content_id); - else if (content_disposition_type == ATTACHMENT) file->name = g_strdup("unknown"); else if (ctype_subtype && g_ascii_strcasecmp(ctype_subtype, "calendar") == 0) file->name = g_strdup("invite.vcs"); + else if (content_disposition_type == ATTACHMENT) file->name = g_strdup("unknown"); else file->name = g_strdup("delivery-status"); file->content_id = g_strdup(content_id); -- cgit v1.2.3 From aef197dac7ab0d24add8c1573235785331881703 Mon Sep 17 00:00:00 2001 From: San Cho Date: Mon, 20 Jun 2016 17:08:04 +0900 Subject: mail folder, its name is "I", could not be deleted. [Problem] mail folder, its name is "I", could not be deleted. [Cause & Measure] Cause: email-service removes its child folders, searched by "LIKE" sql, so trying to remove "INBOX" as its child folder. Measure: modifying the sql. Change-Id: I654d089670317c7fb13e75e23423d043114d4b50 (cherry picked from commit c27561bbab09c1b071d5cb4e6b527ad88d16bf6d) --- email-core/email-storage/email-storage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/email-core/email-storage/email-storage.c b/email-core/email-storage/email-storage.c index 5e3ca31..ac41f4b 100755 --- a/email-core/email-storage/email-storage.c +++ b/email-core/email-storage/email-storage.c @@ -5356,7 +5356,7 @@ INTERNAL_FUNC int emstorage_get_child_mailbox_list(char *multi_user_name, int ac return false; } - sqlite3_snprintf(sizeof(conditional_clause_string), conditional_clause_string, "WHERE account_id = %d AND UPPER(mailbox_name) LIKE UPPER('%q%%')", account_id, parent_mailbox_name); + sqlite3_snprintf(sizeof(conditional_clause_string), conditional_clause_string, "WHERE account_id = %d AND (UPPER(mailbox_name) = UPPER('%q') OR UPPER(mailbox_name) LIKE UPPER('%q/%%'))", account_id, parent_mailbox_name, parent_mailbox_name); EM_DEBUG_LOG("conditional_clause_string[%s]", conditional_clause_string); if ((error = emstorage_query_mailbox_tbl(multi_user_name, conditional_clause_string, " ORDER BY mailbox_name DESC ", 0, transaction, mailbox_list, select_num)) != EMAIL_ERROR_NONE) { @@ -5368,6 +5368,7 @@ INTERNAL_FUNC int emstorage_get_child_mailbox_list(char *multi_user_name, int ac FINISH_OFF: + if (err_code != NULL) *err_code = error; -- cgit v1.2.3 From b405850488f1ee00d2189c8a4b0ca638e6dfc771 Mon Sep 17 00:00:00 2001 From: San Cho Date: Mon, 20 Jun 2016 18:59:16 +0900 Subject: Unble to compose is displayed when attach contact and send [Problem] Unble to compose is displayed when attach contact and send [Cause & Measure] Cause: the length of attachment file name is too long. Measure: extend file name buffer size. Change-Id: Ia67c1fa57f1553eedb6ed3a477265f466c2b6174 (cherry picked from commit e87d6cbc9c49203c506c880a67b743f2d298eb39) --- email-daemon/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/email-daemon/main.c b/email-daemon/main.c index 7b01385..db963b0 100755 --- a/email-daemon/main.c +++ b/email-daemon/main.c @@ -1508,10 +1508,10 @@ void stb_add_mail(HIPC_API a_hAPI) email_meeting_request_t result_meeting_request = {0}; emipc_email_api_info *api_info = (emipc_email_api_info *)a_hAPI; email_account_server_t account_server_type = EMAIL_SERVER_TYPE_NONE; - int nAPPID = emipc_get_app_id(a_hAPI); - char *multi_user_name = NULL; - char *prefix_path = NULL; - char real_file_path[255] = {0}; + int nAPPID = emipc_get_app_id(a_hAPI); + char *multi_user_name = NULL; + char *prefix_path = NULL; + char real_file_path[MAX_PATH] = {0}; if ((err = emcore_get_user_name(nAPPID, &multi_user_name)) != EMAIL_ERROR_NONE) { EM_DEBUG_EXCEPTION("emcore_get_user_info failed : [%d]", err); -- cgit v1.2.3 From afdaadeb063ec4b4993b56f15f99c323988c802d Mon Sep 17 00:00:00 2001 From: San Cho Date: Mon, 27 Jun 2016 19:16:03 +0900 Subject: not checking mail folder sync error when LIST command's result callback is called. [Problem] the mails of INBOX was removed suddendly. [Cause & Measure] Cause: mail folder sync operation is operated quite often. But if there is a unexpected error in the folder sync time, we are guessing that not synced folder yet (because of network error) may be removed on mail server. so we are removing it from local db. Change-Id: I33c2af6afd2956cfd188d5d0f6fc2df0dbb0ddaa Signed-off-by: intae, jeon (cherry picked from commit 2a80badc56f9df0909a55d42f8594553d8fe2dc5) --- email-core/email-core-imap-mailbox.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/email-core/email-core-imap-mailbox.c b/email-core/email-core-imap-mailbox.c index c5fa364..c1349bf 100755 --- a/email-core/email-core-imap-mailbox.c +++ b/email-core/email-core-imap-mailbox.c @@ -741,9 +741,22 @@ int emcore_download_mailbox_list(void *mail_stream, ret = false; } else { ret = true; - } - + /* checking once more if there is a INBOX or not */ + int i = 0; + bool is_found_inbox = false; + for (i = 0; i < *count; i++) { + if ((*mailbox_list)[i].mailbox_type == EMAIL_MAILBOX_TYPE_INBOX || !g_ascii_strcasecmp((*mailbox_list)[i].mailbox_name, "INBOX")) { + is_found_inbox = true; + break; + } + } + if (!is_found_inbox) { + EM_DEBUG_CRITICAL_EXCEPTION("There is no INBOX!"); + err = EMAIL_ERROR_MAILBOX_NOT_FOUND; + ret = false; + } + } FINISH_OFF: if (err_code) -- cgit v1.2.3 From 15163e720eede6738bbd6f277c245333b56a3d40 Mon Sep 17 00:00:00 2001 From: San Cho Date: Thu, 7 Jul 2016 16:49:55 +0900 Subject: attachment of airtel's mail was not shown [Problem] attachment of airtel's mail was not shown [Cause & Measure] Cause: mime format of airtel's mail was wrong. attachment part should be under "mixed" multipart, but it was in "releated" multipart. Measure: checking content disposition to classify attachment part. Change-Id: I6f4b950995f15afe368d3eecef946f12e207ec38 (cherry picked from commit c029edde2e3cf2d02124e415a882955dd8075e26) --- email-core/email-core-gmime.c | 100 +++++++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 46 deletions(-) diff --git a/email-core/email-core-gmime.c b/email-core/email-core-gmime.c index f16b8b8..cfb2494 100755 --- a/email-core/email-core-gmime.c +++ b/email-core/email-core-gmime.c @@ -509,18 +509,20 @@ static void emcore_gmime_pop3_parse_foreach_cb(GMimeObject *parent, GMimeObject /*Content - END*/ /*Figure out TEXT or ATTACHMENT(INLINE) ?*/ - if ((!disposition_str && g_ascii_strcasecmp(ctype_type, "text") == 0) && + if ((!disposition_str && ctype_type && g_ascii_strcasecmp(ctype_type, "text") == 0) && (g_ascii_strcasecmp(ctype_subtype, "plain") == 0 || g_ascii_strcasecmp(ctype_subtype, "html") == 0)) { EM_DEBUG_LOG("TEXT"); - } else if (parent_ctype_subtype && + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, GMIME_DISPOSITION_ATTACHMENT) == 0) || + (parent_ctype_subtype && g_ascii_strncasecmp(parent_ctype_subtype, "mixed", strlen("mixed")) == 0)) { + content_disposition_type = ATTACHMENT; + EM_DEBUG_LOG("ATTACHMENT"); + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, "inline") == 0) || + (parent_ctype_subtype && ((g_ascii_strncasecmp(parent_ctype_subtype, "related", strlen("related")) == 0) || - (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0))) { + (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0)))) { content_disposition_type = INLINE_ATTACHMENT; EM_DEBUG_LOG("INLINE_ATTACHMENT"); - } else if (parent_ctype_subtype && g_ascii_strcasecmp(parent_ctype_subtype, "mixed") == 0) { - content_disposition_type = ATTACHMENT; - EM_DEBUG_LOG("ATTACHMENT"); } else { int result = false; if (content_id && (emcore_search_string_from_file(cnt_info->text.html, @@ -1093,17 +1095,18 @@ static void emcore_gmime_eml_parse_foreach_cb(GMimeObject *parent, GMimeObject * g_ascii_strcasecmp(ctype_subtype, "html") == 0)) { cnt_info->total_body_size += content_size; EM_DEBUG_LOG("TEXT"); - } else if (parent_ctype_subtype && + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, GMIME_DISPOSITION_ATTACHMENT) == 0) || + (parent_ctype_subtype && g_ascii_strncasecmp(parent_ctype_subtype, "mixed", strlen("mixed")) == 0)) { + content_disposition_type = ATTACHMENT; + cnt_info->total_attachment_size += content_size; + EM_DEBUG_LOG("ATTACHMENT"); + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, "inline") == 0) || + (parent_ctype_subtype && ((g_ascii_strncasecmp(parent_ctype_subtype, "related", strlen("related")) == 0) || - (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0))) { + (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0)))) { content_disposition_type = INLINE_ATTACHMENT; cnt_info->total_body_size += content_size; EM_DEBUG_LOG("INLINE_ATTACHMENT"); - } else if (parent_ctype_subtype && - g_ascii_strncasecmp(parent_ctype_subtype, "mixed", strlen("mixed")) == 0) { - content_disposition_type = ATTACHMENT; - cnt_info->total_attachment_size += content_size; - EM_DEBUG_LOG("ATTACHMENT"); } else { int result = false; if (content_id && (emcore_search_string_from_file(cnt_info->text.html, @@ -1519,15 +1522,16 @@ INTERNAL_FUNC void emcore_gmime_imap_parse_foreach_cb(GMimeObject *parent, GMime (g_ascii_strcasecmp(ctype_subtype, "plain") == 0 || g_ascii_strcasecmp(ctype_subtype, "html") == 0)) { EM_DEBUG_LOG("TEXT"); - } else if (parent_ctype_subtype && + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, GMIME_DISPOSITION_ATTACHMENT) == 0) || + (parent_ctype_subtype && g_ascii_strncasecmp(parent_ctype_subtype, "mixed", strlen("mixed")) == 0)) { + content_disposition_type = ATTACHMENT; + EM_DEBUG_LOG("ATTACHMENT"); + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, "inline") == 0) || + (parent_ctype_subtype && ((g_ascii_strncasecmp(parent_ctype_subtype, "related", strlen("related")) == 0) || - (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0))) { + (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0)))) { content_disposition_type = INLINE_ATTACHMENT; EM_DEBUG_LOG("INLINE_ATTACHMENT"); - } else if (parent_ctype_subtype && - g_ascii_strncasecmp(parent_ctype_subtype, "mixed", strlen("mixed")) == 0) { - content_disposition_type = ATTACHMENT; - EM_DEBUG_LOG("ATTACHMENT"); } else { int result = false; if (content_id && (emcore_search_string_from_file(cnt_info->text.html, @@ -1979,7 +1983,7 @@ INTERNAL_FUNC void emcore_gmime_imap_parse_full_foreach_cb(GMimeObject *parent, parent_ctype = g_mime_object_get_content_type(parent); parent_ctype_type = (char *)g_mime_content_type_get_media_type(parent_ctype); parent_ctype_subtype = (char *)g_mime_content_type_get_media_subtype(parent_ctype); - EM_DEBUG_LOG("Content-type[%s/%s]", parent_ctype_type, parent_ctype_subtype); + EM_DEBUG_LOG("Parent Content-type[%s/%s]", parent_ctype_type, parent_ctype_subtype); /*Content Type*/ ctype = g_mime_object_get_content_type(mobject); @@ -2018,15 +2022,16 @@ INTERNAL_FUNC void emcore_gmime_imap_parse_full_foreach_cb(GMimeObject *parent, (g_ascii_strcasecmp(ctype_subtype, "plain") == 0 || g_ascii_strcasecmp(ctype_subtype, "html") == 0)) { EM_DEBUG_LOG("TEXT"); - } else if (parent_ctype_subtype && + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, GMIME_DISPOSITION_ATTACHMENT) == 0) || + (parent_ctype_subtype && g_ascii_strncasecmp(parent_ctype_subtype, "mixed", strlen("mixed")) == 0)) { + content_disposition_type = ATTACHMENT; + EM_DEBUG_LOG("ATTACHMENT"); + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, "inline") == 0) || + (parent_ctype_subtype && ((g_ascii_strncasecmp(parent_ctype_subtype, "related", strlen("related")) == 0) || - (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0))) { + (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0)))) { content_disposition_type = INLINE_ATTACHMENT; EM_DEBUG_LOG("INLINE_ATTACHMENT"); - } else if (parent_ctype_subtype && - g_ascii_strncasecmp(parent_ctype_subtype, "mixed", strlen("mixed")) == 0) { - content_disposition_type = ATTACHMENT; - EM_DEBUG_LOG("ATTACHMENT"); } else { int result = false; if (content_id && (emcore_search_string_from_file(cnt_info->text.html, @@ -2429,7 +2434,7 @@ INTERNAL_FUNC void emcore_gmime_imap_parse_bodystructure_foreach_cb(GMimeObject parent_ctype = g_mime_object_get_content_type(parent); parent_ctype_type = (char *)g_mime_content_type_get_media_type(parent_ctype); parent_ctype_subtype = (char *)g_mime_content_type_get_media_subtype(parent_ctype); - EM_DEBUG_LOG("Content-type[%s/%s]", parent_ctype_type, parent_ctype_subtype); + EM_DEBUG_LOG("Parent Content-type[%s/%s]", parent_ctype_type, parent_ctype_subtype); /* Parent content type - END */ /*Content Type*/ @@ -2474,17 +2479,18 @@ INTERNAL_FUNC void emcore_gmime_imap_parse_bodystructure_foreach_cb(GMimeObject g_ascii_strcasecmp(ctype_subtype, "html") == 0)) { cnt_info->total_body_size += content_size; EM_DEBUG_LOG("TEXT"); - } else if (parent_ctype_subtype && + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, GMIME_DISPOSITION_ATTACHMENT) == 0) || + (parent_ctype_subtype && g_ascii_strncasecmp(parent_ctype_subtype, "mixed", strlen("mixed")) == 0)) { + content_disposition_type = ATTACHMENT; + cnt_info->total_attachment_size += content_size; + EM_DEBUG_LOG("ATTACHMENT"); + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, "inline") == 0) || + (parent_ctype_subtype && ((g_ascii_strncasecmp(parent_ctype_subtype, "related", strlen("related")) == 0) || - (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0))) { + (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0)))) { content_disposition_type = INLINE_ATTACHMENT; cnt_info->total_body_size += content_size; EM_DEBUG_LOG("INLINE_ATTACHMENT"); - } else if (parent_ctype_subtype && - g_ascii_strncasecmp(parent_ctype_subtype, "mixed", strlen("mixed")) == 0) { - content_disposition_type = ATTACHMENT; - cnt_info->total_attachment_size += content_size; - EM_DEBUG_LOG("ATTACHMENT"); } else { if (disposition_str && g_ascii_strcasecmp(disposition_str, GMIME_DISPOSITION_ATTACHMENT) == 0) { content_disposition_type = ATTACHMENT; @@ -2720,15 +2726,16 @@ INTERNAL_FUNC void emcore_gmime_get_body_sections_foreach_cb(GMimeObject *parent (g_ascii_strcasecmp(ctype_subtype, "plain") == 0 || g_ascii_strcasecmp(ctype_subtype, "html") == 0)) { EM_DEBUG_LOG("TEXT"); - } else if (parent_ctype_subtype && + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, GMIME_DISPOSITION_ATTACHMENT) == 0) || + (parent_ctype_subtype && g_ascii_strncasecmp(parent_ctype_subtype, "mixed", strlen("mixed")) == 0)) { + content_disposition_type = ATTACHMENT; + EM_DEBUG_LOG("ATTACHMENT"); + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, "inline") == 0) || + (parent_ctype_subtype && ((g_ascii_strncasecmp(parent_ctype_subtype, "related", strlen("related")) == 0) || - (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0))) { + (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0)))) { content_disposition_type = INLINE_ATTACHMENT; EM_DEBUG_LOG("INLINE_ATTACHMENT"); - } else if (parent_ctype_subtype && - g_ascii_strncasecmp(parent_ctype_subtype, "mixed", strlen("mixed")) == 0) { - content_disposition_type = ATTACHMENT; - EM_DEBUG_LOG("ATTACHMENT"); } else { if (disposition_str && g_ascii_strcasecmp(disposition_str, GMIME_DISPOSITION_ATTACHMENT) == 0) { content_disposition_type = ATTACHMENT; @@ -2947,15 +2954,16 @@ INTERNAL_FUNC void emcore_gmime_get_attachment_section_foreach_cb(GMimeObject *p (g_ascii_strcasecmp(ctype_subtype, "plain") == 0 || g_ascii_strcasecmp(ctype_subtype, "html") == 0)) { EM_DEBUG_LOG("TEXT"); - } else if (parent_ctype_subtype && + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, GMIME_DISPOSITION_ATTACHMENT) == 0) || + (parent_ctype_subtype && g_ascii_strncasecmp(parent_ctype_subtype, "mixed", strlen("mixed")) == 0)) { + content_disposition_type = ATTACHMENT; + EM_DEBUG_LOG("ATTACHMENT"); + } else if ((disposition_str && g_ascii_strcasecmp(disposition_str, "inline") == 0) || + (parent_ctype_subtype && ((g_ascii_strncasecmp(parent_ctype_subtype, "related", strlen("related")) == 0) || - (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0))) { + (g_ascii_strncasecmp(parent_ctype_subtype, "relative", strlen("relative")) == 0)))) { content_disposition_type = INLINE_ATTACHMENT; EM_DEBUG_LOG("INLINE_ATTACHMENT"); - } else if (parent_ctype_subtype && - g_ascii_strncasecmp(parent_ctype_subtype, "mixed", strlen("mixed")) == 0) { - content_disposition_type = ATTACHMENT; - EM_DEBUG_LOG("ATTACHMENT"); } else { if (disposition_str && g_ascii_strcasecmp(disposition_str, GMIME_DISPOSITION_ATTACHMENT) == 0) { content_disposition_type = ATTACHMENT; -- cgit v1.2.3 From 4c077ccc0a712673afe9e146880d9110a3aa3b08 Mon Sep 17 00:00:00 2001 From: San Cho Date: Mon, 11 Jul 2016 17:02:07 +0900 Subject: the order of auto download attachment was wrong [Problem] the order of auto download attachment was wrong [Cause & Measure] Cause: the older mail's attachment was downloaded first. Measure: sorting mails by server id and download attachment. Change-Id: Ib7d4649ba3b960bc2a66e23f8032ea0d068d157e (cherry picked from commit df03367cd6d9cd10d47c26c402819b1122ec8813) --- email-core/email-core-auto-download.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/email-core/email-core-auto-download.c b/email-core/email-core-auto-download.c index 156ec89..b990f97 100755 --- a/email-core/email-core-auto-download.c +++ b/email-core/email-core-auto-download.c @@ -59,6 +59,7 @@ INTERNAL_FUNC int auto_download_thread_run = 0; #define AUTO_DOWNLOAD_QUEUE_MAX 100 static void* worker_auto_download_queue(void *arg); +static gint auto_download_compare_func(gconstpointer a, gconstpointer b, gpointer user_data); INTERNAL_FUNC int emcore_start_auto_download_loop(int *err_code) { @@ -175,14 +176,9 @@ INTERNAL_FUNC int emcore_insert_auto_download_event(email_event_auto_download *e EM_DEBUG_EXCEPTION("auto download que is full..."); error = EMAIL_ERROR_EVENT_QUEUE_FULL; ret = false; - } else if (event_data->status == EMAIL_EVENT_STATUS_DIRECT) { - event_data->status = EMAIL_EVENT_STATUS_WAIT; - g_queue_push_head(g_auto_download_que, event_data); - //WAKE_CONDITION_VARIABLE(_auto_downalod_available_signal); - ret = true; } else { event_data->status = EMAIL_EVENT_STATUS_WAIT; - g_queue_push_tail(g_auto_download_que, event_data); + g_queue_insert_sorted(g_auto_download_que, event_data, auto_download_compare_func, event_data); //WAKE_CONDITION_VARIABLE(_auto_downalod_available_signal); ret = true; } @@ -467,7 +463,7 @@ static void* worker_auto_download_queue(void *arg) } activity->activity_id = activity_list[di].activity_id; - activity->status = 0; + activity->status = EMAIL_EVENT_STATUS_DIRECT; activity->account_id = activity_list[di].account_id; activity->mail_id = activity_list[di].mail_id; activity->server_mail_id = activity_list[di].server_mail_id; @@ -862,4 +858,12 @@ FINISH_OFF: return ret; } - +static gint auto_download_compare_func(gconstpointer a, gconstpointer b, gpointer user_data) +{ + email_event_auto_download *first = (email_event_auto_download*)a; + email_event_auto_download *second = (email_event_auto_download*)b; + if (first->server_mail_id == second->server_mail_id) return 0; + else if (first->server_mail_id > second->server_mail_id) return -1; + else return 1; + return 1; +} -- cgit v1.2.3 From 3b28b2c5350623fa80ed7ab1337e69d67c9c85a2 Mon Sep 17 00:00:00 2001 From: San Cho Date: Tue, 26 Jul 2016 18:30:41 +0900 Subject: when downloading attachment automatically, mail body does not have to be downloaded fully [Problem] auto download attachment was not operated well. [Cause & Measure] Cause: mail body was being downloaded fully to get attachment information completely before downloading attachment. Measure: attachment information have to exist unconditionally if email size is "Header only" Change-Id: Ic3b9c745b2b40a2631a43fd30535aed0f1f65ad5 Signed-off-by: intae, jeon (cherry picked from commit eb2b71afca503c9a390d0b7d50647f4ea552e372) --- email-core/email-core-auto-download.c | 96 ++++++++++++++++++----------------- email-core/email-core-mailbox-sync.c | 56 ++++++++++++-------- 2 files changed, 84 insertions(+), 68 deletions(-) diff --git a/email-core/email-core-auto-download.c b/email-core/email-core-auto-download.c index b990f97..7f5d045 100755 --- a/email-core/email-core-auto-download.c +++ b/email-core/email-core-auto-download.c @@ -59,7 +59,7 @@ INTERNAL_FUNC int auto_download_thread_run = 0; #define AUTO_DOWNLOAD_QUEUE_MAX 100 static void* worker_auto_download_queue(void *arg); -static gint auto_download_compare_func(gconstpointer a, gconstpointer b, gpointer user_data); +static gint __auto_download_compare_func(gconstpointer a, gconstpointer b, gpointer user_data); INTERNAL_FUNC int emcore_start_auto_download_loop(int *err_code) { @@ -178,7 +178,7 @@ INTERNAL_FUNC int emcore_insert_auto_download_event(email_event_auto_download *e ret = false; } else { event_data->status = EMAIL_EVENT_STATUS_WAIT; - g_queue_insert_sorted(g_auto_download_que, event_data, auto_download_compare_func, event_data); + g_queue_insert_sorted(g_auto_download_que, event_data, __auto_download_compare_func, event_data); //WAKE_CONDITION_VARIABLE(_auto_downalod_available_signal); ret = true; } @@ -399,19 +399,15 @@ static void* worker_auto_download_queue(void *arg) } if (!(account_ref->wifi_auto_download)) { - if (account_ref) { - emcore_free_account(account_ref); - EM_SAFE_FREE(account_ref); - } - - continue; - } - - if (account_ref) { + EM_DEBUG_LOG("ACCOUNT[%d] AUTO DOWNLOAD MODE OFF", account_ref->account_id); emcore_free_account(account_ref); EM_SAFE_FREE(account_ref); + continue; } + emcore_free_account(account_ref); + EM_SAFE_FREE(account_ref); + mailbox_count = 0; EM_SAFE_FREE(mailbox_list); if (!emstorage_get_auto_download_mailbox_list(NULL, account_list[ai], &mailbox_list, &mailbox_count, false, &err)) { @@ -537,11 +533,6 @@ CHECK_CONTINUE: goto POP_HEAD; } - if (account_ref) { - emcore_free_account(account_ref); - EM_SAFE_FREE(account_ref); - } - if ((err = emstorage_get_mailbox_by_id(event_data->multi_user_name, event_data->mailbox_id, &target_mailbox)) != EMAIL_ERROR_NONE) { EM_DEBUG_EXCEPTION("emstorage_get_mailbox_by_id failed. [%d]", err); } @@ -559,43 +550,51 @@ CHECK_CONTINUE: /* Handling storage full */ if ((err = emcore_is_storage_full()) == EMAIL_ERROR_MAIL_MEMORY_FULL) { EM_DEBUG_EXCEPTION("Storage is full"); - ENTER_RECURSIVE_CRITICAL_SECTION(_auto_download_queue_lock); auto_download_thread_run = 0; SLEEP_CONDITION_VARIABLE(_auto_downalod_available_signal, *_auto_download_queue_lock); EM_DEBUG_LOG("Wake up by _auto_downalod_available_signal"); LEAVE_RECURSIVE_CRITICAL_SECTION(_auto_download_queue_lock); + if (account_ref) { + emcore_free_account(account_ref); + EM_SAFE_FREE(account_ref); + } + continue; } - snprintf(uid_str, sizeof(uid_str), "%ld", event_data->server_mail_id); - if (!emstorage_get_maildata_by_servermailid(event_data->multi_user_name, - uid_str, - event_data->mailbox_id, - &mail, - true, - &err) || !mail) { - EM_DEBUG_EXCEPTION("emstorage_get_mail_data_by_servermailid failed : [%d]", err); - } else { + // POP3's UID is string, not integer type. So event_data->server_mail_id is invalid in this time. + // emstorage_get_mail_data_by_servermailid() is always fail if it is POP3 event. + if (!emstorage_get_mail_by_id(event_data->multi_user_name, + event_data->mail_id, + &mail, + true, + &err) || !mail) { + EM_DEBUG_EXCEPTION("emstorage_get_mail_by_id failed : [%d]", err); + } + else { if (mail->body_download_status & EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED) { EM_DEBUG_LOG("fully downloaded mail"); - } else { - EM_DEBUG_LOG("#####AUTO DOWNLOAD BODY: ACCOUNT_ID[%d] MAILBOX_ID[%d] MAIL_ID[%d] UID[%d] ACTIVITY[%d]#####", - event_data->account_id, event_data->mailbox_id, - event_data->mail_id, event_data->server_mail_id, event_data->activity_id); - - if (!emcore_gmime_download_body_sections(event_data->multi_user_name, - NULL, - event_data->account_id, - event_data->mail_id, - 0, - NO_LIMITATION, - -1, - 0, - 1, - &err)) - EM_DEBUG_EXCEPTION("emcore_gmime_download_body_sections failed - %d", err); + } + else { + EM_DEBUG_LOG("partially downloaded mail"); + if (account_ref->incoming_server_type == EMAIL_SERVER_TYPE_POP3) { + EM_DEBUG_LOG("#####AUTO DOWNLOAD BODY: ACCOUNT_ID[%d] MAILBOX_ID[%d] MAIL_ID[%d] UID[%d] ACTIVITY[%d]#####", + event_data->account_id, event_data->mailbox_id, + event_data->mail_id, event_data->server_mail_id, event_data->activity_id); + if (!emcore_gmime_download_body_sections(event_data->multi_user_name, + NULL, + event_data->account_id, + event_data->mail_id, + 0, + NO_LIMITATION, + -1, + 0, + 1, + &err)) + EM_DEBUG_EXCEPTION("emcore_gmime_download_body_sections failed - %d", err); + } } if (mail->attachment_count > 0) { @@ -858,12 +857,17 @@ FINISH_OFF: return ret; } -static gint auto_download_compare_func(gconstpointer a, gconstpointer b, gpointer user_data) +static gint __auto_download_compare_func(gconstpointer a, gconstpointer b, gpointer user_data) { email_event_auto_download *first = (email_event_auto_download*)a; email_event_auto_download *second = (email_event_auto_download*)b; - if (first->server_mail_id == second->server_mail_id) return 0; - else if (first->server_mail_id > second->server_mail_id) return -1; - else return 1; + if (first->account_id == second->account_id) { + if (first->server_mail_id == second->server_mail_id) return 0; + else if (first->server_mail_id > second->server_mail_id) return -1; + else return 1; + } else { + if (first->account_id < second->account_id) return -1; + else return 1; + } return 1; } diff --git a/email-core/email-core-mailbox-sync.c b/email-core/email-core-mailbox-sync.c index d6c8a3d..b7e2690 100755 --- a/email-core/email-core-mailbox-sync.c +++ b/email-core/email-core-mailbox-sync.c @@ -2442,17 +2442,15 @@ INTERNAL_FUNC int emcore_sync_header(char *multi_user_name, #ifndef __FEATURE_PARTIAL_BODY_FOR_POP3__ if (account_ref->incoming_server_type == EMAIL_SERVER_TYPE_IMAP4) { #endif /* __FEATURE_PARTIAL_BODY_FOR_POP3__ */ - if (account_ref->auto_download_size != 0) { - if (false == emcore_initiate_pbd(multi_user_name, - *stream, - account_id, - mail_id, - uid_elem->uid, - input_mailbox_tbl->mailbox_id, - input_mailbox_tbl->mailbox_name, - &err)) - EM_DEBUG_LOG("Partial body download initiation failed [%d]", err); - } + if (false == emcore_initiate_pbd(multi_user_name, + *stream, + account_id, + mail_id, + uid_elem->uid, + input_mailbox_tbl->mailbox_id, + input_mailbox_tbl->mailbox_name, + &err)) + EM_DEBUG_LOG("Partial body download initiation failed [%d]", err); #ifndef __FEATURE_PARTIAL_BODY_FOR_POP3__ } #endif /* __FEATURE_PARTIAL_BODY_FOR_POP3__ */ @@ -3709,12 +3707,6 @@ INTERNAL_FUNC int emcore_initiate_pbd(char *multi_user_name, MAILSTREAM *stream, goto FINISH_OFF; } - if (account_ref->auto_download_size == 0) { - EM_DEBUG_LOG("Header only download"); - ret = true; - goto FINISH_OFF; - } - memset(&pbd_event, 0x00, sizeof(email_event_partial_body_thd)); pbd_event.account_id = account_id; @@ -3982,8 +3974,19 @@ static int emcore_gmime_download_imap_partial_mail_body(MAILSTREAM *stream, int false, &err) || !mail) { EM_DEBUG_EXCEPTION("emstorage_get_mail_data_by_servermailid failed : [%d]", err); - if (err == EMAIL_ERROR_MAIL_NOT_FOUND || !mail) - goto FINISH_OFF; + if (err == EMAIL_ERROR_MAIL_NOT_FOUND || !mail) { + if (false == emcore_delete_pbd_activity(pbd_event[temp_count].multi_user_name, + pbd_event[temp_count].account_id, + pbd_event[temp_count].mail_id, + pbd_event[temp_count].activity_id, + &err)) { + EM_DEBUG_EXCEPTION("emcore_delete_pbd_activity failed [%d]", err); + } + } + if (mail) + emstorage_free_mail(&mail, 1, NULL); + mail = NULL; + continue; } if (mailbox_tbl) { @@ -4076,11 +4079,15 @@ static int emcore_gmime_download_imap_partial_mail_body(MAILSTREAM *stream, int iter1 = g_mime_part_iter_new((GMimeObject *)message1); iter2 = g_mime_part_iter_new((GMimeObject *)message2); - if (!g_mime_part_iter_is_valid(iter1) || !g_mime_part_iter_is_valid(iter2)) { - EM_DEBUG_EXCEPTION("Part iterator is not valid"); + if (!g_mime_part_iter_is_valid(iter1)) { + EM_DEBUG_EXCEPTION("Part1 iterator is not valid"); goto FINISH_OFF; } + if (!g_mime_part_iter_is_valid(iter2)) { + EM_DEBUG_EXCEPTION("Part2 iterator is not valid"); + } + do { part_tmp2 = g_mime_part_iter_get_current(iter2); if (part_tmp2 && GMIME_IS_PART(part_tmp2)) { @@ -4652,7 +4659,12 @@ INTERNAL_FUNC int emcore_download_bulk_partial_mail_body(MAILSTREAM *stream, ema goto FINISH_OFF; } - auto_download_size = (pbd_account_tbl->auto_download_size < 4096) ? 4096 : pbd_account_tbl->auto_download_size; + // To get attachment info in bodystructure for imap account + if (pbd_account_tbl->auto_download_size == 0) { + auto_download_size = 1; + } else { + auto_download_size = (pbd_account_tbl->auto_download_size < 4096) ? 4096 : pbd_account_tbl->auto_download_size; + } switch (pbd_account_tbl->incoming_server_type) { case EMAIL_SERVER_TYPE_IMAP4: -- cgit v1.2.3 From bcb4f917b695ef432ce81c5c9ab5ff3d5f95b8a6 Mon Sep 17 00:00:00 2001 From: San Cho Date: Thu, 28 Jul 2016 17:58:48 +0900 Subject: apply secure log for privacy Change-Id: Ia76e7dffe1004eee9baf78ed109e7c40ea12034a Signed-off-by: intae, jeon (cherry picked from commit a84f75b390a3b229acbbdc531bd39f2b0b58bc7c) --- email-common-use/email-utilities.c | 10 +++++----- email-common-use/include/email-debug-log.h | 3 +++ email-core/email-core-gmime.c | 6 +++--- email-core/email-core-mime.c | 5 ++++- email-core/email-core-mm-callbacks.c | 2 +- email-core/email-core-smtp.c | 10 +++++----- email-core/email-core-utils.c | 7 ++++--- email-core/email-storage/email-storage.c | 8 ++++---- 8 files changed, 29 insertions(+), 22 deletions(-) diff --git a/email-common-use/email-utilities.c b/email-common-use/email-utilities.c index 96cfb9c..f0e6ee4 100755 --- a/email-common-use/email-utilities.c +++ b/email-common-use/email-utilities.c @@ -165,7 +165,7 @@ INTERNAL_FUNC int em_upper_path(char *path) INTERNAL_FUNC void em_skip_whitespace(char *addr_str, char **pAddr) { - EM_DEBUG_FUNC_BEGIN("addr_str[%p]", addr_str); + EM_DEBUG_FUNC_BEGIN_SEC("addr_str[%p]", addr_str); if (!addr_str) return ; @@ -181,12 +181,12 @@ INTERNAL_FUNC void em_skip_whitespace(char *addr_str, char **pAddr) ptr[j] = NULL_CHAR; *pAddr = EM_SAFE_STRDUP(ptr); - EM_DEBUG_FUNC_END("ptr[%s]", ptr); + EM_DEBUG_FUNC_END_SEC("ptr[%s]", ptr); } INTERNAL_FUNC void em_skip_whitespace_without_alias(char *addr_str, char **pAddr) { - EM_DEBUG_FUNC_BEGIN("addr_str[%p]", addr_str); + EM_DEBUG_FUNC_BEGIN_SEC("addr_str[%p]", addr_str); if (!addr_str) return ; @@ -231,7 +231,7 @@ INTERNAL_FUNC void em_skip_whitespace_without_alias(char *addr_str, char **pAddr ptr[j++] = NULL_CHAR; *pAddr = EM_SAFE_STRDUP(ptr); - EM_DEBUG_FUNC_END("ptr[%s]", ptr); + EM_DEBUG_FUNC_END_SEC("ptr[%s]", ptr); } INTERNAL_FUNC char* em_skip_whitespace_without_strdup(char *source_string) @@ -1384,7 +1384,7 @@ INTERNAL_FUNC int em_fopen(const char *filename, const char *mode, FILE **fp) INTERNAL_FUNC int em_open(const char *filename, int oflags, mode_t mode, int *handle) { - EM_DEBUG_FUNC_BEGIN("filename: [%s]", filename); + EM_DEBUG_FUNC_BEGIN_SEC("filename : [%s]", filename); int err = EMAIL_ERROR_NONE; if (!filename) { diff --git a/email-common-use/include/email-debug-log.h b/email-common-use/include/email-debug-log.h index ef9141c..8c9cf9c 100755 --- a/email-common-use/include/email-debug-log.h +++ b/email-common-use/include/email-debug-log.h @@ -64,6 +64,7 @@ extern "C" #define EM_DEBUG_LOG_SEC(format, arg...) SECURE_SLOGD(format, ##arg) #define EM_DEBUG_EXCEPTION_SEC(format, arg...) SECURE_SLOGE("[EXCEPTION!] " format "\n", ##arg) #define EM_DEBUG_FUNC_BEGIN_SEC(format, arg...) EM_DEBUG_LOG_SEC("BEGIN - "format, ##arg) +#define EM_DEBUG_FUNC_END_SEC(format, arg...) EM_DEBUG_LOG_SEC("END - "format, ##arg) #ifdef _DEBUG_MIME_PARSE_ #define EM_DEBUG_LOG_MIME(format, arg...) EM_DEBUG_LOG_SEC(format, ##arg) @@ -79,6 +80,8 @@ extern "C" #define EM_DEBUG_FUNC_END(format, arg...) #undef EM_DEBUG_FUNC_BEGIN_SEC #define EM_DEBUG_FUNC_BEGIN_SEC(format, arg...) +#undef EM_DEBUG_FUNC_END_SEC +#define EM_DEBUG_FUNC_END_SEC(format, arg...) #endif #ifdef __FEATURE_LOG_FOR_DEBUG_LOG_DEV__ diff --git a/email-core/email-core-gmime.c b/email-core/email-core-gmime.c index cfb2494..7ec0c59 100755 --- a/email-core/email-core-gmime.c +++ b/email-core/email-core-gmime.c @@ -3256,7 +3256,7 @@ INTERNAL_FUNC void emcore_gmime_construct_multipart(GMimeMultipart *multipart, if (part->body.parameter) { PARAMETER *param = part->body.parameter; while (param) { - EM_DEBUG_LOG("Content-Type Parameter: attribute[%s], value[%s]", param->attribute, param->value); + EM_DEBUG_LOG_SEC("Content-Type Parameter: attribute[%s], value[%s]", param->attribute, param->value); if (param->attribute || param->value) g_mime_object_set_content_type_parameter(subpart, param->attribute, param->value); param = param->next; @@ -4980,7 +4980,7 @@ FINISH_OFF: INTERNAL_FUNC int emcore_gmime_check_filename_duplication(char *source_filename, struct _m_content_info *cnt_info) { - EM_DEBUG_FUNC_BEGIN("source_file_name [%s], content_info [%p]", source_filename, cnt_info); + EM_DEBUG_FUNC_BEGIN_SEC("source_file_name [%s], content_info [%p]", source_filename, cnt_info); if (!source_filename || !cnt_info || strlen(source_filename) <= 0) { EM_DEBUG_EXCEPTION("Invalid parameter"); @@ -5074,7 +5074,7 @@ INTERNAL_FUNC char *emcore_gmime_get_decoding_text(const char *text) return NULL; } - EM_DEBUG_LOG("decoded_text : [%s]", decoded_text); + EM_DEBUG_LOG_SEC("decoded_text : [%s]", decoded_text); return decoded_text; } diff --git a/email-core/email-core-mime.c b/email-core/email-core-mime.c index 013b8f8..6ca95a8 100755 --- a/email-core/email-core-mime.c +++ b/email-core/email-core-mime.c @@ -134,7 +134,7 @@ extern long pop3_reply(MAILSTREAM *stream); char *em_get_escaped_str(const char *str) { - EM_DEBUG_FUNC_BEGIN("str [%s]", str); + EM_DEBUG_FUNC_BEGIN_SEC("str [%s]", str); int i = 0, j = 0; int len = 0; @@ -161,6 +161,7 @@ char *em_get_escaped_str(const char *str) } ret[ret_i++] = '\0'; + EM_DEBUG_FUNC_END(); return ret; } @@ -243,6 +244,8 @@ char *em_split_file_path(char *str) EM_SAFE_FREE(temp_str); EM_SAFE_FREE(temp_cid_data); + + EM_DEBUG_FUNC_END(); return buf; } diff --git a/email-core/email-core-mm-callbacks.c b/email-core/email-core-mm-callbacks.c index eb78dea..eef6494 100755 --- a/email-core/email-core-mm-callbacks.c +++ b/email-core/email-core-mm-callbacks.c @@ -291,7 +291,7 @@ INTERNAL_FUNC void mm_log(char *string, long errflg) switch (errflg) { case NIL: - EM_DEBUG_LOG("IMAP_TOOLKIT_LOG [%s]", string); + EM_DEBUG_LOG_SEC("IMAP_TOOLKIT_LOG [%s]", string); break; case WARN: diff --git a/email-core/email-core-smtp.c b/email-core/email-core-smtp.c index 4c9cd93..2e5dba4 100755 --- a/email-core/email-core-smtp.c +++ b/email-core/email-core-smtp.c @@ -132,7 +132,7 @@ static char *emcore_find_img_tag(char *source_string) if (source_string[cur] == 'M' || source_string[cur] == 'm') { cur++; if (source_string[cur] == 'G' || source_string[cur] == 'g') { - EM_DEBUG_FUNC_END("%s", source_string + cur - 2); + EM_DEBUG_FUNC_END_SEC("%s", source_string + cur - 2); return source_string + cur - 2; } } @@ -2612,7 +2612,7 @@ static int emcore_send_mail_smtp(char *multi_user_name, } send_ret = smtp_send(stream, "MAIL", buf); - EM_DEBUG_LOG("[SMTP] MAIL %s --------> %s", buf, stream->reply); + EM_DEBUG_LOG_SEC("[SMTP] MAIL %s --------> %s", buf, stream->reply); switch (send_ret) { case SMTP_RESPONSE_OK: @@ -2858,7 +2858,7 @@ FINISH_OFF: char *emcore_generate_content_id_string(const char *hostname, int *err) { - EM_DEBUG_FUNC_BEGIN("hostname[%p]", hostname); + EM_DEBUG_FUNC_BEGIN_SEC("hostname[%p]", hostname); if (!hostname) { EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM"); @@ -2891,7 +2891,7 @@ char *emcore_generate_content_id_string(const char *hostname, int *err) if (err) *err = EMAIL_ERROR_NONE; - EM_DEBUG_FUNC_END("cid_string [%s]", cid_string); + EM_DEBUG_FUNC_END_SEC("cid_string [%s]", cid_string); return cid_string; } @@ -3378,7 +3378,7 @@ FINISH_OFF: #endif static char *emcore_encode_rfc2047_text(char *utf8_text, int *err_code) { - EM_DEBUG_FUNC_BEGIN("utf8_text[%s], err_code[%p]", utf8_text, err_code); + EM_DEBUG_FUNC_BEGIN_SEC("utf8_text[%s], err_code[%p]", utf8_text, err_code); if (utf8_text == NULL) { if (err_code != NULL) diff --git a/email-core/email-core-utils.c b/email-core/email-core-utils.c index db9fea5..885e7fb 100755 --- a/email-core/email-core-utils.c +++ b/email-core/email-core-utils.c @@ -593,7 +593,7 @@ FINISH_OFF: INTERNAL_FUNC int emcore_get_file_size(char *path, int *size, int *err_code) { - EM_DEBUG_FUNC_BEGIN("path[%s], size[%p], err_code[%p]", path, size, err_code); + EM_DEBUG_FUNC_BEGIN_SEC("path[%s], size[%p], err_code[%p]", path, size, err_code); int ret = false; int error = EMAIL_ERROR_NONE; @@ -627,7 +627,7 @@ FINISH_OFF: INTERNAL_FUNC int emcore_check_drm_file(char *path, int *err_code) { - EM_DEBUG_FUNC_BEGIN("path[%s], err_code[%p]", path, err_code); + EM_DEBUG_FUNC_BEGIN_SEC("path[%s], err_code[%p]", path, err_code); int ret = false; int error = EMAIL_ERROR_NONE; @@ -1317,7 +1317,7 @@ static char *emcore_get_sound_file_path(int default_ringtone_status, char *alert ret = EM_SAFE_STRDUP(vconf_get_str(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR)); } - EM_DEBUG_FUNC_END("ret [%s]", ret); + EM_DEBUG_FUNC_END_SEC("ret [%s]", ret); return ret; } @@ -1805,6 +1805,7 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac break; } */ + if ((noti_err = notification_set_layout(noti, NOTIFICATION_LY_NOTI_EVENT_SINGLE)) != NOTIFICATION_ERROR_NONE) { EM_DEBUG_EXCEPTION("notification_set_layout failed [%d]", noti_err); diff --git a/email-core/email-storage/email-storage.c b/email-core/email-storage/email-storage.c index ac41f4b..ff45094 100755 --- a/email-core/email-storage/email-storage.c +++ b/email-core/email-storage/email-storage.c @@ -11568,7 +11568,7 @@ INTERNAL_FUNC int emstorage_get_save_name(char *multi_user_name, int account_id, /* Did not allow the slash */ modified_fname = reg_replace_new(fname, "/", "_"); - EM_DEBUG_LOG("modified_fname : [%s]", modified_fname); + EM_DEBUG_LOG_SEC("modified_fname : [%s]", modified_fname); if (modified_fname == NULL) modified_fname = g_strdup(fname); @@ -11623,10 +11623,10 @@ INTERNAL_FUNC int emstorage_get_save_name(char *multi_user_name, int account_id, goto FINISH_OFF; } snprintf(move_buf, 512, "%s/%s", prefix_path, path_buf); - EM_DEBUG_LOG("move_buf : [%s]", move_buf); + EM_DEBUG_LOG_SEC("move_buf : [%s]", move_buf); } else { snprintf(move_buf, 512, "%s", path_buf); - EM_DEBUG_LOG("move_buf : [%s]", move_buf); + EM_DEBUG_LOG_SEC("move_buf : [%s]", move_buf); } ret = true; @@ -11814,7 +11814,7 @@ FINISH_OFF: INTERNAL_FUNC int emstorage_copy_file(char *src_file, char *dst_file, int sync_status, int *err_code) { - EM_DEBUG_FUNC_BEGIN("src_file[%s], dst_file[%s], err_code[%p]", src_file, dst_file, err_code); + EM_DEBUG_FUNC_BEGIN_SEC("src_file[%s], dst_file[%s], err_code[%p]", src_file, dst_file, err_code); EM_DEBUG_LOG("Using the fsync function"); int ret = false; int error = EMAIL_ERROR_NONE; -- cgit v1.2.3 From a41892e6a9b123fd5497f9b60c85e7ae746f367e Mon Sep 17 00:00:00 2001 From: "sireesha.t" Date: Wed, 12 Oct 2016 12:01:50 +0530 Subject: push is not working for the outlook.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Problem]“Push” is not working for the “outlook.com “ . [Cause & Measure] Cause: In gmail EXISTS response is coming first then RECENT response.In outlook RECENT response coming first then EXISTS. In code once we read first response, we are not reading second response but sync procedure kept under EXISTS response. So for outlook server we are not doing sync operation . Measure: Modified code to read both EXISTS and RECENT responses. Change-Id: I2de6a9ecd013e06110d8c17f2cd86bd7ca012088 Signed-off-by: intae, jeon (cherry picked from commit cc93fcf5b51ec4d992d3f832bd41a3cabb5139fe) --- email-core/email-core-imap-idle.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/email-core/email-core-imap-idle.c b/email-core/email-core-imap-idle.c index 3d97cb3..63d2a09 100755 --- a/email-core/email-core-imap-idle.c +++ b/email-core/email-core-imap-idle.c @@ -252,10 +252,14 @@ static int emcore_parse_imap_idle_response(char *multi_user_name, if (strstr(p, "EXIST") != NULL) { if (!emcore_imap_idle_insert_sync_event(multi_user_name, input_account_id, input_mailbox_id, &err)) EM_DEBUG_EXCEPTION_SEC("Syncing mailbox[%d] failed with err_code [%d]", input_mailbox_id, err); - } else + EM_SAFE_FREE(p); + break; + } + else { EM_DEBUG_LOG("Skipped this message"); - EM_SAFE_FREE(p); - break; + EM_SAFE_FREE(p); + } + } } else if (p && (!strncmp(p, "+", 1))) { /* Bad response from server */ -- cgit v1.2.3 From 0eb2f3fceb6c8e8f5df890088459a82713dfd9be Mon Sep 17 00:00:00 2001 From: San Cho Date: Tue, 24 May 2016 15:55:52 +0900 Subject: Sent Fail notification disappears from notification panel if launching email app [Problem] "Sent Fail" notification disappears from notification panel if launching email app [Cause & Measure] Cause: emcore_clear_notification() is called if email app is launched, then email-service removes all notification unconditionally. Measure: set noti type when inserting notification, and classify the sent fail notification when emcore_clear_notification is called. Change-Id: I6ddd96ff6259356160ccc4e733fba7cc22190105 Signed-off-by: intae, jeon (cherry picked from commit e4f45b7ba6f4edd4094ac937b61abbaf2b70d1f1) --- email-common-use/include/email-internal-types.h | 9 ++ email-core/email-core-account.c | 2 +- email-core/email-core-utils.c | 105 +++++++++++++++++++----- email-core/email-storage/email-storage.c | 1 + email-core/include/email-core-utils.h | 2 +- 5 files changed, 98 insertions(+), 21 deletions(-) diff --git a/email-common-use/include/email-internal-types.h b/email-common-use/include/email-internal-types.h index a009db3..176762f 100755 --- a/email-common-use/include/email-internal-types.h +++ b/email-common-use/include/email-internal-types.h @@ -44,6 +44,15 @@ extern "C" #define INTERNAL_FUNC __attribute__((visibility("default"))) #endif +/* ----------------------------------------------------------------------------- */ +/* notification type */ +#define __NOTI_NEW_MAIL_SINGLE "NEW_MAIL_SINGLE" +#define __NOTI_NEW_MAIL_MULTI "NEW_MAIL_MULTI" +#define __NOTI_SENT "SENT" +#define __NOTI_SENDING "SENDING" +#define __NOTI_SENT_FAIL "SENT_FAIL" + + /* ----------------------------------------------------------------------------- */ /* Feature definitions */ /* #define __FEATURE_USING_ACCOUNT_SVC_FOR_ACCOUNT_MANAGEMENT__ */ diff --git a/email-core/email-core-account.c b/email-core/email-core-account.c index cd049e3..74a164f 100755 --- a/email-core/email-core-account.c +++ b/email-core/email-core-account.c @@ -532,7 +532,7 @@ INTERNAL_FUNC int emcore_delete_account(char *multi_user_name, int account_id, i } emcore_display_unread_in_badge(multi_user_name); - emcore_delete_notification_by_account(multi_user_name, account_id, true); + emcore_delete_notification_by_account(multi_user_name, account_id, true, true); ret = true; diff --git a/email-core/email-core-utils.c b/email-core/email-core-utils.c index 885e7fb..ad92011 100755 --- a/email-core/email-core-utils.c +++ b/email-core/email-core-utils.c @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -59,6 +58,7 @@ #endif /* __FEATURE_USE_DRM_API__ */ #include #include +#include #include #include #include @@ -1551,6 +1551,8 @@ INTERNAL_FUNC int emcore_add_notification(char *multi_user_name, int account_id, app_control_add_extra_data(service, "MAIL_ID", buf); snprintf(buf, sizeof(buf), "%d", p_mail_data->mailbox_id); app_control_add_extra_data(service, "MAILBOX_ID", buf); + snprintf(buf, sizeof(buf), "%s", __NOTI_NEW_MAIL_SINGLE); + app_control_add_extra_data(service, "NOTI_TYPE", buf); app_control_set_app_id(service, NATIVE_EMAIL_APPLICATION_PKG); app_control_to_bundle(service, &b); @@ -1572,6 +1574,8 @@ INTERNAL_FUNC int emcore_add_notification(char *multi_user_name, int account_id, app_control_add_extra_data(service, "RUN_TYPE", buf); snprintf(buf, sizeof(buf), "%d", account_id); app_control_add_extra_data(service, "ACCOUNT_ID", buf); + snprintf(buf, sizeof(buf), "%s", __NOTI_NEW_MAIL_MULTI); + app_control_add_extra_data(service, "NOTI_TYPE", buf); if (unseen > EMAIL_NOTI_MAX_MAIL_ID) unseen = EMAIL_NOTI_MAX_MAIL_ID; @@ -1711,7 +1715,7 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac } /* Delete the previous noti */ - emcore_delete_notification_by_account(multi_user_name, account_id, true); + emcore_delete_notification_by_account(multi_user_name, account_id, true, true); if (g_sending_noti_handle) { if ((noti_err = notification_free(g_sending_noti_handle)) != NOTIFICATION_ERROR_NONE) err = EMAIL_ERROR_NOTI; @@ -1759,6 +1763,17 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac app_control_add_extra_data(service, "MAIL_ID", buf); snprintf(buf, sizeof(buf), "%d", p_mail_data->mailbox_id); app_control_add_extra_data(service, "MAILBOX_ID", buf); + snprintf(buf, sizeof(buf), "%d", sending_error); + app_control_add_extra_data(service, "SENDING_ERROR", buf); + if (sending_error == EMAIL_ERROR_NONE) { + if (action == EMAIL_ACTION_SEND_MAIL) + snprintf(buf, sizeof(buf), "%s", __NOTI_SENT); + else if (action == EMAIL_ACTION_SENDING_MAIL) + snprintf(buf, sizeof(buf), "%s", __NOTI_SENDING); + } else { + snprintf(buf, sizeof(buf), "%s", __NOTI_SENT_FAIL); + } + app_control_add_extra_data(service, "NOTI_TYPE", buf); app_control_set_app_id(service, NATIVE_EMAIL_APPLICATION_PKG); app_control_to_bundle(service, &b); @@ -3336,13 +3351,13 @@ INTERNAL_FUNC int emcore_clear_notifications(char *multi_user_name, int account_ goto FINISH_OFF; } - for (i = 0; i < account_count; i++) { - error_code = emcore_delete_notification_by_account(multi_user_name, account_list[i].account_id, true); + for(i = 0; i < account_count; i++) { + error_code = emcore_delete_notification_by_account(multi_user_name, account_list[i].account_id, true, false); if (error_code != EMAIL_ERROR_NONE) EM_DEBUG_EXCEPTION("emcore_delete_notification_by_account failed"); } } else { - error_code = emcore_delete_notification_by_account(multi_user_name, account_id, true); + error_code = emcore_delete_notification_by_account(multi_user_name, account_id, true, false); if (error_code != EMAIL_ERROR_NONE) EM_DEBUG_EXCEPTION("emcore_delete_notification_by_account failed"); } @@ -3364,31 +3379,83 @@ FINISH_OFF: #define EAS_EXECUTABLE_PATH "/usr/bin/eas-engine" -INTERNAL_FUNC int emcore_delete_notification_by_account(char *multi_user_name, int account_id, int with_noti_tray) +INTERNAL_FUNC int emcore_delete_notification_by_account(char *multi_user_name, int account_id, int with_noti_tray, int is_delete_sent_fail_noti) { - EM_DEBUG_FUNC_BEGIN("account_id [%d]", account_id); + EM_DEBUG_FUNC_BEGIN("account_id [%d], with_noti_tray [%d], is_delete_sent_fail_noti: [%d]", account_id, with_noti_tray, is_delete_sent_fail_noti); int error_code = EMAIL_ERROR_NONE; - int private_id = 0; - char vconf_private_id[MAX_PATH] = {0, }; - SNPRINTF(vconf_private_id, sizeof(vconf_private_id), "%s/%d", VCONF_KEY_NOTI_PRIVATE_ID, account_id); - if (vconf_get_int(vconf_private_id, &private_id) != 0) { - EM_DEBUG_EXCEPTION("vconf_get_int failed"); - } #ifdef __FEATURE_NOTIFICATION_ENABLE__ notification_error_e noti_err = NOTIFICATION_ERROR_NONE; + notification_h noti = NULL; + notification_h noti_to_be_deleted = NULL; + notification_list_h noti_list = NULL; + notification_list_h head_noti_list = NULL; + bundle *noti_args = NULL; - if ((noti_err = notification_delete_by_priv_id(NATIVE_EMAIL_APPLICATION_PKG, NOTIFICATION_TYPE_NOTI, private_id)) != NOTIFICATION_ERROR_NONE) { - EM_DEBUG_EXCEPTION("notification_delete_by_priv_id failed [%d]", noti_err); + noti_err = notification_get_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list); + if (noti_err != NOTIFICATION_ERROR_NONE) { + EM_DEBUG_EXCEPTION("notification_get_list failed: [%d]", noti_err); error_code = EMAIL_ERROR_NOTI; + goto FINISH_OFF; } - if (with_noti_tray) { - if ((noti_err = notification_delete_by_priv_id(NATIVE_EMAIL_APPLICATION_PKG, NOTIFICATION_TYPE_ONGOING, private_id)) != NOTIFICATION_ERROR_NONE) { - EM_DEBUG_EXCEPTION("notification_delete_by_priv_id failed [%d]", noti_err); - error_code = EMAIL_ERROR_NOTI; + while (noti_list != NULL) { + noti = notification_list_get_data(noti_list); + noti_err = notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, ¬i_args); + if (!noti_args) { + noti_err = notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH, NULL, ¬i_args); + if (!noti_args) { + noti_list = notification_list_get_next(noti_list); + continue; + } + } + + const char *account_id_str = bundle_get_val(noti_args, "ACCOUNT_ID"); + const char *noti_type_str = bundle_get_val(noti_args, "NOTI_TYPE"); + if (!account_id_str || !noti_type_str) { + noti_list = notification_list_get_next(noti_list); + continue; + } + EM_DEBUG_LOG("account_id_str: [%s]", account_id_str); + EM_DEBUG_LOG("noti_type_str: [%s]", noti_type_str); + // noti_type_str: NEW_MAIL_SINGLE, NEW_MAIL_MULTI, SENT, SENT_FAIL, SENDING + if (account_id_str && (atoi(account_id_str) == account_id)) { + if (!g_strcmp0(noti_type_str, __NOTI_NEW_MAIL_SINGLE) || + !g_strcmp0(noti_type_str, __NOTI_NEW_MAIL_MULTI) || + !g_strcmp0(noti_type_str, __NOTI_SENT)) { + // normal notification + noti_to_be_deleted = noti; + } else if (with_noti_tray && !g_strcmp0(noti_type_str, __NOTI_SENDING)) { + // sending ongoing notification + noti_to_be_deleted = noti; + } else if (!g_strcmp0(noti_type_str, __NOTI_SENT_FAIL)) { + // sent failed notification + if (is_delete_sent_fail_noti) { + noti_to_be_deleted = noti; + } else { + const char *error_str = bundle_get_val(noti_args, "SENDING_ERROR"); + EM_DEBUG_LOG("There is a notification for sending error, not clear this notification [%s].", error_str); + } + } + } + + if (noti_to_be_deleted) { + noti_list = notification_list_remove(noti_list, noti_to_be_deleted); + notification_delete(noti_to_be_deleted); + noti_to_be_deleted = NULL; + // maintain head pointer for free + head_noti_list = notification_list_get_head(head_noti_list); + } else { + // maintain head pointer for free + head_noti_list = notification_list_get_head(head_noti_list); + noti_list = notification_list_get_next(noti_list); } + noti_args = NULL; } + +FINISH_OFF: + if (head_noti_list) + notification_free_list(head_noti_list); #endif /* __FEATURE_NOTIFICATION_ENABLE__ */ EM_DEBUG_FUNC_END(); return error_code; diff --git a/email-core/email-storage/email-storage.c b/email-core/email-storage/email-storage.c index ff45094..250fe2a 100755 --- a/email-core/email-storage/email-storage.c +++ b/email-core/email-storage/email-storage.c @@ -11332,6 +11332,7 @@ INTERNAL_FUNC int emstorage_free_attachment(emstorage_attachment_tbl_t** attachm INTERNAL_FUNC int emstorage_begin_transaction(char *multi_user_name, void *d1, void *d2, int *err_code) { + EM_DEBUG_FUNC_BEGIN(); EM_PROFILE_BEGIN(emStorageBeginTransaction); int ret = true; diff --git a/email-core/include/email-core-utils.h b/email-core/include/email-core-utils.h index 33c8663..ae4aa0e 100755 --- a/email-core/include/email-core-utils.h +++ b/email-core/include/email-core-utils.h @@ -110,7 +110,7 @@ INTERNAL_FUNC int emcore_add_notification(char *multi_user_name, int account_id, INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int account_id, int mail_id, email_action_t action, int sending_error, unsigned long display); INTERNAL_FUNC void emcore_update_notification_for_send(int account_id, int mail_id, double progress); INTERNAL_FUNC int emcore_delete_notification_for_read_mail(int mail_id); -INTERNAL_FUNC int emcore_delete_notification_by_account(char *multi_user_name, int account_id, int with_noti_tray); +INTERNAL_FUNC int emcore_delete_notification_by_account(char *multi_user_name, int account_id, int with_noti_tray, int is_delete_sent_fail_noti); INTERNAL_FUNC int emcore_show_user_message(char *multi_user_name, int id, email_action_t action, int error); -- cgit v1.2.3 From 2968685d9a495802dc4d0eadcd457a1d25656f19 Mon Sep 17 00:00:00 2001 From: San Cho Date: Mon, 13 Jun 2016 12:28:42 +0900 Subject: New mails notification is merged with sending email notification in quick panel. [Problem] New mails notification is merged with sending email notification in quick panel. [Cause & Measure] Cause: notification private id was shared with new mail notification and sending mail notification. Measure: remove using private id for sending mail nofitifcation. Change-Id: Icf625efd6692167c3e0f6ac94d7d2d7bac5912d7 (cherry picked from commit 1a31fab290be58ba30247599c2b0d918f874b0be) --- email-core/email-core-utils.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/email-core/email-core-utils.c b/email-core/email-core-utils.c index ad92011..ac10553 100755 --- a/email-core/email-core-utils.c +++ b/email-core/email-core-utils.c @@ -1958,13 +1958,14 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac goto FINISH_OFF; } - if ((noti_err = notification_insert(noti, &private_id)) != NOTIFICATION_ERROR_NONE) { + if ((noti_err = notification_insert(noti, NULL)) != NOTIFICATION_ERROR_NONE) { EM_DEBUG_EXCEPTION("notification_insert failed [%d]", noti_err); err = EMAIL_ERROR_NOTI; goto FINISH_OFF; } g_sending_noti_handle = noti; +#if 0 EM_DEBUG_LOG("Private_id = [%d]", private_id); SNPRINTF(vconf_private_id, sizeof(vconf_private_id), "%s/%d", VCONF_KEY_NOTI_PRIVATE_ID, account_id); @@ -1973,6 +1974,7 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac err = EMAIL_ERROR_GCONF_FAILURE; goto FINISH_OFF; } +#endif break; @@ -2025,17 +2027,9 @@ INTERNAL_FUNC void emcore_update_notification_for_send(int account_id, int mail_ { EM_DEBUG_FUNC_BEGIN("account_id: %d, mail_id: %d, progress: %f", account_id, mail_id, progress); - int private_id = 0; - char vconf_private_id[MAX_PATH] = {0, }; notification_error_e noti_err = NOTIFICATION_ERROR_NONE; - SNPRINTF(vconf_private_id, sizeof(vconf_private_id), "%s/%d", VCONF_KEY_NOTI_PRIVATE_ID, account_id); - if (vconf_get_int(vconf_private_id, &private_id) != 0) { - EM_DEBUG_EXCEPTION("vconf_get_int failed"); - } - - EM_DEBUG_LOG("Private_id = [%d]", private_id); - noti_err = notification_update_progress(g_sending_noti_handle, private_id, progress); + noti_err = notification_update_progress(g_sending_noti_handle, NOTIFICATION_PRIV_ID_NONE, progress); if (noti_err != NOTIFICATION_ERROR_NONE) { EM_DEBUG_LOG("notification_update_progress failed [0x%x]", noti_err); } @@ -3352,12 +3346,12 @@ INTERNAL_FUNC int emcore_clear_notifications(char *multi_user_name, int account_ } for(i = 0; i < account_count; i++) { - error_code = emcore_delete_notification_by_account(multi_user_name, account_list[i].account_id, true, false); + error_code = emcore_delete_notification_by_account(multi_user_name, account_list[i].account_id, false, false); if (error_code != EMAIL_ERROR_NONE) EM_DEBUG_EXCEPTION("emcore_delete_notification_by_account failed"); } } else { - error_code = emcore_delete_notification_by_account(multi_user_name, account_id, true, false); + error_code = emcore_delete_notification_by_account(multi_user_name, account_id, false, false); if (error_code != EMAIL_ERROR_NONE) EM_DEBUG_EXCEPTION("emcore_delete_notification_by_account failed"); } -- cgit v1.2.3 From 06abd6c49312a7a3afce4d5b9907ea33df96a2b0 Mon Sep 17 00:00:00 2001 From: San Cho Date: Wed, 15 Jun 2016 10:55:13 +0900 Subject: new mail notification was removed after sending mail failed notification occurred Change-Id: I8ca65c36ea87a906abd9721e835251371c120cc5 Signed-off-by: intae, jeon (cherry picked from commit f707d25cb50c04f312aa92f84809b4ee6e10212d) --- email-core/email-core-account.c | 2 +- email-core/email-core-utils.c | 58 +++++++++-------------------------- email-core/include/email-core-utils.h | 2 +- 3 files changed, 17 insertions(+), 45 deletions(-) diff --git a/email-core/email-core-account.c b/email-core/email-core-account.c index 74a164f..dac6d42 100755 --- a/email-core/email-core-account.c +++ b/email-core/email-core-account.c @@ -532,7 +532,7 @@ INTERNAL_FUNC int emcore_delete_account(char *multi_user_name, int account_id, i } emcore_display_unread_in_badge(multi_user_name); - emcore_delete_notification_by_account(multi_user_name, account_id, true, true); + emcore_delete_notification_by_account(multi_user_name, account_id, true, true, true); ret = true; diff --git a/email-core/email-core-utils.c b/email-core/email-core-utils.c index ac10553..0d1bc43 100755 --- a/email-core/email-core-utils.c +++ b/email-core/email-core-utils.c @@ -1715,12 +1715,7 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac } /* Delete the previous noti */ - emcore_delete_notification_by_account(multi_user_name, account_id, true, true); - if (g_sending_noti_handle) { - if ((noti_err = notification_free(g_sending_noti_handle)) != NOTIFICATION_ERROR_NONE) - err = EMAIL_ERROR_NOTI; - g_sending_noti_handle = NULL; - } + emcore_delete_notification_by_account(multi_user_name, account_id, false, true, true); if ((err = emcore_set_join_zone(multi_user_name, &join_zone)) != EMAIL_ERROR_NONE) { EM_DEBUG_EXCEPTION("emcore_set_join_zone failed : [%d]", err); @@ -1901,21 +1896,12 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac goto FINISH_OFF; } - if ((noti_err = notification_insert(noti, &private_id)) != NOTIFICATION_ERROR_NONE) { + if ((noti_err = notification_insert(noti, NULL)) != NOTIFICATION_ERROR_NONE) { EM_DEBUG_EXCEPTION("notification_insert failed [%d]", noti_err); err = EMAIL_ERROR_NOTI; goto FINISH_OFF; } - EM_DEBUG_LOG("Private_id = [%d]", private_id); - - SNPRINTF(vconf_private_id, sizeof(vconf_private_id), "%s/%d", VCONF_KEY_NOTI_PRIVATE_ID, account_id); - if (vconf_set_int(vconf_private_id, private_id) != 0) { - EM_DEBUG_EXCEPTION("vconf_set_int failed"); - err = EMAIL_ERROR_GCONF_FAILURE; - goto FINISH_OFF; - } - break; case EMAIL_ACTION_SENDING_MAIL: @@ -1965,17 +1951,6 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac } g_sending_noti_handle = noti; -#if 0 - EM_DEBUG_LOG("Private_id = [%d]", private_id); - - SNPRINTF(vconf_private_id, sizeof(vconf_private_id), "%s/%d", VCONF_KEY_NOTI_PRIVATE_ID, account_id); - if (vconf_set_int (vconf_private_id, private_id) != 0) { - EM_DEBUG_EXCEPTION("vconf_set_int failed"); - err = EMAIL_ERROR_GCONF_FAILURE; - goto FINISH_OFF; - } -#endif - break; default: @@ -3346,12 +3321,12 @@ INTERNAL_FUNC int emcore_clear_notifications(char *multi_user_name, int account_ } for(i = 0; i < account_count; i++) { - error_code = emcore_delete_notification_by_account(multi_user_name, account_list[i].account_id, false, false); + error_code = emcore_delete_notification_by_account(multi_user_name, account_list[i].account_id, true, false, false); if (error_code != EMAIL_ERROR_NONE) EM_DEBUG_EXCEPTION("emcore_delete_notification_by_account failed"); } } else { - error_code = emcore_delete_notification_by_account(multi_user_name, account_id, false, false); + error_code = emcore_delete_notification_by_account(multi_user_name, account_id, true, false, false); if (error_code != EMAIL_ERROR_NONE) EM_DEBUG_EXCEPTION("emcore_delete_notification_by_account failed"); } @@ -3372,10 +3347,10 @@ FINISH_OFF: } #define EAS_EXECUTABLE_PATH "/usr/bin/eas-engine" - -INTERNAL_FUNC int emcore_delete_notification_by_account(char *multi_user_name, int account_id, int with_noti_tray, int is_delete_sent_fail_noti) +/* TODO this function will modify with bit flag */ +INTERNAL_FUNC int emcore_delete_notification_by_account(char *multi_user_name, int account_id, int is_delete_new_mail_noti, int is_delete_sending_noti, int is_delete_sent_fail_noti) { - EM_DEBUG_FUNC_BEGIN("account_id [%d], with_noti_tray [%d], is_delete_sent_fail_noti: [%d]", account_id, with_noti_tray, is_delete_sent_fail_noti); + EM_DEBUG_FUNC_BEGIN("account_id [%d], is_delete_new_mail_noti[%d], is_delete_sending_noti[%d], is_delete_sent_fail_noti: [%d]", account_id, is_delete_new_mail_noti, is_delete_sending_noti, is_delete_sent_fail_noti); int error_code = EMAIL_ERROR_NONE; #ifdef __FEATURE_NOTIFICATION_ENABLE__ @@ -3414,22 +3389,19 @@ INTERNAL_FUNC int emcore_delete_notification_by_account(char *multi_user_name, i EM_DEBUG_LOG("noti_type_str: [%s]", noti_type_str); // noti_type_str: NEW_MAIL_SINGLE, NEW_MAIL_MULTI, SENT, SENT_FAIL, SENDING if (account_id_str && (atoi(account_id_str) == account_id)) { - if (!g_strcmp0(noti_type_str, __NOTI_NEW_MAIL_SINGLE) || + + if (is_delete_new_mail_noti && + (!g_strcmp0(noti_type_str, __NOTI_NEW_MAIL_SINGLE) || !g_strcmp0(noti_type_str, __NOTI_NEW_MAIL_MULTI) || - !g_strcmp0(noti_type_str, __NOTI_SENT)) { + !g_strcmp0(noti_type_str, __NOTI_SENT))) { // normal notification noti_to_be_deleted = noti; - } else if (with_noti_tray && !g_strcmp0(noti_type_str, __NOTI_SENDING)) { + } else if (is_delete_sending_noti && !g_strcmp0(noti_type_str, __NOTI_SENDING)) { // sending ongoing notification noti_to_be_deleted = noti; - } else if (!g_strcmp0(noti_type_str, __NOTI_SENT_FAIL)) { - // sent failed notification - if (is_delete_sent_fail_noti) { - noti_to_be_deleted = noti; - } else { - const char *error_str = bundle_get_val(noti_args, "SENDING_ERROR"); - EM_DEBUG_LOG("There is a notification for sending error, not clear this notification [%s].", error_str); - } + g_sending_noti_handle = NULL; + } else if (is_delete_sent_fail_noti && !g_strcmp0(noti_type_str, __NOTI_SENT_FAIL)) { + noti_to_be_deleted = noti; } } diff --git a/email-core/include/email-core-utils.h b/email-core/include/email-core-utils.h index ae4aa0e..c99190f 100755 --- a/email-core/include/email-core-utils.h +++ b/email-core/include/email-core-utils.h @@ -110,7 +110,7 @@ INTERNAL_FUNC int emcore_add_notification(char *multi_user_name, int account_id, INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int account_id, int mail_id, email_action_t action, int sending_error, unsigned long display); INTERNAL_FUNC void emcore_update_notification_for_send(int account_id, int mail_id, double progress); INTERNAL_FUNC int emcore_delete_notification_for_read_mail(int mail_id); -INTERNAL_FUNC int emcore_delete_notification_by_account(char *multi_user_name, int account_id, int with_noti_tray, int is_delete_sent_fail_noti); +INTERNAL_FUNC int emcore_delete_notification_by_account(char *multi_user_name, int account_id, int is_delete_new_mail_noti, int is_delete_sending_noti, int is_delete_sent_fail_noti); INTERNAL_FUNC int emcore_show_user_message(char *multi_user_name, int id, email_action_t action, int error); -- cgit v1.2.3 From 53ecd61f6c7f74d6886ebb072917b3a20d8083a0 Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Thu, 10 Nov 2016 09:53:06 +0900 Subject: fix jira issue[TSAM9784] for notification Change-Id: Ide1d5325934623eb512c8f160d4472ec75e93fcd Signed-off-by: intae, jeon (cherry picked from commit 9e99a40ce1372b9f9a39e1aac36ffcde60418ce0) --- email-core/email-core-auto-download.c | 1 - email-core/email-core-smtp.c | 2 - email-core/email-core-utils.c | 79 +++++++++++++++++++++++++++++++++-- email-daemon/email-daemon-event.c | 2 +- 4 files changed, 76 insertions(+), 8 deletions(-) diff --git a/email-core/email-core-auto-download.c b/email-core/email-core-auto-download.c index 7f5d045..7a4cb6e 100755 --- a/email-core/email-core-auto-download.c +++ b/email-core/email-core-auto-download.c @@ -494,7 +494,6 @@ CHECK_CONTINUE: LEAVE_RECURSIVE_CRITICAL_SECTION(_auto_download_queue_lock); EM_DEBUG_LOG_DEV(">>>>>>>>>>>>>>> Got auto download event_data !!! <<<<<<<<<<<<<<<"); int state1 = 0, state2 = 0, state3 = 0, wifi_status = 0; - char uid_str[50] = {0, }; emstorage_mail_tbl_t *mail = NULL; emstorage_mailbox_tbl_t *target_mailbox = NULL; email_account_t *account_ref = NULL; diff --git a/email-core/email-core-smtp.c b/email-core/email-core-smtp.c index 2e5dba4..8e41b93 100755 --- a/email-core/email-core-smtp.c +++ b/email-core/email-core-smtp.c @@ -1695,7 +1695,6 @@ INTERNAL_FUNC int emcore_send_mail(char *multi_user_name, int mail_id, int *err_ emstorage_read_mail_uid_tbl_t *downloaded_mail = NULL; int dst_mailbox_id = 0; int total_mail_size = 0; - int sent_flag = 0; char *server_uid = NULL; MAILSTREAM *mail_stream = NULL; @@ -1896,7 +1895,6 @@ INTERNAL_FUNC int emcore_send_mail(char *multi_user_name, int mail_id, int *err_ goto FINISH_OFF; } - sent_flag = 1; /* sent mail is moved to 'SENT' box or deleted. */ if (opt->keep_local_copy) { diff --git a/email-core/email-core-utils.c b/email-core/email-core-utils.c index 0d1bc43..e473f20 100755 --- a/email-core/email-core-utils.c +++ b/email-core/email-core-utils.c @@ -1149,7 +1149,6 @@ static int emcore_layout_single_noti(notification_h noti, char *account_name, in { EM_DEBUG_FUNC_BEGIN(); notification_error_e noti_err = NOTIFICATION_ERROR_NONE; - noti_err = notification_set_layout(noti, NOTIFICATION_LY_NOTI_EVENT_SINGLE); if (noti_err != NOTIFICATION_ERROR_NONE) { EM_DEBUG_EXCEPTION("notification_set_layout NOTI_EVENT_SINGLE failed [%d]", noti_err); @@ -1378,6 +1377,73 @@ FINISH_OFF: } #endif +static int __emcore_show_new_mail_noti(void) +{ + EM_DEBUG_FUNC_BEGIN(); + notification_h noti = NULL; + notification_error_e noti_err = NOTIFICATION_ERROR_NONE; + + int err = EMAIL_ERROR_NONE; + + noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE); + if (noti == NULL) { + EM_DEBUG_EXCEPTION("notification_new failed"); + err = EMAIL_ERROR_SYSTEM_FAILURE; + goto FINISH_OFF; + } + if ((noti_err = notification_set_pkgname(noti, NATIVE_EMAIL_APPLICATION_PKG)) != NOTIFICATION_ERROR_NONE) { + EM_DEBUG_EXCEPTION("notification_set_pkgname failed [%d]", noti_err); + err = EMAIL_ERROR_SYSTEM_FAILURE; + goto FINISH_OFF; + } + + if ((noti_err = notification_set_text_domain(noti, NATIVE_EMAIL_DOMAIN, tzplatform_mkpath(TZ_SYS_RO_APP,"org.tizen.email/res/locale"))) != NOTIFICATION_ERROR_NONE) { + EM_DEBUG_EXCEPTION("notification_set_text_domain failed [%d]", noti_err); + err = EMAIL_ERROR_SYSTEM_FAILURE; + goto FINISH_OFF; + } + + + if ((noti_err = notification_set_layout(noti, NOTIFICATION_LY_NOTI_EVENT_SINGLE)) != NOTIFICATION_ERROR_NONE) { + EM_DEBUG_EXCEPTION("notification_set_layout failed [%d]", noti_err); + err = EMAIL_ERROR_NOTI; + goto FINISH_OFF; + } + + if ((noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, EMAIL_NOTI_ICON_PATH)) != NOTIFICATION_ERROR_NONE) { + EM_DEBUG_EXCEPTION("notification_set_image failed [%d]", noti_err); + err = EMAIL_ERROR_NOTI; + goto FINISH_OFF; + } + + if ((noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, "New email", "IDS_EMAIL_TPOP_NEW_EMAIL_RECEIVED_ABB", NOTIFICATION_VARIABLE_TYPE_NONE)) != NOTIFICATION_ERROR_NONE) { + EM_DEBUG_EXCEPTION("notification_set_text failed [%d]", noti_err); + err = EMAIL_ERROR_SYSTEM_FAILURE; + goto FINISH_OFF; + } + + + if ((noti_err = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_TICKER)) != NOTIFICATION_ERROR_NONE) { + EM_DEBUG_EXCEPTION("notification_insert failed [%d]", noti_err); + err = EMAIL_ERROR_SYSTEM_FAILURE; + goto FINISH_OFF; + } + + if ((noti_err = notification_insert(noti, NULL)) != NOTIFICATION_ERROR_NONE) { + EM_DEBUG_EXCEPTION("notification_insert failed [%d]", noti_err); + err = EMAIL_ERROR_SYSTEM_FAILURE; + goto FINISH_OFF; + } + +FINISH_OFF: + if (noti) + notification_free(noti); + + EM_DEBUG_FUNC_END("ret [%d]", err); + return err; +} + + INTERNAL_FUNC int emcore_add_notification(char *multi_user_name, int account_id, int mail_id, int unread_mail_count, int vip_unread_mail_count, int input_play_alert_tone, int sending_error, unsigned long display) { @@ -1425,6 +1491,7 @@ INTERNAL_FUNC int emcore_add_notification(char *multi_user_name, int account_id, } unseen = unread_mail_count_t; + display_status = account_tbl->options.display_content_status; /* Load the previous noti */ @@ -1607,12 +1674,18 @@ INTERNAL_FUNC int emcore_add_notification(char *multi_user_name, int account_id, /* err = EMAIL_ERROR_PRIORITY_SENDER_MAIL_NOT_FOUND;*/ /*there is no mail for priority sender*/ } - if ((noti_err = notification_set_display_applist(noti, display)) != NOTIFICATION_ERROR_NONE) { + if ((noti_err = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_LOCK )) != NOTIFICATION_ERROR_NONE) { EM_DEBUG_EXCEPTION("notification_insert failed [%d]", noti_err); err = EMAIL_ERROR_SYSTEM_FAILURE; goto FINISH_OFF; } + if ((err = __emcore_show_new_mail_noti()) != EMAIL_ERROR_NONE){ + EM_DEBUG_EXCEPTION("notification new_mail ticker failed!!"); + + } + + if (new_noti) { if ((noti_err = notification_insert(noti, &private_id)) != NOTIFICATION_ERROR_NONE) { EM_DEBUG_EXCEPTION("notification_insert failed [%d]", noti_err); @@ -1683,11 +1756,9 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac EM_DEBUG_FUNC_BEGIN("account_id: %d, mail_id: %d, action:%d", account_id, mail_id, action); int err = EMAIL_ERROR_NONE; #ifdef __FEATURE_NOTIFICATION_ENABLE__ - int private_id = 0; void *join_zone = NULL; char *mailbox_name = NULL; /* char *dgettext_string = NULL; */ - char vconf_private_id[MAX_PATH] = {0, }; notification_h noti = NULL; notification_error_e noti_err = NOTIFICATION_ERROR_NONE; emstorage_mail_tbl_t *p_mail_data = NULL; diff --git a/email-daemon/email-daemon-event.c b/email-daemon/email-daemon-event.c index cef3a18..e973dfb 100644 --- a/email-daemon/email-daemon-event.c +++ b/email-daemon/email-daemon-event.c @@ -2042,7 +2042,7 @@ static gpointer partial_body_download_thread(gpointer data) int err = EMAIL_ERROR_NONE; email_session_t *session = NULL; email_event_partial_body_thd partial_body_thd_event; - int i, account_count = 0; + int account_count = 0; emstorage_account_tbl_t *account_list = NULL; int event_que_state = 0; int send_event_que_state = 0; -- cgit v1.2.3 From 8bac706046f1d8f02aaab633ad22c3e5e1b71896 Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Wed, 9 Nov 2016 09:54:38 +0900 Subject: change UX concept for notification Change-Id: Icb2f4beacee793f21fd2b4be2e1c404594abd68d Signed-off-by: intae, jeon (cherry picked from commit f794e9227ace502687ab2d1d1bee1b9044a53c6f) --- email-core/email-core-utils.c | 81 +++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 29 deletions(-) diff --git a/email-core/email-core-utils.c b/email-core/email-core-utils.c index e473f20..71b280c 100755 --- a/email-core/email-core-utils.c +++ b/email-core/email-core-utils.c @@ -1751,6 +1751,17 @@ FINISH_OFF: return err; } +static gboolean __on_timer_delete_notification(gpointer userdata) +{ + int private_id = (int)userdata; + notification_error_e noti_err = NOTIFICATION_ERROR_NONE; + if ((noti_err = notification_delete_by_priv_id(NATIVE_EMAIL_APPLICATION_PKG, NOTIFICATION_TYPE_NOTI, private_id)) != NOTIFICATION_ERROR_NONE) { + EM_DEBUG_EXCEPTION("notification delete fail!!"); + } + + return false; +} + INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int account_id, int mail_id, email_action_t action, int sending_error, unsigned long display) { EM_DEBUG_FUNC_BEGIN("account_id: %d, mail_id: %d, action:%d", account_id, mail_id, action); @@ -1763,7 +1774,7 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac notification_error_e noti_err = NOTIFICATION_ERROR_NONE; emstorage_mail_tbl_t *p_mail_data = NULL; emstorage_account_tbl_t *account_tbl = NULL; - + int private_id = 0; /* For service bundle */ char buf[256] = {0,}; app_control_h service = NULL; @@ -1815,39 +1826,45 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac goto FINISH_OFF; } - /* Create service bundle */ + app_control_create(&service); if (!service) { EM_DEBUG_EXCEPTION("service create failed"); } - snprintf(buf, sizeof(buf), "%d", 12); - app_control_add_extra_data(service, "RUN_TYPE", buf); - snprintf(buf, sizeof(buf), "%d", account_id); - app_control_add_extra_data(service, "ACCOUNT_ID", buf); - snprintf(buf, sizeof(buf), "%d", p_mail_data->mail_id); - app_control_add_extra_data(service, "MAIL_ID", buf); - snprintf(buf, sizeof(buf), "%d", p_mail_data->mailbox_id); - app_control_add_extra_data(service, "MAILBOX_ID", buf); - snprintf(buf, sizeof(buf), "%d", sending_error); - app_control_add_extra_data(service, "SENDING_ERROR", buf); - if (sending_error == EMAIL_ERROR_NONE) { - if (action == EMAIL_ACTION_SEND_MAIL) - snprintf(buf, sizeof(buf), "%s", __NOTI_SENT); - else if (action == EMAIL_ACTION_SENDING_MAIL) - snprintf(buf, sizeof(buf), "%s", __NOTI_SENDING); - } else { - snprintf(buf, sizeof(buf), "%s", __NOTI_SENT_FAIL); - } - app_control_add_extra_data(service, "NOTI_TYPE", buf); - app_control_set_app_id(service, NATIVE_EMAIL_APPLICATION_PKG); + /* Create service bundle */ + if (sending_error != EMAIL_ERROR_NONE || action == EMAIL_ACTION_SENDING_MAIL) { - app_control_to_bundle(service, &b); - noti_err = notification_set_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, b); - if (noti_err != NOTIFICATION_ERROR_NONE) { - EM_DEBUG_EXCEPTION("notification_set_execute_option failed [%d]", noti_err); - err = EMAIL_ERROR_SYSTEM_FAILURE; - goto FINISH_OFF; + snprintf(buf, sizeof(buf), "%d", 12); + app_control_add_extra_data(service, "RUN_TYPE", buf); + snprintf(buf, sizeof(buf), "%d", account_id); + app_control_add_extra_data(service, "ACCOUNT_ID", buf); + snprintf(buf, sizeof(buf), "%d", p_mail_data->mail_id); + app_control_add_extra_data(service, "MAIL_ID", buf); + snprintf(buf, sizeof(buf), "%d", p_mail_data->mailbox_id); + app_control_add_extra_data(service, "MAILBOX_ID", buf); + + app_control_set_app_id(service, NATIVE_EMAIL_APPLICATION_PKG); + + + snprintf(buf, sizeof(buf), "%d", sending_error); + app_control_add_extra_data(service, "SENDING_ERROR", buf); + if (sending_error == EMAIL_ERROR_NONE) { + if (action == EMAIL_ACTION_SENDING_MAIL) + snprintf(buf, sizeof(buf), "%s", __NOTI_SENDING); + } else { + snprintf(buf, sizeof(buf), "%s", __NOTI_SENT_FAIL); + } + app_control_add_extra_data(service, "NOTI_TYPE", buf); + app_control_set_app_id(service, NATIVE_EMAIL_APPLICATION_PKG); + + app_control_to_bundle(service, &b); + noti_err = notification_set_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, b); + if (noti_err != NOTIFICATION_ERROR_NONE) { + EM_DEBUG_EXCEPTION("notification_set_execute_option failed [%d]", noti_err); + err = EMAIL_ERROR_SYSTEM_FAILURE; + goto FINISH_OFF; + } } switch (action) { @@ -1914,6 +1931,8 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac switch (sending_error) { case EMAIL_ERROR_NONE: + notification_set_property(noti,NOTIFICATION_PROP_DISABLE_AUTO_DELETE); + if ((noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, "Email Sent", @@ -1967,12 +1986,16 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac goto FINISH_OFF; } - if ((noti_err = notification_insert(noti, NULL)) != NOTIFICATION_ERROR_NONE) { + if ((noti_err = notification_insert(noti, &private_id)) != NOTIFICATION_ERROR_NONE) { EM_DEBUG_EXCEPTION("notification_insert failed [%d]", noti_err); err = EMAIL_ERROR_NOTI; goto FINISH_OFF; } + if (sending_error == EMAIL_ERROR_NONE) { + g_timeout_add_seconds(3, __on_timer_delete_notification, private_id); + } + break; case EMAIL_ACTION_SENDING_MAIL: -- cgit v1.2.3 From 9da5a97be7e57a24c71d2fecf896fa2c2f722d35 Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Wed, 9 Nov 2016 15:00:09 +0900 Subject: fix spec for email booting policy Change-Id: I4aecf71130b41095e6604a2f467bab2cc4fb41e9 Signed-off-by: intae, jeon (cherry picked from commit 898ce6ddba2ea5e19ce4968bd4e08735abeb3c47) --- email-daemon/email-daemon-init.c | 8 ++++++++ packaging/email-service.spec | 3 +++ 2 files changed, 11 insertions(+) diff --git a/email-daemon/email-daemon-init.c b/email-daemon/email-daemon-init.c index 427f0b1..f61de58 100755 --- a/email-daemon/email-daemon-init.c +++ b/email-daemon/email-daemon-init.c @@ -320,6 +320,14 @@ static void callback_for_NETWORK_STATUS(connection_type_e new_conn_type, void *i goto FINISH_OFF; } + /* initialize imap idle connection if network connection type is changed */ + if (conn_type != new_conn_type) { + + EM_DEBUG_LOG("connection type is changed. initializing imap idle connection"); + emcore_refresh_imap_idle_thread(); + + } + for (i = 0; i < account_count ; i++) { account_info = account_list + i; /* check if inbox folder sync is finished */ diff --git a/packaging/email-service.spec b/packaging/email-service.spec index 8203d84..9aeff34 100755 --- a/packaging/email-service.spec +++ b/packaging/email-service.spec @@ -120,7 +120,9 @@ cp -f res/%{name}.sql %{buildroot}%{upgrade_data_path} %make_install mkdir -p %{buildroot}%{_unitdir_user} +mkdir -p %{buildroot}%{_unitdir_user}/basic.target.wants install -m 0644 %{SOURCE4} %{buildroot}%{_unitdir_user}/email-service.service +ln -s ../email-service.service %{buildroot}%{_unitdir_user}/basic.target.wants/email-service.service mkdir -p %{buildroot}%{_unitdir_user}/sockets.target.wants install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir_user}/email-service.socket @@ -160,6 +162,7 @@ systemctl daemon-reload %{_bindir}/email-service %{_libdir}/lib*.so.* %{_unitdir_user}/email-service.service +%{_unitdir_user}/basic.target.wants/email-service.service %{_unitdir_user}/email-service.socket %{_unitdir_user}/sockets.target.wants/email-service.socket %{_datarootdir}/dbus-1/services/email-service.service -- cgit v1.2.3 From b4a55592b4ef79dd70e8f5b60df9f8edce83425d Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Thu, 24 Nov 2016 15:03:35 +0900 Subject: fix build warning Change-Id: I1749cb0191242c91af312da69fffcb1bda34d020 Signed-off-by: intae, jeon (cherry picked from commit b7e16c4f63ebfdccb7671b9916de93a7fb740f4d) --- email-core/email-core-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/email-core/email-core-utils.c b/email-core/email-core-utils.c index 71b280c..845df27 100755 --- a/email-core/email-core-utils.c +++ b/email-core/email-core-utils.c @@ -1993,7 +1993,7 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac } if (sending_error == EMAIL_ERROR_NONE) { - g_timeout_add_seconds(3, __on_timer_delete_notification, private_id); + g_timeout_add_seconds(3, __on_timer_delete_notification, (gpointer)private_id); } break; -- cgit v1.2.3 From 3c899c715ff93b37fed2e25d3d67f1310240c1ab Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Wed, 30 Nov 2016 09:50:28 +0900 Subject: cannot read draft mail because of error of sorting events with priority(TSAM_10281) Change-Id: Ic5d5add678ff366a3c1719e5e9ab678bfdf2d452 Signed-off-by: intae, jeon (cherry picked from commit 4e45fc2774fab08603b2e0bfa15fb40a7bd6c8b5) --- email-core/email-core-event.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/email-core/email-core-event.c b/email-core/email-core-event.c index 699443c..67bf84e 100755 --- a/email-core/email-core-event.c +++ b/email-core/email-core-event.c @@ -1694,7 +1694,8 @@ static void emcore_adjust_sync_mail_flag_event_priority() // find sync flag event. for (i = 0; i < q_length; i++) { email_event_t *p = g_queue_peek_nth(g_event_que, i); - if (p->type == EMAIL_EVENT_SYNC_FLAGS_FIELD_TO_SERVER) { + // working element is index = 0, except working element + if (p->type == EMAIL_EVENT_SYNC_FLAGS_FIELD_TO_SERVER && i > 0) { sync_flag_event_list = g_list_append(sync_flag_event_list, p); } } -- cgit v1.2.3 From 53f0086b88036c397daea03a531962501731e9d3 Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Wed, 30 Nov 2016 14:04:00 +0900 Subject: fix svace issue Change-Id: Ibb1a91e4474800fca68b22fbca2c3bdc9f8d875c Signed-off-by: intae, jeon (cherry picked from commit ee0c4458745cae78c3e0e0e2267907b7ebae82b5) --- email-ipc/email-socket/email-ipc-socket.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/email-ipc/email-socket/email-ipc-socket.c b/email-ipc/email-socket/email-ipc-socket.c index f692a18..9916f3b 100755 --- a/email-ipc/email-socket/email-ipc-socket.c +++ b/email-ipc/email-socket/email-ipc-socket.c @@ -219,6 +219,11 @@ EXPORT_API int emipc_open_email_socket(int fd, const char *path) SNPRINTF(uid_string, sizeof(uid_string), "%d", getuid()); ipc_socket_path = g_strconcat(EM_SOCKET_USER_PATH, "/", uid_string, "/", EM_SOCKET_PATH_NAME, NULL); + if (NULL == ipc_socket_path) { + EM_DEBUG_EXCEPTION("ipc_socket_path is null"); + return EMAIL_ERROR_SYSTEM_FAILURE; + } + if (strcmp(path, ipc_socket_path) == 0 && sd_listen_fds(1) == 1 && sd_is_socket_unix(SD_LISTEN_FDS_START, SOCK_SEQPACKET, -1, ipc_socket_path, 0) > 0) { @@ -296,6 +301,12 @@ EXPORT_API int emipc_connect_email_socket(int fd) memset(&server, 0, sizeof(server)); server.sun_family = AF_UNIX; + + if (NULL == ipc_socket_path) { + EM_DEBUG_EXCEPTION("ipc_socket_path is null"); + return EMAIL_ERROR_SYSTEM_FAILURE; + } + strncpy(server.sun_path, ipc_socket_path, sizeof(server.sun_path)-1); EM_SAFE_FREE(ipc_socket_path); -- cgit v1.2.3 From f08ff3d3f4d095a85d0644f83c2dd202950e8bbe Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Fri, 2 Dec 2016 14:31:55 +0900 Subject: modify upgrade shell script name Change-Id: Iefab0a0d8b38fa3205fbc44079e9404b474f53a1 Signed-off-by: intae, jeon --- 500.email-service.patch.sh | 49 -------------------------------------------- 500.email-service.sh | 49 ++++++++++++++++++++++++++++++++++++++++++++ packaging/email-service.spec | 4 ++-- 3 files changed, 51 insertions(+), 51 deletions(-) delete mode 100644 500.email-service.patch.sh create mode 100644 500.email-service.sh diff --git a/500.email-service.patch.sh b/500.email-service.patch.sh deleted file mode 100644 index 070de7c..0000000 --- a/500.email-service.patch.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -PATH=/bin:/usr/bin:/sbin:/usr/sbin - -#-------------------------------------------------# -# email-service patch for upgrade (2.4 -> 3.0) # -#-------------------------------------------------# - -# Macro -DB_DIR_24=/opt/usr/dbspace -DB_DIR_30=/opt/usr/home/owner/.applications/dbspace - -DB_FILE_24=$DB_DIR_24/.email-service.db -DB_FILE_30=$DB_DIR_30/.email-service.db - -DATA_DIR_24=/opt/usr/data -DATA_DIR_30=/opt/usr/home/owner/data - -EMSVC_DATA_24=$DATA_DIR_24/email -EMSVC_DATA_30=$DATA_DIR_30/email - -UPGRADE_DATA_DIR=/usr/share/upgrade/data -UPGRADE_DATA_FILE=$UPGRADE_DATA_DIR/email-service.sql - -EM_COMMON_DATA_30=/opt/data/email -EM_RES_DATA_30=$EM_COMMON_DATA_30/res - -# Make Directory -mkdir -p $DATA_DIR_30 -mkdir -p $EM_RES_DATA_30 - -# Move -mv $DB_FILE_24 $DB_FILE_30 -mv $EMSVC_DATA_24 $EMSVC_DATA_30 -mv $DB_FILE_24-journal $DB_FILE_30-journal -mv $UPGRADE_DATA_FILE $EM_RES_DATA_30 - -chown owner:users $DB_FILE_30 -chown owner:users $DATA_DIR_30 -chown -R owner:users $EMSVC_DATA_30 - -chsmack -a User::Home $DB_FILE_30 -chsmack -a User::Home $DB_FILE_30-journal -chsmack -a User::Home -t $EMSVC_DATA_30 - -find $EMSVC_DATA_30/.email_data -exec chsmack -a 'User::Home' {} \; -find $EMSVC_DATA_30/.email_data -type d -exec chsmack -t {} \; - -# Remove - diff --git a/500.email-service.sh b/500.email-service.sh new file mode 100644 index 0000000..070de7c --- /dev/null +++ b/500.email-service.sh @@ -0,0 +1,49 @@ +#!/bin/sh +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +#-------------------------------------------------# +# email-service patch for upgrade (2.4 -> 3.0) # +#-------------------------------------------------# + +# Macro +DB_DIR_24=/opt/usr/dbspace +DB_DIR_30=/opt/usr/home/owner/.applications/dbspace + +DB_FILE_24=$DB_DIR_24/.email-service.db +DB_FILE_30=$DB_DIR_30/.email-service.db + +DATA_DIR_24=/opt/usr/data +DATA_DIR_30=/opt/usr/home/owner/data + +EMSVC_DATA_24=$DATA_DIR_24/email +EMSVC_DATA_30=$DATA_DIR_30/email + +UPGRADE_DATA_DIR=/usr/share/upgrade/data +UPGRADE_DATA_FILE=$UPGRADE_DATA_DIR/email-service.sql + +EM_COMMON_DATA_30=/opt/data/email +EM_RES_DATA_30=$EM_COMMON_DATA_30/res + +# Make Directory +mkdir -p $DATA_DIR_30 +mkdir -p $EM_RES_DATA_30 + +# Move +mv $DB_FILE_24 $DB_FILE_30 +mv $EMSVC_DATA_24 $EMSVC_DATA_30 +mv $DB_FILE_24-journal $DB_FILE_30-journal +mv $UPGRADE_DATA_FILE $EM_RES_DATA_30 + +chown owner:users $DB_FILE_30 +chown owner:users $DATA_DIR_30 +chown -R owner:users $EMSVC_DATA_30 + +chsmack -a User::Home $DB_FILE_30 +chsmack -a User::Home $DB_FILE_30-journal +chsmack -a User::Home -t $EMSVC_DATA_30 + +find $EMSVC_DATA_30/.email_data -exec chsmack -a 'User::Home' {} \; +find $EMSVC_DATA_30/.email_data -type d -exec chsmack -t {} \; + +# Remove + diff --git a/packaging/email-service.spec b/packaging/email-service.spec index 9aeff34..c9bd06b 100755 --- a/packaging/email-service.spec +++ b/packaging/email-service.spec @@ -114,7 +114,7 @@ fi # OS upgrade mkdir -p %{buildroot}%{upgrade_script_path} mkdir -p %{buildroot}%{upgrade_data_path} -cp -f 500.%{name}.patch.sh %{buildroot}%{upgrade_script_path} +cp -f 500.%{name}.sh %{buildroot}%{upgrade_script_path} cp -f res/%{name}.sql %{buildroot}%{upgrade_data_path} %make_install @@ -171,7 +171,7 @@ systemctl daemon-reload %{_bindir}/email-service_init_db.sh # OS upgrade -%{upgrade_script_path}/500.%{name}.patch.sh +%{upgrade_script_path}/500.%{name}.sh %{upgrade_data_path}/%{name}.sql %files devel -- cgit v1.2.3 From 8433f7e024a97dc0f8ab1fc2f48bce835bfa471d Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Thu, 1 Dec 2016 14:35:40 +0900 Subject: fix wrong realloc(TSAM_10622) Change-Id: Icb6c3fbacadba7e4df57e3a57454bca385f37976 Signed-off-by: intae, jeon (cherry picked from commit dc3b5d82ca8f7982e6d7412981e8f3c9a0c698bc) --- email-core/email-core-account.c | 12 +++++++++++- email-core/email-core-task-manager.c | 25 +++++++++++++++++++------ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/email-core/email-core-account.c b/email-core/email-core-account.c index dac6d42..a8fde23 100755 --- a/email-core/email-core-account.c +++ b/email-core/email-core-account.c @@ -1409,7 +1409,17 @@ size_t emcore_curl_write_callback(char* data, size_t size, size_t nmemb, void* t last_pos = EM_SAFE_STRLEN(*result_string); new_buffer_length = last_pos + received_length + 1; EM_DEBUG_LOG("new_buffer_length[%d]", new_buffer_length); - *result_string = realloc(*result_string, new_buffer_length); + + char *new_result_string = NULL; + new_result_string = realloc(*result_string, new_buffer_length); + if (NULL == new_result_string) { + EM_DEBUG_EXCEPTION("memory reallocation failed"); + EM_SAFE_FREE(*result_string); + received_length = 0; + goto FINISH_OFF; + } + + *result_string = new_result_string; } if (*result_string == NULL) { diff --git a/email-core/email-core-task-manager.c b/email-core/email-core-task-manager.c index c7ef50e..de449ae 100755 --- a/email-core/email-core-task-manager.c +++ b/email-core/email-core-task-manager.c @@ -233,17 +233,30 @@ static int emcore_register_task_handler(email_task_type_t input_task_type, _task_handler_array_size++; if (_task_handler_array) { - _task_handler_array = realloc(_task_handler_array, sizeof(email_task_handler_t*) * _task_handler_array_size); + + email_task_handler_t **_new_task_handler_array = NULL; + + _new_task_handler_array = realloc(_task_handler_array, sizeof(email_task_handler_t*) * _task_handler_array_size); + if (NULL == _new_task_handler_array) { + EM_DEBUG_EXCEPTION("memory reallocation failed"); + err = EMAIL_ERROR_OUT_OF_MEMORY; + EM_SAFE_FREE(new_task_handler); + EM_SAFE_FREE(_task_handler_array); + goto FINISH_OFF; + } + + _task_handler_array = _new_task_handler_array; } else { _task_handler_array = malloc(sizeof(email_task_handler_t*) * _task_handler_array_size); - } - if (_task_handler_array == NULL) { - err = EMAIL_ERROR_OUT_OF_MEMORY; - EM_SAFE_FREE(new_task_handler); - goto FINISH_OFF; + if (_task_handler_array == NULL) { + err = EMAIL_ERROR_OUT_OF_MEMORY; + EM_SAFE_FREE(new_task_handler); + goto FINISH_OFF; + } } + _task_handler_array[_task_handler_array_size - 1] = new_task_handler; FINISH_OFF: -- cgit v1.2.3 From d16232c2bf0f27fb3d53ca12c3df7f07454907e4 Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Thu, 1 Dec 2016 12:50:03 +0900 Subject: fix uninitialized variable(TSAM_10623) Change-Id: Ic34a550f44aea231e27b53d5a4aff203e9d007b1 Signed-off-by: intae, jeon (cherry picked from commit d7b9143de40eb3a1ef66a7d9b46db1198ad04bbe) --- email-core/email-core-imap-mailbox.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/email-core/email-core-imap-mailbox.c b/email-core/email-core-imap-mailbox.c index c1349bf..4a96d77 100755 --- a/email-core/email-core-imap-mailbox.c +++ b/email-core/email-core-imap-mailbox.c @@ -1037,7 +1037,7 @@ FINISH_OFF: quota_t callback_for_get_quota_root(MAILSTREAM *stream, unsigned char *mailbox, STRINGLIST *quota_root_list) { EM_DEBUG_FUNC_BEGIN(); - quota_t ret_quota; + quota_t ret_quota = NIL; EM_DEBUG_FUNC_END(); return ret_quota; } @@ -1045,7 +1045,7 @@ quota_t callback_for_get_quota_root(MAILSTREAM *stream, unsigned char *mailbox, quota_t callback_for_get_quota(MAILSTREAM *stream, unsigned char *quota_root, QUOTALIST *quota_list) { EM_DEBUG_FUNC_BEGIN(); - quota_t ret_quota; + quota_t ret_quota = NIL; EM_DEBUG_FUNC_END(); return ret_quota; } -- cgit v1.2.3 From 347e6e36c96f254fe9e54ffe4112c5b40e5bbc7e Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Mon, 5 Dec 2016 09:01:47 +0900 Subject: Upgrade: cp instead of mv Change-Id: I06e0109004a2a9df1df9c9ba385ca9524200a724 Signed-off-by: intae, jeon --- 500.email-service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/500.email-service.sh b/500.email-service.sh index 070de7c..f05902c 100644 --- a/500.email-service.sh +++ b/500.email-service.sh @@ -32,7 +32,7 @@ mkdir -p $EM_RES_DATA_30 mv $DB_FILE_24 $DB_FILE_30 mv $EMSVC_DATA_24 $EMSVC_DATA_30 mv $DB_FILE_24-journal $DB_FILE_30-journal -mv $UPGRADE_DATA_FILE $EM_RES_DATA_30 +cp $UPGRADE_DATA_FILE $EM_RES_DATA_30 chown owner:users $DB_FILE_30 chown owner:users $DATA_DIR_30 -- cgit v1.2.3 From 4bfb6121f355cb6e1beddc2b6b3b50eb2039691f Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Tue, 29 Nov 2016 19:03:56 +0900 Subject: fix overflow issue with strncat(TSAM_10563) Change-Id: I97c7469e706df002ee3fcaf4d9aa8fcfa86104a0 Signed-off-by: intae, jeon (cherry picked from commit 1d9d304272ecde60b42df51f5dde046b55c2c41b) --- email-core/email-core-mail.c | 77 +++++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 23 deletions(-) diff --git a/email-core/email-core-mail.c b/email-core/email-core-mail.c index 0e922ca..8fa9146 100755 --- a/email-core/email-core-mail.c +++ b/email-core/email-core-mail.c @@ -7837,6 +7837,19 @@ FINISH_OFF: EM_DEBUG_FUNC_END(); return err; } +static int get_filter_string_length(char *filter_string) +{ + + EM_DEBUG_FUNC_BEGIN("filter_string : [%p]", filter_string); + int filter_string_length = 0; + int length = 0; + + filter_string_length = strlen(filter_string); + length = (MAX_PREVIEW_TEXT_LENGTH - filter_string_length) > STRING_LENGTH_FOR_DISPLAY ? STRING_LENGTH_FOR_DISPLAY :(MAX_PREVIEW_TEXT_LENGTH - filter_string_length); + + EM_DEBUG_FUNC_END(); + return length; +} static int get_search_filter_string(email_search_filter_t *search_filter, int search_filter_count, char **output_filter_string) { @@ -7870,7 +7883,9 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se } SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "OR "); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + /* TODO it will use realloc */ + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); } } break; @@ -7881,14 +7896,16 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "ANSWERED "); else SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "UNANSWERED "); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_BCC: EM_DEBUG_LOG_SEC("string_type_key_value [%s]", search_filter[i].search_filter_key_value.string_type_key_value); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "BCC \"%s\" ", search_filter[i].search_filter_key_value.string_type_key_value); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_SENT_DATE_BEFORE: @@ -7896,7 +7913,8 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se emcore_make_date_string_for_search(search_filter[i].search_filter_key_value.time_type_key_value, &time_string); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "BEFORE %s ", time_string); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); EM_SAFE_FREE(time_string); break; @@ -7904,14 +7922,16 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se EM_DEBUG_LOG_SEC("string_type_key_value [%s]", search_filter[i].search_filter_key_value.string_type_key_value); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "BODY \"%s\" ", search_filter[i].search_filter_key_value.string_type_key_value); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_CC: EM_DEBUG_LOG_SEC("string_type_key_value [%s]", search_filter[i].search_filter_key_value.string_type_key_value); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "CC \"%s\" ", search_filter[i].search_filter_key_value.string_type_key_value); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_FLAGS_DELETED: @@ -7921,7 +7941,7 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se else SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "UNDELETED "); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_FLAGS_FLAGED: @@ -7931,14 +7951,15 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se else SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "UNFLAGGED "); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_FROM: EM_DEBUG_LOG_SEC("string_type_key_value [%s]", search_filter[i].search_filter_key_value.string_type_key_value); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "FROM \"%s\" ", search_filter[i].search_filter_key_value.string_type_key_value); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_KEYWORD: @@ -7946,7 +7967,7 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "KEYWORD \"%s\" ", search_filter[i].search_filter_key_value.string_type_key_value); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_FLAGS_NEW: @@ -7954,7 +7975,7 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se if (search_filter[i].search_filter_key_value.integer_type_key_value) SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "NEW "); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_FLAGS_OLD: @@ -7962,7 +7983,7 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se if (search_filter[i].search_filter_key_value.integer_type_key_value) SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "OLD "); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_SENT_DATE_ON: @@ -7970,7 +7991,8 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se emcore_make_date_string_for_search(search_filter[i].search_filter_key_value.time_type_key_value, &time_string); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "ON %s ", time_string); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); EM_SAFE_FREE(time_string); break; @@ -7978,7 +8000,8 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se EM_DEBUG_LOG("integer_type_key_value [%d]", search_filter[i].search_filter_key_value.integer_type_key_value); if (search_filter[i].search_filter_key_value.integer_type_key_value) SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "RECENT "); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_FLAGS_SEEN: @@ -7988,7 +8011,7 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se else SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "UNSEEN "); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_SENT_DATE_SINCE: @@ -7996,7 +8019,8 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se emcore_make_date_string_for_search(search_filter[i].search_filter_key_value.time_type_key_value, &time_string); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "SINCE %s ", time_string); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); EM_SAFE_FREE(time_string); break; @@ -8004,27 +8028,31 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se EM_DEBUG_LOG_SEC("string_type_key_value [%s]", search_filter[i].search_filter_key_value.string_type_key_value); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "SUBJECT \"%s\" ", search_filter[i].search_filter_key_value.string_type_key_value); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_TEXT: EM_DEBUG_LOG_SEC("string_type_key_value [%s]", search_filter[i].search_filter_key_value.string_type_key_value); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "TEXT \"%s\" ", search_filter[i].search_filter_key_value.string_type_key_value); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_TO: EM_DEBUG_LOG_SEC("string_type_key_value [%s]", search_filter[i].search_filter_key_value.string_type_key_value); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "TO \"%s\" ", search_filter[i].search_filter_key_value.string_type_key_value); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_HEADER_PRIORITY: EM_DEBUG_LOG("integer_type_key_value [%d]", search_filter[i].search_filter_key_value.integer_type_key_value); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "HEADER x-priority %d ", search_filter[i].search_filter_key_value.integer_type_key_value); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_SIZE_LARSER: @@ -8043,20 +8071,23 @@ static int get_search_filter_string(email_search_filter_t *search_filter, int se EM_DEBUG_LOG_SEC("string_type_key_value [%s]", search_filter[i].search_filter_key_value.string_type_key_value); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "X-GM-RAW \"has:attachment filename:%s\" ", search_filter[i].search_filter_key_value.string_type_key_value); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_CHARSET: EM_DEBUG_LOG("string_type_key_value [%s]", search_filter[i].search_filter_key_value.string_type_key_value); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "charset %s ", search_filter[i].search_filter_key_value.string_type_key_value); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_USER_DEFINED: EM_DEBUG_LOG("string_type_key_value [%s]", search_filter[i].search_filter_key_value.string_type_key_value); SNPRINTF(temp_criteria, STRING_LENGTH_FOR_DISPLAY, "%s", search_filter[i].search_filter_key_value.string_type_key_value); - strncat(filter_string, temp_criteria, STRING_LENGTH_FOR_DISPLAY); + + strncat(filter_string, temp_criteria, get_filter_string_length(filter_string)); break; case EMAIL_SEARCH_FILTER_TYPE_MESSAGE_NO: -- cgit v1.2.3 From e64dbcf781fcd01a9938b29b83bf41b5a205da49 Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Tue, 6 Dec 2016 11:24:17 +0900 Subject: add excluding coverage Change-Id: I38f6a7e98d55ec52f76e4cc65adfb8b389c8be19 Signed-off-by: intae, jeon --- email-api/email-api-account.c | 114 +++++++++++++++++- email-api/email-api-etc.c | 14 +++ email-api/email-api-init.c | 9 +- email-api/email-api-mail.c | 181 +++++++++++++++++++++++++++-- email-api/email-api-mailbox.c | 74 +++++++++++- email-api/email-api-network.c | 102 +++++++++++++++- email-api/email-api-rule.c | 10 ++ email-common-use/include/email-debug-log.h | 18 +-- 8 files changed, 497 insertions(+), 25 deletions(-) mode change 100755 => 100644 email-api/email-api-etc.c mode change 100755 => 100644 email-api/email-api-init.c mode change 100755 => 100644 email-api/email-api-mail.c mode change 100755 => 100644 email-api/email-api-mailbox.c mode change 100755 => 100644 email-api/email-api-network.c mode change 100755 => 100644 email-api/email-api-rule.c mode change 100755 => 100644 email-common-use/include/email-debug-log.h diff --git a/email-api/email-api-account.c b/email-api/email-api-account.c index 1c63a46..b7af867 100755 --- a/email-api/email-api-account.c +++ b/email-api/email-api-account.c @@ -52,55 +52,87 @@ EXPORT_API int email_add_account(email_account_t* account) HIPC_API hAPI = NULL; if (account == NULL || account->user_email_address == NULL || account->incoming_server_user_name == NULL || account->incoming_server_address == NULL || + account->outgoing_server_user_name == NULL || account->outgoing_server_address == NULL) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM"); return EMAIL_ERROR_INVALID_PARAM; + + /* LCOV_EXCL_STOP */ } if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) { - EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err); + + /* LCOV_EXCL_START */ + EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err); goto FINISH_OFF; + + /* LCOV_EXCL_STOP */ } if (!emstorage_check_duplicated_account(multi_user_name, account, true, &err)) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emstorage_check_duplicated_account failed (%d) ", err); goto FINISH_OFF; + + /* LCOV_EXCL_STOP */ } /* composing account information to be added */ hAPI = emipc_create_email_api(_EMAIL_API_ADD_ACCOUNT); if (hAPI == NULL) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + + /* LCOV_EXCL_STOP */ } local_account_stream = em_convert_account_to_byte_stream(account, &size); if (local_account_stream == NULL) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_convert_account_to_byte_stream failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + + /* LCOV_EXCL_STOP */ } if (!emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, local_account_stream, size)) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + + /* LCOV_EXCL_STOP */ } EM_DEBUG_LOG("APPID[%d], APIID [%d]", emipc_get_app_id(hAPI), emipc_get_api_id(hAPI)); /* passing account information to service */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + + /* LCOV_EXCL_STOP */ } /* get result from service */ if ((ret_from_ipc = emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err)) != EMAIL_ERROR_NONE) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_get_parameter failed [%d]", ret_from_ipc); err = ret_from_ipc; goto FINISH_OFF; + + /* LCOV_EXCL_STOP */ } if (err == EMAIL_ERROR_NONE) { @@ -184,18 +216,24 @@ EXPORT_API int email_delete_account(int account_id) /* account_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter account_id failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &ret); if (ret != EMAIL_ERROR_NONE) { /* get error code */ + /* LCOV_EXCL_START */ emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), &err); + /* LCOV_EXCL_STOP */ } emipc_destroy_email_api(hAPI); @@ -245,8 +283,10 @@ EXPORT_API int email_update_account(int account_id, email_account_t* new_account } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -282,28 +322,36 @@ EXPORT_API int email_update_account_with_validation(int account_id, email_accoun /* account_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("email_update_account--emipc_add_parameter account_id failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* new_account */ new_account_stream = em_convert_account_to_byte_stream(new_account, &size); EM_PROXY_IF_NULL_RETURN_VALUE(new_account_stream, hAPI, EMAIL_ERROR_NULL_VALUE); if (!emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, new_account_stream, size)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("email_update_account--emipc_add_parameter new_account failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* with_validation */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&with_validation, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("email_update_account--emipc_add_parameter with_validation failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("email_update_account--emipc_execute_proxy_api failed "); /* Prevent defect 18624 */ EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -396,9 +444,11 @@ EXPORT_API int email_get_account_list(email_account_t** account_list, int* count if (temp_account_tbl && (*count) > 0) { *account_list = em_malloc(sizeof(email_account_t) * (*count)); if (!*account_list) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("allocation failed [%d]", err); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } memset((void*)*account_list, 0, sizeof(email_account_t) * (*count)); @@ -436,13 +486,17 @@ EXPORT_API int email_validate_account(int account_id, int *handle) /* account_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_execute_proxy_api failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &ret); /* return */ @@ -481,13 +535,17 @@ EXPORT_API int email_validate_account_ex(email_account_t* account, int *handle) local_account_stream = em_convert_account_to_byte_stream(account, &size); EM_PROXY_IF_NULL_RETURN_VALUE(local_account_stream, hAPI, EMAIL_ERROR_NULL_VALUE); if (!emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, local_account_stream, size)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_execute_proxy_api failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &ret); @@ -542,21 +600,27 @@ EXPORT_API int email_add_account_with_validation(email_account_t* account, int * local_account_stream = em_convert_account_to_byte_stream(account, &size); if (local_account_stream == NULL) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_convert_account_to_byte_stream failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (!emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, local_account_stream, size)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter failed "); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_execute_proxy_api failed "); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &ret); @@ -581,7 +645,7 @@ FINISH_OFF: return err; } - +/* LCOV_EXCL_START */ EXPORT_API int email_backup_accounts_into_secure_storage(const char *file_name) { EM_DEBUG_API_BEGIN("file_name[%p]", file_name); @@ -676,6 +740,7 @@ EXPORT_API int email_restore_accounts_from_secure_storage(const char * file_name return err; } +/* LCOV_EXCL_STOP */ EXPORT_API int email_get_password_length_of_account(int account_id, email_get_password_length_type password_type, int *password_length) { EM_DEBUG_API_BEGIN("account_id[%d] password_length[%p]", account_id, password_length); @@ -694,19 +759,27 @@ EXPORT_API int email_get_password_length_of_account(int account_id, email_get_pa /* account_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* password type */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&password_type, sizeof(int))) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_execute_proxy_api failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &ret); @@ -737,32 +810,48 @@ EXPORT_API int email_update_notification_bar(int account_id, int total_mail_coun /* account_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&account_id, sizeof(int))) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } + /* total_mail_count */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&total_mail_count, sizeof(int))) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* unread_mail_count */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&unread_mail_count, sizeof(int))) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* input_from_eas */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_from_eas, sizeof(int))) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_execute_proxy_api failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -785,13 +874,19 @@ EXPORT_API int email_clear_all_notification_bar() /* account_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&account_id, sizeof(int))) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_execute_proxy_api failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -818,13 +913,19 @@ EXPORT_API int email_clear_notification_bar(int account_id) /* account_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&account_id, sizeof(int))) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_execute_proxy_api failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -850,13 +951,19 @@ EXPORT_API int email_save_default_account_id(int input_account_id) /* Input account ID */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char *)&input_account_id, sizeof(int))) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter input_account_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -880,8 +987,11 @@ EXPORT_API int email_load_default_account_id(int *output_account_id) EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE); if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); diff --git a/email-api/email-api-etc.c b/email-api/email-api-etc.c old mode 100755 new mode 100644 index c86640e..baa66a9 --- a/email-api/email-api-etc.c +++ b/email-api/email-api-etc.c @@ -52,25 +52,33 @@ EXPORT_API int email_show_user_message(int id, email_action_t action, int error_ /* id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_LOG("emipc_add_parameter failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* action */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&action, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_LOG("emipc_add_parameter failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* error_code */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&error_code, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_LOG("emipc_add_parameter failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_execute_proxy_api(hAPI)) { + /* LCOV_EXCL_START */ EM_DEBUG_LOG("ipcProxy_ExecuteAsyncAPI failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -115,22 +123,28 @@ EXPORT_API int email_write_mime_file(email_mail_data_t *input_mail_data, hAPI = emipc_create_email_api(_EMAIL_API_WRITE_MIME_FILE); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (!emipc_execute_proxy_api(hAPI)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if ((ret_from_ipc = emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err)) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_get_parameter failed:[%d]", ret_from_ipc); err = ret_from_ipc; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (!emcore_make_rfc822_file(NULL, input_mail_data, input_attachment_data, input_attachment_count, false, diff --git a/email-api/email-api-init.c b/email-api/email-api-init.c old mode 100755 new mode 100644 index bd16579..79d2e73 --- a/email-api/email-api-init.c +++ b/email-api/email-api-init.c @@ -118,8 +118,7 @@ EXPORT_API int email_service_end(void) } /* API - Exposed to External Application- core team.Creates all Email DB tables [ EXTERNAL] */ - - +/* LCOV_EXCL_START */ EXPORT_API int email_init_storage(void) { EM_DEBUG_API_BEGIN(); @@ -140,7 +139,7 @@ EXPORT_API int email_init_storage(void) EM_DEBUG_API_END("error[%d]", error); return error; } - +/* LCOV_EXCL_STOP */ EXPORT_API int email_ping_service(void) { EM_DEBUG_API_BEGIN(); @@ -150,8 +149,12 @@ EXPORT_API int email_ping_service(void) EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE); if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &error); diff --git a/email-api/email-api-mail.c b/email-api/email-api-mail.c old mode 100755 new mode 100644 index b6ea750..ffcf793 --- a/email-api/email-api-mail.c +++ b/email-api/email-api-mail.c @@ -84,11 +84,12 @@ EXPORT_API int email_add_mail(email_mail_data_t *input_mail_data, email_attachme if (input_from_eas == 0) { /* native emails */ if ((input_mail_data->smime_type != EMAIL_SMIME_NONE) && (input_mail_data->mailbox_type != EMAIL_MAILBOX_TYPE_DRAFT)) { + /* LCOV_EXCL_START */ if (!emcore_make_rfc822_file(multi_user_name, input_mail_data, input_attachment_data_list, input_attachment_count, true, &rfc822_file, &err)) { EM_DEBUG_EXCEPTION("emcore_make_rfc822_file failed [%d]", err); goto FINISH_OFF; } - + /* LCOV_EXCL_STOP */ input_mail_data->file_path_mime_entity = EM_SAFE_STRDUP(emcore_set_mime_entity(rfc822_file)); emstorage_delete_file(rfc822_file, NULL); @@ -98,18 +99,22 @@ EXPORT_API int email_add_mail(email_mail_data_t *input_mail_data, email_attachme hAPI = emipc_create_email_api(_EMAIL_API_ADD_MAIL); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* email_mail_data_t */ mail_data_stream = em_convert_mail_data_to_byte_stream(input_mail_data, &size); if (!mail_data_stream) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_convert_mail_data_to_byte_stream failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (!emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, mail_data_stream, size)) @@ -119,9 +124,11 @@ EXPORT_API int email_add_mail(email_mail_data_t *input_mail_data, email_attachme attachment_data_list_stream = em_convert_attachment_data_to_byte_stream(input_attachment_data_list, input_attachment_count, &size); if ((size > 0) && !emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, attachment_data_list_stream, size)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_dynamic_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* email_meeting_request_t */ @@ -129,9 +136,11 @@ EXPORT_API int email_add_mail(email_mail_data_t *input_mail_data, email_attachme meeting_request_stream = em_convert_meeting_req_to_byte_stream(input_meeting_request, &size); if (!meeting_request_stream) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_convert_meeting_req_to_byte_stream failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (!emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, meeting_request_stream, size)) @@ -143,9 +152,11 @@ EXPORT_API int email_add_mail(email_mail_data_t *input_mail_data, email_attachme /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* get result from service */ @@ -168,14 +179,18 @@ EXPORT_API int email_add_mail(email_mail_data_t *input_mail_data, email_attachme } } } else { + /* LCOV_EXCL_START */ err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } } else { /* take care of mails from eas */ + /* LCOV_EXCL_START */ err = emcore_add_mail(multi_user_name, input_mail_data, input_attachment_data_list, input_attachment_count, input_meeting_request, input_from_eas, false); if (err != EMAIL_ERROR_NONE) { EM_DEBUG_EXCEPTION("emcore_add_mail failed [%d]", err); goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } } @@ -202,14 +217,18 @@ EXPORT_API int email_add_read_receipt(int input_read_mail_id, int *output_receip EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE); if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_read_mail_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("Add Param mail body Fail"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -275,7 +294,7 @@ EXPORT_API int email_create_db_full() EM_DEBUG_EXCEPTION("email_get_mailbox_list_ex failed [%d]", err); goto FINISH_OFF; } - + /* LCOV_EXCL_START */ for (mailbox_index = 0; mailbox_index < mailbox_count; mailbox_index++) { mail_slot_size = mailbox_list[mailbox_index].mail_slot_size; for (mail_index = 0; mail_index < mail_slot_size; mail_index++) { @@ -289,7 +308,7 @@ EXPORT_API int email_create_db_full() } } } - + /* LCOV_EXCL_STOP */ FINISH_OFF: if ((err = email_close_db()) != EMAIL_ERROR_NONE) { EM_DEBUG_EXCEPTION("email_close_db failed [%d]", err); @@ -332,24 +351,30 @@ EXPORT_API int email_update_mail(email_mail_data_t *input_mail_data, email_attac hAPI = emipc_create_email_api(_EMAIL_API_UPDATE_MAIL); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* email_mail_data_t */ mail_data_stream = em_convert_mail_data_to_byte_stream(input_mail_data, &size); if (!mail_data_stream) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_convert_mail_data_to_byte_stream failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, mail_data_stream, size)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter for head failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* email_attachment_data_t */ @@ -362,6 +387,7 @@ EXPORT_API int email_update_mail(email_mail_data_t *input_mail_data, email_attac /* email_meeting_request_t */ if (input_mail_data->meeting_request_status != EMAIL_MAIL_TYPE_NORMAL) { + /* LCOV_EXCL_START */ meeting_request_stream = em_convert_meeting_req_to_byte_stream(input_meeting_request, &size); if (!meeting_request_stream) { @@ -375,20 +401,24 @@ EXPORT_API int email_update_mail(email_mail_data_t *input_mail_data, email_attac err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; } - } + }/* LCOV_EXCL_STOP */ /* input_from_eas */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_from_eas, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -454,7 +484,7 @@ FINISH_OFF: EM_DEBUG_API_END("err[%d]", err); return err; } - +/* LCOV_EXCL_START */ EXPORT_API int email_clear_mail_data() { EM_DEBUG_API_BEGIN(); @@ -477,6 +507,7 @@ EXPORT_API int email_clear_mail_data() return err; } +/* LCOV_EXCL_STOP */ EXPORT_API int email_count_mail(email_list_filter_t *input_filter_list, int input_filter_count, int *output_total_mail_count, int *output_unseen_mail_count) { @@ -544,43 +575,55 @@ EXPORT_API int email_delete_mail(int input_mailbox_id, int *input_mail_ids, int hAPI = emipc_create_email_api(_EMAIL_API_DELETE_MAIL); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* mailbox id*/ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Number of mail_ids */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_num, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* set of mail_ids */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)input_mail_ids, input_num * sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* from-server */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_from_server, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -610,27 +653,35 @@ EXPORT_API int email_delete_all_mails_in_mailbox(int input_mailbox_id, int input hAPI = emipc_create_email_api(_EMAIL_API_DELETE_ALL_MAIL); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_from_server, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -658,31 +709,39 @@ EXPORT_API int email_add_attachment(int mail_id, email_attachment_data_t* attach hAPI = emipc_create_email_api(_EMAIL_API_ADD_ATTACHMENT); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* mail_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&mail_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Attachment */ attchment_stream = em_convert_attachment_data_to_byte_stream(attachment, 1, &size); if (!attchment_stream) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_convert_attachment_data_to_byte_stream failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, attchment_stream, size)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ @@ -720,23 +779,29 @@ EXPORT_API int email_delete_attachment(int attachment_id) hAPI = emipc_create_email_api(_EMAIL_API_DELETE_ATTACHMENT); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* attachment_index */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&attachment_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -841,16 +906,20 @@ EXPORT_API int email_get_attachment_data(int attachment_id, email_attachment_dat /* attachment_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&attachment_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -861,9 +930,11 @@ EXPORT_API int email_get_attachment_data(int attachment_id, email_attachment_dat attchment_stream = (char*)em_malloc(nSize+1); if (!attchment_stream) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_malloc failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, nSize, attchment_stream); @@ -871,9 +942,11 @@ EXPORT_API int email_get_attachment_data(int attachment_id, email_attachment_dat } if (!attachment_data) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("EMAIL_ERROR_NULL_VALUE"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } *attachment = attachment_data; @@ -1206,6 +1279,7 @@ EXPORT_API int email_get_mail_data(int input_mail_id, email_mail_data_t **output Mail Flag API -----------------------------------------------------------*/ +/* LCOV_EXCL_START */ EXPORT_API int email_modify_seen_flag(int *mail_ids, int num, int seen_flag, int onserver) { EM_DEBUG_API_BEGIN("mail_ids[%p] num[%d] seen_flag[%d] on_server[%d]", mail_ids, num, seen_flag, onserver); @@ -1213,6 +1287,7 @@ EXPORT_API int email_modify_seen_flag(int *mail_ids, int num, int seen_flag, int return EMAIL_ERROR_NOT_IMPLEMENTED; } +/* LCOV_EXCL_STOP */ EXPORT_API int email_set_flags_field(int account_id, int *mail_ids, int num, email_flags_field_type field_type, int value, int onserver) { EM_DEBUG_API_BEGIN("account_id[%d] mail_ids[%p] num[%d] field_type[%d] seen_flag[%d] on_server[%d]", account_id, mail_ids, num, field_type, value, onserver); @@ -1222,65 +1297,83 @@ EXPORT_API int email_set_flags_field(int account_id, int *mail_ids, int num, ema EM_IF_NULL_RETURN_VALUE(mail_ids, EMAIL_ERROR_INVALID_PARAM); if (account_id == 0 || num <= 0 || (onserver != 0 && onserver != 1)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM"); return EMAIL_ERROR_INVALID_PARAM; + /* LCOV_EXCL_STOP */ } HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_SET_FLAGS_FIELD); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* account_id*/ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Number of mail_ids */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&num, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* set of mail_ids */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)mail_ids, num * sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* field_type */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&field_type, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* value */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&value, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* onserver */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &(onserver), sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -1320,37 +1413,47 @@ EXPORT_API int email_move_mail_to_mailbox(int *mail_ids, int num, int input_targ hAPI = emipc_create_email_api(_EMAIL_API_MOVE_MAIL); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Number of mail_ids */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&num, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* set of mail_ids */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)mail_ids, num * sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* input_target_mailbox_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_target_mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -1380,30 +1483,38 @@ EXPORT_API int email_move_all_mails_to_mailbox(int input_source_mailbox_id, int hAPI = emipc_create_email_api(_EMAIL_API_MOVE_ALL_MAIL); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* input_source_mailbox_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_source_mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* input_target_mailbox_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_target_mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -1486,15 +1597,17 @@ EXPORT_API int email_cancel_sending_mail(int mail_id) /* check account bind type and branch off */ if (em_get_account_server_type_by_account_id(multi_user_name, account_id, &account_server_type, false, &err) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC) { int as_handle; ASNotiData as_noti_data; - + /* LCOV_EXCL_START */ if (em_get_handle_for_activesync(&as_handle, &err) == false) { EM_DEBUG_EXCEPTION("em_get_handle_for_activesync failed[%d].", err); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; @@ -1512,34 +1625,43 @@ EXPORT_API int email_cancel_sending_mail(int mail_id) err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; } + /* LCOV_EXCL_STOP */ } else { hAPI = emipc_create_email_api(_EMAIL_API_SEND_MAIL_CANCEL_JOB); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Account_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Mail ID */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &(mail_id), sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -1575,30 +1697,38 @@ EXPORT_API int email_retry_sending_mail(int mail_id, int timeout_in_sec) HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_SEND_RETRY); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Mail ID */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &(mail_id), sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* timeout */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &(timeout_in_sec), sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -1787,37 +1917,47 @@ EXPORT_API int email_move_thread_to_mailbox(int thread_id, int target_mailbox_id HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_MOVE_THREAD_TO_MAILBOX); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* thread_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&thread_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* target mailbox information */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&target_mailbox_id, sizeof(int))) { - EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); + /* LCOV_EXCL_START */ + EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* move_always_flag */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&move_always_flag, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -1844,30 +1984,38 @@ EXPORT_API int email_delete_thread(int thread_id, int delete_always_flag) HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_DELETE_THREAD); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* thread_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&thread_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* delete_always_flag */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&delete_always_flag, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -1895,37 +2043,47 @@ EXPORT_API int email_modify_seen_flag_of_thread(int thread_id, int seen_flag, in HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_MODIFY_SEEN_FLAG_OF_THREAD); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* thread_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&thread_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* seen_flag */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&seen_flag, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* on_server */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&on_server, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -1991,34 +2149,43 @@ EXPORT_API int email_expunge_mails_deleted_flagged(int input_mailbox_id, int inp if (output_handle) *output_handle = as_handle; + } else { hAPI = emipc_create_email_api(_EMAIL_API_EXPUNGE_MAILS_DELETED_FLAGGED); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* input_mailbox_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* input_on_server */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_on_server, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); diff --git a/email-api/email-api-mailbox.c b/email-api/email-api-mailbox.c old mode 100755 new mode 100644 index fb979ba..a6314b0 --- a/email-api/email-api-mailbox.c +++ b/email-api/email-api-mailbox.c @@ -64,9 +64,11 @@ EXPORT_API int email_add_mailbox(email_mailbox_t* new_mailbox, int on_server, in /* check account bind type and branch off */ if (em_get_account_server_type_by_account_id(multi_user_name, new_mailbox->account_id, &account_server_type, false, &err) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC && on_server) { @@ -88,9 +90,11 @@ EXPORT_API int email_add_mailbox(email_mailbox_t* new_mailbox, int on_server, in as_noti_data.add_mailbox.multi_user_name = multi_user_name; if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_ADD_MAILBOX, &as_noti_data) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed."); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (handle) @@ -105,19 +109,25 @@ EXPORT_API int email_add_mailbox(email_mailbox_t* new_mailbox, int on_server, in EM_PROXY_IF_NULL_RETURN_VALUE(local_mailbox_stream, hAPI, EMAIL_ERROR_NULL_VALUE); if (!emipc_add_parameter(hAPI, ePARAMETER_IN, local_mailbox_stream, size)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); EM_SAFE_FREE(local_mailbox_stream); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &on_server, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -205,28 +215,38 @@ EXPORT_API int email_rename_mailbox(int input_mailbox_id, char *input_mailbox_na hAPI = emipc_create_email_api(_EMAIL_API_RENAME_MAILBOX); if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter for input_mailbox_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, input_mailbox_name, EM_SAFE_STRLEN(input_mailbox_name)+1)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter for input_mailbox_path failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, input_mailbox_alias, EM_SAFE_STRLEN(input_mailbox_alias)+1)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter for input_mailbox_alias failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_on_server, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -272,18 +292,22 @@ EXPORT_API int email_rename_mailbox_ex(int input_mailbox_id, char *input_mailbox /* check account bind type and branch off */ if (em_get_account_server_type_by_account_id(multi_user_name, mailbox_tbl->account_id, &account_server_type, false, &err) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC && input_on_server) { int as_handle; if (em_get_handle_for_activesync(&as_handle, &err) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_get_handle_for_activesync failed[%d].", err); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* noti to active sync */ @@ -308,33 +332,45 @@ EXPORT_API int email_rename_mailbox_ex(int input_mailbox_id, char *input_mailbox hAPI = emipc_create_email_api(_EMAIL_API_RENAME_MAILBOX_EX); if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter for input_mailbox_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, input_mailbox_name, EM_SAFE_STRLEN(input_mailbox_name)+1)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter for input_mailbox_path failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, input_mailbox_alias, EM_SAFE_STRLEN(input_mailbox_alias)+1)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter for input_mailbox_alias failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, input_eas_data, input_eas_data_length)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter for input_eas_data failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_on_server, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -381,18 +417,22 @@ EXPORT_API int email_delete_mailbox(int input_mailbox_id, int input_on_server, i /* check account bind type and branch off */ if (em_get_account_server_type_by_account_id(multi_user_name, mailbox_tbl->account_id, &account_server_type, false, &err) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC && input_on_server) { int as_handle; if (em_get_handle_for_activesync(&as_handle, &err) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_get_handle_for_activesync failed[%d].", err); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* noti to active sync */ @@ -402,9 +442,11 @@ EXPORT_API int email_delete_mailbox(int input_mailbox_id, int input_on_server, i as_noti_data.delete_mailbox.multi_user_name = multi_user_name; if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_DELETE_MAILBOX, &as_noti_data) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed."); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (output_handle) @@ -481,9 +523,11 @@ EXPORT_API int email_delete_mailbox_ex(int input_account_id, int *input_mailbox_ &account_server_type, false, &err) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC && input_on_server) { @@ -545,18 +589,24 @@ EXPORT_API int email_set_mailbox_type(int input_mailbox_id, email_mailbox_type_e EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE); if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_type, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -580,18 +630,24 @@ EXPORT_API int email_set_local_mailbox(int input_mailbox_id, int input_is_local_ EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE); if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_is_local_mailbox, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -602,7 +658,7 @@ EXPORT_API int email_set_local_mailbox(int input_mailbox_id, int input_is_local_ EM_DEBUG_API_END("err[%d]", err); return err; } - +/* LCOV_EXCL_START */ EXPORT_API int email_get_sync_mailbox_list(int account_id, email_mailbox_t** mailbox_list, int* count) { EM_DEBUG_API_BEGIN(); @@ -649,7 +705,7 @@ FINISH_OFF: EM_DEBUG_API_END("err[%d]", err); return err; } - +/* LCOV_EXCL_STOP */ EXPORT_API int email_get_mailbox_list(int account_id, int mailbox_sync_type, email_mailbox_t** mailbox_list, int* count) { @@ -678,9 +734,11 @@ EXPORT_API int email_get_mailbox_list(int account_id, int mailbox_sync_type, ema if (mailbox_count > 0) { if (!(*mailbox_list = em_malloc(sizeof(email_mailbox_t) * mailbox_count))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("malloc failed for mailbox_list"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } for (i = 0; i < mailbox_count; i++) @@ -732,9 +790,11 @@ EXPORT_API int email_get_mailbox_list_ex(int account_id, int mailbox_sync_type, if (mailbox_count > 0) { if (!(*mailbox_list = em_malloc(sizeof(email_mailbox_t) * mailbox_count))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("malloc failed for mailbox_list"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } for (i = 0; i < mailbox_count; i++) @@ -781,9 +841,11 @@ EXPORT_API int email_get_mailbox_list_by_keyword(int account_id, char *keyword, if (mailbox_count > 0) { if (!(*mailbox_list = em_malloc(sizeof(email_mailbox_t) * mailbox_count))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("malloc failed for mailbox_list"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } for (i = 0; i < mailbox_count; i++) @@ -917,23 +979,31 @@ EXPORT_API int email_set_mail_slot_size(int account_id, int mailbox_id, int new_ if (hAPI) { if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter for account_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter for account_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &new_slot_size, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION(" emipc_add_parameter for new_slot_size failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); diff --git a/email-api/email-api-network.c b/email-api/email-api-network.c old mode 100755 new mode 100644 index 8f27238..44b541d --- a/email-api/email-api-network.c +++ b/email-api/email-api-network.c @@ -52,8 +52,10 @@ EXPORT_API int email_send_mail(int mail_id, int *handle) ASNotiData as_noti_data; if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err); goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (mail_id <= 0) { @@ -68,9 +70,11 @@ EXPORT_API int email_send_mail(int mail_id, int *handle) } if (mail_table_data->account_id <= 0) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("EM_IF_ACCOUNT_ID_NULL: Account ID [ %d ] ", mail_table_data->account_id); emstorage_free_mail(&mail_table_data, 1, NULL); return EMAIL_ERROR_INVALID_PARAM; + /* LCOV_EXCL_STOP */ } EM_DEBUG_LOG("mail_table_data->account_id[%d], mail_table_data->mailbox_id[%d]", mail_table_data->account_id, mail_table_data->mailbox_id); @@ -110,22 +114,28 @@ EXPORT_API int email_send_mail(int mail_id, int *handle) hAPI = emipc_create_email_api(_EMAIL_API_SEND_MAIL); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("INVALID PARAM: hAPI NULL "); emstorage_free_mail(&mail_table_data, 1, NULL); return EMAIL_ERROR_NULL_VALUE; + /* LCOV_EXCL_STOP */ } /* mail_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&mail_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("email_send_mail--Add Param mail_id failed"); emstorage_free_mail(&mail_table_data, 1, NULL); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("email_send_mail--emipc_execute_proxy_api failed "); emstorage_free_mail(&mail_table_data, 1, NULL); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_CRASH); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -184,9 +194,11 @@ EXPORT_API int email_send_mail_with_downloading_attachment_of_original_mail(int /* check account bind type and branch off */ if (em_get_account_server_type_by_account_id(multi_user_name, mail_table_data->account_id, &account_server_type, false, &err) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC) { @@ -196,9 +208,11 @@ EXPORT_API int email_send_mail_with_downloading_attachment_of_original_mail(int memset(&as_noti_data, 0x00, sizeof(ASNotiData)); if (em_get_handle_for_activesync(&as_handle, &err) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_get_handle_for_activesync failed[%d].", err); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* noti to active sync */ @@ -265,9 +279,11 @@ EXPORT_API int email_schedule_sending_mail(int input_mail_id, time_t input_sched /* check account bind type and branch off */ if (em_get_account_server_type_by_account_id(multi_user_name, mail_table_data->account_id, &account_server_type, false, &err) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC) { @@ -275,13 +291,13 @@ EXPORT_API int email_schedule_sending_mail(int input_mail_id, time_t input_sched ASNotiData as_noti_data; memset(&as_noti_data, 0x00, sizeof(ASNotiData)); - + /* LCOV_EXCL_START */ if (em_get_handle_for_activesync(&as_handle, &err) == false) { EM_DEBUG_EXCEPTION("em_get_handle_for_activesync failed[%d].", err); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; } - + /* LCOV_EXCL_STOP */ /* noti to active sync */ as_noti_data.schedule_sending_mail.handle = as_handle; as_noti_data.schedule_sending_mail.account_id = mail_table_data->account_id; @@ -332,15 +348,19 @@ EXPORT_API int email_send_saved(int account_id, int *handle) /* Account ID */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &(account_id), sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter account_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_SAFE_FREE(pOptionStream); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -368,14 +388,18 @@ EXPORT_API int email_sync_header(int input_account_id, int input_mailbox_id, int memset(&as_noti_data, 0x00, sizeof(ASNotiData)); if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err); goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* 2010/02/12 ch715.lee : check account bind type and branch off */ if (em_get_account_server_type_by_account_id(multi_user_name, input_account_id, &account_server_type, true, &err) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err); goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC) { @@ -408,16 +432,20 @@ EXPORT_API int email_sync_header(int input_account_id, int input_mailbox_id, int /* input_account_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* input_mailbox_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { @@ -471,22 +499,28 @@ EXPORT_API int email_sync_header_for_all_account(int *handle) /* input_account_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* input_account_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_SAFE_FREE(multi_user_name); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -617,24 +651,32 @@ EXPORT_API int email_download_body(int mail_id, int with_attachment, int *handle /* Account Id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* Mail Id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&mail_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* with_attachment */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&with_attachment, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -735,26 +777,34 @@ EXPORT_API int email_download_attachment(int mail_id, int nth, int *handle) /* Account Id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* Mail ID */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &(mail_id), sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter mail_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* nth */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &(nth), sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter mail_id failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -823,9 +873,11 @@ EXPORT_API int email_cancel_job(int input_account_id, int input_handle, email_ca as_noti_data.cancel_job.multi_user_name = multi_user_name; if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_CANCEL_JOB, &as_noti_data) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed."); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } } } @@ -834,28 +886,36 @@ EXPORT_API int email_cancel_job(int input_account_id, int input_handle, email_ca hAPI = emipc_create_email_api(_EMAIL_API_CANCEL_JOB); if (!hAPI) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("INVALID PARAM: hAPI NULL "); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_account_id, sizeof(int))) { /* input_account_id == 0 */ + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_handle, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_SOCKET_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -874,9 +934,11 @@ EXPORT_API int email_cancel_job(int input_account_id, int input_handle, email_ca as_noti_data.cancel_job.multi_user_name = multi_user_name; if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_CANCEL_JOB, &as_noti_data) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed."); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } } else { hAPI = emipc_create_email_api(_EMAIL_API_CANCEL_JOB); @@ -884,19 +946,25 @@ EXPORT_API int email_cancel_job(int input_account_id, int input_handle, email_ca EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE); if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_handle, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* Execute API */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); emipc_destroy_email_api(hAPI); @@ -948,15 +1016,19 @@ EXPORT_API int email_get_task_information(email_task_information_t **output_task } if ((hAPI = emipc_create_email_api(_EMAIL_API_GET_TASK_INFORMATION)) == NULL) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_create_email_api failed"); err = EMAIL_ERROR_IPC_CRASH; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); err = EMAIL_ERROR_IPC_CRASH; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -966,9 +1038,11 @@ EXPORT_API int email_get_task_information(email_task_information_t **output_task task_information_stream = (char*)em_malloc(task_information_stream_length + 1); if (!task_information_stream) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_malloc failed"); err = EMAIL_ERROR_OUT_OF_MEMORY; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, task_information_stream_length, task_information_stream); @@ -977,9 +1051,11 @@ EXPORT_API int email_get_task_information(email_task_information_t **output_task } if (!output_task_information) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("EMAIL_ERROR_NULL_VALUE"); err = EMAIL_ERROR_NULL_VALUE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } } @@ -1009,13 +1085,17 @@ EXPORT_API int email_sync_imap_mailbox_list(int account_id, int *handle) /* account_id */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_LOG("emipc_add_parameter failed "); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } if (!emipc_execute_proxy_api(hAPI)) { + /* LCOV_EXCL_START */ EM_DEBUG_LOG("ipcProxy_ExecuteAsyncAPI failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); @@ -1073,8 +1153,10 @@ EXPORT_API int email_search_mail_on_server(int input_account_id, int as_handle = 0; if (em_get_handle_for_activesync(&as_handle, &err) == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_get_handle_for_activesync failed[%d].", err); goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } /* noti to active sync */ @@ -1088,9 +1170,11 @@ EXPORT_API int email_search_mail_on_server(int input_account_id, return_value = em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_SEARCH_ON_SERVER, &as_noti_data); if (return_value == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed."); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (output_handle) @@ -1101,15 +1185,19 @@ EXPORT_API int email_search_mail_on_server(int input_account_id, EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE); if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (void*)&input_account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed "); err = EMAIL_ERROR_IPC_PROTOCOL_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (void*)&input_mailbox_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed "); err = EMAIL_ERROR_IPC_PROTOCOL_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } stream_for_search_filter_list = em_convert_search_filter_to_byte_stream(input_search_filter_list, @@ -1121,9 +1209,11 @@ EXPORT_API int email_search_mail_on_server(int input_account_id, if (!emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, stream_for_search_filter_list, stream_size_for_search_filter_list)) { /*prevent 18950*/ + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed "); err = EMAIL_ERROR_IPC_PROTOCOL_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { @@ -1198,9 +1288,11 @@ EXPORT_API int email_clear_result_of_search_mail_on_server(int input_account_id) return_value = em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_CLEAR_RESULT_OF_SEARCH_ON_SERVER, &as_noti_data); if (return_value == false) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed."); err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } } else { hAPI = emipc_create_email_api(_EMAIL_API_CLEAR_RESULT_OF_SEARCH_MAIL_ON_SERVER); @@ -1208,20 +1300,26 @@ EXPORT_API int email_clear_result_of_search_mail_on_server(int input_account_id) EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE); if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (void*)&input_account_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_add_parameter failed "); err = EMAIL_ERROR_IPC_PROTOCOL_FAILURE; goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err); if (err != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("_EMAIL_API_CLEAR_RESULT_OF_SEARCH_MAIL_ON_SERVER failed [%d]", err); goto FINISH_OFF; + /* LCOV_EXCL_STOP */ } } diff --git a/email-api/email-api-rule.c b/email-api/email-api-rule.c old mode 100755 new mode 100644 index 373d1a7..8ebed31 --- a/email-api/email-api-rule.c +++ b/email-api/email-api-rule.c @@ -124,14 +124,18 @@ EXPORT_API int email_add_rule(email_rule_t* filtering_set) stream = em_convert_rule_to_byte_stream(filtering_set, &size); EM_PROXY_IF_NULL_RETURN_VALUE(stream, hAPI, EMAIL_ERROR_NULL_VALUE); if (!emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, stream, size)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("Add Param Failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* pass rule info */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api Failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } /* get reult form service */ @@ -170,8 +174,10 @@ EXPORT_API int email_update_rule(int filter_id, email_rule_t* new_set) /* make filter info */ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&filter_id, sizeof(int))) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("Add Param filter_id Failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } stream = em_convert_rule_to_byte_stream(new_set, &size); @@ -179,14 +185,18 @@ EXPORT_API int email_update_rule(int filter_id, email_rule_t* new_set) EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); } if (!emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, stream, size)) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("Add Param new_set Failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE); + /* LCOV_EXCL_STOP */ } /* request update rule with filter info */ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) { + /* LCOV_EXCL_START */ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api Failed"); EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE); + /* LCOV_EXCL_STOP */ } /* get result */ diff --git a/email-common-use/include/email-debug-log.h b/email-common-use/include/email-debug-log.h old mode 100755 new mode 100644 index 8c9cf9c..92c878b --- a/email-common-use/include/email-debug-log.h +++ b/email-common-use/include/email-debug-log.h @@ -58,12 +58,12 @@ extern "C" #define LOG_TAG "EMAIL_SERVICE" -#define EM_DEBUG_LOG(format, arg...) SLOGD(format, ##arg) -#define EM_DEBUG_EXCEPTION(format, arg...) SLOGE("[EXCEPTION!] " format "\n", ##arg) +#define EM_DEBUG_LOG(format, arg...) SLOGD(format, ##arg) /* LCOV_EXCL_LINE */ +#define EM_DEBUG_EXCEPTION(format, arg...) SLOGE("[EXCEPTION!] " format "\n", ##arg) /* LCOV_EXCL_LINE */ -#define EM_DEBUG_LOG_SEC(format, arg...) SECURE_SLOGD(format, ##arg) -#define EM_DEBUG_EXCEPTION_SEC(format, arg...) SECURE_SLOGE("[EXCEPTION!] " format "\n", ##arg) -#define EM_DEBUG_FUNC_BEGIN_SEC(format, arg...) EM_DEBUG_LOG_SEC("BEGIN - "format, ##arg) +#define EM_DEBUG_LOG_SEC(format, arg...) SECURE_SLOGD(format, ##arg) /* LCOV_EXCL_LINE */ +#define EM_DEBUG_EXCEPTION_SEC(format, arg...) SECURE_SLOGE("[EXCEPTION!] " format "\n", ##arg) /* LCOV_EXCL_LINE */ +#define EM_DEBUG_FUNC_BEGIN_SEC(format, arg...) EM_DEBUG_LOG_SEC("BEGIN - "format, ##arg) /* LCOV_EXCL_LINE */ #define EM_DEBUG_FUNC_END_SEC(format, arg...) EM_DEBUG_LOG_SEC("END - "format, ##arg) #ifdef _DEBUG_MIME_PARSE_ @@ -178,10 +178,10 @@ extern "C" #else /* __FEATURE_DEBUG_LOG__ */ - #define EM_DEBUG_LINE - #define EM_DEBUG_LOG(format, arg...) - #define EM_DEBUG_ASSERT(format, arg...) - #define EM_DEBUG_EXCEPTION(format, arg...) + #define EM_DEBUG_LINE /* LCOV_EXCL_LINE */ + #define EM_DEBUG_LOG(format, arg...) /* LCOV_EXCL_LINE */ + #define EM_DEBUG_ASSERT(format, arg...) /* LCOV_EXCL_LINE */ + #define EM_DEBUG_EXCEPTION(format, arg...) /* LCOV_EXCL_LINE */ #define EM_DEBUG_DB_EXEC(eval, expr, X) if (eval) { EM_DEBUG_DB X; expr;} else {;} -- cgit v1.2.3