ADD_DEFINITIONS(-DTZ_SYS_GLOBALUSER_DATA_PATH="${TZ_SYS_GLOBALUSER_DATA}")
ADD_DEFINITIONS(-DTZ_SYS_GLOBALUSER_DB_PATH="${TZ_SYS_GLOBALUSER_DB}")
ADD_DEFINITIONS(-DTZ_SYS_HOME_PATH="${TZ_SYS_HOME}")
-ADD_DEFINITIONS(-DLIBDIR="${LIBDIR}")
+ADD_DEFINITIONS(-DLIB_INSTALL_DIR="${LIB_INSTALL_DIR}")
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
err = MsgSubmitReq(&reqInfo, false);
if (err == MSG_SUCCESS) {
+ MSG_DEBUG("MsgSubmitReq() Success");
MsgTransactionManager::instance()->broadcastStorageChangeCB(MSG_SUCCESS, MSG_STORAGE_CHANGE_UPDATE, &msgIdList);
- if (err == MSG_SUCCESS)
- MSG_DEBUG("MsgSubmitReq() Success");
- else
- MSG_DEBUG("MsgSubmitReq() Fail, [%d]", err);
} else {
MSG_DEBUG("MsgSubmitReq() Fail, [%d]", err);
}
} MSG_PLG_TABLE_T;
static const MSG_PLG_TABLE_T __msg_plg_items[] = {
- { MSG_SMS_TYPE, LIBDIR"/libmsg_sms_plugin.so" },
- { MSG_MMS_TYPE, LIBDIR"/libmsg_mms_plugin.so" }
+ { MSG_SMS_TYPE, LIB_INSTALL_DIR"/libmsg_sms_plugin.so" },
+ { MSG_MMS_TYPE, LIB_INSTALL_DIR"/libmsg_mms_plugin.so" }
};
%define APP_LOCALEDIR %{APP_RESDIR}/locale
%define APP_MANIFESTDIR %{TZ_SYS_RO_PACKAGES}
%endif
-%define LIBDIR %{_libdir}
%prep
%setup -q
strncpy(pMsgInfo->addressList[0].addressVal, mmsHeader.pFrom->szAddr, MAX_ADDRESS_VAL_LEN);
if (MmsAddrUtilCheckEmailAddress(pMsgInfo->addressList[0].addressVal)) {
pMsgInfo->addressList[0].addressType = MSG_ADDRESS_TYPE_EMAIL;
+ } else {
+ pMsgInfo->addressList[0].addressType = MSG_ADDRESS_TYPE_PLMN;
}
}
pMsgInfo->addressList[addr_idx].recipientType = MSG_RECIPIENTS_TYPE_TO;
if (MmsAddrUtilCheckEmailAddress(pMsgInfo->addressList[addr_idx].addressVal)) {
pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_EMAIL;
+ } else {
+ pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_PLMN;
}
} else {
addr_idx--;
pMsgInfo->addressList[addr_idx].recipientType = MSG_RECIPIENTS_TYPE_CC;
if (MmsAddrUtilCheckEmailAddress(pMsgInfo->addressList[addr_idx].addressVal)) {
pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_EMAIL;
+ } else {
+ pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_PLMN;
}
} else {
addr_idx--;
void SmsPluginCbMsgHandler::Decode2gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_CBMSG_PAGE_S *pCbPage)
{
- unsigned char cbData[pCbMsg->Length+1];
-
- memset(cbData, 0x00, sizeof(cbData));
+ unsigned char cbData[pCbMsg->Length+1] = {0};
memcpy(cbData, pCbMsg->szMsgData, pCbMsg->Length);
cbData[pCbMsg->Length] = '\0';
dataLen = (dataLen*8) / 7;
SmsPluginUDCodec udCodec;
- char pageData[MAX_CBMSG_PAGE_SIZE+1];
+ char pageData[MAX_CBMSG_PAGE_SIZE*8/7] = {0};
int unpackLen = udCodec.unpack7bitChar(&cbData[6], dataLen, 0, pageData);
if (pCbPage->pageHeader.dcs.iso639Lang[0]) {
void SmsPluginCbMsgHandler::Decode3gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_CBMSG_PAGE_S *pCbPage)
{
- unsigned char cbData[(MAX_CBMSG_PAGE_SIZE*MAX_CBMSG_PAGE_NUM)+1];
-
- memset(cbData, 0x00, sizeof(cbData));
+ unsigned char cbData[MAX_CBMSG_TOTAL_PAGE_SIZE + 1] = {0};
memcpy(cbData, pCbMsg->szMsgData, pCbMsg->Length);
cbData[pCbMsg->Length] = '\0';
switch (pCbPage->pageHeader.dcs.codingScheme) {
case SMS_CHARSET_7BIT: {
for (int i = 0; i < pCbPage->pageHeader.totalPages; ++i) {
- char cbMessage[MAX_CBMSG_PAGE_SIZE] = {0, };
- dataLen = cbData[7+(i+1)*82 + i];
- memcpy(cbMessage, &cbData[7+(i*82)+ i], dataLen);
-
- dataLen = (dataLen*8) / 7;
+ unsigned char cbMessage[MAX_CBMSG_PAGE_SIZE] = {0};
+ dataLen = cbData[7 + (i + 1) * MAX_CBMSG_PAGE_SIZE + i];
if (dataLen > MAX_CBMSG_PAGE_SIZE)
THROW(MsgException::SMS_PLG_ERROR, "CB Msg Size is over MAX [%d]", dataLen);
+ memcpy(cbMessage, &cbData[7+(i*MAX_CBMSG_PAGE_SIZE)+ i], dataLen);
+ dataLen = (dataLen*8) / 7;
+
SmsPluginUDCodec udCodec;
int unpackLen = udCodec.unpack7bitChar((const unsigned char *)cbMessage, dataLen, 0, pCbPage->pageData + offset);
offset += unpackLen;
char cbMessage[MAX_CBMSG_PAGE_SIZE]= {0, };
for (int i = 0; i < pCbPage->pageHeader.totalPages; ++i) {
- dataLen = cbData[7+(i+1)*82 + i];
- memcpy(cbMessage + offset, &cbData[7+(i*82)+ i], dataLen);
+ dataLen = cbData[7+(i+1)*MAX_CBMSG_PAGE_SIZE + i];
+ memcpy(cbMessage + offset, &cbData[7+(i*MAX_CBMSG_PAGE_SIZE)+ i], dataLen);
offset += dataLen;
}
dataLen = offset;
pCbPage->pageLength = dataLen;
}
#else
- char cbMessage[MAX_CBMSG_PAGE_SIZE] = {0, };
+ char cbMessage[MAX_CBMSG_PAGE_SIZE*MAX_CBMSG_PAGE_NUM+1] = {0, };
for (int i = 0; i < pCbPage->pageHeader.totalPages; ++i) {
if (pCbPage->pageHeader.dcs.iso639Lang[0]) {
- dataLen = cbData[7+(i+1)*82 + i] - 2;
+ dataLen = cbData[7+(i+1)*MAX_CBMSG_PAGE_SIZE + i] - 2;
if (dataLen > 0) {
- memcpy(cbMessage + offset, &cbData[7+(i*82)+ i + 2], dataLen);
+ memcpy(cbMessage + offset, &cbData[7+(i*MAX_CBMSG_PAGE_SIZE)+ i + 2], dataLen);
offset += dataLen;
}
} else {
- dataLen = cbData[7+(i+1)*82 + i];
+ dataLen = cbData[7+(i+1)*MAX_CBMSG_PAGE_SIZE + i];
if (dataLen > 0) {
- memcpy(cbMessage + offset, &cbData[7+(i*82)+ i], dataLen);
+ memcpy(cbMessage + offset, &cbData[7+(i*MAX_CBMSG_PAGE_SIZE)+ i], dataLen);
offset += dataLen;
}
}
MSG_SMS_VLD_INFO("%d, SMS Send Start, %s->%s, %s", pReqInfo->msgInfo.msgId, \
(msisdn == NULL)?"ME":msisdn, \
pReqInfo->msgInfo.addressList[0].addressVal, \
- (tapiRet == TAPI_API_SUCCESS)?"Success":"Fail");
+ "Success");
MSG_SMS_VLD_TXT("%d, [%s]", pReqInfo->msgInfo.msgId, pReqInfo->msgInfo.msgText);
int selectedSimIndex;
char meImei[MAX_ME_IMEI_LEN + 1];
- bool bMbdnEnable[MAX_TELEPHONY_HANDLE_CNT];
+ bool bMbdnEnable[MAX_TELEPHONY_HANDLE_CNT+1];
MsgMutex mx;
MsgCndVar cv;
#define MAX_REL_TIME_PARAM_LEN 1
#define MAX_UD_HEADER_NUM 7
#define MAX_SAT_TPDU_LEN 175
-#define MAX_CBMSG_PAGE_SIZE 1252
+#define MAX_CBMSG_PAGE_SIZE 82
+#define MAX_CBMSG_TOTAL_PAGE_SIZE 1252 /* 6 + 1 + (MAX_CBMSG_PAGE_SIZE + 1) * MAX_CBMSG_PAGE_NUM = 1252 */
#define MAX_ETWS_SIZE 56
#define MAX_CBMSG_PAGE_NUM 15
#define MAX_SIM_SMS_NUM 255
unsigned char hour;
unsigned char minute;
unsigned char second;
- unsigned char timeZone;
+ int timeZone;
} SMS_TIME_ABS_S;
SMS_CBMSG_TYPE_T cbMsgType; /*CBS Msg or SCHEDULE Msg or CBS41 Msg */
SMS_CBMSG_HEADER_S pageHeader; /**< CB Message Header */
int pageLength; /**< message string length */
- char pageData[MAX_CBMSG_PAGE_SIZE*8/7+1]; /**< user data */
+ char pageData[MAX_CBMSG_TOTAL_PAGE_SIZE*8/7+1]; /**< user data */
} SMS_CBMSG_PAGE_S;
SMS_CODING_SCHEME_T codingScheme; /**< How to encode a message. */
time_t recvTime; /**< Msg Recv Time */
int msgLength; /**< message string length */
- char msgData[MAX_CBMSG_PAGE_SIZE*8/7*MAX_CBMSG_PAGE_NUM+1]; /**< user data */
+ char msgData[MAX_CBMSG_TOTAL_PAGE_SIZE*8/7+1]; /**< user data */
} SMS_CBMSG_S;
typedef struct _SMS_ETWS_PRIMARY_S {
msg_error_t msg_launch_app(const char *app_id, bundle *bundle_data)
{
msg_launch_app_data *data = (msg_launch_app_data *)calloc(1, sizeof(msg_launch_app_data));
+ if (data == NULL) {
+ MSG_ERR("Memory alloc failed!");
+ return MSG_ERR_MEMORY_ERROR;
+ }
+
data->app_id = g_strdup(app_id);
data->bundle_data = bundle_dup(bundle_data);
pthread_t thd;
#include "MsgUtilMime.h"
#include "MsgDebug.h"
+#define MIME_MAX_NUM 167
+#define EXT_MAX 68
+#define MIME_SUB_TYPE_VND 1
+#define MIME_SUB_TYPE_X 2
+
typedef enum _MimeAppType {
MIME_APPLICATION_NONE,
121, 121, 121,
122, 122, 122,
129, 136, 144,
- 151, 161, 163
+ 151, 161, 163,
+ MIME_MAX_NUM
};
static int mimeTableEnum[] =
};
-#define MIME_MAX_NUM 167
-#define EXT_MAX 68
-#define MIME_SUB_TYPE_VND 1
-#define MIME_SUB_TYPE_X 2
-
int __MimeGetTableIndexInt(MimeType mime);
int __MimeGetTableIndexString(const char *szMime);
MimeMainType __MimeGetMainTypeName(const char *szType);
}
} else {
fileSize = strlen(pMsg->msgData);
- pFileData = (char *)calloc(1, fileSize+1);
+ pFileData = new char[fileSize+1];
if (!pFileData)
goto __CATCH_FAIL__;
+ memset(pFileData, 0x00, fileSize+1);
snprintf(pFileData, fileSize, "%s", pMsg->msgData);
}
memset(pTemp, 0, sizeof(VObject));
pTemp->property = type;
+ if (pVCard == NULL)
+ goto CATCH;
+
if (pVCard->pTop == NULL) {
pVCard->pTop = pTemp;
pVCard->pCur = pTemp;
VFREE(pCardRawTmp);
- if (pVCard->pTop == NULL)
+ if (pVCard == NULL || pVCard->pTop == NULL)
goto CATCH;
if (!vcard_ended)
int param_status = false;
int numberedParam = 0;
int enc = 0;
- int start_status = 0;
char* temp = NULL;
char* pVTree = NULL;
bool vmsg_ended = false;
if (!strncmp(szMsgBegin, "VCARD", strlen("VCARD"))) {
VDATA_TRACE("pVTree: %s", pVTree);
pVCard = vcard_decode(pVTree);
- pCurrent->pNext = pVCard;
+ if (pCurrent) {
+ pCurrent->pNext = pVCard;
+ }
pCurrent = pVCard;
dLen = ((strstr(pMsgRaw, "END:VCARD") + 9) - pMsgRaw);
pMsgRaw += dLen;
} else {
-
- if (start_status == 1)
- goto CATCH;
-
if (!strncmp(szMsgBegin, "VMSG", strlen("VMSG"))) {
if ((pVMsg = (VTree*)calloc(1, sizeof(VTree))) == NULL) {
- start_status = 1;
goto CATCH;
}
memset(pVMsg, 0x00, sizeof(VTree));
pCurrent = pVMsg;
} else if (!strncmp(szMsgBegin, "VBODY", strlen("VBODY"))) {
if ((pVBody = (VTree*)calloc(1, sizeof(VTree))) == NULL) {
- start_status = 1;
goto CATCH;
}
VDATA_TRACE("pMsgRawTmp: %s", pMsgRawTmp);
/* VFREE(pMsgRawTmp); */
- if (pVMsg->pTop == NULL) {
+ if (pVMsg && pVMsg->pTop == NULL) {
VDATA_TRACE("pVMsg->Top: NULL");
goto CATCH;
}
int total = 0;
int cnt = 0;
+ if (!pVMsgRaw || !pVMsgRaw->pTop) {
+ return NULL;
+ }
+
for (; cnt < pVMsgRaw->pTop->valueCount; cnt++) {
if (pVMsgRaw->pTop->pszValue[cnt] == NULL) {
break;
}
}
-
-
}
switch (pTmpTree->treeType) {