\r
_CbsMessageImpl::_CbsMessageImpl(const _CbsMessageImpl& value)\r
{\r
+ result r = E_SUCCESS;\r
__cbsMsgTime = value.__cbsMsgTime;\r
__cbsMessageId = value.__cbsMessageId;\r
__cbsSenderMsg = value.__cbsSenderMsg;\r
__dataCodingScheme = value.__dataCodingScheme;\r
__cbslanguageType = value.__cbslanguageType;\r
\r
- __pCbsSerialNumber->SetArray(value.__pCbsSerialNumber->GetPointer(), 0, value.__pCbsSerialNumber->GetLimit());\r
+ r = __pCbsSerialNumber->SetArray(value.__pCbsSerialNumber->GetPointer(), 0, value.__pCbsSerialNumber->GetLimit());\r
+ SysTryReturnVoidResult(NID_MSG, r == E_SUCCESS, r, "Failed to set array");\r
__pCbsSerialNumber->SetPosition(0);\r
}\r
\r
_CbsMessageImpl&\r
_CbsMessageImpl::operator =(const _CbsMessageImpl& rhs)\r
{\r
+ result r = E_SUCCESS;\r
+\r
if (this != &rhs)\r
{\r
__cbsMsgTime = rhs.__cbsMsgTime;\r
__dataCodingScheme = rhs.__dataCodingScheme;\r
__cbslanguageType = rhs.__cbslanguageType;\r
\r
- __pCbsSerialNumber->SetArray(rhs.__pCbsSerialNumber->GetPointer(), 0, rhs.__pCbsSerialNumber->GetLimit());\r
- __pCbsSerialNumber->SetPosition(0);\r
+ r = __pCbsSerialNumber->SetArray(rhs.__pCbsSerialNumber->GetPointer(), 0, rhs.__pCbsSerialNumber->GetLimit());\r
+ if (r == E_SUCCESS)\r
+ {\r
+ __pCbsSerialNumber->SetPosition(0);\r
+ }\r
}\r
\r
return (*this);\r
_EmailEvent* pEmailEvent = null;
_EmailAsyncData *pEmailAsyncData = null;
- for( int i=0; i < _EmailManagerImpl::__pEmailAsyncData->GetCount() ; i++)
+ for( int i=0; i < _EmailManagerImpl::__pEmailAsyncData->GetCount(); i++)
{
_EmailManagerImpl::__pMutex->Acquire();
_EmailManagerImpl::__pEmailAsyncData->GetAt(i, pEmailAsyncData);
_EmailManagerImpl::__pMutex->Release();
- if (msgId == pEmailAsyncData->msgId);
+ if (msgId == pEmailAsyncData->msgId)
{
_EmailEventArg* pEmailEventArg = null;
pEmailEvent = pEmailAsyncData->pEventData;
_EmailEvent* pEmailEvent = null;
_EmailAsyncData *pEmailAsyncData = null;
- for( int i=0; i < _EmailManagerImpl::__pEmailAsyncData->GetCount() ; i++)
+ for( int i=0; i < _EmailManagerImpl::__pEmailAsyncData->GetCount(); i++)
{
_EmailManagerImpl::__pMutex->Acquire();
_EmailManagerImpl::__pEmailAsyncData->GetAt(i, pEmailAsyncData);
_EmailManagerImpl::__pMutex->Release();
- if (msgId == pEmailAsyncData->msgId);
+ if (msgId == pEmailAsyncData->msgId)
{
_EmailEventArg* pEmailEventArg = null;
pEmailEvent = pEmailAsyncData->pEventData;
\r
_EtwsPrimaryNotificationImpl::_EtwsPrimaryNotificationImpl(const _EtwsPrimaryNotificationImpl& value)\r
{\r
+ result r = E_SUCCESS;\r
__etwsMsgTime = value.__etwsMsgTime;\r
__etwsMessageId = value.__etwsMessageId;\r
\r
- __pEtwsSerialNumber->SetArray(value.__pEtwsSerialNumber->GetPointer(), 0, value.__pEtwsSerialNumber->GetLimit());\r
+ r = __pEtwsSerialNumber->SetArray(value.__pEtwsSerialNumber->GetPointer(), 0, value.__pEtwsSerialNumber->GetLimit());\r
+ SysTryReturnVoidResult(NID_MSG, r == E_SUCCESS, r, "Failed to set array");\r
__pEtwsSerialNumber->SetPosition(0);\r
\r
- __pEtwsSecurityInfo->SetArray(value.__pEtwsSecurityInfo->GetPointer(), 0, value.__pEtwsSecurityInfo->GetLimit());\r
+ r = __pEtwsSecurityInfo->SetArray(value.__pEtwsSecurityInfo->GetPointer(), 0, value.__pEtwsSecurityInfo->GetLimit());\r
+ SysTryReturnVoidResult(NID_MSG, r == E_SUCCESS, r, "Failed to set array");\r
__pEtwsSecurityInfo->SetPosition(0);\r
\r
- __pEtwsWarningType->SetArray(value.__pEtwsWarningType->GetPointer(), 0, value.__pEtwsWarningType->GetLimit());\r
+ r = __pEtwsWarningType->SetArray(value.__pEtwsWarningType->GetPointer(), 0, value.__pEtwsWarningType->GetLimit());\r
+ SysTryReturnVoidResult(NID_MSG, r == E_SUCCESS, r, "Failed to set array");\r
__pEtwsWarningType->SetPosition(0);\r
}\r
\r
_EtwsPrimaryNotificationImpl&\r
_EtwsPrimaryNotificationImpl::operator =(const _EtwsPrimaryNotificationImpl& rhs)\r
{\r
+ result r = E_SUCCESS;\r
if (this != &rhs)\r
{\r
__etwsMsgTime = rhs.__etwsMsgTime;\r
__etwsMessageId = rhs.__etwsMessageId;\r
\r
- __pEtwsSerialNumber->SetArray(rhs.__pEtwsSerialNumber->GetPointer(), 0, rhs.__pEtwsSerialNumber->GetLimit());\r
- __pEtwsSerialNumber->SetPosition(0);\r
-\r
- __pEtwsSecurityInfo->SetArray(rhs.__pEtwsSecurityInfo->GetPointer(), 0, rhs.__pEtwsSecurityInfo->GetLimit());\r
- __pEtwsSecurityInfo->SetPosition(0);\r
-\r
- __pEtwsWarningType->SetArray(rhs.__pEtwsWarningType->GetPointer(), 0, rhs.__pEtwsWarningType->GetLimit());\r
- __pEtwsWarningType->SetPosition(0);\r
+ r = __pEtwsSerialNumber->SetArray(rhs.__pEtwsSerialNumber->GetPointer(), 0, rhs.__pEtwsSerialNumber->GetLimit());\r
+ if (r == E_SUCCESS)\r
+ {\r
+ __pEtwsSerialNumber->SetPosition(0);\r
+ }\r
+ \r
+ r = __pEtwsSecurityInfo->SetArray(rhs.__pEtwsSecurityInfo->GetPointer(), 0, rhs.__pEtwsSecurityInfo->GetLimit());\r
+ if (r == E_SUCCESS)\r
+ {\r
+ __pEtwsSecurityInfo->SetPosition(0);\r
+ }\r
+\r
+ r = __pEtwsWarningType->SetArray(rhs.__pEtwsWarningType->GetPointer(), 0, rhs.__pEtwsWarningType->GetLimit());\r
+ if (r == E_SUCCESS)\r
+ {\r
+ __pEtwsWarningType->SetPosition(0);\r
+ }\r
}\r
\r
return (*this);\r
err = AddMessageAddress(recipientList, RECIPIENT_TYPE_TO, msgInfo, MSG_RECIPIENTS_TYPE_TO);
SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "Message add address error");
- if (pMsgBody)
- {
- delete[] pMsgBody;
- pMsgBody = null;
- }
+ delete[] pMsgBody;
+ pMsgBody = null;
return err;
err = PopulateMmsContent(message, msgInfo);
SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "failed to generate MMS message");
- if (pSubject)
- {
- delete[] pSubject;
- pSubject = null;
- }
+ delete[] pSubject;
+ pSubject = null;
return err;
int count = 0;
int index = 0;
const int zero = 0;
+ String *pRecipient = null;
result r = E_SUCCESS;
pRecipientList = (const_cast< RecipientList& >(recipientList)).GetListN(type);
count = pRecipientList->GetCount();
SysTryCatch(NID_MSG, count != zero, r = E_SUCCESS , r, "Type[%d] Recipient is empty",type);
- tempRecipient.Append(L"<" + *(dynamic_cast< String* >(pRecipientList->GetAt(index))) + L">");
+ pRecipient = dynamic_cast< String* >(pRecipientList->GetAt(index));
+ SysTryCatch(NID_MSG, pRecipient != null, r = GetLastResult(), r, "[%s] Failed to get recipient", GetErrorMessage(r));
+
+ tempRecipient.Append(L"<" + *(pRecipient) + L">");
index++;
for (; index < count; index++)
}
pPhoneNum = _StringConverter::CopyToCharArrayN(*pTempRecipient);
+ SysTryCatch(NID_MSG, pPhoneNum != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "memory allocation failed.");
msg_struct_list_s *pAddrList = NULL;
msg_struct_t addrInfo = NULL;
pAddrList->nCount++;
- if (pPhoneNum)
- {
- delete[] pPhoneNum;
- pPhoneNum = null;
- }
+ delete[] pPhoneNum;
+ pPhoneNum = null;
}
// deallocate
_MsgUtil::SendEmail(const EmailMessage& message, const RecipientList& recipientList, int &mailId, int &requestId)
{
-//////////////////
email_account_t* pAccount = NULL;
email_mail_data_t *pMail = null;
email_mailbox_t *pMailbox = null;
result r = E_SUCCESS;
String fromAddr;
-
email_service_begin();
pMail = (email_mail_data_t *)calloc(1,sizeof(email_mail_data_t));
free(*pAttach);
}
free( pAttach);
-
}
email_free_mail_data(&pMail, 1);
email_free_mailbox(&pMailbox, 1);
email_service_end();
return r;
-
-/////////////
-
}
result
pMail->attachment_count = index+1;
}
- if (pAttachmentList)
+ if (pAttachmentList->GetCount() > 0)
{
- if (pAttachmentList->GetCount() > 0)
- {
- pAttachmentList->RemoveAll(true);
- }
- delete pAttachmentList;
- pAttachmentList = null;
+ pAttachmentList->RemoveAll(true);
}
+ delete pAttachmentList;
+ pAttachmentList = null;
+
return r;
CATCH:
}
-
result
_MsgUtil::AddEmailCallBackToDbus(void)
{
-
DBusConnection* pConnection=NULL;
DBusError error = {0};
result r = E_SUCCESS;
ArrayList* pList = null;
int err = MSG_SUCCESS;
result r = E_SUCCESS;
- msg_struct_list_s msgList;
+ msg_struct_list_s msgList = {0};
msg_struct_t searchCon = NULL;
ClearLastResult();
char* pSearchString = NULL;
int folderId = MSG_ALLBOX_ID;
ArrayList* pList = NULL;
- msg_struct_list_s msgList;
+ msg_struct_list_s msgList = {0};
msg_struct_t searchCon = NULL;
ClearLastResult();
result
_SmsMmsCallbackHandler::AddCbsChannel(int from, int to, Tizen::Base::String& name, bool activate)
{
- int err = MSG_SUCCESS;
result r = E_SUCCESS;
- CbsChannel* pCbsChannel = null;
int fromId = 0;
int toId = 0;
bool channelFound = false;
result
_SmsMmsCallbackHandler::RemoveCbsChannel(int from, int to)
{
- int err = MSG_SUCCESS;
result r = E_SUCCESS;
int fromId = 0;
int toId = 0;
result
_SmsMmsCallbackHandler::UpdateCbsChannel(int from, int to, Tizen::Base::String name, bool activate)
{
- int err = MSG_SUCCESS;
result r = E_SUCCESS;
int fromId = 0;
int toId = 0;
void
_SmsMmsCallbackHandler::IncomingCbsMessageCallback(msg_handle_t hMsgHandle, msg_struct_t newMsg, void* pUserParam)
{
+ result r = E_SUCCESS;
_SmsEventArg* pSmsEventArg = null;
int tempReceivedTime = 0;
DateTime receivedTime;
String etwsSecurityInfo(etwsWarningInfo);
length = etwsSecurityInfo.GetLength();
msgSecurityInfo.Construct(length);
- msgSecurityInfo.SetArray((byte*) etwsWarningInfo, 0, length);
+ r = msgSecurityInfo.SetArray((byte*) etwsWarningInfo, 0, length);
msgSecurityInfo.SetPosition(0);
Tizen::Base::Integer warningtype(etwsWarningType);
void
_SmsMmsCallbackHandler::IncomingWapPushMessageCallback(msg_handle_t hMsgHandle, const char* pHeader, const char* pBody, int bodyLength, void* pUserParam)
{
+ result r = E_SUCCESS;
_SmsEvent* pSmsEvent = static_cast <_SmsEvent*>(pUserParam);
_SmsEventArg* pSmsEventArg = null;
String msgHeader(pHeader);
Tizen::Base::ByteBuffer msgBody;
msgBody.Construct(bodyLength);
- msgBody.SetArray((byte*) pBody, 0, bodyLength);
+ r = msgBody.SetArray((byte*) pBody, 0, bodyLength);
msgBody.SetPosition(0);
SysLog(NID_MSG, "push msg body: [%s]", pBody);
r = __pWapPushReceiveEvent->RemoveListener(listener);
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "listner remove failed");
- if (__pWapPushReceiveEvent)
- {
- delete __pWapPushReceiveEvent;
- __pWapPushReceiveEvent = null;
- }
+ delete __pWapPushReceiveEvent;
+ __pWapPushReceiveEvent = null;
return r;
int err = MSG_SUCCESS;
char* pWapAppId = null;
char* pContentType = null;
- msg_struct_t pushInfo;
+ msg_struct_t pushInfo = null;
char* pPkgName = null;
ClearLastResult();
int err = MSG_SUCCESS;
char* pWapAppId = null;
char* pContentType = null;
- msg_struct_t pushInfo;
+ msg_struct_t pushInfo = null;
char* pPkgName = null;
ClearLastResult();
_WapPushMessageImpl::_WapPushMessageImpl(const _WapPushMessageImpl& value)
{
- __pMsgBody->SetArray(value.__pMsgBody->GetPointer(), 0, value.__pMsgBody->GetLimit());
+ result r = E_SUCCESS;
+
+ r = __pMsgBody->SetArray(value.__pMsgBody->GetPointer(), 0, value.__pMsgBody->GetLimit());
+ SysTryReturnVoidResult(NID_MSG, r == E_SUCCESS, r, "Failed to set array");
__pMsgBody->SetPosition(0);
__msgHeader = value.__msgHeader;
}
_WapPushMessageImpl&
_WapPushMessageImpl::operator =(const _WapPushMessageImpl& rhs)
{
+ result r = E_SUCCESS;
+
if (this != &rhs)
{
- __pMsgBody->SetArray(rhs.__pMsgBody->GetPointer(), 0, rhs.__pMsgBody->GetLimit());
- __pMsgBody->SetPosition(0);
- __msgHeader = rhs.__msgHeader;
+ r = __pMsgBody->SetArray(rhs.__pMsgBody->GetPointer(), 0, rhs.__pMsgBody->GetLimit());
+ if (r == E_SUCCESS)
+ {
+ __pMsgBody->SetPosition(0);
+ __msgHeader = rhs.__msgHeader;
+ }
}
return (*this);