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 "MsgException.h"
23 #include "MsgUtilFile.h"
24 #include "MsgGconfWrapper.h"
25 #include "MsgProxyContact.h"
26 #include "MsgProxyListener.h"
27 #include "MsgHandle.h"
28 #include "MsgSqliteWrapper.h"
30 /*==================================================================================================
31 IMPLEMENTATION OF MsgHandle - Control Member Functions
32 ==================================================================================================*/
33 MsgHandle::MsgHandle() : mCounter(0), mClientSock()
35 memset(mConnectionId, 0x00, sizeof(mConnectionId));
36 memset(mCookie, 0x00, sizeof(mCookie));
40 MsgHandle::~MsgHandle()
45 void MsgHandle::openHandle()
49 MsgProxyListener::instance()->insertOpenHandleSet(this);
51 /* server is currently booting and service is not available until the end of booting */
52 if (MsgSettingGetBool(VCONFKEY_MSG_SERVER_READY, &bReady) != MSG_SUCCESS)
53 MSG_INFO("MsgSettingGetBool() is failed");
55 if (bReady == false) {
56 THROW(MsgException::SERVER_READY_ERROR, "Msg Server is not ready !!!!!");
58 MSG_INFO("Msg Server is ready !!!!!");
66 void MsgHandle::closeHandle(MsgHandle* pHandle)
70 /* Remove CB List of closing Handle */
71 MsgProxyListener* eventListener = MsgProxyListener::instance();
73 eventListener->clearListOfClosedHandle(pHandle);
74 /* eventListener->stop(); */
76 /* Close Socket IPC */
79 #ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
80 /* Close Contact Service */
81 if (MsgCloseContactSvc() != MSG_SUCCESS) {
82 MSG_WARN("Fail to close contact service.");
84 #endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
85 removeDbHandle(); /* unregister db handler */
91 void MsgHandle::connectSocket()
93 mClientSock.connect(MSG_SOCKET_PATH);
97 void MsgHandle::disconnectSocket()
103 void MsgHandle::write(const char *pCmdData, int cmdSize, char **ppEvent)
105 if (pCmdData == NULL || ppEvent == NULL) {
106 THROW(MsgException::INVALID_PARAM, "Param is NULL");
111 /* Send Command to MSG FW */
112 MutexLocker lock(mx);
113 ret = mClientSock.write(pCmdData, cmdSize);
115 THROW(MsgException::IPC_ERROR, "IPC write error");
117 char *tmpEvent = NULL;
120 /* Receive Result from MSG FW */
123 if (tmpEvent == NULL) {
124 MSG_DEBUG("Event Data is NULL!!");
128 if (!CheckEventData(tmpEvent)) {
139 void MsgHandle::read(char **ppEvent)
141 unsigned int dataSize = 0;
143 int ret = mClientSock.read(ppEvent, &dataSize);
145 if (ret == CLOSE_CONNECTION_BY_SIGNAL) {
146 THROW(MsgException::IPC_ERROR, "Server closed connection");
151 void MsgHandle::convertMsgStruct(const MSG_MESSAGE_HIDDEN_S *pSrc, MSG_MESSAGE_INFO_S *pDest)
155 pDest->msgId = pSrc->msgId;
156 pDest->threadId = pSrc->threadId;
157 pDest->folderId = pSrc->folderId;
158 pDest->msgType.mainType = pSrc->mainType;
159 pDest->msgType.subType = pSrc->subType;
160 pDest->msgType.classType = pSrc->classType;
161 pDest->storageId = pSrc->storageId;
163 if (g_list_length(pSrc->addressList) > 0) {
164 msg_struct_s *addr_info = NULL;
165 MSG_ADDRESS_INFO_S *address = NULL;
167 pDest->nAddressCnt = g_list_length(pSrc->addressList);
168 pDest->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S) * pDest->nAddressCnt];
169 memset(pDest->addressList, 0x00, sizeof(MSG_ADDRESS_INFO_S) * pDest->nAddressCnt);
171 for (int i = 0; i < pDest->nAddressCnt; i++) {
172 addr_info = (msg_struct_s *)g_list_nth_data(pSrc->addressList, (guint)i);
173 address = (MSG_ADDRESS_INFO_S *)addr_info->data;
175 pDest->addressList[i].addressType = address->addressType;
176 pDest->addressList[i].recipientType = address->recipientType;
177 pDest->addressList[i].contactId = address->contactId;
178 strncpy(pDest->addressList[i].addressVal, address->addressVal, MAX_ADDRESS_VAL_LEN);
179 strncpy(pDest->addressList[i].displayName, address->displayName, MAX_DISPLAY_NAME_LEN);
182 msg_struct_list_s *addr_info_s = pSrc->addr_list;
184 if (addr_info_s && (addr_info_s->nCount > 0)) {
185 msg_struct_s *addr_info = NULL;
186 MSG_ADDRESS_INFO_S *address = NULL;
188 pDest->nAddressCnt = addr_info_s->nCount;
190 pDest->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S) * addr_info_s->nCount];
191 memset(pDest->addressList, 0x00, sizeof(MSG_ADDRESS_INFO_S) * addr_info_s->nCount);
193 for (int i = 0; i < addr_info_s->nCount; i++) {
194 addr_info = (msg_struct_s *)addr_info_s->msg_struct_info[i];
196 address = (MSG_ADDRESS_INFO_S *)addr_info->data;
198 pDest->addressList[i].addressType = address->addressType;
199 pDest->addressList[i].recipientType = address->recipientType;
200 pDest->addressList[i].contactId = address->contactId;
201 strncpy(pDest->addressList[i].addressVal, address->addressVal, MAX_ADDRESS_VAL_LEN);
202 strncpy(pDest->addressList[i].displayName, address->displayName, MAX_DISPLAY_NAME_LEN);
207 strncpy(pDest->replyAddress, pSrc->replyAddress, MAX_PHONE_NUMBER_LEN);
208 strncpy(pDest->subject, pSrc->subject, MAX_SUBJECT_LEN);
210 pDest->displayTime = pSrc->displayTime;
211 pDest->networkStatus = pSrc->networkStatus;
212 pDest->encodeType = pSrc->encodeType;
213 pDest->bRead = pSrc->bRead;
214 pDest->bProtected = pSrc->bProtected;
215 pDest->bBackup = pSrc->bBackup;
216 pDest->priority = pSrc->priority;
217 pDest->direction = pSrc->direction;
220 pDest->msgPort.valid = pSrc->bPortValid;
222 if (pDest->msgPort.valid == true) {
223 pDest->msgPort.dstPort = pSrc->dstPort;
224 pDest->msgPort.srcPort = pSrc->srcPort;
227 MSG_DEBUG("nSize = %d", pSrc->dataSize);
228 MSG_DEBUG("mainType = %d", pSrc->mainType);
230 if (pSrc->mainType == MSG_SMS_TYPE) {
231 if (pSrc->pData != NULL) {
232 pDest->bTextSms = true;
233 pDest->dataSize = pSrc->dataSize;
235 memset(pDest->msgText, 0x00, sizeof(pDest->msgText));
237 if (pSrc->dataSize > MAX_MSG_TEXT_LEN) {
238 /* Save Message Data into File */
239 char fileName[MSG_FILENAME_LEN_MAX+1];
240 memset(fileName, 0x00, sizeof(fileName));
242 if (MsgCreateFileName(fileName) == false)
243 THROW(MsgException::FILE_ERROR, "MsgCreateFileName error");
245 MSG_SEC_DEBUG("Save pSrc->pData into file : size[%d] name[%s]", pDest->dataSize, fileName);
247 if (MsgWriteIpcFile(fileName, (char*)pSrc->pData, pSrc->dataSize) == false)
248 THROW(MsgException::FILE_ERROR, "MsgWriteIpcFile error");
250 memset(pDest->msgData, 0x00, sizeof(pDest->msgData));
251 strncpy(pDest->msgData, fileName, MAX_MSG_DATA_LEN);
253 pDest->bTextSms = false;
256 if (pDest->encodeType == MSG_ENCODE_8BIT)
257 memcpy(pDest->msgText, pSrc->pData, pSrc->dataSize);
259 strncpy(pDest->msgText, (char*)pSrc->pData, pSrc->dataSize);
262 MSG_DEBUG("pData = %s", pSrc->pData);
264 MSG_DEBUG("pSrc->pData is NULL.");
265 pDest->bTextSms = true;
269 MSG_SEC_DEBUG("msgText = %s", pDest->msgText);
270 } else if (pSrc->mainType == MSG_MMS_TYPE) {
271 pDest->bTextSms = false;
272 pDest->dataSize = pSrc->dataSize;
274 if (pSrc->subType == MSG_READREPLY_MMS) {
275 memset(pDest->msgData, 0x00, sizeof(pDest->msgData));
277 if (pSrc->mmsDataSize < MAX_MSG_DATA_LEN)
278 memcpy(pDest->msgData, pSrc->pMmsData, pSrc->mmsDataSize);
280 memcpy(pDest->msgData, pSrc->pMmsData, MAX_MSG_DATA_LEN);
283 /* Save Message Data into File */
284 char fileName[MSG_FILENAME_LEN_MAX+1];
285 memset(fileName, 0x00, sizeof(fileName));
287 if (MsgCreateFileName(fileName) == false)
288 THROW(MsgException::FILE_ERROR, "MsgCreateFileName error");
290 /* change file extension in case of java MMS msg */
291 if (pSrc->subType == MSG_SENDREQ_JAVA_MMS) {
292 char* pFileNameExt = NULL;
293 pFileNameExt = strstr(fileName, "DATA");
295 snprintf(pFileNameExt, strlen("JAVA")+1, "JAVA");
298 MSG_SEC_DEBUG("Save Message Data into file : size[%d] name[%s]", pSrc->mmsDataSize, fileName);
299 if (MsgWriteIpcFile(fileName, (char*)pSrc->pMmsData, pSrc->mmsDataSize) == false)
300 THROW(MsgException::FILE_ERROR, "MsgWriteIpcFile error");
302 memset(pDest->msgData, 0x00, sizeof(pDest->msgData));
303 strncpy(pDest->msgData, fileName, MAX_MSG_DATA_LEN);
305 strncpy(pDest->msgText, (char*)pSrc->pData, MAX_MSG_TEXT_LEN);
308 if (strlen(pSrc->thumbPath) > 0) {
309 memset(pDest->thumbPath, 0x00, sizeof(pDest->thumbPath));
310 memcpy(pDest->thumbPath, pSrc->thumbPath, sizeof(pDest->thumbPath));
315 pDest->sim_idx = pSrc->simIndex;
321 void MsgHandle::convertMsgStruct(const MSG_MESSAGE_INFO_S *pSrc, MSG_MESSAGE_HIDDEN_S *pDest)
325 pDest->msgId = pSrc->msgId;
326 pDest->threadId = pSrc->threadId;
327 pDest->folderId = pSrc->folderId;
328 pDest->mainType = pSrc->msgType.mainType;
329 pDest->subType = pSrc->msgType.subType;
330 pDest->storageId = pSrc->storageId;
332 strncpy(pDest->replyAddress, pSrc->replyAddress, MAX_PHONE_NUMBER_LEN);
333 strncpy(pDest->subject, pSrc->subject, MAX_SUBJECT_LEN);
335 pDest->displayTime = pSrc->displayTime;
336 pDest->networkStatus = pSrc->networkStatus;
337 pDest->encodeType = pSrc->encodeType;
338 pDest->bRead = pSrc->bRead;
339 pDest->bProtected = pSrc->bProtected;
340 pDest->bBackup = pSrc->bBackup;
341 pDest->priority = pSrc->priority;
342 pDest->direction = pSrc->direction;
343 pDest->simIndex = pSrc->sim_idx;
346 pDest->bPortValid = pSrc->msgPort.valid;
348 if (pDest->bPortValid == true) {
349 pDest->dstPort = pSrc->msgPort.dstPort;
350 pDest->srcPort = pSrc->msgPort.srcPort;
353 if (pSrc->thumbPath[0] != '\0')
354 strncpy(pDest->thumbPath, pSrc->thumbPath, MSG_FILEPATH_LEN_MAX);
356 int maxCnt = (pSrc->nAddressCnt > 10)? MAX_TO_ADDRESS_CNT: pSrc->nAddressCnt;
358 pDest->addr_list->nCount = maxCnt;
360 msg_struct_s *addr_info_s = NULL;
361 MSG_ADDRESS_INFO_S *addr_info = NULL;
363 for (int i = 0; i < maxCnt; i++) {
364 addr_info_s = (msg_struct_s *)pDest->addr_list->msg_struct_info[i];
365 addr_info = (MSG_ADDRESS_INFO_S *)addr_info_s->data;
367 addr_info->addressType = pSrc->addressList[i].addressType;
368 addr_info->recipientType = pSrc->addressList[i].recipientType;
369 addr_info->contactId = pSrc->addressList[i].contactId;
370 strncpy(addr_info->addressVal, pSrc->addressList[i].addressVal, MAX_ADDRESS_VAL_LEN);
371 strncpy(addr_info->displayName, pSrc->addressList[i].displayName, MAX_DISPLAY_NAME_LEN);
372 addr_info->displayName[MAX_DISPLAY_NAME_LEN] = '\0';
375 for (int i = 0; i < pSrc->nAddressCnt; i++) {
376 addr_info_s = new msg_struct_s;
377 memset(addr_info_s, 0x00, sizeof(msg_struct_s));
379 addr_info_s->type = MSG_STRUCT_ADDRESS_INFO;
380 addr_info_s->data = new MSG_ADDRESS_INFO_S;
381 memset(addr_info_s->data, 0x00, sizeof(MSG_ADDRESS_INFO_S));
383 addr_info = (MSG_ADDRESS_INFO_S *)addr_info_s->data;
385 addr_info->addressType = pSrc->addressList[i].addressType;
386 addr_info->recipientType = pSrc->addressList[i].recipientType;
387 addr_info->contactId = pSrc->addressList[i].contactId;
388 strncpy(addr_info->addressVal, pSrc->addressList[i].addressVal, MAX_ADDRESS_VAL_LEN);
389 strncpy(addr_info->displayName, pSrc->addressList[i].displayName, MAX_DISPLAY_NAME_LEN);
390 addr_info->displayName[MAX_DISPLAY_NAME_LEN] = '\0';
392 pDest->addressList = g_list_append(pDest->addressList, addr_info_s);
396 if (pSrc->bTextSms == false) {
399 char* pFileData = NULL;
400 unique_ptr<char*, void(*)(char**)> buf(&pFileData, unique_ptr_deleter);
402 pDest->dataSize = pSrc->dataSize;
404 /* Get Message Data from File */
405 if (MsgOpenAndReadFile(pSrc->msgData, &pFileData, &fileSize) == false)
406 THROW(MsgException::FILE_ERROR, "MsgOpenAndReadFile error");
408 if (pSrc->msgType.mainType == MSG_SMS_TYPE) {
409 if (pDest->encodeType == MSG_ENCODE_8BIT) {
410 pDest->pData = (void*)new char[fileSize];
411 memset(pDest->pData, 0x00, fileSize);
412 memcpy(pDest->pData, pFileData, fileSize);
414 pDest->pData = (void*)new char[fileSize+1];
415 memset(pDest->pData, 0x00, fileSize+1);
416 strncpy((char*)pDest->pData, pFileData, fileSize);
419 if (pSrc->msgText[0] != '\0') {
420 pDest->pData = (void*)new char[strlen(pSrc->msgText)+1];
421 memset(pDest->pData, 0x00, strlen(pSrc->msgText)+1);
422 strncpy((char*)pDest->pData, pSrc->msgText, strlen(pSrc->msgText));
424 pDest->mmsDataSize = fileSize;
425 pDest->pMmsData = (void*)new char[fileSize];
426 memset(pDest->pMmsData, 0x00, fileSize);
427 memcpy(pDest->pMmsData, pFileData, fileSize);
428 MSG_SEC_DEBUG("Get Message Data from file : size[%d] name[%s]", pDest->mmsDataSize, pSrc->msgData);
432 pDest->dataSize = pSrc->dataSize;
434 if (pSrc->msgType.mainType == MSG_SMS_TYPE) {
435 if (pDest->encodeType == MSG_ENCODE_8BIT || pSrc->msgType.subType == MSG_ETWS_SMS) {
436 pDest->pData = (void*)new char[pDest->dataSize];
437 memset(pDest->pData, 0x00, pDest->dataSize);
438 memcpy(pDest->pData, pSrc->msgText, pDest->dataSize);
440 pDest->pData = (void*)new char[pDest->dataSize+1];
441 memset(pDest->pData, 0x00, pDest->dataSize+1);
442 strncpy((char*)pDest->pData, pSrc->msgText, pDest->dataSize);
445 if (pSrc->msgText[0] != '\0') {
446 pDest->pData = (void*)new char[strlen(pSrc->msgText)+1];
447 memset(pDest->pData, 0x00, strlen(pSrc->msgText)+1);
448 strncpy((char*)pDest->pData, pSrc->msgText, strlen(pSrc->msgText));
451 pDest->mmsDataSize = pDest->dataSize;
452 pDest->pMmsData = (void*)new char[pDest->dataSize];
453 memset(pDest->pMmsData, 0x00, pDest->dataSize);
454 memcpy(pDest->pMmsData, pSrc->msgData, pDest->dataSize);
462 void MsgHandle::convertSendOptStruct(const MSG_SENDINGOPT_S* pSrc, MSG_SENDINGOPT_INFO_S* pDest, MSG_MESSAGE_TYPE_S msgType)
466 pDest->bSetting = pSrc->bSetting;
468 if (pSrc->bSetting == false) {
469 MSG_DEBUG("No Sending Option");
473 pDest->bDeliverReq = pSrc->bDeliverReq;
474 pDest->bKeepCopy = pSrc->bKeepCopy;
476 MSG_DEBUG("pDest->bSetting = %d", pDest->bSetting);
477 MSG_DEBUG("pDest->bDeliverReq = %d", pDest->bDeliverReq);
478 MSG_DEBUG("pDest->bKeepCopy = %d", pDest->bKeepCopy);
480 if (msgType.mainType == MSG_SMS_TYPE) {
481 msg_struct_s *pStruct = (msg_struct_s *)pSrc->smsSendOpt;
483 SMS_SENDINGOPT_S *pSms = (SMS_SENDINGOPT_S *)pStruct->data;
485 pDest->option.smsSendOptInfo.bReplyPath = pSms->bReplyPath;
488 } else if (msgType.mainType == MSG_MMS_TYPE) {
489 msg_struct_s *pStruct = (msg_struct_s *)pSrc->mmsSendOpt;
491 MMS_SENDINGOPT_S *pMms = (MMS_SENDINGOPT_S *)pStruct->data;
493 pDest->option.mmsSendOptInfo.priority = pMms->priority;
494 pDest->option.mmsSendOptInfo.bReadReq = pMms->bReadReq;
496 MSG_DEBUG("pDest->option.mmsSendOpt.priority = %d", pMms->priority);
497 MSG_DEBUG("pDest->option.mmsSendOpt.bReadReq = %d", pMms->bReadReq);
499 if (pMms->expiryTime == 0) {
500 pDest->option.mmsSendOptInfo.expiryTime.type = MMS_TIMETYPE_NONE;
501 pDest->option.mmsSendOptInfo.expiryTime.time = pMms->expiryTime;
503 pDest->option.mmsSendOptInfo.expiryTime.type = MMS_TIMETYPE_RELATIVE;
504 pDest->option.mmsSendOptInfo.expiryTime.time = pMms->expiryTime;
507 if (pMms->bUseDeliveryCustomTime == true) {
508 pDest->option.mmsSendOptInfo.bUseDeliveryCustomTime = true;
510 pDest->option.mmsSendOptInfo.bUseDeliveryCustomTime = false;
512 pDest->option.mmsSendOptInfo.deliveryTime.type = MMS_TIMETYPE_RELATIVE;
513 pDest->option.mmsSendOptInfo.deliveryTime.time = pMms->deliveryTime;
515 MSG_DEBUG("pDest->option.mmsSendOpt.expiryTime = %d", pDest->option.mmsSendOptInfo.expiryTime.time);
524 void MsgHandle::convertSendOptStruct(const MSG_SENDINGOPT_INFO_S* pSrc, MSG_SENDINGOPT_S* pDest, MSG_MESSAGE_TYPE_S msgType)
528 pDest->bDeliverReq = pSrc->bDeliverReq;
529 pDest->bKeepCopy = pSrc->bKeepCopy;
531 MSG_DEBUG("pDest->bDeliverReq = %d", pDest->bDeliverReq);
532 MSG_DEBUG("pDest->bKeepCopy = %d", pDest->bKeepCopy);
534 if (msgType.mainType == MSG_SMS_TYPE) {
535 msg_struct_s *pStruct = (msg_struct_s *)pDest->smsSendOpt;
536 SMS_SENDINGOPT_S *pSms = (SMS_SENDINGOPT_S *)pStruct->data;
537 pSms->bReplyPath = pSrc->option.smsSendOptInfo.bReplyPath;
538 } else if (msgType.mainType == MSG_MMS_TYPE) {
539 msg_struct_s *pStruct = (msg_struct_s *)pDest->mmsSendOpt;
540 MMS_SENDINGOPT_S *pMms = (MMS_SENDINGOPT_S *)pStruct->data;
541 pMms->priority = pSrc->option.mmsSendOptInfo.priority;
542 pMms->bReadReq = pSrc->option.mmsSendOptInfo.bReadReq;
543 pMms->expiryTime = pSrc->option.mmsSendOptInfo.expiryTime.time;
544 pMms->deliveryTime = pSrc->option.mmsSendOptInfo.deliveryTime.time;
546 MSG_DEBUG("pDest->option.mmsSendOpt.priority = %d", pMms->priority);
547 MSG_DEBUG("pDest->option.mmsSendOpt.bReadReq = %d", pMms->bReadReq);
548 MSG_DEBUG("pDest->option.mmsSendOpt.expiryTime = %d", pMms->expiryTime);
555 int MsgHandle::getSettingCmdSize(MSG_OPTION_TYPE_T optionType)
557 int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_OPTION_TYPE_T);
559 switch (optionType) {
560 case MSG_GENERAL_OPT:
561 cmdSize += sizeof(MSG_GENERAL_OPT_S);
563 case MSG_SMS_SENDOPT:
564 cmdSize += sizeof(MSG_SMS_SENDOPT_S);
567 cmdSize += sizeof(MSG_SMSC_LIST_S);
569 case MSG_MMS_SENDOPT:
570 cmdSize += sizeof(MSG_MMS_SENDOPT_S);
572 case MSG_MMS_RECVOPT:
573 cmdSize += sizeof(MSG_MMS_RECVOPT_S);
575 case MSG_MMS_STYLEOPT:
576 cmdSize += sizeof(MSG_MMS_STYLEOPT_S);
578 case MSG_PUSHMSG_OPT:
579 cmdSize += sizeof(MSG_PUSHMSG_OPT_S);
582 cmdSize += sizeof(MSG_CBMSG_OPT_S);
584 case MSG_VOICEMAIL_OPT:
585 cmdSize += sizeof(MSG_VOICEMAIL_OPT_S);
587 case MSG_MSGSIZE_OPT:
588 cmdSize += sizeof(MSG_MSGSIZE_OPT_S);
596 bool MsgHandle::CheckEventData(char *pEventData)
598 MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
600 switch (pEvent->eventType) {
601 case MSG_EVENT_PLG_SENT_STATUS_CNF:
602 case MSG_EVENT_PLG_INCOMING_MSG_IND:
603 case MSG_EVENT_PLG_INCOMING_MMS_CONF:
604 case MSG_EVENT_PLG_INCOMING_SYNCML_MSG_IND:
605 case MSG_EVENT_PLG_INCOMING_LBS_MSG_IND:
606 case MSG_EVENT_PLG_STORAGE_CHANGE_IND:
607 case MSG_EVENT_PLG_INCOMING_CB_MSG_IND:
608 case MSG_EVENT_PLG_INCOMING_PUSH_MSG_IND:
609 case MSG_EVENT_PLG_REPORT_MSG_INCOMING_IND: