JMMSProtocol.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:298k
源码类别:
MTK
开发平台:
C/C++
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s %d", "JMMS, mmi_jmms_send_and_store_mms returned:",
- eRet));
- if (eRet == JC_OK)
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (IsScreenPresent(SCR_ID_JMMS_DRAFTS_OPTIONS))
- #else
- if (g_jmms_context->last_scr_id == SCR_ID_JMMS_DRAFTS_OPTIONS)
- #endif
- {
- /* /it means mmms was sent using "Sent" Option in Drafts */
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT_AND_STORED);
- mmi_jmms_drafts_delete_on_sent();
- }
- else
- {
- //TODO:: display error pop up with preoper string for error
- ///by knowing error type status (error_code parameter)
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT_AND_STORED);
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (IsScreenPresent(SCR_ID_JMMS_PREVIEW))
- {
- DeleteScreenFromToNnodes(SCR_ID_JMMS_PROGRESS, 5);
- }
- else if(!IsScreenPresent(SCR_ID_UM_MAIN))
- {
- DeleteScreenFromToNnodes(SCR_ID_JMMS_PROGRESS, 3);
- }
- else
- {
- DeleteScreenFromToNnodes(SCR_ID_JMMS_PROGRESS, 4);
- }
- #else /* __MMI_UNIFIED_MESSAGE__ */
- DeleteScreenFromToNnodes(SCR_ID_JMMS_PROGRESS, 3); // sachin
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- ///back to main mms screen if come from write mms
- ///back to "Send to other" option screen if from there etc.
- }
- }
- else
- {
- //TODO:: display error pop up with preoper string for error of sent
- ///by knowing error type status (error_code parameter)
- if (eRet == E_MEMORY_FULL_ERROR)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT_AND_FAIL_STORE_MEMORY);
- }
- else if (eRet == JC_ERR_MEMORY_ALLOCATION || eRet == JC_ERR_FILE_WRITE)
- {
- if(g_jmms_context->save_mms == MMI_TRUE)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT_AND_FAIL_STORE_MEM_FULL);
- }
- else
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_MEMORY_FULL_REACH);
- }
- }
- else
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT_AND_FAIL_STORE);
- }
- /* /called from 'Sent" option in Drafts folder */
- #ifdef __MMI_UNIFIED_MESSAGE__
- if(IsScreenPresent(SCR_ID_JMMS_PREVIEW))
- {
- DeleteScreenFromToNnodes(SCR_ID_JMMS_PROGRESS, 5);
- }
- else if (IsScreenPresent(SCR_ID_JMMS_DRAFTS_OPTIONS))
- {
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_UM_DRAFT);
- }
- else if(!IsScreenPresent(SCR_ID_UM_MAIN))
- {
- DeleteScreenFromToNnodes(SCR_ID_JMMS_PROGRESS, 3);
- }
- else
- {
- DeleteScreenFromToNnodes(SCR_ID_JMMS_PROGRESS, 4);
- }
- #else
- if (g_jmms_context->last_scr_id == SCR_ID_JMMS_DRAFTS_OPTIONS)
- {
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, g_jmms_context->last_scr_id);
- }
- else
- DeleteScreenFromToNnodes(SCR_ID_JMMS_PROGRESS, 3);
- #endif
- }
- #ifndef __MMI_UNIFIED_MESSAGE__
- }
- else
- {
- /* /it means called from "Send Only" option */
- // sandeep start 22 Nov for bug number PMT006053
- eRet = mmi_jmms_send_and_store_mms("Outbox", jmms_context->msg_handle, comm_node);
- if(eRet == JC_OK)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT_AND_STORED);
- }
- else
- {
- if (eRet == E_MEMORY_FULL_ERROR)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_COMM_ABORTED_AND_FAIL_STORE_MEMORY);
- }
- else if (eRet == JC_ERR_MEMORY_ALLOCATION || eRet == JC_ERR_FILE_WRITE)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_COMM_ABORTED_AND_FAIL_STORE_MEM_FULL);
- }
- else
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_COMM_ABORTED_AND_FAIL_STORE);
- }
- }
- //mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT);
- // sandeep end 22 Nov for bug number PMT006053
- DeleteScreenFromToNnodes(SCR_ID_JMMS_PROGRESS, 3);
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- else
- {
- //it meas user selects "Resent" from Outbox.
- ///in this case update the MMS into the outbox
- eRet = mmi_jmms_send_and_store_mms("Outbox", jmms_context->msg_handle, comm_node);
- if( JC_OK == eRet)
- {
- eRet = mmi_jmms_delete_message(MMI_JMMS_OUTBOX, g_jmms_context->store_context->nMsgs_in_Current_folder - (g_jmms_context->nCurr_scr_hilited_index));
- }
- else if(E_MEMORY_FULL_ERROR == eRet)
- {
- mmi_jmms_add_memory_full_node_if_not_already();
- }
- mmi_jmms_handle_error_string(error_code, E_TYPE_NEW_MMS);
- #ifdef __MMI_UNIFIED_MESSAGE__
- if(IsScreenPresent(SCR_ID_UM_UNSENT))
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_UM_UNSENT);
- else
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, IDLE_SCREEN_ID);
- #else
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, g_jmms_context->last_scr_id);
- #endif
- }
- mmi_jmms_deinit_mms_context(jmms_context);
- }
- else
- {
- // TODO:: need to display string accordinbg to error_code
- mmi_jmms_handle_error_string(error_code, E_TYPE_NEW_MMS);
- if (g_jmms_context->last_scr_id == SCR_ID_JMMS_OUTBOX_OPTIONS
- || g_jmms_context->last_scr_id == SCR_ID_JMMS_DRAFTS_OPTIONS)
- {
- ///it means mms sent from "ReSent" in Outbox or "Sent" in Drafts
- ///for these deinit the complete mms context
- mmi_jmms_deinit_mms_context(jmms_context);
- }
- else
- {
- mmi_jmms_free_message_header();
- }
- DeleteScreenIfPresent(SCR_ID_JMMS_PROGRESS);
- DeleteScreenIfPresent(SCR_ID_JMMS_SENT_OPTIONS);
- DeleteScreenIfPresent(SCR_ID_JMMS_DRAFTS_OPTIONS);
- DeleteScreenIfPresent(SCR_ID_JMMS_OUTBOX_OPTIONS);
- DeleteScreenIfPresent(SCR_ID_WRITE_MMS_DONE_OPTIONS);
- // DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, g_jmms_context->last_scr_id);
- }
- break;
- #ifdef MMI_JMMS_JAVA_MMS_SUPPORT
- case E_TYPE_NEW_JAVA_MMS_SEND:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "JMMS Communication state: NEW JAVA MMS"));
- mmi_jmms_deinit_mms_context(jmms_context);
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_ERROR);
- break;
- #endif /* MMI_JMMS_JAVA_MMS_SUPPORT */
- case E_TYPE_ACK_RESPONSE:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "JMMS Communication state: MMS ACK Response"));
- break;
- case E_TYPE_NOTIFICATION_RESPONSE:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "JMMS Communication state: MMS Notification response"));
- break;
- case E_TYPE_READ_REPORT_PDU:
- case E_TYPE_READ_REPORT_MMS:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "JMMS Communication state: MMS Read Report"));
- if (eRet == E_JMMS_STORAGE_FULL)
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_STORAGE_ERROR_READ_REPORT_SENT,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- }
- else
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_ERROR_READ_REPORT_SENT,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- }
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- break;
- case E_TYPE_IMMEDIATE_RETRIEVAL_FETCH:
- case E_TYPE_DEFFERED_RETRIEVAL_FETCH:
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "JMMS Communication state: MMS Download"));
- jdi_CommunicationFreeReference(g_jmms_context->hCommHandle, comm_node->uiReferenceID);
- mmi_jmms_update_status_icon_indicator();
- if (comm_node->mms_communication_state == E_TYPE_DEFFERED_RETRIEVAL_FETCH)
- {
- if (calling_function == E_FROM_ERROR_CALLBACK)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_DOWNLAOD);
- }
- else
- {
- mmi_jmms_handle_error_string(error_code, E_TYPE_DEFFERED_RETRIEVAL_FETCH);
- }
- #ifdef __MMI_UNIFIED_MESSAGE__
- if(IsScreenPresent(SCR_ID_UM_INBOX))
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_UM_INBOX); /* sachin */
- else
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, IDLE_SCREEN_ID); /* sachin */
- #else
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, g_jmms_context->last_scr_id);
- #endif
- }
- else if (comm_node->mms_communication_state == E_TYPE_IMMEDIATE_RETRIEVAL_FETCH)
- {
- /*
- Changes are made to fix PMTSW00004306.
- */
- /*eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_ERROR_MMS_DOWNLAOD_STORE_FUL,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);*/
- U16 currScrenID = GetActiveScreenId();
- //sandeep starts
- #if defined (__MMI_UNIFIED_MESSAGE__)
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) comm_node->msg_index, //sandeep pass message index in case of UM
- (U8) E_MSG_TYPE_RECEIVE,
- NULL);
- if ((currScrenID == IDLE_SCREEN_ID) || (currScrenID == SCR_ID_UM_NEW_MSG_IND)|| (currScrenID == SCR_ID_UM_NEW_MSG_DUMMY_IND))
- {
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- }
- #else
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_NEW_MMS_NOTIFICATION,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- if (currScrenID == IDLE_SCREEN_ID)
- {
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- }
- #endif
- //sandeep ends
- else
- {
- mmi_jmms_show_new_mms_pop_up();
- }
- }
- }
- //#ifdef __MMI_MMS_SIGNATURE__
- mmi_jmms_del_inserted_auto_signature_slide();
- //#endif
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_error_string
- * DESCRIPTION
- *
- * PARAMETERS
- * error_code [IN]
- * communication_state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_handle_error_string(JC_RETCODE error_code, U16 communication_state)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s%d", "mmi_jmms_handle_error_string, Error Code:", error_code));
- if (communication_state == E_TYPE_NEW_MMS)
- {
- /* /These are error code for Send Conf. Pdu reposne */
- switch (error_code)
- {
- case E_RESP_ERR_SENDING_ADDR_UNRESOLVED:
- case E_RESP_TRANSIENT_SENDING_ADDR_UNRESOLVED:
- case E_RESP_PERMANENT_SENDING_ADDRESS_UNRESOLVED:
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_ADDR_UNRESOLVED);
- return;
- case E_RESP_ERR_NETWORK_PROBLEM:
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_NETWORK_PROBLEM);
- return;
- case E_RESP_ERR_CONTENT_NOT_ACCEPTED:
- case E_RESP_ERR_UNSUPPORTED_MSG:
- case E_RESP_PERMANENT_MSG_FORMAT_CORRUPT:
- case E_RESP_PERMANENT_MSG_NOT_FOUND:
- case E_RESP_PERMANENT_CONTENT_NOT_ACCEPTED:
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_INVALID_MSG);
- return;
- case E_RESP_PERMANENT_REPLY_CHARGING_NOT_ACCEPTED:
- case E_RESP_PERMANENT_REPLY_CHARGING_FORWARD_DENIED:
- case E_RESP_PERMANET_REPLY_CHARGING_NOT_SUPPORTED:
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_REPLY_CHARGING);
- return;
- case E_RESP_PERMANENT_ADDRESS_HIDING_NOT_SUPPORTED:
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_ADDR_HIDING);
- return;
- case E_RESP_ERR_SERVICE_DENIED:
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_SERVER_DENIED);
- return;
- }
- }
- switch (error_code)
- {
- case JMMS_WRONG_CONTENT_TYPE_ERROR:
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_WRONG_CONTENT_TYPE);
- return;
- case 300:
- case 301:
- case 302:
- case 303:
- case 304:
- case 305:
- case 306:
- case 307:
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_REDIRECTION);
- return;
- case 400:
- case 401:
- case 402:
- case 403:
- case 404:
- case 405:
- case 406:
- case 407:
- case 408:
- case 409:
- case 410:
- case 411:
- case 412:
- case 413:
- case 414:
- case 415:
- case 416:
- case 417:
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_CLIENT);
- return;
- case 500:
- case 501:
- case 502:
- case 503:
- case 504:
- case 505:
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_SERVER);
- return;
- case JC_ERR_FILE_FULL:
- if(communication_state == E_TYPE_NEW_MMS)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT_AND_FAIL_STORE_MEM_FULL);
- }
- else
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_DOWNLAOD_STORE_FUL);
- }
- return;
- default:
- if (communication_state == E_TYPE_NEW_MMS)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT);
- return;
- }
- else if (communication_state == E_TYPE_DEFFERED_RETRIEVAL_FETCH)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_DOWNLAOD);
- return;
- }
- }
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_get_em_mms_version
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- S8 *mmi_jmms_get_em_mms_version(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (wap_custom_get_mms_version())
- {
- case EM_MMS_VERSION_10:
- /* Change MMS agent to version 1.0 no matter MMSC */
- return "1.0";
- case EM_MMS_VERSION_11:
- /* Change MMS agent to version 1.1 no matter MMSC */
- return "1.1";
- case EM_MMS_VERSION_12:
- /* Change MMS agent to version 1.2 no matter MMSC */
- return "1.2";
- default:
- return "1.0";
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_set_mmsc_version
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_set_mmsc_version(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- FS_HANDLE fh = 0;
- S32 ret_code, len = 0;
- U32 read_len = 0, index;
- S8 *file_buffer = NULL;
- S8 file_name[(MAX_FILE_LENGTH + 1) * ENCODING_LENGTH];
- U8 *temp_uniocde_url = NULL;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_set_mmsc_version"));
- g_jmms_context->version = jdd_MemAlloc(sizeof(S8), (MAX_VERSION_LENGTH + 1) * ENCODING_LENGTH);
- if (g_jmms_context->version == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto END;
- }
- /* /mmsc_url is mmsc url set in message settings */
- temp_uniocde_url = mmi_jmms_get_activated_mmsc_url(g_jmms_context);
- if (temp_uniocde_url == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto END;
- }
- /*
- * These modification is made to not to convert the version string into the unicode string.
- *
- * Modified by : Raj Kumar Gupta
- * Date : July 27, 2006
- */
- if (wap_custom_get_mms_version() == EM_MMS_VERSION_DEFAULT)
- {
- if ((g_jmms_context->nSent_last_MMSC_URL != NULL)
- && (strcmp((S8*) (g_jmms_context->nSent_last_MMSC_URL), (S8*) temp_uniocde_url) == 0))
- {
- strcpy((S8*) g_jmms_context->version, (S8*) g_jmms_context->nSent_last_version);
- }
- else
- {
- AnsiiToUnicodeString((PS8) file_name, (PS8) MMS_MMSC_URLS_FILE_NAME);
- fh = FS_Open((const WCHAR*)file_name, FS_READ_ONLY);
- if (fh > 0) /* /file exists */
- {
- len = GetFSFileSize(fh);
- file_buffer = (S8*) jdd_MemAlloc(sizeof(S8), len);
- if ((NULL == file_buffer) && (len > 0))
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto END;
- }
- if (len > 0)
- {
- ret_code = FS_Read(fh, file_buffer, len, &read_len);
- if (ret_code < 0)
- {
- eRet = ret_code;
- goto END;
- }
- }
- if (fh > 0)
- {
- FS_Close(fh);
- }
- len = 0;
- index = 0;
- while ((read_len - index) != 0)
- {
- len = (pfnUnicodeStrlen(file_buffer + index) + 1) * ENCODING_LENGTH;
- if (pfnUnicodeStrcmp((S8*) (file_buffer + index), (S8*) temp_uniocde_url) == 0)
- {
- index = index + len;
- UnicodeToAnsii((S8*) g_jmms_context->version, (S8*) (file_buffer + index));
- break;
- }
- else
- {
- index = index + len;
- len = (pfnUnicodeStrlen(file_buffer + index) + 1) * ENCODING_LENGTH;
- index = index + len;
- }
- }
- read_len = read_len - index;
- if (read_len == 0) /* /entry not found */
- {
- /* /set the defualt version for MMS */
- strcpy((PS8) g_jmms_context->version, (PS8) (mmi_jmms_get_em_mms_version()));
- }
- if (file_buffer)
- {
- jdd_MemFree(file_buffer);
- file_buffer = NULL;
- }
- }
- else
- {
- /* set the defualt version for MMS */
- strcpy((PS8) g_jmms_context->version, (PS8) (mmi_jmms_get_em_mms_version()));
- }
- }
- }
- else
- {
- strcpy((PS8) g_jmms_context->version, (PS8) (mmi_jmms_get_em_mms_version()));
- }
- END:
- if (file_buffer)
- {
- jdd_MemFree(file_buffer);
- file_buffer = NULL;
- }
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_read_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * pStream [?] [?] [?]
- * uiOffset [IN]
- * uiSize [IN]
- * pBuffer [?] [?] [?]
- * pSizeRead [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_read_callback(
- void *pStream,
- JC_INT32 uiOffset,
- JC_UINT32 uiSize,
- JC_UINT8 *pBuffer,
- JC_UINT32 *pSizeRead)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- JDD_FILE hFile = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "JMMS Read Callback"));
- if (pStream == NULL || pBuffer == NULL)
- {
- eRet = JC_ERR_INVALID_PARAMETER;
- goto error;
- }
- if (g_jmms_context->jmms_fs_handle == NULL)
- {
- if (jdd_FSInitialize(&g_jmms_context->jmms_fs_handle) != JC_OK)
- {
- eRet = JC_ERR_FILE_OPEN;
- goto error;
- }
- }
- hFile = jdd_FSOpen(g_jmms_context->jmms_fs_handle, (JC_CHAR*) pStream, E_OPEN_READ_MODE);
- if (hFile == NULL)
- {
- eRet = JC_ERR_FILE_OPEN;
- goto error;
- }
- if (uiOffset > 0)
- {
- eRet = jdd_FSSeek(hFile, uiOffset, E_FILE_SEEK_SET);
- if (eRet != JC_OK)
- {
- goto error;
- }
- }
- *pSizeRead = jdd_FSRead(pBuffer, sizeof(JC_INT8), uiSize, hFile);
- if (*pSizeRead != uiSize)
- {
- eRet = JC_ERR_FILE_READ;
- }
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "File Name: %s, bytes read = %d", pStream, *pSizeRead));
- error:
- if (hFile != NULL)
- {
- jdd_FSClose(hFile);
- }
- if (g_jmms_context->jmms_fs_handle != NULL)
- {
- jdd_FSDeinitialize(g_jmms_context->jmms_fs_handle);
- g_jmms_context->jmms_fs_handle = NULL;
- }
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_write_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * pStream [?] [?] [?]
- * pBuffer [?] [?] [?]
- * uiSize [IN]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_write_callback(void *pStream, JC_UINT8 *pBuffer, JC_UINT32 uiSize)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- JC_INT32 iBytesWritten = 0;
- JDD_FILE hFile = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "JMMS Write Callback"));
- if (pStream == NULL || pBuffer == NULL)
- {
- eRet = JC_ERR_NULL_POINTER;
- goto error;
- }
- if (uiSize == 0)
- {
- eRet = JC_ERR_INVALID_PARAMETER;
- goto error;
- }
- if (g_jmms_context->jmms_fs_handle == NULL)
- {
- if (jdd_FSInitialize(&g_jmms_context->jmms_fs_handle) != JC_OK)
- {
- eRet = JC_ERR_FILE_OPEN;
- goto error;
- }
- }
- hFile = jdd_FSOpen(g_jmms_context->jmms_fs_handle, (JC_CHAR*) pStream, E_CREATE_APPEND_WRITE_MODE);
- if (hFile == NULL)
- {
- eRet = JC_ERR_FILE_OPEN;
- goto error;
- }
- iBytesWritten = jdd_FSWrite(pBuffer, 1, uiSize, hFile);
- if (iBytesWritten != uiSize)
- {
- eRet = JC_ERR_FILE_WRITE;
- }
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "File Name: %s, bytes written = %d", pStream, iBytesWritten));
- error:
- if (hFile != NULL)
- {
- jdd_FSClose(hFile);
- }
- if (g_jmms_context->jmms_fs_handle != NULL)
- {
- jdd_FSDeinitialize(g_jmms_context->jmms_fs_handle);
- g_jmms_context->jmms_fs_handle = NULL;
- }
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "JMMS Write Callback return: %d", eRet));
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_notification_ack_response
- * DESCRIPTION
- *
- * PARAMETERS
- * jmms_context [?] [?] [?]
- * pURLInd [?] [?] [?]
- * Content [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_handle_notification_ack_response(
- jmms_context_struct *jmms_context,
- COMM_FETCH_URL_IND_RESP *pURLInd,
- CONTENT_DATA *Content)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_notification_ack_response"));
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- eRet = jdi_CommunicationFreeReference(jmms_context->hCommHandle, pURLInd->uiRequestID);
- pURLInd->uiRequestID = 0;
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_read_report_pdu_response
- * DESCRIPTION
- *
- * PARAMETERS
- * jmms_context [?] [?] [?]
- * pURLInd [?] [?] [?]
- * Content [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_handle_read_report_pdu_response(
- jmms_context_struct *jmms_context,
- COMM_FETCH_URL_IND_RESP *pURLInd,
- CONTENT_DATA *Content)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_read_report_pdu_response"));
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_SUCCESS_READ_REPORT_SENT,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- eRet = jdi_CommunicationFreeReference(jmms_context->hCommHandle, pURLInd->uiRequestID);
- pURLInd->uiRequestID = 0;
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_read_report_mms_response
- * DESCRIPTION
- *
- * PARAMETERS
- * jmms_context [?] [?] [?]
- * pURLInd [?] [?] [?]
- * Content [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_handle_read_report_mms_response(
- jmms_context_struct *jmms_context,
- COMM_FETCH_URL_IND_RESP *pURLInd,
- CONTENT_DATA *Content)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- MSG_HANDLE hTempMsg = NULL;
- MESSAGE_HEADERS *pMsgHeaders = NULL;
- EMM1MessageType eMsg;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_read_report_mms_response"));
- eRet = mmi_jmms_jdi_parse_msg_buffer(&hTempMsg, Content, E_TYPE_MMS, E_FALSE);
- /* Async changes start */
- while (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- eRet = mmi_jmms_jdi_msg_parse_continue(hTempMsg);
- };
- /* Async changes end */
- if (eRet != JC_OK)
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_ERROR_READ_REPORT_SENT,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- goto CaseEnd;
- }
- eRet = mmi_jmms_jdi_get_msg_headers(hTempMsg, &pMsgHeaders);
- if (eRet != JC_OK)
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_ERROR_READ_REPORT_SENT,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- goto CaseEnd;
- }
- eMsg = pMsgHeaders->eMsgType;
- switch (pMsgHeaders->eMsgType)
- {
- case E_MSG_TYPE_SEND_RESPONSE:
- {
- MESSAGE_SEND_RESPONSE *pSendHdr = (MESSAGE_SEND_RESPONSE*) pMsgHeaders->pHeaders;
- if (E_RESP_OK == pSendHdr->eStatus)
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_SUCCESS_READ_REPORT_SENT,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- }
- else
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_ERROR_READ_REPORT_SENT,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- }
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- }
- break;
- }
- CaseEnd:
- /* /added for retry mechanism */
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- if (NULL != hTempMsg)
- {
- mmi_jmms_jdi_msg_deinit(hTempMsg);
- hTempMsg = NULL;
- }
- eRet = jdi_CommunicationFreeReference(jmms_context->hCommHandle, pURLInd->uiRequestID);
- pURLInd->uiRequestID = 0;
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_immediate_downlaod_response
- * DESCRIPTION
- *
- * PARAMETERS
- * jmms_context [?] [?] [?]
- * pURLInd [?] [?] [?]
- * Content [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_handle_immediate_downlaod_response(
- jmms_context_struct *jmms_context,
- COMM_FETCH_URL_IND_RESP *pURLInd,
- CONTENT_DATA *Content)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* JC_UINT32 msgid = 0; */
- JC_RETCODE eRet = JC_OK;
- MSG_HANDLE hTempMsg = NULL;
- MESSAGE_HEADERS *pMsgHeaders = NULL;
- JC_INT8 *content_type = NULL;
- JC_UINT32 msg_index;
- JC_RETCODE ret_val = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_immediate_downlaod_response"));
- eRet = mmi_jmms_jdi_parse_msg_buffer(&hTempMsg, Content, E_TYPE_MMS, E_FALSE);
- /* Async changes start */
- while (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- eRet = mmi_jmms_jdi_msg_parse_continue(hTempMsg);
- }
- /* Async changes end */
- if (JC_OK != eRet)
- {
- goto Endcase;
- }
- eRet = mmi_jmms_jdi_get_msg_headers(hTempMsg, &pMsgHeaders);
- if (eRet != JC_OK || pMsgHeaders == NULL)
- {
- goto Endcase;
- }
- ///putting here as found that stroe_update change the file name
- ///so require to use before that
- eRet = jmms_mmi_notification_response_for_immediate_retrieval(*Content);
- if (pMsgHeaders->eMsgType == E_MSG_TYPE_RECEIVE)
- {
- jmms_communication_state_node *comm_node = NULL;
- comm_node = mmi_jmms_get_comm_state(jmms_context, pURLInd->uiRequestID);
- if (comm_node == NULL)
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_NEW_MMS_NOT_SAVED,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- goto Endcase;
- }
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "(%d) Comm Node index = %d", __LINE__, comm_node->msg_index));
- if (comm_node->msg_index == 0) /* /it means notification didn't save successfully */
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_jmms_get_content_type(Content, &content_type);
- if (MMI_TRUE == mmi_jsr_check_recv_mms_for_java(content_type))
- {
- JC_UINT32 temp_extrabyte = 0x02000000;
- eRet = mmi_jmms_save_message_buffer_in_Store("Inbox", &msg_index, pMsgHeaders, Content, &temp_extrabyte);
- }
- else
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- eRet = mmi_jmms_save_message_buffer_in_Store("Inbox", &msg_index, pMsgHeaders, Content, NULL);
- if (eRet != JC_OK)
- {
- if (eRet == JC_ERR_MEMORY_ALLOCATION || eRet == JC_ERR_FILE_WRITE)
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_NEW_MMS_MEMORY_NOT_SAVED,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- }
- else
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_NEW_MMS_NOT_SAVED,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- }
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- goto Endcase;
- }
- }
- else /* /update the notification */
- {
- msg_index = (comm_node->msg_index);
- ret_val = mmi_jmms_get_content_type(Content, &content_type);
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (MMI_TRUE == mmi_jsr_check_recv_mms_for_java(content_type))
- {
- eRet = mmi_jmms_store_update_message("Inbox", &(msg_index), pMsgHeaders, Content, 0x02000000);
- }
- else
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- eRet = mmi_jmms_store_update_message("Inbox", &(msg_index), pMsgHeaders, Content, 0);
- if (eRet != JC_OK)
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_NEW_MMS_NOT_SAVED,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- goto Endcase;
- }
- ///to handle the case when current scrn is Inbox Msgs List screen
- /// and Notification need to be updated by Msg recieved
- #ifdef __MMI_UNIFIED_MESSAGE__
- if ( (IsScreenPresent(SCR_ID_UM_INBOX)) || (GetActiveScreenId() == SCR_ID_UM_INBOX) )
- #else /* amit checked in inbox screen is present the reset the count*/
- if ( (IsScreenPresent(SCR_ID_JMMS_INBOX)) || (GetActiveScreenId() == SCR_ID_JMMS_INBOX) )
- #endif
- {
- /* /to forcefully run the condition in mmi_jmms_entry_inbox_screen() */
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_um_jmms_highlight_mms_message_ind();
- #endif
- g_jmms_context->store_context->update_nmsgs_in_current_folder = 1;
- }
- }
- #ifdef MMI_JMMS_JAVA_MMS_SUPPORT
- ///Manish chnaging as found that stroe_update change the file name
- ///so require to use before that
- ////eRet=mmi_jmms_get_content_type(Content,&content_type);
- if (ret_val == JC_OK)
- {
- if (mmi_jsr_check_recv_mms_for_java(content_type))
- {
- if ((!isInCall()) && (!AlmIsTonePlaying())) /* if no call is there only then show it */
- {
- mmi_jmms_update_status_icon_indicator();
- mmi_msg_entry_new_msg_popup(MSG_NEW_JMMS_JAVA_MMS);
- }
- else
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_NEW_JAVA_MMS,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- }
- goto Endcase;
- }
- /* } */
- }
- if (content_type != NULL)
- {
- jdd_MemFree(content_type);
- content_type = NULL;
- }
- #endif /* MMI_JMMS_JAVA_MMS_SUPPORT */
- eRet = mmi_jmms_add_pending_mms_info_node((U16) msg_index, (U8) E_MSG_TYPE_RECEIVE, NULL);
- if (eRet == JC_OK)
- {
- mmi_jmms_update_status_icon_indicator();
- mmi_jmms_show_new_mms_pop_up();
- }
- }
- Endcase:
- if (content_type != NULL)
- {
- jdd_MemFree(content_type);
- content_type = NULL;
- }
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- if (NULL != hTempMsg)
- {
- mmi_jmms_jdi_msg_deinit(hTempMsg);
- hTempMsg = NULL;
- }
- eRet = jdi_CommunicationFreeReference(jmms_context->hCommHandle, pURLInd->uiRequestID);
- pURLInd->uiRequestID = 0;
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_deffered_downlaod_response
- * DESCRIPTION
- *
- * PARAMETERS
- * jmms_context [?] [?] [?]
- * pURLInd [?] [?] [?]
- * Content [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_handle_deffered_downlaod_response(
- jmms_context_struct *jmms_context,
- COMM_FETCH_URL_IND_RESP *pURLInd,
- CONTENT_DATA *Content)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #ifdef MMI_JMMS_JAVA_MMS_SUPPORT
- MMI_BOOL flag = MMI_FALSE;
- #endif /* MMI_JMMS_JAVA_MMS_SUPPORT */
- JC_RETCODE eRet = JC_OK;
- MSG_HANDLE hTempMsg = NULL;
- MESSAGE_HEADERS *pMsgHeaders = NULL;
- JC_INT8 *content_type = NULL;
- /* JC_UINT32 msg_index = 0; */
- MMI_BOOL intterupt_handling = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_deffered_downlaod_response"));
- eRet = mmi_jmms_jdi_parse_msg_buffer(&hTempMsg, Content, E_TYPE_MMS, E_FALSE);
- /* Async changes start */
- while (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- eRet = mmi_jmms_jdi_msg_parse_continue(hTempMsg);
- }
- /* Async changes end */
- if (JC_OK != eRet)
- {
- goto EndofDeferredcase;
- }
- eRet = mmi_jmms_jdi_get_msg_headers(hTempMsg, &pMsgHeaders);
- if (eRet != JC_OK || pMsgHeaders == NULL)
- {
- goto EndofDeferredcase;
- }
- mmi_jmms_update_status_icon_indicator();
- #ifdef MMI_JMMS_JAVA_MMS_SUPPORT
- eRet = mmi_jmms_get_content_type(Content, &content_type);
- if (eRet == JC_OK)
- {
- flag = mmi_jsr_check_recv_mms_for_java(content_type);
- if (flag == MMI_TRUE)
- {
- jmms_communication_state_node *comm_node = NULL;
- comm_node = mmi_jmms_get_comm_state(jmms_context, pURLInd->uiRequestID);
- if (comm_node == NULL)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SAVING);
- if (g_jmms_context->last_scr_id == IDLE_SCREEN_ID)
- {
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, IDLE_SCREEN_ID);
- }
- else
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- HistoryReplace(SCR_ID_UM_INBOX, SCR_ID_UM_INBOX, mmi_um_jmms_pre_entry_inbox_including_highlighter);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_UM_INBOX);
- #else /* __MMI_UNIFIED_MESSAGE__ */
- /* /Todo: tets it. */
- HistoryReplace(SCR_ID_JMMS_INBOX, SCR_ID_JMMS_INBOX, mmi_jmms_entry_inbox);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_JMMS_INBOX);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- }
- else
- {
- ///putting here the ACK.as found that stroe_update change the file name
- ///so require to use before that
- jmms_mmi_ack_for_deffered_retrieval(*Content);
- #ifdef __MMI_UNIFIED_MESSAGE__
- eRet = mmi_jmms_store_update_message("Inbox", &(comm_node->msg_index), pMsgHeaders, Content, 0x02000000);
- #else
- eRet = mmi_jmms_store_update_message("Inbox", &(comm_node->msg_index), pMsgHeaders, Content, 0);
- #endif
- if (eRet != JC_OK)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SAVING);
- if (g_jmms_context->last_scr_id == IDLE_SCREEN_ID)
- {
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, IDLE_SCREEN_ID);
- }
- else
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- HistoryReplace(
- SCR_ID_UM_INBOX,
- SCR_ID_UM_INBOX,
- mmi_um_jmms_pre_entry_inbox_including_highlighter);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_UM_INBOX);
- #else /* __MMI_UNIFIED_MESSAGE__ */
- /* /Todo: tets it. */
- HistoryReplace(SCR_ID_JMMS_INBOX, SCR_ID_JMMS_INBOX, mmi_jmms_entry_inbox);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_JMMS_INBOX);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- }
- else
- {
- ///TODO:: change pop up to New Java MMS
- ///"This is JAVA MMS.Please Use JAVA Midlet to Access It"
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_jmms_set_msg_type(
- g_jmms_context->store_context->nMsgs_in_Current_folder - comm_node->msg_index,
- E_MSG_JAVA_MESSAGE);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- if (GetActiveScreenId() != SCR_ID_JMMS_PROGRESS)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_NEW_JAVA_MMS);
- }
- else
- {
- mmi_jmms_update_status_icon_indicator();
- mmi_msg_entry_new_msg_popup(MSG_NEW_JMMS_JAVA_MMS);
- }
- if (g_jmms_context->last_scr_id == IDLE_SCREEN_ID)
- {
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, IDLE_SCREEN_ID);
- }
- else
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- HistoryReplace(
- SCR_ID_UM_INBOX,
- SCR_ID_UM_INBOX,
- mmi_um_jmms_pre_entry_inbox_including_highlighter);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_UM_INBOX);
- #else /* __MMI_UNIFIED_MESSAGE__ */
- /* /Todo: tets it. */
- HistoryReplace(SCR_ID_JMMS_INBOX, SCR_ID_JMMS_INBOX, mmi_jmms_entry_inbox);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_JMMS_INBOX);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- }
- }
- eRet = JC_OK;
- if (content_type != NULL)
- {
- jdd_MemFree(content_type);
- content_type = NULL;
- }
- goto EndofDeferredcase;
- }
- }
- if (content_type != NULL)
- {
- jdd_MemFree(content_type);
- content_type = NULL;
- }
- #endif /* MMI_JMMS_JAVA_MMS_SUPPORT */
- eRet = mmi_jmms_handle_deffered_retrieved_mms((*Content));
- if (eRet == JC_OK)
- {
- ///Todo:: test it
- ////manish hello
- if (GetActiveScreenId() != SCR_ID_JMMS_PROGRESS)
- {
- intterupt_handling = MMI_TRUE;
- /* /Todo: need to test it */
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_MMS_DOWNLAOD_SUCCESS);
- }
- if (g_jmms_context->last_scr_id == IDLE_SCREEN_ID)
- {
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, IDLE_SCREEN_ID);
- }
- else
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- HistoryReplace(SCR_ID_UM_INBOX, SCR_ID_UM_INBOX, mmi_um_jmms_pre_entry_inbox_including_highlighter);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_UM_INBOX);
- #else /* __MMI_UNIFIED_MESSAGE__ */
- /* /Todo: tets it. */
- HistoryReplace(SCR_ID_JMMS_INBOX, SCR_ID_JMMS_INBOX, mmi_jmms_entry_inbox);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_JMMS_INBOX);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- }
- if (eRet != E_UNKNOWN_MSG)
- {
- JC_RETCODE error_code = JC_OK;
- jmms_communication_state_node *comm_node = NULL;
- comm_node = mmi_jmms_get_comm_state(jmms_context, pURLInd->uiRequestID);
- if (comm_node == NULL)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SAVING);
- if (g_jmms_context->last_scr_id == IDLE_SCREEN_ID)
- {
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, IDLE_SCREEN_ID);
- }
- else
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- HistoryReplace(SCR_ID_UM_INBOX, SCR_ID_UM_INBOX, mmi_um_jmms_pre_entry_inbox_including_highlighter);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_JMMS_INBOX);
- #else /* __MMI_UNIFIED_MESSAGE__ */
- /* /Todo: tets it. */
- HistoryReplace(SCR_ID_JMMS_INBOX, SCR_ID_JMMS_INBOX, mmi_jmms_entry_inbox);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_JMMS_INBOX);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- }
- else
- {
- ///putting here the ACK.as found that stroe_update change the file name
- ///so require to use before that
- jmms_mmi_ack_for_deffered_retrieval(*Content);
- error_code = mmi_jmms_store_update_message("Inbox", &(comm_node->msg_index), pMsgHeaders, Content, 0);
- if (error_code != JC_OK)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SAVING);
- if (g_jmms_context->last_scr_id == IDLE_SCREEN_ID)
- {
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, IDLE_SCREEN_ID);
- }
- else
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- HistoryReplace(SCR_ID_UM_INBOX, SCR_ID_UM_INBOX, mmi_um_jmms_pre_entry_inbox_including_highlighter);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_JMMS_INBOX);
- #else /* __MMI_UNIFIED_MESSAGE__ */
- /* /Todo: tets it. */
- HistoryReplace(SCR_ID_JMMS_INBOX, SCR_ID_JMMS_INBOX, mmi_jmms_entry_inbox);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, SCR_ID_JMMS_INBOX);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- }
- else
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_jmms_set_msg_type(
- g_jmms_context->store_context->nMsgs_in_Current_folder - comm_node->msg_index,
- E_MSG_RECEIVE);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- if (intterupt_handling == MMI_FALSE)
- {
- g_jmms_context->is_unread_msg_deleted = 0;
- mmi_jmms_set_msg_as_read((U8) ((comm_node->msg_index) - 1));
- #ifdef __MMI_UNIFIED_MESSAGE__
- g_jmms_context->show_property_screen = MMI_TRUE;
- #endif
- /* /manish hello */
- mmi_jmms_handle_read_report(g_jmms_context->MsgHeader_type_p);
- }
- else
- {
- /* /check -set for interuupt */
- g_jmms_context->progress_screen_title = (U16) (comm_node->msg_index);
- }
- jmms_context->mms_index = comm_node->msg_index;
- }
- }
- ///Manish chnaging as found that stroe_update change the file name
- ///so require to use before that
- /////error_code=jmms_mmi_ack_for_deffered_retrieval(*Content);
- }
- EndofDeferredcase:
- if (content_type != NULL)
- {
- jdd_MemFree(content_type);
- content_type = NULL;
- }
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- if (NULL != hTempMsg)
- {
- mmi_jmms_jdi_msg_deinit(hTempMsg);
- hTempMsg = NULL;
- }
- eRet = jdi_CommunicationFreeReference(jmms_context->hCommHandle, pURLInd->uiRequestID);
- pURLInd->uiRequestID = 0;
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_new_mms_send_response
- * DESCRIPTION
- *
- * PARAMETERS
- * jmms_context [?] [?] [?]
- * pURLInd [?] [?] [?]
- * Content [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_handle_new_mms_send_response(
- jmms_context_struct *jmms_context,
- COMM_FETCH_URL_IND_RESP *pURLInd,
- CONTENT_DATA *Content)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MESSAGE_HEADERS *pMsgHeaders = NULL;
- EMM1MessageType eMsg;
- U8 num_retries = 0;
- S8 temp_version[MAX_VERSION_LENGTH + 1];
- JC_RETCODE eRet = JC_OK;
- MSG_HANDLE hTempMsg = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_new_mms_send_response"));
- eRet = mmi_jmms_jdi_parse_msg_buffer(&hTempMsg, Content, E_TYPE_MMS, E_FALSE);
- /* Async changes begin */
- while (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- eRet = mmi_jmms_jdi_msg_parse_continue(hTempMsg);
- }
- /* Async changes end */
- if (eRet != JC_OK)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT);
- goto END;
- }
- eRet = mmi_jmms_jdi_get_msg_headers(hTempMsg, &pMsgHeaders);
- if (eRet != JC_OK)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT);
- goto END;
- }
- eMsg = pMsgHeaders->eMsgType;
- switch (pMsgHeaders->eMsgType)
- {
- case E_MSG_TYPE_SEND_RESPONSE:
- {
- MESSAGE_SEND_RESPONSE *pSendHdr = (MESSAGE_SEND_RESPONSE*) pMsgHeaders->pHeaders;
- U8 *temp_uniocde_url = NULL;
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s%d", "JMMS send response, Status:", pSendHdr->eStatus));
- if (E_RESP_OK == pSendHdr->eStatus)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "JMMS send response: OK"));
- num_retries = jmms_context->nSent_retry_counter;
- temp_uniocde_url = mmi_jmms_get_activated_mmsc_url(jmms_context);
- /* / replace temp_uniocde_url by url set in message settings */
- jmms_context->nSent_last_MMSC_URL = (S8*) temp_uniocde_url;
- /*
- * No need to convert into Unicode string.
- *
- * Modified by : Raj Kumar Gupta
- * Date : July 27, 2006
- */
- /* /version should always be in ansii */
- strcpy((PS8) jmms_context->nSent_last_version, (PS8) pSendHdr->pVersion);
- if (num_retries >= 1) /* /MMS was sent in 2 retries due to version problem */
- { /* store such mmsc urls in a file */
- /* /wrie/update the MMSC URL and version into file */
- mmi_jmms_update_mmsc_url_version(
- jmms_context->nSent_last_MMSC_URL,
- jmms_context->nSent_last_version);
- }
- if (g_jmms_context->save_mms == MMI_TRUE)
- {
- jmms_communication_state_node *comm_node = NULL;
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "JMMS send response: Save MMS True"));
- comm_node = mmi_jmms_get_comm_state(jmms_context, pURLInd->uiRequestID);
- if (comm_node == NULL)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_MMS_SENT_NOT_SAVE);
- }
- else
- {
- eRet = mmi_jmms_send_and_store_mms("Sent", jmms_context->msg_handle, comm_node);
- if (eRet == JC_OK)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_SUCCESS_MMS_SENT);
- }
- else
- {
- if (eRet == E_MEMORY_FULL_ERROR)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_MMS_SENT_NOT_SAVE_MEMORY);
- }
- else if (eRet == JC_ERR_MEMORY_ALLOCATION || eRet == JC_ERR_FILE_WRITE)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_MMS_SENT_NOT_SAVE_MEMORY_FULL);
- }
- else
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_MMS_SENT_NOT_SAVE);
- }
- }
- }
- }
- else
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_SUCCESS_MMS_SENT_ONLY);
- }
- #ifdef __MMI_UNIFIED_MESSAGE__
- /* Sandeep start Nov 14 */
- /* if (IsScreenPresent(SCR_ID_UM_INBOX))
- {
- DeleteUptoScrID(SCR_ID_UM_INBOX);
- }
- else if (IsScreenPresent(SCR_ID_UM_SENT))
- {
- DeleteUptoScrID(SCR_ID_UM_SENT);
- } */
- /* Sandeep start Nov 14 */
- if (IsScreenPresent(SCR_ID_JMMS_OUTBOX_OPTIONS))
- {
- mmi_jmms_outbox_delete_on_sent();
- }
- else if (IsScreenPresent(SCR_ID_JMMS_DRAFTS_OPTIONS))
- {
- mmi_jmms_drafts_delete_on_sent();
- }
- else if (IsScreenPresent(SCR_ID_JMMS_PREVIEW))
- {
- DeleteScreenFromToNnodes(SCR_ID_JMMS_PROGRESS, 5);
- }
- else if (!IsScreenPresent(SCR_ID_UM_MAIN))
- {
- DeleteScreenFromToNnodes(SCR_ID_JMMS_PROGRESS, 3);
- }
- else
- {
- DeleteScreenFromToNnodes(SCR_ID_JMMS_PROGRESS, 4);
- }
- #else /* __MMI_UNIFIED_MESSAGE__ */
- if (IsScreenPresent(SCR_ID_JMMS_INBOX))
- {
- DeleteUptoScrID(SCR_ID_JMMS_INBOX);
- }
- else if (IsScreenPresent(SCR_ID_JMMS_OUTBOX))
- {
- DeleteUptoScrID(SCR_ID_JMMS_OUTBOX);
- }
- if (g_jmms_context->last_scr_id == SCR_ID_JMMS_OUTBOX_OPTIONS)
- {
- mmi_jmms_outbox_delete_on_sent();
- }
- else if (g_jmms_context->last_scr_id == SCR_ID_JMMS_DRAFTS_OPTIONS)
- {
- mmi_jmms_drafts_delete_on_sent();
- }
- else
- {
- DeleteScreenFromToNnodes(SCR_ID_JMMS_PROGRESS, 3);
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- mmi_jmms_deinit_mms_context(jmms_context);
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- goto END1;
- }
- else
- {
- if (pSendHdr->eStatus == E_RESP_ERR_UNSUPPORTED_MSG
- || pSendHdr->eStatus == E_RESP_ERR_MESG_NOT_FOUND
- || pSendHdr->eStatus == E_RESP_ERR_MSG_FORMAT_CORRUPT)
- {
- jmms_context->nSent_retry_counter++;
- if (jmms_context->nSent_retry_counter >= 3) /* /TODO:: may need to change to 3 i.e. also for 1.1 */
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT);
- goto END;
- }
- else
- {
- if (GetActiveScreenId() == SCR_ID_JMMS_PROGRESS)
- {
- ChangeTitleString((U8*)GetString(STR_ID_JMMS_RETRY));
- draw_title();
- cat66_update_progress_string();
- }
- /* Sandeep Start 16 Nov to fix MAUI00226856 */
- strcpy((PS8) temp_version, (PS8) "1.0");
- if (strcmp((S8*) jmms_context->version, (S8*) temp_version) == 0)
- {
- strcpy((PS8) jmms_context->version, (PS8) "1.1");
- }
- else
- {
- strcpy((PS8) temp_version, (PS8) "1.1");
- if (strcmp((S8*) jmms_context->version, (S8*) temp_version) == 0)
- {
- strcpy((PS8) jmms_context->version, (PS8) "1.2");
- }
- else
- {
- strcpy((PS8) temp_version, (PS8) "1.2");
- if (strcmp((S8*) jmms_context->version, (S8*) temp_version) == 0)
- {
- strcpy((PS8) jmms_context->version, (PS8) "1.0");
- }
- else
- {
- jmms_communication_state_node *comm_node = NULL;
- comm_node = mmi_jmms_get_comm_state(jmms_context, pURLInd->uiRequestID);
- eRet = mmi_jmms_send_and_store_mms("Outbox", jmms_context->msg_handle, comm_node);
- if(eRet == JC_OK)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT_AND_STORED);
- goto END;
- }
- else
- {
- if (eRet == E_MEMORY_FULL_ERROR)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_COMM_ABORTED_AND_FAIL_STORE_MEMORY);
- goto END;
- }
- else if (eRet == JC_ERR_MEMORY_ALLOCATION || eRet == JC_ERR_FILE_WRITE)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_COMM_ABORTED_AND_FAIL_STORE_MEM_FULL);
- goto END;
- }
- else
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_COMM_ABORTED_AND_FAIL_STORE);
- goto END;
- }
- }
- }
- }
- }
- /* Sandeep end 16 Nov to fix MAUI00226856 */
- if (NULL != hTempMsg)
- {
- mmi_jmms_jdi_msg_deinit(hTempMsg);
- hTempMsg = NULL;
- }
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- eRet = jdi_CommunicationFreeReference(jmms_context->hCommHandle, pURLInd->uiRequestID);
- if (JC_OK != eRet)
- {
- pURLInd->uiRequestID = 0;
- mmi_jmms_free_message_header();
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, g_jmms_context->last_scr_id);
- return eRet;
- }
- pURLInd->uiRequestID = 0;
- /* Register the function that to be execute after the completion of the
- encapsulation */
- mmi_jmms_add_send_callback_node(mmi_jmms_handle_new_mms_send_response_asynch_callback);
- mmi_jmms_send_mms(jmms_context->msg_handle, E_TYPE_NEW_MMS, E_TRUE, 1, E_TRUE);
- return JC_OK;
- }
- }
- else if (pSendHdr->eStatus == E_RESP_ERR_NETWORK_PROBLEM || // TODO:: need to check right status
- pSendHdr->eStatus == E_RESP_ERR_SERVICE_DENIED)
- {
- /* /added for retry mechanism */
- if (pURLInd->uiRequestID)
- {
- eRet = jdi_CommunicationFreeReference(jmms_context->hCommHandle, pURLInd->uiRequestID);
- if (JC_OK != eRet)
- {
- /* 2 March -- need care */
- mmi_jmms_free_message_header();
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- pURLInd->uiRequestID = 0;
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, g_jmms_context->last_scr_id);
- return eRet;
- }
- }
- eRet = mmi_jmms_retry_communication(
- jmms_context,
- E_FROM_URL_CALLBACK,
- pURLInd->uiRequestID,
- pSendHdr->eStatus);
- if (JC_OK != eRet && eRet != E_JMMS_RETRY_COMPLETE) /* /if eRet=E_JMMS_RETRY_COMPLETE then it means error already handled */
- {
- mmi_jmms_free_message_header();
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- pURLInd->uiRequestID = 0;
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT);
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, g_jmms_context->last_scr_id);
- return eRet;
- }
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- pURLInd->uiRequestID = 0;
- return eRet;
- }
- else
- {
- /*Dilip Start 24 Aug 2006*/
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (IsScreenPresent(SCR_ID_UM_UNSENT))
- {
- DeleteUptoScrID(SCR_ID_UM_UNSENT);
- }
- else if (IsScreenPresent(SCR_ID_UM_DRAFT))
- {
- DeleteUptoScrID(SCR_ID_UM_DRAFT);
- }
- else if (IsScreenPresent(SCR_ID_UM_INBOX))
- {
- DeleteUptoScrID(SCR_ID_UM_INBOX);
- }
- else if(IsScreenPresent(SCR_ID_UM_SENT))
- {
- DeleteUptoScrID(SCR_ID_UM_SENT);
- }
- #endif
- /*Dilip End 24 Aug 2006*/
- //TODO:: display error pop up with preoper string for error
- ///by knowing error type status
- /* sandeep start to fix MAUI_00420829 */
- mmi_jmms_handle_error_string(pSendHdr->eStatus, E_TYPE_NEW_MMS);
- //mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT);
- /* sandeep end to fix MAUI_00420829 */
- }
- }
- }
- break;
- default:
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_UNABLE_PARSE_SENT_RESPONSE);
- } /* /end of switch(pMsgHeaders->eMsgType) */
- END:
- /* These lines are added to remove the auto signature or blank slide in case of
- MMS sending fail. --- By Raj Kumar Gupta on August 29, 2006 */
- //#ifdef __MMI_MMS_SIGNATURE__
- mmi_jmms_del_inserted_auto_signature_slide();
- //#endif
- /* End of changes */
- // DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, g_jmms_context->last_scr_id);
- DeleteScreenIfPresent(SCR_ID_JMMS_PROGRESS);
- DeleteScreenIfPresent(SCR_ID_JMMS_SENT_OPTIONS);
- DeleteScreenIfPresent(SCR_ID_JMMS_DRAFTS_OPTIONS);
- DeleteScreenIfPresent(SCR_ID_JMMS_OUTBOX_OPTIONS);
- DeleteScreenIfPresent(SCR_ID_WRITE_MMS_DONE_OPTIONS);
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- END1:
- ///for E_TYPE_IMMEDIATE_RETRIEVAL_FETCH state has been set to E_TYPE_NOTIFICATION_RESPONSE
- ///soo don't set to E_TYPE_NULL
- /* free any allocated memory */
- mmi_jmms_free_message_header();
- if (NULL != hTempMsg)
- {
- mmi_jmms_jdi_msg_deinit(hTempMsg);
- }
- eRet = jdi_CommunicationFreeReference(jmms_context->hCommHandle, pURLInd->uiRequestID);
- pURLInd->uiRequestID = 0;
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_new_mms_send_response_asynch_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * eRet [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_handle_new_mms_send_response_asynch_callback(JC_RETCODE eRet)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_new_mms_send_response_asynch_callback"));
- if (JC_OK != eRet)
- {
- mmi_jmms_free_message_header();
- if (eRet == E_JMMS_STORAGE_FULL)
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT_STORE_FUL);
- }
- /* Added by - Raj Kumar Gupta on 31 August, 2006 */
- else if(eRet == E_COMMUNICATION_ABORTED)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_JMMS_COMM_ABORTED),
- IMG_GLOBAL_INFO,
- 1,
- JMMS_POPUP_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT);
- }
- DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, g_jmms_context->last_scr_id);
- }
- }
- #ifdef MMI_JMMS_JAVA_MMS_SUPPORT
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_jsr_mms_send_response
- * DESCRIPTION
- *
- * PARAMETERS
- * jmms_context [?] [?] [?]
- * pURLInd [?] [?] [?]
- * Content [IN]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_jsr_mms_send_response(
- jmms_context_struct *jmms_context,
- COMM_FETCH_URL_IND_RESP *pURLInd,
- CONTENT_DATA Content)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- MSG_HANDLE hTempMsg = NULL;
- MESSAGE_HEADERS *pMsgHeaders = NULL;
- EMM1MessageType eMsg;
- U8 num_retries = 0;
- S8 temp_version[MAX_VERSION_LENGTH + 1];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_jsr_mms_send_response"));
- eRet = mmi_jmms_jdi_parse_msg_buffer(&hTempMsg, &Content, E_TYPE_MMS, E_FALSE);
- /* Async changes begin */
- while (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- eRet = mmi_jmms_jdi_msg_parse_continue(hTempMsg);
- };
- /* Async changes end */
- if (eRet != JC_OK)
- {
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_ERROR);
- goto END;
- }
- eRet = mmi_jmms_jdi_get_msg_headers(hTempMsg, &pMsgHeaders);
- if (eRet != JC_OK)
- {
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_ERROR);
- goto END;
- }
- eMsg = pMsgHeaders->eMsgType;
- switch (pMsgHeaders->eMsgType)
- {
- case E_MSG_TYPE_SEND_RESPONSE:
- {
- MESSAGE_SEND_RESPONSE *pSendHdr = (MESSAGE_SEND_RESPONSE*) pMsgHeaders->pHeaders;
- U8 *temp_uniocde_url = NULL;
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s%d", "JMMS JSR send response, Status:", pSendHdr->eStatus));
- if (E_RESP_OK == pSendHdr->eStatus)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s%d", "JMMS JSR send response, OK"));
- num_retries = jmms_context->nSent_retry_counter;
- temp_uniocde_url = mmi_jmms_get_activated_mmsc_url(jmms_context);
- jmms_context->nSent_last_MMSC_URL = (S8*) temp_uniocde_url;
- /*
- * No need to convert into Unicode string.
- *
- * Modified by : Raj Kumar Gupta
- * Date : July 27, 2006
- */
- /* /version should always be in ansii */
- strcpy((PS8) jmms_context->nSent_last_version, (PS8) pSendHdr->pVersion);
- if (num_retries >= 1) /* /MMS was sent in 2 retries due to version problem */
- { /* store such mmsc urls in a file */
- /* /wrie/update the MMSC URL and version into file */
- mmi_jmms_update_mmsc_url_version(
- jmms_context->nSent_last_MMSC_URL,
- jmms_context->nSent_last_version);
- }
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_OK);
- goto END;
- }
- else
- {
- if (pSendHdr->eStatus == E_RESP_ERR_UNSUPPORTED_MSG
- || pSendHdr->eStatus == E_RESP_ERR_MESG_NOT_FOUND
- || pSendHdr->eStatus == E_RESP_ERR_MSG_FORMAT_CORRUPT)
- {
- jmms_context->nSent_retry_counter++;
- if (jmms_context->nSent_retry_counter >= 2) /* /TODO:: may need to change to 3 i.e. also for 1.1 */
- {
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_ERROR);
- goto END;
- }
- else
- {
- strcpy((PS8) temp_version, (PS8) "1.0");
- if (strcmp((S8*) jmms_context->version, (S8*) temp_version) == 0)
- {
- strcpy((PS8) jmms_context->version, (PS8) "1.2");
- }
- else
- {
- strcpy((PS8) temp_version, (PS8) "1.2");
- if (strcmp((S8*) jmms_context->version, (S8*) temp_version) == 0)
- {
- strcpy((PS8) jmms_context->version, (PS8) "1.0");
- }
- else
- {
- // TODO:: may need to check for 1.1 also
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_ERROR);
- goto END;
- }
- }
- if (NULL != hTempMsg)
- {
- mmi_jmms_jdi_msg_deinit(hTempMsg);
- hTempMsg = NULL;
- }
- ///manish - commenting
- ///mmi_jmms_free_comm_node(jmms_context,pURLInd->uiRequestID);
- eRet = jdi_CommunicationFreeReference(jmms_context->hCommHandle, pURLInd->uiRequestID);
- if (JC_OK != eRet)
- {
- pURLInd->uiRequestID = 0;
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_ERROR);
- return eRet;
- }
- pURLInd->uiRequestID = 0;
- {
- jmms_communication_state_node *comm_node = NULL;
- comm_node = mmi_jmms_get_comm_state(jmms_context, pURLInd->uiRequestID);
- if (comm_node == NULL)
- {
- pURLInd->uiRequestID = 0;
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_ERROR);
- return eRet;
- }
- eRet = mmi_jmms_resend_mms(comm_node, 1);
- if (JC_OK != eRet)
- {
- pURLInd->uiRequestID = 0;
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_ERROR);
- return eRet;
- }
- }
- if (JC_OK != eRet)
- {
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_ERROR);
- }
- return eRet;
- }
- }
- else if (pSendHdr->eStatus == E_RESP_ERR_NETWORK_PROBLEM || // TODO:: need to check right status
- pSendHdr->eStatus == E_RESP_ERR_SERVICE_DENIED)
- {
- /* /added for retry mechanism */
- if (pURLInd->uiRequestID)
- {
- eRet = jdi_CommunicationFreeReference(jmms_context->hCommHandle, pURLInd->uiRequestID);
- if (JC_OK != eRet)
- {
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- pURLInd->uiRequestID = 0;
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_ERROR);
- return eRet;
- }
- }
- eRet = mmi_jmms_retry_communication(
- jmms_context,
- E_FROM_URL_CALLBACK,
- pURLInd->uiRequestID,
- pSendHdr->eStatus);
- if (JC_OK != eRet && eRet != E_JMMS_RETRY_COMPLETE)
- {
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- pURLInd->uiRequestID = 0;
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_ERROR);
- return eRet;
- }
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- pURLInd->uiRequestID = 0;
- return eRet;
- }
- else
- {
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_ERROR);
- }
- }
- }
- break;
- default:
- (*(jmms_context->jsr_mms_send_callback)) (JSR_RESULT_ERROR);
- } /* /end of switch switch(pMsgHeaders->eMsgType) */
- END:
- mmi_jmms_free_comm_node(jmms_context, pURLInd->uiRequestID);
- if (NULL != hTempMsg)
- {
- mmi_jmms_jdi_msg_deinit(hTempMsg);
- }
- eRet = jdi_CommunicationFreeReference(jmms_context->hCommHandle, pURLInd->uiRequestID);
- pURLInd->uiRequestID = 0;
- return eRet;
- }
- #endif /* MMI_JMMS_JAVA_MMS_SUPPORT */ /* //MMI_JMMS_JAVA_MMS_SUPPORT */
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_handle_pop_up_for_interupt
- * DESCRIPTION
- *
- * PARAMETERS
- * strid [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_handle_pop_up_for_interupt(U16 strid)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_pop_up_for_interupt"));
- if (GetActiveScreenId() != SCR_ID_JMMS_PROGRESS)
- {
- U16 k;
- MMI_BOOL ret;
- history hist;
- historyNode *saved_history;
- interupt_screen_title = strid;
- memset(&hist, 0, sizeof(history));
- if (GetCurrScrnId() == SCR_ID_JMMS_PROGRESS)
- {
- hist.scrnID = SCR_ID_JMMS_POP_SCREEN;
- hist.entryFuncPtr = mmi_jmms_entry_general_pop_screen_in_case_interupt;
- AddHistory(hist);
- /* This is a workaround to make sure that if small screen is the current screen on MMI.
- Its state is not changed and SCR_ID_JMMS_POP_SCREEN is not saved as small screen */
- GetHistoryPointer(SCR_ID_JMMS_POP_SCREEN,&saved_history);
- if(saved_history->isSmallScreen==1)
- {
- saved_history->isSmallScreen=0;
- set_small_screen();
- }
- }
- else
- {
- /* for test */
- ret = GetNextScrnIdOf(SCR_ID_JMMS_PROGRESS, &k);
- if (ret == MMI_TRUE)
- {
- hist.scrnID = SCR_ID_JMMS_POP_SCREEN;
- hist.entryFuncPtr = mmi_jmms_entry_general_pop_screen_in_case_interupt;
- InsertHistoryBeforeThisScrnReference(k, &hist);
- }
- }
- }
- else
- {
- if (strid == STR_ID_JMMS_SUCCESS_MMS_SENT || strid == STR_ID_JMMS_SUCCESS_MMS_SENT_ONLY)
- {
- DisplayPopup((U8*) GetString(strid), IMG_GLOBAL_ACTIVATED, 1, JMMS_POPUP_TIME, SUCCESS_TONE);
- }
- else
- {
- DisplayPopup((U8*) GetString(strid), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_general_pop_screen_in_case_interupt
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_entry_general_pop_screen_in_case_interupt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_JMMS_POP_SCREEN, NULL, mmi_jmms_entry_general_pop_screen_in_case_interupt, NULL);
- ShowCategory2Screen(
- STR_MMS_MENUENTRY,
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- interupt_screen_title,
- NULL);
- if (interupt_screen_title == STR_ID_JMMS_MMS_DOWNLAOD_SUCCESS)
- {
- SetRightSoftkeyFunction(mmi_jmms_back_msg_download_sucess, KEY_EVENT_UP);
- if (isInCall() == FALSE)
- SetKeyHandler(mmi_jmms_end_key_downlaod_sucess_pop_screen, KEY_END, KEY_EVENT_DOWN); /* /delete the link list */
- }
- else
- {
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_end_key_downlaod_sucess_pop_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_end_key_downlaod_sucess_pop_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_jmms_deinit_mms_context(g_jmms_context);
- GoBackToHistory(IDLE_SCREEN_ID);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_back_msg_download_sucess
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_back_msg_download_sucess(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_jmms_context->is_unread_msg_deleted = 0;
- mmi_jmms_set_msg_as_read((U8) g_jmms_context->mms_index);
- #ifdef __MMI_UNIFIED_MESSAGE__
- g_jmms_context->show_property_screen = MMI_TRUE;
- #endif
- mmi_jmms_handle_read_report(g_jmms_context->MsgHeader_type_p);
- }
- /* PMT VIKAS START 20060401 */
- #include"wgui_status_icons.h"
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_show_mms_status_icon
- * DESCRIPTION
- * To show MMS indicator icon
- * PARAMETERS
- * status [IN]
- * STATUS
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_show_mms_status_icon(mmi_jmms_status_icon_type status)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (status)
- {
- case MMS_STATUS_OFF:
- HideStatusIcon(STATUS_ICON_MMS_UNREAD);
- HideStatusIcon(STATUS_ICON_MMS_BUSY);
- break;
- case MMS_STATUS_NEW_MESSAGE:
- HideStatusIcon(STATUS_ICON_MMS_BUSY);
- HideStatusIcon(STATUS_ICON_MMS_UNREAD);
- ShowStatusIcon(STATUS_ICON_MMS_UNREAD);
- break;
- case MMS_STATUS_BUSY:
- HideStatusIcon(STATUS_ICON_MMS_UNREAD);
- HideStatusIcon(STATUS_ICON_MMS_BUSY);
- BlinkStatusIcon(STATUS_ICON_MMS_BUSY);
- break;
- case MMS_STATUS_FULL:
- HideStatusIcon(STATUS_ICON_MMS_UNREAD);
- HideStatusIcon(STATUS_ICON_MMS_BUSY);
- BlinkStatusIcon(STATUS_ICON_MMS_UNREAD);
- break;
- default:
- HideStatusIcon(STATUS_ICON_MMS_UNREAD);
- HideStatusIcon(STATUS_ICON_MMS_BUSY);
- break;
- }
- UpdateStatusIcons();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_set_mms_downloading_busy
- * DESCRIPTION
- * To handle MMS downloading indicator
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_set_mms_downloading_busy(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_mms_downloading_busy++;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_reset_mms_downloading_busy
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_reset_mms_downloading_busy(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s%d ", "mmi_jmms_reset_mms_downloading_busy Val=", g_mms_downloading_busy));
- if (g_mms_downloading_busy != 0)
- {
- g_mms_downloading_busy--;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_is_download_busy
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- U8 mmi_jmms_is_download_busy(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s%d", "Download Busy=",g_mms_downloading_busy));
- return g_mms_downloading_busy;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_stop_download_busy
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_stop_download_busy(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s%d", "Download Busy=",g_mms_downloading_busy));
- g_mms_downloading_busy = 0;
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_update_status_icon_indicator
- * DESCRIPTION
- * To set indicator icon
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_update_status_icon_indicator(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 unread_msgs = 0;
- U8 total_num_messages;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_update_status_icon_indicator"));
- if (mmi_jmms_is_download_busy() > 0)
- {
- mmi_jmms_show_mms_status_icon(MMS_STATUS_BUSY);
- }
- else
- {
- eRet = mmi_jmms_get_total_number_of_messages(&total_num_messages);
- if (eRet != JC_OK)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s%d", "No Update, eRet = ",eRet));
- return;
- }
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s%d", "Total Messages=",total_num_messages));
- if (total_num_messages >= (MAX_POSSIBLE_MESSAGES_THRESHOLD))
- {
- mmi_jmms_show_mms_status_icon(MMS_STATUS_FULL);
- }
- else
- {
- mmi_jmms_get_number_of_unread_messages_in_inbox(&unread_msgs);
- if (unread_msgs > 0)
- {
- mmi_jmms_show_mms_status_icon(MMS_STATUS_NEW_MESSAGE);
- }
- else
- {
- mmi_jmms_show_mms_status_icon(MMS_STATUS_OFF);
- }
- }
- }
- }
- /* PMT VIKAS END 20060401 */
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_add_memory_full_node_if_not_already
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_add_memory_full_node_if_not_already(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- MMI_BOOL found = MMI_FALSE;
- jmms_pending_mms_info_struct *node1 = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- node1 = g_jmms_context->pending_mms_info_list;
- while (node1 != NULL)
- {
- if (node1->Index == STR_ID_JMMS_ERROR_MMS_MEMORY_FULL)
- {
- found = MMI_TRUE;
- break;
- }
- node1 = node1->next;
- }
- if (found == MMI_FALSE)
- {
- eRet = mmi_jmms_add_pending_mms_info_node(
- (U16) STR_ID_JMMS_ERROR_MMS_MEMORY_FULL,
- (U8) E_MSG_TYPE_IDLE_SCREEN_POP_UP,
- NULL);
- if (eRet == JC_OK)
- {
- mmi_jmms_check_for_idle_screen();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_remove_memory_full_node_if_present
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_remove_memory_full_node_if_present(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- jmms_pending_mms_info_struct *node1 = NULL;
- jmms_pending_mms_info_struct *node2 = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- node1 = g_jmms_context->pending_mms_info_list;
- node2 = g_jmms_context->pending_mms_info_list;
- while (node1 != NULL)
- {
- if (node1->Index == STR_ID_JMMS_ERROR_MMS_MEMORY_FULL)
- {
- node2->next = node1->next;
- if (node1->mms_url != NULL)
- {
- jdd_MemFree(node1->mms_url);
- }
- if(node1 == g_jmms_context->pending_mms_info_list)
- g_jmms_context->pending_mms_info_list = node1->next;
- jdd_MemFree(node1);
- node1 = NULL;
- break;
- }
- node2 = node1;
- node1 = node1->next;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_end_key_progressing
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_jmms_end_key_progressing(void)
- {
- mmi_jmms_end_comm();
- g_end_key_processing_handler();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_set_end_key_progressing_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_jmms_set_end_key_progressing_handler(void)
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_set_end_key_progressing_handler"));
- if(!isInCall())
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "End Key is Set for Communication"));
- g_end_key_processing_handler=GetKeyHandler(KEY_END,KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_end_key_progressing, KEY_END, KEY_EVENT_DOWN);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_update_pending_downloads
- * DESCRIPTION
- * This function updates the message Index of notifications pending for download
- * PARAMETERS
- * JC_UINT32T
- * RETURNS
- * JC_RETCODE
- *****************************************************************************/
- JC_RETCODE mmi_jmms_update_pending_downloads(JC_UINT32 msg_index)
- {
- jmms_communication_state_node *comm_node = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "mmi_jmms_update_pending_downloads:",
- msg_index));
- comm_node = g_jmms_context->comm_state;
- ASSERT(msg_index);
- while (comm_node != NULL)
- {
- if ((comm_node->mms_communication_state == E_TYPE_IMMEDIATE_RETRIEVAL_FETCH)||
- (comm_node->mms_communication_state == E_TYPE_DEFFERED_RETRIEVAL_FETCH))
- {
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "Notofication found. Msg Id:",
- comm_node->msg_index));
- if(comm_node->msg_index > msg_index)
- {
- --comm_node->msg_index;
- }
- else if (comm_node->msg_index == msg_index)
- {
- ASSERT(0);
- }
- }
- comm_node = comm_node->next;
- }
- return JC_OK;
- }
- #endif /* (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT)) */