==================================================================================================*/
#define MAX_SOUND_FILE_LEN 1024
-#define DEFAULT_ALERT_FILE "/opt/usr/share/settings/Alerts/notification_sdk.wav"
+#define DEFAULT_ALERT_FILE "/opt/usr/share/settings/Alerts/Whistle.ogg"
#define HAPTIC_TEST_ITERATION 1
#define MSG_VIBRATION_INTERVAL 3000
void MsgSoundPlayer::MsgGetRingtonePath(char *userRingtonePath, char **msg_tone_file_path_p)
{
-
#ifndef MSG_WEARABLE_PROFILE
- char *tmpFilePath = NULL;
- *msg_tone_file_path_p = new char[MSG_FILEPATH_LEN_MAX+1];
-
- char *msg_tone_file_path = *msg_tone_file_path_p;
-
MSG_RINGTONE_TYPE_T ringtoneType = (MSG_RINGTONE_TYPE_T)MsgSettingGetInt(MSG_SETTING_RINGTONE_TYPE);
MSG_DEBUG("Ringtone type = [%d]", ringtoneType);
return;
}
- if(userRingtonePath && userRingtonePath[0] != '\0') {
+ char *tmpFilePath = NULL;
+ *msg_tone_file_path_p = new char[MSG_FILEPATH_LEN_MAX+1];
+
+ char *msg_tone_file_path = *msg_tone_file_path_p;
+
+ bool bUserRingtone = userRingtonePath && userRingtonePath[0] != '\0';
+ if (bUserRingtone) {
tmpFilePath = userRingtonePath;
} else {
if (ringtoneType == MSG_RINGTONE_TYPE_DEFAULT) {
}
} else {
MSG_DEBUG("Set ringtone to tmpFilePath.");
- strncpy(msg_tone_file_path, tmpFilePath, MSG_FILEPATH_LEN_MAX);
+ snprintf(msg_tone_file_path, MSG_FILEPATH_LEN_MAX, "%s", tmpFilePath);
}
- if (tmpFilePath && userRingtonePath[0] == '\0') {
+ if (tmpFilePath && !bUserRingtone) {
free(tmpFilePath);
tmpFilePath = NULL;
}
MSG_SEC_DEBUG("Msg Setting : Noti Alert=[%d], With vibration=[%d]", bMsgSettingNoti, bMsgSettingVibration);
int callStatus = 0;
- int alertOnCall = 0;
+// int alertOnCall = 0;
callStatus = MsgSettingGetInt(VCONFKEY_CALL_STATE);
MSG_DEBUG("Call Status [%d]", callStatus);
/* 1. On Call */
*bOnCall = true; // set call status;
-
+#if 0
alertOnCall = MsgSettingGetInt(VCONFKEY_CISSAPPL_ALERT_ON_CALL_INT);
MSG_DEBUG("Alert On Call [%d]", alertOnCall);
}
}
}
+#endif
} else {
/* 2. Call is not active */
MSG_DEBUG("Call is not active.");
- int voiceRecording = MsgSettingGetInt(VCONFKEY_VOICERECORDER_STATE);
if (bVoiceMail) { /* 2-1. Voice message */
if (bMsgSettingNoti) {
}
} else { /* 2-1. Normal message */
if (bMsgSettingNoti) {
- if (voiceRecording != VCONFKEY_VOICERECORDER_RECORDING) {
- if (bSoundOn) {
- MSG_DEBUG("Play sound.");
- *bPlaySound = true;
- } else {
- MSG_DEBUG("It doesn't play vibration.");
- }
+ if (bSoundOn) {
+ MSG_DEBUG("Play sound.");
+ *bPlaySound = true;
+ } else {
+ MSG_DEBUG("It doesn't play vibration.");
+ }
- if ((bSoundOn || bVibrationOn) && bMsgSettingVibration) {
- MSG_DEBUG("Play vibration.");
- *bPlayVibration = true;
- } else {
- MSG_DEBUG("It doesn't play vibration.");
- }
+ if ((bSoundOn || bVibrationOn) && bMsgSettingVibration) {
+ MSG_DEBUG("Play vibration.");
+ *bPlayVibration = true;
} else {
- MSG_DEBUG("It doesn't play sound/vibration.");
+ MSG_DEBUG("It doesn't play vibration.");
}
} else {
MSG_DEBUG("It doesn't play sound/vibration.");
void MsgPlayTTSMode(MSG_SUB_TYPE_T msgSubType, msg_message_id_t msgId, bool isFavorites)
{
MSG_BEGIN();
-
+#if 0
bool bNotification = true;
if (MsgSettingGetBool(MSG_SETTING_NOTIFICATION, &bNotification) != MSG_SUCCESS) {
}
MsgChangePmState();
-
+#endif
MSG_END();
}
// MMS Received Ind Process Func
MsgPlugin *plg = MsgPluginManager::instance()->getPlugin(pMsgInfo->msgType.mainType);
+ if (plg == NULL)
+ return MSG_ERR_NULL_POINTER;
//Contents of msg Data was removed and replaced to retrievedFilePath
// NOTICE:: now it was moved to handleEvent in MsgListnerThread
MSG_MAIN_TYPE_T msgMainType = pMsgInfo->msgType.mainType;
MsgPlugin *plg = MsgPluginManager::instance()->getPlugin(msgMainType);
+ if (plg == NULL)
+ return MSG_ERR_NULL_POINTER;
+
// Read the default network SIM
MsgPlugin *sms_plg = MsgPluginManager::instance()->getPlugin(MSG_SMS_TYPE);
return -1;
}
- // Regist vconf CB.
- MsgSettingRegVconfCB();
mainloop = g_main_loop_new(NULL, FALSE);
MSG_DEBUG("Fail to start Messaging Framework!!!");
}
- // Remove vconf CB
- MsgSettingRemoveVconfCB();
//contacts-service is not used for gear
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
// Close Contact Sevice
mLibHandler = dlopen(libPath, RTLD_NOW);
if (!mLibHandler)
- THROW(MsgException::PLUGIN_ERROR, "ERROR dlopen library : [%s] [%s]", libPath, dlerror());
-
- // Clear Error
- dlerror();
+ THROW(MsgException::PLUGIN_ERROR, "ERROR dlopen library : [%s]", libPath);
// assign the c function pointers
msg_error_t(*pFunc)(MSG_PLUGIN_HANDLER_S*) = NULL;
pFunc = (msg_error_t(*)(MSG_PLUGIN_HANDLER_S*))dlsym(mLibHandler, "MsgPlgCreateHandle");
- char *error = dlerror();
-
- if (error != NULL)
- THROW(MsgException::PLUGIN_ERROR, "ERROR dlsym library : [%s]", dlerror());
+ if (!pFunc)
+ THROW(MsgException::PLUGIN_ERROR, "ERROR dlsym library");
if ((*pFunc)(&mPlgHandler) != MSG_SUCCESS)
THROW(MsgException::PLUGIN_ERROR, "ERROR to create plugin handle");
pFilterList->msg_struct_info = (msg_struct_t *)calloc(rowCnt, sizeof(MSG_FILTER_S *));
- msg_struct_s* pTmp = NULL;
-
- for (int i = 0; i < rowCnt; i++)
- {
- pFilterList->msg_struct_info[i] = (msg_struct_t)new msg_struct_s;
-
- pTmp = (msg_struct_s *)pFilterList->msg_struct_info[i];
- pTmp->type = MSG_STRUCT_FILTER;
- pTmp->data = new MSG_FILTER_S;
- MSG_FILTER_S *pFilter = (MSG_FILTER_S *)pTmp->data;
- memset(pFilter, 0x00, sizeof(MSG_FILTER_S));
- pFilter->filterId = dbHandle->getColumnToInt(index++);
- pFilter->filterType = dbHandle->getColumnToInt(index++);
- memset(pFilter->filterValue, 0x00, sizeof(pFilter->filterValue));
- dbHandle->getColumnToString(index++, MAX_FILTER_VALUE_LEN, pFilter->filterValue);
- pFilter->bActive = dbHandle->getColumnToInt(index++);
+ if (pFilterList->msg_struct_info != NULL) {
+ msg_struct_s* pTmp = NULL;
+
+ for (int i = 0; i < rowCnt; i++)
+ {
+ pFilterList->msg_struct_info[i] = (msg_struct_t)new msg_struct_s;
+
+ pTmp = (msg_struct_s *)pFilterList->msg_struct_info[i];
+ pTmp->type = MSG_STRUCT_FILTER;
+ pTmp->data = new MSG_FILTER_S;
+ MSG_FILTER_S *pFilter = (MSG_FILTER_S *)pTmp->data;
+ memset(pFilter, 0x00, sizeof(MSG_FILTER_S));
+ pFilter->filterId = dbHandle->getColumnToInt(index++);
+ pFilter->filterType = dbHandle->getColumnToInt(index++);
+ memset(pFilter->filterValue, 0x00, sizeof(pFilter->filterValue));
+ dbHandle->getColumnToString(index++, MAX_FILTER_VALUE_LEN, pFilter->filterValue);
+ pFilter->bActive = dbHandle->getColumnToInt(index++);
+ }
}
-
dbHandle->freeTable();
MSG_END();
int MsgSettingGetAutoReject();
bool MsgSettingGetUnknownAutoReject();
-void MsgSettingRegVconfCB();
-void MsgSettingRemoveVconfCB();
-
void MsgSettingRegVconfCBCommon(const char *pKey, _vconf_change_cb pCb);
void MsgSettingRemoveVconfCBCommon(const char *pKey, _vconf_change_cb pCb);
-#ifdef MSG_PENDING_PUSH_MESSAGE
-msg_error_t MsgSendPendingPushMsg(void);
-#endif
#endif // MSG_GCONF_WRAPPER_H
}
-//static void MsgContactSvcCallback(const char *view_uri, void *user_data)
-//{
-// MSG_DEBUG("MsgContactSvcCallback is called.");
-// if (!strcmp(CONTACT_CALLBACK_USER_DATA, (const char*)user_data)) {
-// MSG_DEBUG("Contact Data is Changed!!!");
-// MsgSyncContact();
-// } else if (!strcmp(ADDRESSBOOK_CALLBACK_USER_DATA, (const char*)user_data)) {
-// MSG_DEBUG("Address Book Data is Changed!!!");
-// MsgSyncAddressbook();
-// }
-//
-// if (ContactDbHandle.disconnect() != MSG_SUCCESS)
-// MSG_DEBUG("DB Disconnect Fail");
-//}
-
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
/*==================================================================================================
FUNCTION IMPLEMENTATION
bool checkBlockingMode(char *address, bool *pisFavorites)
{
+#if 0
MsgZoneChange();
msg_error_t err = MSG_SUCCESS;
MsgZoneRevert();
return isblock;
+#else
+ if (pisFavorites != NULL)
+ *pisFavorites = false;
+
+ return false;
+#endif
}
#endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED
#include "MsgUtilStorage.h"
#include "MsgGconfWrapper.h"
#include "MsgException.h"
-#ifdef MSG_PENDING_PUSH_MESSAGE
-#include "MsgIpcSocket.h"
-#endif
#ifdef USE_GCONF
#endif
-#ifdef MSG_PENDING_PUSH_MESSAGE
-int bPushServiceReady = 0;
-#endif
-
int autoReject = 0;
bool bUnknownAutoReject = false;
/*==================================================================================================
FUNCTION IMPLEMENTATION
==================================================================================================*/
-static void MsgVconfCB(keynode_t *key, void* data)
-{
-#if 0
- char *keyStr = NULL;
- keyStr = vconf_keynode_get_name(key);
-
- if (!keyStr)
- return;
-
- if (!g_strcmp0(keyStr, VCONFKEY_CISSAPPL_AUTO_REJECT_INT)) {
- autoReject = vconf_keynode_get_int(key);
- MSG_DEBUG("[%s] key CB called. set to [%d].", VCONFKEY_CISSAPPL_AUTO_REJECT_INT, autoReject);
- } else if (!g_strcmp0(keyStr, VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL)) {
- bUnknownAutoReject = vconf_keynode_get_bool(key);
- MSG_DEBUG("[%s] key CB called. set to [%d].", VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL, bUnknownAutoReject);
- }
-#ifdef MSG_PENDING_PUSH_MESSAGE
- else if (!g_strcmp0(keyStr, VCONFKEY_USER_SERVICE_READY)){
- bPushServiceReady = vconf_keynode_get_int(key);
- MSG_DEBUG("[%s] key CB called. set to [%d].", VCONFKEY_USER_SERVICE_READY, bPushServiceReady);
-
- if(bPushServiceReady)
- {
- try {
- if (MsgSendPendingPushMsg() == MSG_SUCCESS) {
- MSG_DEBUG("MsgSendPendingPushMsg success");
- } else {
- MSG_DEBUG("MsgSendPendingPushMsg fail");
- }
- } catch (MsgException& e) {
- MSG_FATAL("%s", e.what());
- MSG_DEBUG("MsgSendPendingPushMsg fail");
- }
- }
- }
-#endif
- else {
- MSG_DEBUG("key did not match.");
- }
-#endif
-}
msg_error_t MsgSettingSetString(const char *pKey, const char *pSetValue)
{
MSG_DEBUG("Success to remove vconf CB with [%s]", pKey);
}
}
-
-
-void MsgSettingRegVconfCB()
-{
-#if 0
- // Set default values.
- autoReject = MsgSettingGetInt(VCONFKEY_CISSAPPL_AUTO_REJECT_INT);
- MsgSettingGetBool(VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL, &bUnknownAutoReject);
-
- MsgSettingRegVconfCBCommon(VCONFKEY_CISSAPPL_AUTO_REJECT_INT, MsgVconfCB);
- MsgSettingRegVconfCBCommon(VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL, MsgVconfCB);
-
-#ifdef MSG_PENDING_PUSH_MESSAGE
- MsgSettingRegVconfCBCommon(VCONFKEY_USER_SERVICE_READY, MsgVconfCB);
-#endif
-#endif
-}
-
-void MsgSettingRemoveVconfCB()
-{
-#if 0
- MsgSettingRemoveVconfCBCommon(VCONFKEY_CISSAPPL_AUTO_REJECT_INT, MsgVconfCB);
- MsgSettingRemoveVconfCBCommon(VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL, MsgVconfCB);
-#endif
-}
-
-msg_error_t MsgSendPendingPushMsg(void)
-{
- MSG_BEGIN();
-
- // establish connection to msgfw daemon
- MsgIpcClientSocket client;
- client.connect(MSG_SOCKET_PATH);
-
- // composing command
- int cmdSize = sizeof(MSG_CMD_S); // cmd type, MSG_SYNCML_MESSAGE_DATA_S
-
- MSG_DEBUG("cmdSize: %d", cmdSize);
-
- char cmdBuf[cmdSize];
- bzero(cmdBuf, cmdSize);
- MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
-
- // Set Command Parameters
- pCmd->cmdType = MSG_CMD_SEND_PENDING_PUSH_MESSAGE;
-
- memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN);
-
- // Send Command to Messaging FW
- client.write(cmdBuf, cmdSize);
-
- // Receive result from Transaction Manager
- char* retBuf = NULL;
- AutoPtr<char> wrap(&retBuf);
- unsigned int retSize;
- client.read(&retBuf, &retSize);
-
- // close connection to msgfw daemon
- client.close();
-
- // Decoding the result from FW and Returning it to plugin
- // the result is used for making delivery report
- MSG_EVENT_S* pEvent = (MSG_EVENT_S*)retBuf;
-
- if (pEvent->eventType != MSG_EVENT_SEND_PENDING_PUSH_MESSAGE)
- MSG_FATAL("Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
- //THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
-
- MSG_END();
-
- return (pEvent->result);
-}
goto __CATCH_FAIL__;
msgText = (char *)calloc(1, fileSize);
- memcpy(msgText, pFileData, fileSize);
+ if(pFileData && msgText)
+ memcpy(msgText, pFileData, fileSize);
+
pObject->numOfBiData = fileSize;
pObject->pszValue[0] = msgText;
}
//Insert VBody for mms raw data;
char* pFileData = NULL;
MMS_DATA_S *pMmsData = NULL;
- int fileSize = 0;
- char* msgText = NULL;
+ int fileSize = 0;
+ char* msgText = NULL;
#if 0
char filePath[MSG_FILEPATH_LEN_MAX] = {0, };
if(pMsg->msgType.subType == MSG_NOTIFICATIONIND_MMS)
} else {
fileSize = strlen(pMsg->msgData);
pFileData = (char *)calloc(1, fileSize+1);
+ if (!pFileData)
+ goto __CATCH_FAIL__;
snprintf(pFileData, fileSize, "%s", pMsg->msgData);
}
if (pFileData) {
if (MsgDeserializeMmsData(pFileData, fileSize, &pMmsData) != 0) {
MSG_DEBUG("Fail to Deserialize Message Data");
+ MsgMmsRelease(&pMmsData);
goto __CATCH_FAIL__;
}
int serializedDataSize = 0;
- serializedDataSize = MsgSerializeMms(pMmsData, &pFileData);
+ if (pMmsData) {
+ MsgMmsSetMultipartListData(pMmsData);//app file -> data
+ serializedDataSize = MsgSerializeMms(pMmsData, &pFileData);
+ }
if (pFileData) {
fileSize = serializedDataSize;
#endif
MSG_DEBUG("FILE SIZE IS %d, %s", fileSize, pFileData);
msgText = (char *)calloc(1, fileSize);
- if(pFileData)
+ if(pFileData && msgText)
memcpy(msgText, pFileData, fileSize);
-
pObject->numOfBiData = fileSize;
pObject->pszValue[0] = msgText;
pObject->valueCount = 1;