2 * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include "MsgCppTypes.h"
22 #include "MsgUtilFile.h"
23 #include "MsgException.h"
24 #include "MsgSettingTypes.h"
25 #include "MsgMmsMessage.h"
26 #include "MsgGconfWrapper.h"
27 #include "MsgSerialize.h"
28 #include "MsgSpamFilter.h"
29 #include "MsgUtilMime.h"
30 #include "MsgUtilFunction.h"
32 #include "MmsPluginDebug.h"
33 #include "MmsPluginTypes.h"
34 #include "MmsPluginCodec.h"
35 #include "MmsPluginInternal.h"
36 #include "MmsPluginStorage.h"
37 #include "MmsPluginAppBase.h"
39 /*==================================================================================================
40 IMPLEMENTATION OF MmsPluginInternal - Member Functions
41 ==================================================================================================*/
42 MmsPluginInternal *MmsPluginInternal::pInstance = NULL;
45 MmsPluginInternal::MmsPluginInternal()
49 MmsPluginInternal::~MmsPluginInternal()
53 MmsPluginInternal *MmsPluginInternal::instance()
56 pInstance = new MmsPluginInternal();
61 void MmsPluginInternal::processReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest, bool *bReject)
66 char fileName[MSG_FILENAME_LEN_MAX] = {0, };
68 if (pMsgInfo->bTextSms == true) {
69 char fullPath[MAX_FULL_PATH_SIZE+1] = {0, };
71 if (MsgCreateFileName(fileName) == false)
72 THROW(MsgException::FILE_ERROR, "MsgCreateFileName error");
74 MSG_SEC_DEBUG("File name = %s", fileName);
76 if (MsgWriteIpcFile(fileName, pMsgInfo->msgText, pMsgInfo->dataSize) == false)
77 THROW(MsgException::FILE_ERROR, "MsgWriteIpcFile error");
79 snprintf(fullPath, MAX_FULL_PATH_SIZE+1, "%s%s", MSG_IPC_DATA_PATH, fileName);
81 memset(pMsgInfo->msgData, 0x00, sizeof(pMsgInfo->msgData));
82 memcpy(pMsgInfo->msgData, fullPath, strlen(fullPath));
83 pMsgInfo->bTextSms = false;
86 MSG_SEC_DEBUG("MMS File Path = %s", pMsgInfo->msgData);
89 MmsRegisterDecodeBuffer();
91 if ((pFile = MsgOpenFile(pMsgInfo->msgData, "rb+")) == NULL) {
92 MSG_DEBUG("File Open Error: %s", pMsgInfo->msgData);
95 if (!MmsBinaryDecodeMsgHeader(pFile, pMsgInfo->dataSize))
96 MSG_DEBUG("Decoding Header Failed \r\n");
100 if (remove(pMsgInfo->msgData) != 0)
101 MSG_DEBUG("Fail remove");
103 switch (mmsHeader.type) {
104 case MMS_MSGTYPE_NOTIFICATION_IND:
105 MSG_DEBUG("process noti.ind\n");
106 /* For Set Value pMsgInfo */
107 if (processNotiInd(pMsgInfo, pRequest) == false)
113 case MMS_MSGTYPE_DELIVERY_IND:
114 MSG_DEBUG("process delivery.ind\n");
115 /* For Set Value pMsgInfo */
116 processDeliveryInd(pMsgInfo);
119 case MMS_MSGTYPE_READORG_IND:
120 MSG_DEBUG("process readorig.ind\n");
121 processReadOrgInd(pMsgInfo);
131 bool MmsPluginInternal::processNotiInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest)
133 MSG_DEBUG("MmsProcessNotiInd");
135 MSG_MMS_HOME_RETRIEVE_TYPE_T retrieveType;
139 MsgDbHandler *dbHandle = getDbHandle();
141 MmsInitMsgAttrib(&attrib);
143 pMsgInfo->msgType.mainType = MSG_MMS_TYPE;
144 pMsgInfo->msgType.subType = MSG_NOTIFICATIONIND_MMS;
145 pMsgInfo->priority = mmsHeader.priority;
146 strncpy(pMsgInfo->subject, mmsHeader.szSubject, MSG_LOCALE_SUBJ_LEN);
148 MSG_DEBUG("pMsgInfo->subject [%s]", pMsgInfo->subject);
150 #if 0 /* we do not need to add empty subject text any more. */
151 if (strlen(pMsgInfo->subject) < 1)
152 snprintf(pMsgInfo->subject, MAX_SUBJECT_LEN, "MMS Notification Message.");
155 attrib.expiryTime = mmsHeader.expiryTime;
157 if (mmsHeader.pFrom) {
158 MmsAddrUtilRemovePlmnString(mmsHeader.pFrom->szAddr);
160 strncpy(pMsgInfo->addressList[0].addressVal, mmsHeader.pFrom->szAddr, MAX_ADDRESS_VAL_LEN);
161 if (MmsAddrUtilCheckEmailAddress(pMsgInfo->addressList[0].addressVal)) {
162 pMsgInfo->addressList[0].addressType = MSG_ADDRESS_TYPE_EMAIL;
166 MMS_DATA_S *mms_data = MsgMmsCreate();
167 if (mms_data == NULL)
170 mms_data->header = MsgMmsCreateHeader();
172 if (mms_data->header == NULL) {
173 MsgMmsRelease(&mms_data);
177 MMS_HEADER_DATA_S *pHeader = mms_data->header;
179 pHeader->messageType = mmsHeader.type;
181 snprintf(pHeader->trID, sizeof(pHeader->trID), "%s", mmsHeader.szTrID);
183 pHeader->mmsVersion = mmsHeader.version;
186 if (mmsHeader.pFrom) {
187 MmsAddrUtilRemovePlmnString(mmsHeader.pFrom->szAddr);
188 snprintf(pHeader->szFrom, sizeof(pHeader->szFrom), "%s", mmsHeader.pFrom->szAddr);
192 snprintf(pHeader->szSubject, sizeof(pHeader->szSubject), "%s", mmsHeader.szSubject);
193 /* Delivery Report */
194 pHeader->bDeliveryReport = (mmsHeader.deliveryReport != MMS_REPORT_YES);
196 pHeader->messageClass = mmsHeader.msgClass;
199 pHeader->mmsPriority = mmsHeader.priority;
201 /* Message Size : pMmsMsg->mmsAttrib.msgSize = mmsHeader.msgSize; */
203 pHeader->expiry.type = mmsHeader.expiryTime.type;
204 pHeader->expiry.time = mmsHeader.expiryTime.time;
206 time_t curTime = time(NULL);
208 if (pHeader->expiry.type == MMS_TIMETYPE_RELATIVE) {
209 pHeader->expiry.type = MMS_TIMETYPE_ABSOLUTE;
210 pHeader->expiry.time += curTime;
215 /* int contentClass; */ /*text | image-basic| image-rich | video-basic | video-rich | megapixel | content-basic | content-rich */
216 strncpy(pHeader->contentLocation, mmsHeader.szContentLocation, MMS_LOCATION_LEN);
218 pHeader->messageSize = mmsHeader.msgSize;
220 MSG_DEBUG("Message size = [%d]", pHeader->messageSize);
222 char *pSerializedMms = NULL;
223 int serializeDataSize = 0;
225 char pTempFileName[MSG_FILENAME_LEN_MAX+1] = {0};
226 char pTempFilePath[MSG_FILEPATH_LEN_MAX+1] = {0};
228 serializeDataSize = MsgSerializeMms(mms_data, &pSerializedMms);
230 if (pSerializedMms) {
231 if (MsgCreateFileName(pTempFileName) == true) {
232 pMsgInfo->bTextSms = false;
234 snprintf(pTempFilePath, sizeof(pTempFilePath), "%s%s", MSG_IPC_DATA_PATH, pTempFileName);
236 MsgOpenCreateAndOverwriteFile(pTempFilePath, pSerializedMms, serializeDataSize);
239 snprintf(pMsgInfo->msgData, sizeof(pMsgInfo->msgData), "%s", pTempFileName);
242 delete [] pSerializedMms;
245 MsgMmsRelease(&mms_data);
247 /* Check contents-location is in noti.ind */
248 if (mmsHeader.szContentLocation[0] == '\0') {
249 THROW(MsgException::INCOMING_MSG_ERROR, "######## Contents-location is empty in MMS-Noti-Ind #######");
254 char pPduFilePath[MAX_FULL_PATH_SIZE] = {0};
256 if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SVC_ROAM, &roamState) != MSG_SUCCESS)
257 MSG_INFO("MsgSettingGetInt() is failed");
259 if (MsgSettingGetBool(MMS_SEND_REPORT_ALLOWED, &bReportAllowed) != MSG_SUCCESS)
260 MSG_INFO("MsgSettingGetBool() is failed");
262 if (checkRejectNotiInd(roamState, bReportAllowed, pPduFilePath)) {
263 MSG_DEBUG("MMS Message Rejected......");
265 pMsgInfo->dataSize = strlen(pPduFilePath);
266 memcpy(&pRequest->msgInfo, pMsgInfo, sizeof(MSG_MESSAGE_INFO_S));
267 snprintf(pRequest->msgInfo.msgData, sizeof(pRequest->msgInfo.msgData), "%s", pPduFilePath);
268 pRequest->msgInfo.msgType.subType = MSG_NOTIFYRESPIND_MMS;
273 if (MsgCheckFilter(dbHandle, pMsgInfo)) {
274 encodeNotifyRespInd(mmsHeader.szTrID, MSG_DELIVERY_REPORT_DEFERRED, bReportAllowed, pPduFilePath);
276 pMsgInfo->dataSize = strlen(pPduFilePath);
278 pRequest->msgInfo.bTextSms = false;
280 memcpy(&pRequest->msgInfo, pMsgInfo, sizeof(MSG_MESSAGE_INFO_S));
282 snprintf(pRequest->msgInfo.msgData, sizeof(pRequest->msgInfo.msgData), "%s", pPduFilePath);
283 MSG_SEC_DEBUG("pRequest->msgInfo.msgData = %s", pRequest->msgInfo.msgData);
284 pRequest->msgInfo.msgType.subType = MSG_NOTIFYRESPIND_MMS;
285 pRequest->msgInfo.folderId = MSG_SPAMBOX_ID;
291 if (roamState == VCONFKEY_TELEPHONY_SVC_ROAM_OFF) {
292 if (MsgSettingGetInt(MMS_RECV_HOME_NETWORK, &tmpVal) != MSG_SUCCESS) {
293 MSG_INFO("MsgSettingGetInt() is failed");
295 retrieveType = (MSG_MMS_HOME_RETRIEVE_TYPE_T)tmpVal;
296 MSG_DEBUG("$$$$$$$$$$ MMS_RECV_HOME_NETWORK = %d $$$$$$$$$$$$$", retrieveType);
298 if (MsgSettingGetInt(MMS_RECV_ABROAD_NETWORK, &tmpVal) != MSG_SUCCESS) {
299 MSG_INFO("MsgSettingGetInt() is failed");
301 retrieveType = (MSG_MMS_HOME_RETRIEVE_TYPE_T)tmpVal;
302 MSG_DEBUG("$$$$$$$$$$ MMS_RECV_ABROAD_NETWORK = %d $$$$$$$$$$$$$", retrieveType);
304 if (retrieveType == MSG_ABROAD_RESTRICTED) {
305 MSG_DEBUG("MMS Receiving Setting Restricted was selected.");
306 /* m-notify-resp-ind encoding process */
307 encodeNotifyRespInd(mmsHeader.szTrID, MSG_DELIVERY_REPORT_DEFERRED, bReportAllowed, pPduFilePath);
309 pMsgInfo->dataSize = strlen(pPduFilePath);
311 pRequest->msgInfo.bTextSms = false;
313 memcpy(&pRequest->msgInfo, pMsgInfo, sizeof(MSG_MESSAGE_INFO_S));
315 snprintf(pRequest->msgInfo.msgData, sizeof(pRequest->msgInfo.msgData), "%s", pPduFilePath);
317 pRequest->msgInfo.msgType.subType = MSG_NOTIFYRESPIND_MMS;
323 /* should send http 'GET' */
324 if (retrieveType == MSG_HOME_AUTO_DOWNLOAD || retrieveType == MSG_ABROAD_AUTO_DOWNLOAD) {
325 /* Check if current request sim index is different from default network SIM */
326 /* Convert auto-retrieve to manual retrieve in case sim indexes are different */
328 if (MsgSettingGetInt(MSG_NETWORK_SIM, &default_sim) != MSG_SUCCESS) {
329 MSG_INFO("MsgSettingGetInt() is failed");
332 MSG_DEBUG("default_sim = %d, pMsgInfo->sim_idx = %d", default_sim, pMsgInfo->sim_idx);
334 if (default_sim == (int)pMsgInfo->sim_idx) {
335 MSG_DEBUG("=========== START AUTO RETRIEVE MODE ============");
337 pMsgInfo->dataSize = strlen(mmsHeader.szContentLocation);
339 pRequest->msgInfo.bTextSms = true;
341 memcpy(&pRequest->msgInfo, pMsgInfo, sizeof(MSG_MESSAGE_INFO_S));
343 snprintf(pRequest->msgInfo.msgData, sizeof(pRequest->msgInfo.msgData), "%s", mmsHeader.szContentLocation);
345 pRequest->msgInfo.msgType.subType = MSG_GET_MMS;
347 MSG_SEC_DEBUG("MSG SUBTYPE = %d msg data %s bTextsms %d", pRequest->msgInfo.msgType.subType, pRequest->msgInfo.msgData, pRequest->msgInfo.bTextSms);
349 /* should send m-notify-resp-ind */
350 MSG_DEBUG("=========== START MANUAL RETRIEVE MODE ===========");
351 /* m-notify-resp-ind encoding process */
352 encodeNotifyRespInd(mmsHeader.szTrID, MSG_DELIVERY_REPORT_DEFERRED, bReportAllowed, pPduFilePath);
354 pMsgInfo->dataSize = strlen(pPduFilePath);
356 pRequest->msgInfo.bTextSms = false;
358 memcpy(&pRequest->msgInfo, pMsgInfo, sizeof(MSG_MESSAGE_INFO_S));
360 snprintf(pRequest->msgInfo.msgData, sizeof(pRequest->msgInfo.msgData), "%s", pPduFilePath);
361 MSG_SEC_DEBUG("pRequest->msgInfo.msgData = %s", pRequest->msgInfo.msgData);
362 snprintf(pRequest->msgInfo.msgURL, sizeof(pRequest->msgInfo.msgURL), "%s", mmsHeader.szContentLocation);
363 pRequest->msgInfo.msgType.subType = MSG_NOTIFYRESPIND_MMS;
366 /* should send m-notify-resp-ind */
367 MSG_DEBUG("=========== START MANUAL RETRIEVE MODE ===========");
368 /* m-notify-resp-ind encoding process */
370 if (retrieveType == MSG_HOME_MANUAL || retrieveType == MSG_ABROAD_MANUAL) {
371 encodeNotifyRespInd(mmsHeader.szTrID, MSG_DELIVERY_REPORT_DEFERRED, bReportAllowed, pPduFilePath);
374 pMsgInfo->dataSize = strlen(pPduFilePath);
376 pRequest->msgInfo.bTextSms = false;
378 memcpy(&pRequest->msgInfo, pMsgInfo, sizeof(MSG_MESSAGE_INFO_S));
380 snprintf(pRequest->msgInfo.msgData, sizeof(pRequest->msgInfo.msgData), "%s", pPduFilePath);
381 MSG_SEC_DEBUG("pRequest->msgInfo.msgData = %s", pRequest->msgInfo.msgData);
382 snprintf(pRequest->msgInfo.msgURL, sizeof(pRequest->msgInfo.msgURL), "%s", mmsHeader.szContentLocation);
383 pRequest->msgInfo.msgType.subType = MSG_NOTIFYRESPIND_MMS;
389 void MmsPluginInternal::processDeliveryInd(MSG_MESSAGE_INFO_S *pMsgInfo)
393 MmsMsgMultiStatus status;
394 memset(&status, 0x00, sizeof(MmsMsgMultiStatus));
396 status.msgStatus = mmsHeader.msgStatus;
397 status.handledTime = mmsHeader.date;
398 status.bDeliveryReportIsRead = false;
399 status.bDeliveyrReportIsLast = true;
401 MmsAddrUtilRemovePlmnString(mmsHeader.pTo->szAddr);
402 MSG_SEC_DEBUG("[INFO] [ADDR: %s, MMSID: %s]", mmsHeader.pTo->szAddr, mmsHeader.szMsgID);
404 pMsgInfo->msgType.mainType = MSG_MMS_TYPE;
405 pMsgInfo->msgType.subType = MSG_DELIVERYIND_MMS;
406 pMsgInfo->bTextSms = true;
407 pMsgInfo->dataSize = 0;
408 memset(pMsgInfo->msgData, 0x00, MAX_MSG_DATA_LEN + 1);
410 strncpy(pMsgInfo->msgData, getMmsDeliveryStatus(status.msgStatus), MAX_MSG_DATA_LEN);
411 pMsgInfo->dataSize = strlen(pMsgInfo->msgData);
412 MSG_DEBUG("Delivery Status = %s", pMsgInfo->msgData);
414 strncpy(pMsgInfo->addressList[0].addressVal, mmsHeader.pTo->szAddr, MAX_ADDRESS_VAL_LEN);
416 int tmpId = (msg_message_id_t)MmsPluginStorage::instance()->searchMsgId(mmsHeader.pTo->szAddr, mmsHeader.szMsgID);
418 MSG_DEBUG("Found MSG_ID = %d", tmpId);
420 /* Insert to Delievery DB */
421 MmsPluginStorage::instance()->insertDeliveryReport(tmpId, mmsHeader.pTo->szAddr, &status);
423 pMsgInfo->msgId = (msg_message_id_t)tmpId;
426 MSG_DEBUG("Can not find MMS message in DB");
432 void MmsPluginInternal::processReadOrgInd(MSG_MESSAGE_INFO_S *pMsgInfo)
436 if (pMsgInfo == NULL) {
437 MSG_DEBUG("parameter err");
441 pMsgInfo->msgType.mainType = MSG_MMS_TYPE;
442 pMsgInfo->msgType.subType = MSG_READORGIND_MMS;
443 pMsgInfo->bTextSms = true;
445 MmsAddrUtilRemovePlmnString(mmsHeader.pFrom->szAddr);
446 MmsAddrUtilRemovePlmnString(mmsHeader.pTo->szAddr);
448 memset(pMsgInfo->msgData, 0x00, MAX_MSG_DATA_LEN + 1);
449 pMsgInfo->dataSize = 0;
451 strncpy(pMsgInfo->msgData, getMmsReadStatus(mmsHeader.readStatus), MAX_MSG_DATA_LEN);
452 pMsgInfo->dataSize = strlen(pMsgInfo->msgData);
454 MSG_SEC_DEBUG("read Status = %s", pMsgInfo->msgData);
455 strncpy(pMsgInfo->addressList[0].addressVal, mmsHeader.pFrom->szAddr, MAX_ADDRESS_VAL_LEN);
457 int tmpId = MmsPluginStorage::instance()->searchMsgId(mmsHeader.pFrom->szAddr, mmsHeader.szMsgID);
459 pMsgInfo->msgId = (msg_message_id_t)tmpId;
461 MmsMsgMultiStatus Status;
462 memset(&Status, 0x00, sizeof(MmsMsgMultiStatus));
463 Status.readTime = mmsHeader.date;
464 Status.readStatus = mmsHeader.readStatus;
466 MmsPluginStorage::instance()->insertReadReport(pMsgInfo->msgId, mmsHeader.pFrom->szAddr, &Status);
469 MSG_DEBUG("Can't not find Message!");
475 void MmsPluginInternal::processSendConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTranQEntity *pRequest)
479 MMS_RECV_DATA_S recvData = {{0}, };
481 pMsgInfo->msgId = pRequest->msgId;
483 /* Set only changed members */
484 pMsgInfo->msgType.mainType = MSG_MMS_TYPE;
485 pMsgInfo->msgType.subType = MSG_SENDCONF_MMS;
487 pMsgInfo->folderId = MSG_OUTBOX_ID;
489 strncpy(pMsgInfo->subject, mmsHeader.szSubject, MSG_LOCALE_SUBJ_LEN);
491 if (mmsHeader.responseStatus == MMS_RESPSTATUS_OK) {
492 pMsgInfo->networkStatus = MSG_NETWORK_SEND_SUCCESS;
493 pMsgInfo->dataSize = pRequest->postDataLen;
495 pMsgInfo->networkStatus = MSG_NETWORK_SEND_FAIL;
497 char responseText[MMS_LOCALE_RESP_TEXT_LEN];
499 memset(responseText, 0x00, MMS_LOCALE_RESP_TEXT_LEN);
500 snprintf(responseText, MMS_LOCALE_RESP_TEXT_LEN, " %s [%d]", mmsHeader.szResponseText, mmsHeader.responseStatus);
502 memset(pMsgInfo->msgText, 0x00, MAX_MSG_TEXT_LEN + 1);
503 strncpy(pMsgInfo->msgText, responseText, MMS_LOCALE_RESP_TEXT_LEN);
506 MSG_ADDRESS_INFO_S addressinfo = {0, };
507 char keyName[MAX_VCONFKEY_NAME_LEN];
508 memset(keyName, 0x00, sizeof(keyName));
510 snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, pMsgInfo->sim_idx);
512 if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) {
513 MSG_INFO("MsgSettingGetString() is failed");
516 MmsPluginStorage::instance()->getAddressInfo(pMsgInfo->msgId, &addressinfo);
518 MSG_SEC_DEBUG("%d, MMS Send End %s->%s %s", pMsgInfo->msgId
519 , (msisdn == NULL)?"ME":msisdn
520 , addressinfo.addressVal
521 , (pMsgInfo->networkStatus == MSG_NETWORK_SEND_SUCCESS)?"Success":"Fail");
528 /* set message-id from mmsc */
529 strncpy(recvData.szMsgID, mmsHeader.szMsgID, MMS_MSG_ID_LEN);
530 strncpy(recvData.szTrID, mmsHeader.szTrID, MMS_TR_ID_LEN);
532 memset(pMsgInfo->msgData, 0x00, MAX_MSG_DATA_LEN + 1);
533 memcpy(pMsgInfo->msgData, &recvData, sizeof(MMS_RECV_DATA_S));
536 curTime = time(NULL);
538 pMsgInfo->displayTime = curTime;
541 MmsPluginStorage::instance()->getMmsMessage(&pMsg);
543 MmsReleaseMsgDRMInfo(&pMsg->msgType.drmInfo);
544 MmsReleaseMsgBody(&pMsg->msgBody, pMsg->msgType.type);
550 void MmsPluginInternal::processRetrieveConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTranQEntity *pRequest, char *pRetrievedFilePath)
554 msg_error_t err = MSG_SUCCESS;
555 MMS_RECV_DATA_S recvData = {{0}, };
559 MmsInitMsgAttrib(&attrib);
561 attrib.priority = mmsHeader.priority;
562 attrib.bAskDeliveryReport = getMmsReport(mmsHeader.deliveryReport);
563 attrib.bAskReadReply = getMmsReport(mmsHeader.readReply);
565 /* Set only changed members */
566 pMsgInfo->msgId = pRequest->msgId;
567 MSG_DEBUG("@@@@@ msgId = %d @@@@@", pMsgInfo->msgId);
568 pMsgInfo->msgType.mainType = MSG_MMS_TYPE;
570 if (pRequest->eMmsPduType == eMMS_RETRIEVE_AUTO_CONF)
571 pMsgInfo->msgType.subType = MSG_RETRIEVE_AUTOCONF_MMS;
573 pMsgInfo->msgType.subType = MSG_RETRIEVE_MANUALCONF_MMS;
575 strncpy(pMsgInfo->subject, mmsHeader.szSubject, MSG_LOCALE_SUBJ_LEN);
577 strncpy(pRequest->transactionId, mmsHeader.szTrID, MMS_TR_ID_LEN);
580 curTime = time(NULL);
582 pMsgInfo->displayTime = curTime;
584 if (mmsHeader.retrieveStatus == MMS_RETRSTATUS_OK) {
585 pMsgInfo->networkStatus = MSG_NETWORK_RETRIEVE_SUCCESS;
586 pMsgInfo->folderId = MSG_INBOX_ID;
588 pMsgInfo->networkStatus = MSG_NETWORK_RETRIEVE_FAIL;
589 pMsgInfo->folderId = MSG_INBOX_ID;
590 /* If failed MMS Retrieve, then saved as MMS Noti Ind Message.
591 * It will changed in MsgHandleMmsConfIncomingMsg */
592 /* pMsgInfo->msgType.subType = MSG_NOTIFICATIONIND_MMS; */
595 char keyName[MAX_VCONFKEY_NAME_LEN];
596 memset(keyName, 0x00, sizeof(keyName));
598 snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, pMsgInfo->sim_idx);
600 if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) {
601 MSG_INFO("MsgSettingGetString() is failed");
603 char *normal_msisdn = NULL;
605 normal_msisdn = msg_normalize_number(msisdn);
607 /* get setting value of group message */
608 bool is_group_on = false;
612 MsgHeaderAddress *iter = NULL;
614 iter = mmsHeader.pFrom;
620 iter = mmsHeader.pTo;
622 if (normal_msisdn == NULL || !g_str_has_suffix(iter->szAddr, normal_msisdn))
627 iter = mmsHeader.pCc;
629 if (normal_msisdn == NULL || !g_str_has_suffix(iter->szAddr, normal_msisdn))
634 MSG_ADDRESS_INFO_S *tmp_addr_info = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S)*addr_cnt];
635 memset(tmp_addr_info, 0x00, sizeof(MSG_ADDRESS_INFO_S)*addr_cnt);
636 if (mmsHeader.pFrom == NULL) {
637 strncpy(tmp_addr_info[0].addressVal, pMsgInfo->addressList[0].addressVal, MAX_ADDRESS_VAL_LEN);
640 pMsgInfo->nAddressCnt = addr_cnt;
641 pMsgInfo->addressList = tmp_addr_info;
643 pMsgInfo->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S)];
644 memset(pMsgInfo->addressList, 0x00, sizeof(MSG_ADDRESS_INFO_S));
645 pMsgInfo->nAddressCnt = 1;
648 if (mmsHeader.pFrom) {
649 MSG_DEBUG("FROM : [%s]", mmsHeader.pFrom->szAddr);
650 MmsAddrUtilRemovePlmnString(mmsHeader.pFrom->szAddr);
652 strncpy(pMsgInfo->addressList[0].addressVal, mmsHeader.pFrom->szAddr, MAX_ADDRESS_VAL_LEN);
653 if (MmsAddrUtilCheckEmailAddress(pMsgInfo->addressList[0].addressVal)) {
654 pMsgInfo->addressList[0].addressType = MSG_ADDRESS_TYPE_EMAIL;
656 pMsgInfo->addressList[0].addressType = MSG_ADDRESS_TYPE_PLMN;
663 MsgHeaderAddress *iter = mmsHeader.pTo;
666 MSG_DEBUG("TO : [%s]", mmsHeader.pTo->szAddr);
667 MmsAddrUtilRemovePlmnString(iter->szAddr);
669 if (normal_msisdn == NULL || !g_str_has_suffix(iter->szAddr, normal_msisdn)) {
670 strncpy(pMsgInfo->addressList[addr_idx].addressVal, iter->szAddr, MAX_ADDRESS_VAL_LEN);
671 pMsgInfo->addressList[addr_idx].recipientType = MSG_RECIPIENTS_TYPE_TO;
672 if (MmsAddrUtilCheckEmailAddress(pMsgInfo->addressList[addr_idx].addressVal)) {
673 pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_EMAIL;
675 pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_PLMN;
686 MsgHeaderAddress *iter = mmsHeader.pCc;
689 MSG_DEBUG("CC : [%s]", mmsHeader.pCc->szAddr);
690 MmsAddrUtilRemovePlmnString(iter->szAddr);
692 if (normal_msisdn == NULL || !g_str_has_suffix(iter->szAddr, normal_msisdn)) {
693 strncpy(pMsgInfo->addressList[addr_idx].addressVal, iter->szAddr, MAX_ADDRESS_VAL_LEN);
694 pMsgInfo->addressList[addr_idx].recipientType = MSG_RECIPIENTS_TYPE_CC;
695 if (MmsAddrUtilCheckEmailAddress(pMsgInfo->addressList[addr_idx].addressVal)) {
696 pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_EMAIL;
698 pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_PLMN;
709 MSG_SEC_DEBUG("%d, MMS Receive %s End %s->%s %s", pMsgInfo->msgId
710 , (pRequest->eMmsPduType == eMMS_RETRIEVE_AUTO_CONF)?"Auto":"Manual"
711 , (mmsHeader.pFrom)?mmsHeader.pFrom->szAddr:"YOU"
712 , (msisdn == NULL)?"ME":msisdn
713 , (pMsgInfo->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS)?"Success":"Fail");
720 pMsgInfo->dataSize = pRequest->getDataLen;
722 /* set message-id & MMS TPDU file path */
723 snprintf(recvData.szMsgID, sizeof(recvData.szMsgID), "%s", mmsHeader.szMsgID);
725 if (pRetrievedFilePath)
726 strncpy(recvData.retrievedFilePath, pRetrievedFilePath, sizeof(recvData.retrievedFilePath)-1);
728 char *filename = NULL;
730 #ifdef FEATURE_JAVA_MMS
731 if (mmsHeader.msgType.param.szApplicationID || mmsHeader.msgType.param.szReplyToApplicationID) {
732 recvData.msgAppId.valid = true;
733 if (mmsHeader.msgType.param.szApplicationID)
734 strncpy(recvData.msgAppId.appId, mmsHeader.msgType.param.szApplicationID, sizeof(recvData.msgAppId.appId));
735 if (mmsHeader.msgType.param.szReplyToApplicationID)
736 strncpy(recvData.msgAppId.replyToAppId, mmsHeader.msgType.param.szReplyToApplicationID, sizeof(recvData.msgAppId.replyToAppId));
738 char fullPath[MAX_FULL_PATH_SIZE+1] = {0, };
740 filename = MsgGetFileName(pRetrievedFilePath);
742 snprintf(fullPath, MAX_FULL_PATH_SIZE+1, "%s%s", MSG_IPC_DATA_PATH, filename);
744 if (pRetrievedFilePath) {
745 int ret = rename(pRetrievedFilePath, fullPath);
747 MSG_DEBUG("File rename Error: %s", g_strerror(errno));
752 memcpy(pMsgInfo->msgData, &recvData, sizeof(MMS_RECV_DATA_S));
754 MSG_SEC_DEBUG("@@@@@ MsgData = %s @@@@@", pMsgInfo->msgData);
755 MSG_SEC_DEBUG("@@@@@ retrievedFilePath = %s @@@@@", recvData.retrievedFilePath);
756 MSG_DEBUG("@@@@@ szMsgID = %s @@@@@", recvData.szMsgID);
757 /* update delivery report, read reply */
759 MmsPluginStorage *pStorage = MmsPluginStorage::instance();
761 err = pStorage->updateMmsAttrib(pMsgInfo->msgId, &attrib, pMsgInfo->msgType.subType);
763 MSG_DEBUG("Error value of updateMmsAttrib [%d]", err);
765 /* make MmsData & insert multipart */
766 MMSList *multipart_list = NULL;
767 MMS_MULTIPART_DATA_S *pSmilMultipart = NULL;
769 MmsMsg *pMmsMsg = NULL;
770 MmsPluginStorage::instance()->getMmsMessage(&pMmsMsg);
773 MmsPluginAppBase *appBase;
775 MMS_DATA_S *pMmsData = MsgMmsCreate();
776 if (pMmsData == NULL) {
777 MSG_SEC_DEBUG("Fail to create mms");
781 pMmsData->header = MsgMmsCreateHeader();
783 MmsConvertMmsData(pMmsMsg, pMmsData);
784 /* CID 41996 : MmsConvertMmsData always returns true */
786 if (MmsConvertMmsData(pMmsMsg, pMmsData) != true) {
787 MSG_DEBUG("Fail to Compose MMS Message");
791 bFiltered = checkFilterMmsBody(pMmsData);
792 if (bFiltered == true) {
793 pMsgInfo->folderId = MSG_SPAMBOX_ID;
796 pSmilMultipart = pMmsData->smil;
797 if (pSmilMultipart) {
798 MmsPluginStorage::instance()->insertMultipart(pMsgInfo->msgId, pSmilMultipart);
801 multipart_list = pMmsData->multipartlist;
803 for (int i = 0; i < (int)g_list_length(multipart_list); i++) {
804 MMS_MULTIPART_DATA_S *pMultipart = (MMS_MULTIPART_DATA_S *)g_list_nth_data(multipart_list, i);
805 MmsPluginStorage::instance()->insertMultipart(pMsgInfo->msgId, pMultipart);
808 /* make Preview info for APP */
809 appBase = new MmsPluginAppBase(pMmsData);
810 appBase->makePreviewInfo(pMsgInfo->msgId, false, pRetrievedFilePath);
811 appBase->getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
814 MsgMmsRelease(&pMmsData);
816 if (MsgGetFileSize(pRetrievedFilePath, (int *)&pMsgInfo->dataSize) == false) {
817 MSG_SEC_DEBUG("Fail to get mms file size [%s]", pRetrievedFilePath);
823 pStorage->getMmsMessage(&pMsg);
825 MmsReleaseMsgDRMInfo(&pMsg->msgType.drmInfo);
826 MmsReleaseMsgBody(&pMsg->msgBody, pMsg->msgType.type);
827 g_free(filename); filename = NULL;
831 #else /* NEW process RetrieveConf */
832 void MmsPluginInternal::processRetrieveConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTranQEntity *pRequest, char *pRetrievedFilePath)
836 msg_error_t err = MSG_SUCCESS;
838 pMsgInfo->msgId = pRequest->msgId;
840 pMsgInfo->msgType.mainType = MSG_MMS_TYPE;
841 if (pRequest->eMmsPduType == eMMS_RETRIEVE_AUTO_CONF)
842 pMsgInfo->msgType.subType = MSG_RETRIEVE_AUTOCONF_MMS;
844 pMsgInfo->msgType.subType = MSG_RETRIEVE_MANUALCONF_MMS;
846 strncpy(pMsgInfo->subject, mmsHeader.szSubject, MSG_LOCALE_SUBJ_LEN);
847 strncpy(pRequest->transactionId, mmsHeader.szTrID, MMS_TR_ID_LEN);
850 curTime = time(NULL);
852 pMsgInfo->displayTime = curTime;
854 if (mmsHeader.retrieveStatus == MMS_RETRSTATUS_OK) {
855 pMsgInfo->networkStatus = MSG_NETWORK_RETRIEVE_SUCCESS;
856 pMsgInfo->folderId = MSG_INBOX_ID;
858 pMsgInfo->networkStatus = MSG_NETWORK_RETRIEVE_FAIL;
859 pMsgInfo->folderId = MSG_INBOX_ID;
860 /* If failed MMS Retrieve, then saved as MMS Noti Ind Message.
861 * It will changed in MsgHandleMmsConfIncomingMsg */
862 /* pMsgInfo->msgType.subType = MSG_NOTIFICATIONIND_MMS; */
866 if (MsgSettingGetString(MSG_SIM_MSISDN, &msisdn) != MSG_SUCCESS) {
867 MSG_INFO("MsgSettingGetString() is failed");
871 MmsAddrUtilRemovePlmnString(mmsHeader.pFrom->szAddr);
873 MSG_MMS_VLD_INFO("%d, MMS Receive %s End %s->%s %s", pMsgInfo->msgId
874 , (pRequest->eMmsPduType == eMMS_RETRIEVE_AUTO_CONF)?"Auto":"Manual"
875 , (mmsHeader.pFrom)?mmsHeader.pFrom->szAddr:"YOU"
876 , (msisdn == NULL)?"ME":msisdn
877 , (pMsgInfo->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS)?"Success":"Fail");
884 pMsgInfo->dataSize = pRequest->getDataLen;
886 MmsMsg *pMmsMsg = NULL;
887 MmsPluginStorage::instance()->getMmsMessage(&pMmsMsg);
889 MMS_DATA_S *pMmsData = MsgMmsCreate();
890 pMmsData->header = MsgMmsCreateHeader();
892 if (MmsConvertMmsData(pMmsMsg, pMmsData) != true) {
893 MSG_DEBUG("Fail to Compose MMS Message");
897 char *pSerializedData = NULL;
899 MsgSerializeMms(pMmsData, &pSerializedData);
901 MsgMmsRelease(&pMmsData);
904 char fileName[MSG_FILENAME_LEN_MAX] = {0};
905 char fileFilePath[MSG_FILEPATH_LEN_MAX] = {0};
907 if (MsgCreateFileName(fileName) == false)
910 snprintf(fileFilePath, sizeof(fileFilePath), "%s%s", MSG_DATA_PATH, fileName);
912 if (!MsgOpenCreateAndOverwriteFile(fileFilePath, (char *)pSerializedData, (int)strlen(pSerializedData))) {
916 snprintf(pMsgInfo->msgData, sizeof(pMsgInfo->msgData), "%s", fileFilePath);
918 if (MsgGetFileSize(pRetrievedFilePath, (int *)&pMsgInfo->dataSize) == false) {
919 MSG_SEC_DEBUG("Fail to get mms file size [%s]", pRetrievedFilePath);
925 MmsPluginStorage::instance()->getMmsMessage(&pMsg);
927 MmsReleaseMsgDRMInfo(&pMsg->msgType.drmInfo);
928 MmsReleaseMsgBody(&pMsg->msgBody, pMsg->msgType.type);
933 void MmsPluginInternal::processForwardConf(MSG_MESSAGE_INFO_S *msgInfo, mmsTranQEntity *pRequest)
937 /* This function Send NotifyRespInd Msg
939 * @param pTrID [in] Specifies Transaction ID
940 * @param iStatus [in] Specifies Msg Status
941 * @param iReportAllowed [in] Specifies whether to send deliveryReport to sender or not
942 * @return This function returns true on success, or false on failure.
944 bool MmsPluginInternal::encodeNotifyRespInd(char *szTrID, msg_delivery_report_status_t iStatus, bool bReportAllowed, char *pSendFilePath)
949 char pTempFileName[MSG_FILENAME_LEN_MAX+1] = {0};
950 char pTempFilePath[MAX_FULL_PATH_SIZE] = {0};
952 if (MsgCreateFileName(pTempFileName) == false)
955 snprintf(pTempFilePath, MAX_FULL_PATH_SIZE, "%s%s.noti.ind", MSG_DATA_PATH, pTempFileName);
957 pFile = MsgOpenMMSFile(pTempFilePath);
960 MSG_DEBUG("[ERROR] MsgOpenMMSFile fail");
964 if (MmsEncodeNotiRespInd(pFile, szTrID, iStatus, bReportAllowed) == false) {
965 MSG_DEBUG("MmsEncodeNotifyRespInd: MmsEncodeNotiRespInd fail");
973 /* CID 41993: replaced size 'MAX_MSG_DATA_LEN+1' with MAX_FULL_PATH_SIZE */
974 snprintf(pSendFilePath, MAX_FULL_PATH_SIZE, "%s.mms", pTempFilePath);
976 MSG_DEBUG("[ERROR] pSendFilePath is NULL");
985 /* This function Send AcknowledgeInd Msg
987 * @param pTrID [in] Specifies Transaction ID
988 * @param iReportAllowed [in] Specifies whether to send deliveryReport to sender or not
989 * @return This function returns true on success, or false on failure.
991 bool MmsPluginInternal::encodeAckInd(char *szTrID, bool bReportAllowed, char *pSendFilePath)
995 char pTempFileName[MSG_FILENAME_LEN_MAX+1] = {0};
996 char pTempFilePath[MAX_FULL_PATH_SIZE] = {0};
998 if (MsgCreateFileName(pTempFileName) == false)
1001 snprintf(pTempFilePath, MAX_FULL_PATH_SIZE, "%s%s.ack.ind", MSG_DATA_PATH, pTempFileName);
1003 pFile = MsgOpenMMSFile(pTempFilePath);
1005 MSG_ERR("MsgOpenMMSFile fail \n");
1009 if (MmsEncodeAckInd(pFile, szTrID, bReportAllowed) == false) {
1010 MSG_ERR("MmsEncodeAckInd: MmsEncodeAckInd fail \n");
1011 MsgCloseFile(pFile);
1015 MsgCloseFile(pFile);
1017 if (pSendFilePath) {
1018 snprintf(pSendFilePath, MAX_MSG_DATA_LEN+1, "%s.mms", pTempFilePath);
1020 MSG_ERR("pSendFilePath is NULL");
1029 bool MmsPluginInternal::checkRejectNotiInd(int roamState, bool bReportAllowed, char *pSendFilePath)
1032 MSG_MMS_HOME_RETRIEVE_TYPE_T retrieveType;
1033 bool bRejectAnonymous;
1034 bool bRejectAdvertisement;
1036 if (MsgSettingGetBool(MMS_RECV_REJECT_UNKNOWN, &bRejectAnonymous) != MSG_SUCCESS)
1037 MSG_INFO("MsgSettingGetBool() is failed");
1039 if (MsgSettingGetBool(MMS_RECV_REJECT_ADVERTISE, &bRejectAdvertisement) != MSG_SUCCESS)
1040 MSG_INFO("MsgSettingGetBool() is failed");
1042 /* Anonymous Reject */
1043 if (bRejectAnonymous &&
1044 (mmsHeader.pFrom == NULL || mmsHeader.pFrom->szAddr[0] == '\0')) {
1045 MSG_DEBUG("Anonymous Reject... ");
1046 encodeNotifyRespInd(mmsHeader.szTrID, MSG_DELIVERY_REPORT_REJECTED, bReportAllowed, pSendFilePath);
1051 /* Advertisement Reject */
1052 if (bRejectAdvertisement && mmsHeader.msgClass == MMS_MSGCLASS_ADVERTISEMENT) {
1053 MSG_DEBUG("Advertisement Reject... ");
1054 encodeNotifyRespInd(mmsHeader.szTrID, MSG_DELIVERY_REPORT_REJECTED, bReportAllowed, pSendFilePath);
1059 /* Message Reject - Roaming Case */
1061 if (roamState == VCONFKEY_TELEPHONY_SVC_ROAM_ON) {
1062 if (MsgSettingGetInt(MMS_RECV_ABROAD_NETWORK, &tmpVal) != MSG_SUCCESS) {
1063 MSG_INFO("MsgSettingGetInt() is failed");
1065 retrieveType = (MSG_MMS_HOME_RETRIEVE_TYPE_T)tmpVal;
1066 if (retrieveType == MSG_ABROAD_REJECT) {
1067 MSG_DEBUG("Abroad_Network : Notification Reject... ");
1068 encodeNotifyRespInd(mmsHeader.szTrID, MSG_DELIVERY_REPORT_REJECTED, bReportAllowed, pSendFilePath);
1073 if (MsgSettingGetInt(MMS_RECV_HOME_NETWORK, &tmpVal) != MSG_SUCCESS) {
1074 MSG_INFO("MsgSettingGetInt() is failed");
1076 retrieveType = (MSG_MMS_HOME_RETRIEVE_TYPE_T)tmpVal;
1077 if (retrieveType == MSG_HOME_REJECT) {
1078 MSG_DEBUG("Home_Network : Notification Reject... ");
1079 encodeNotifyRespInd(mmsHeader.szTrID, MSG_DELIVERY_REPORT_REJECTED, bReportAllowed, pSendFilePath);
1085 /* Duplicate MMS notification */
1088 msgId = MmsPluginStorage::instance()->checkDuplicateNotification(mmsHeader.szTrID, mmsHeader.szContentLocation);
1090 MSG_DEBUG("Msg Id = %d", msgId);
1100 bool MmsPluginInternal::checkFilterMmsBody(MMS_DATA_S *pMmsData)
1102 if (pMmsData == NULL)
1105 bool bFiltered = false;
1106 MMS_PAGE_S *pPage = NULL;
1107 MMS_MEDIA_S *pMedia = NULL;
1108 char filePath[MSG_FILEPATH_LEN_MAX + 1];
1109 gchar *fileContent = NULL;
1110 MsgDbHandler *dbHandle = getDbHandle();
1111 MimeType mimeType = MIME_UNKNOWN;
1113 MMS_MESSAGE_DATA_S *mmsMsg = NULL;
1114 unique_ptr<MMS_MESSAGE_DATA_S*, void(*)(MMS_MESSAGE_DATA_S**)> buf(&mmsMsg, unique_ptr_deleter);
1115 mmsMsg = (MMS_MESSAGE_DATA_S *)new char[sizeof(MMS_MESSAGE_DATA_S)];
1116 memset(mmsMsg, 0x00, sizeof(MMS_MESSAGE_DATA_S));
1118 MsgMmsConvertMmsDataToMmsMessageData(pMmsData, mmsMsg);
1120 /* Get the text data from the 1st slide. */
1121 if (mmsMsg->pageCnt <= 0) {
1122 MSG_WARN("pageCnt : %d", mmsMsg->pageCnt);
1123 MsgMmsReleaseMmsLists(mmsMsg);
1127 pPage = _MsgMmsGetPage(mmsMsg, 0);
1130 MSG_WARN("page is NULL");
1131 MsgMmsReleaseMmsLists(mmsMsg);
1135 for (int j = 0; j < pPage->mediaCnt; ++j) {
1136 pMedia = _MsgMmsGetMedia(pPage, j);
1138 if (pMedia && pMedia->mediatype == MMS_SMIL_MEDIA_TEXT) {
1139 MsgGetMimeTypeFromFileName(MIME_MAINTYPE_UNKNOWN, pMedia->szFilePath, &mimeType, NULL);
1141 if (mimeType == MIME_TEXT_X_VCALENDAR || mimeType == MIME_TEXT_X_VCARD || mimeType == MIME_TEXT_X_VTODO || mimeType == MIME_TEXT_X_VNOTE) {
1142 MSG_SEC_DEBUG("Media Type is Text, but Vobject file [%s]", pMedia->szFilePath);
1144 strncpy(filePath, pMedia->szFilePath, MSG_FILEPATH_LEN_MAX);
1146 g_file_get_contents((const gchar*)filePath, (gchar**)&fileContent, NULL, NULL);
1148 bFiltered = MsgCheckFilterByWord(dbHandle, (const char *)fileContent);
1150 g_free(fileContent);
1153 if (bFiltered == true)
1159 MsgMmsReleaseMmsLists(mmsMsg);
1164 bool MmsPluginInternal::getMmsReport(MmsReport mmsReport)
1166 bool result = false;
1168 if (mmsReport == MMS_REPORT_YES)
1170 else if (mmsReport == MMS_REPORT_NO)
1176 const char *MmsPluginInternal::getMmsDeliveryStatus(msg_delivery_report_status_t deliveryStatus)
1178 MSG_DEBUG("msgStatus= %d", deliveryStatus);
1180 switch (deliveryStatus) {
1181 case MSG_DELIVERY_REPORT_EXPIRED:
1183 case MSG_DELIVERY_REPORT_REJECTED:
1185 case MSG_DELIVERY_REPORT_UNREACHABLE:
1186 return "unreachable.";
1187 case MSG_DELIVERY_REPORT_UNRECOGNISED:
1188 return "unrecognised.";
1189 case MSG_DELIVERY_REPORT_SUCCESS:
1190 return "delivered.";
1192 return "delivery failed.";
1196 const char *MmsPluginInternal::getMmsReadStatus(msg_read_report_status_t readStatus)
1198 switch (readStatus) {
1199 case MSG_READ_REPORT_IS_READ:
1200 return "message is read.";
1201 case MSG_READ_REPORT_IS_DELETED:
1202 return "message is deleted.";
1204 return "read status is none.";