From: Sangkoo Kim Date: Tue, 22 Mar 2016 01:51:50 +0000 (+0900) Subject: Fix vconf error check X-Git-Tag: submit/tizen/20160323.015601~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d410f67b6ebfec2c78c0a0c8ce51f6c5814d7031;p=platform%2Fcore%2Fmessaging%2Fmsg-service.git Fix vconf error check Change-Id: I1a2559cb0d3f04668ead466b88c36c1a0d07cfdb --- diff --git a/externals/MsgNotificationWrapper.cpp b/externals/MsgNotificationWrapper.cpp index b3269e3..1b4a5f8 100755 --- a/externals/MsgNotificationWrapper.cpp +++ b/externals/MsgNotificationWrapper.cpp @@ -968,7 +968,9 @@ int getPrivId(msg_notification_type_t noti_type, int sim_idx) case MSG_NOTI_TYPE_NORMAL: case MSG_NOTI_TYPE_SIM: case MSG_NOTI_TYPE_CB: - noti_id = MsgSettingGetInt(NOTIFICATION_PRIV_ID); + if (MsgSettingGetInt(NOTIFICATION_PRIV_ID, ¬i_id) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } break; #else case MSG_NOTI_TYPE_NORMAL: @@ -982,22 +984,30 @@ int getPrivId(msg_notification_type_t noti_type, int sim_idx) break; #endif case MSG_NOTI_TYPE_FAILED: - noti_id = MsgSettingGetInt(MSG_SENTFAIL_NOTI_ID); + if (MsgSettingGetInt(MSG_SENTFAIL_NOTI_ID, ¬i_id) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } break; case MSG_NOTI_TYPE_VOICE_1: { char keyName[MAX_VCONFKEY_NAME_LEN] = {0, }; snprintf(keyName, sizeof(keyName), "%s/%d", VOICE_NOTI_ID_1, sim_idx); - noti_id = MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, ¬i_id) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } break; } case MSG_NOTI_TYPE_VOICE_2: { char keyName[MAX_VCONFKEY_NAME_LEN] = {0, }; snprintf(keyName, sizeof(keyName), "%s/%d", VOICE_NOTI_ID_2, sim_idx); - noti_id = MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, ¬i_id) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } break; } case MSG_NOTI_TYPE_SIM_FULL: - noti_id = MsgSettingGetInt(SIM_FULL_NOTI_PRIV_ID); + if (MsgSettingGetInt(SIM_FULL_NOTI_PRIV_ID, ¬i_id) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } break; default: MSG_DEBUG("No matching noti type [%d]", noti_type); @@ -1190,16 +1200,24 @@ void createInfoData(MSG_NOTI_INFO_S *noti_info, MSG_MESSAGE_INFO_S *msg_info) case MSG_NOTI_TYPE_VOICE_2: { memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_COUNT, msg_info->sim_idx); - noti_info->count = MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &(noti_info->count)) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } noti_info->layout = NOTIFICATION_LY_NOTI_EVENT_SINGLE; noti_info->time = msg_info->displayTime; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, msg_info->sim_idx); - char *voiceNumber = MsgSettingGetString(keyName); + char *voiceNumber = NULL; + if (MsgSettingGetString(keyName, &voiceNumber) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_ALPHA_ID, msg_info->sim_idx); - char *voiceAlphaId = MsgSettingGetString(keyName); + char *voiceAlphaId = NULL; + if (MsgSettingGetString(keyName, &voiceAlphaId) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } char *dialNumber = NULL; MSG_SEC_DEBUG("Voice mail server - alpha id = [%s], default num = [%s]", voiceAlphaId, voiceNumber); @@ -2115,7 +2133,11 @@ void setSoundAndVibration(notification_h noti_h, char *addressVal, bool bVoiceMa setNotiSound(noti_h, NOTIFICATION_SOUND_TYPE_USER_DATA, msg_tone_file_path); else { #endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */ - MSG_RINGTONE_TYPE_T ringtoneType = (MSG_RINGTONE_TYPE_T)MsgSettingGetInt(MSG_SETTING_RINGTONE_TYPE); + int tmpVal = 0; + if (MsgSettingGetInt(MSG_SETTING_RINGTONE_TYPE, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + MSG_RINGTONE_TYPE_T ringtoneType = (MSG_RINGTONE_TYPE_T)tmpVal; if (ringtoneType == MSG_RINGTONE_TYPE_SILENT) setNotiSound(noti_h, NOTIFICATION_SOUND_TYPE_NONE, NULL); else @@ -3182,7 +3204,9 @@ void MsgSoundSetRepeatAlarm() int nRepeatValue = 0; long nRepeatTime = 0; - nRepeatValue = MsgSettingGetInt(MSG_ALERT_REP_TYPE); + if (MsgSettingGetInt(MSG_ALERT_REP_TYPE, &nRepeatValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } switch (nRepeatValue) { case MSG_ALERT_TONE_ONCE: diff --git a/externals/MsgSensorWrapper.cpp b/externals/MsgSensorWrapper.cpp index ca7c001..0cade63 100755 --- a/externals/MsgSensorWrapper.cpp +++ b/externals/MsgSensorWrapper.cpp @@ -50,11 +50,20 @@ void MsgGestureCB(gesture_type_e gesture, const gesture_data_h data, double time if (ret == GESTURE_ERROR_NONE && event == GESTURE_EVENT_DETECTED && \ gesture == GESTURE_TURN_FACE_DOWN) { MSG_DEBUG("GESTURE_TURN_FACE_DOWN gesture detected."); - if (MsgSettingGetInt(VCONFKEY_SETAPPL_MOTION_ACTIVATION)) { - if (MsgSettingGetInt(VCONFKEY_SETAPPL_USE_TURN_OVER)) { - if (SensorCBFunction) - SensorCBFunction(); - } + int motion_activation = 0; + int use_turn_over = 0; + + if (MsgSettingGetInt(VCONFKEY_SETAPPL_MOTION_ACTIVATION, &motion_activation) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + + if (MsgSettingGetInt(VCONFKEY_SETAPPL_USE_TURN_OVER, &use_turn_over) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + + if (motion_activation && use_turn_over) { + if (SensorCBFunction) + SensorCBFunction(); } } } diff --git a/externals/MsgSoundPlayer.cpp b/externals/MsgSoundPlayer.cpp index 292642f..ee9d17b 100755 --- a/externals/MsgSoundPlayer.cpp +++ b/externals/MsgSoundPlayer.cpp @@ -165,7 +165,9 @@ MsgSoundPlayer::MsgSoundPlayer() defaultRingtonePath = NULL; - defaultRingtonePath = MsgSettingGetString(VCONFKEY_SETAPPL_NOTI_RINGTONE_DEFAULT_PATH_STR); + if (MsgSettingGetString(VCONFKEY_SETAPPL_NOTI_RINGTONE_DEFAULT_PATH_STR, &defaultRingtonePath) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } if (defaultRingtonePath == NULL || MsgGetFileSize(defaultRingtonePath) < 1) { defaultRingtonePath = (char *)DEFAULT_ALERT_FILE; @@ -204,7 +206,11 @@ MsgSoundPlayer* MsgSoundPlayer::instance() void MsgSoundPlayer::MsgGetRingtonePath(char *userRingtonePath, char **msg_tone_file_path_p) { #ifndef MSG_WEARABLE_PROFILE - MSG_RINGTONE_TYPE_T ringtoneType = (MSG_RINGTONE_TYPE_T)MsgSettingGetInt(MSG_SETTING_RINGTONE_TYPE); + int tmpVal = 0; + if (MsgSettingGetInt(MSG_SETTING_RINGTONE_TYPE, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + MSG_RINGTONE_TYPE_T ringtoneType = (MSG_RINGTONE_TYPE_T)tmpVal; MSG_DEBUG("Ringtone type = [%d]", ringtoneType); @@ -223,9 +229,13 @@ void MsgSoundPlayer::MsgGetRingtonePath(char *userRingtonePath, char **msg_tone_ tmpFilePath = userRingtonePath; } else { if (ringtoneType == MSG_RINGTONE_TYPE_DEFAULT) { - tmpFilePath = MsgSettingGetString(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR); + if (MsgSettingGetString(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, &tmpFilePath) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } } else { - tmpFilePath = MsgSettingGetString(MSG_SETTING_RINGTONE_PATH); + if (MsgSettingGetString(MSG_SETTING_RINGTONE_PATH, &tmpFilePath) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } } } @@ -311,13 +321,17 @@ void MsgSoundPlayer::MsgGetPlayStatus(bool bVoiceMail, bool *bPlaySound, bool *b bool bSoundOn = false; /* sound setting on notification panel */ bool bVibrationOn = false; /* vibration setting on notification panel */ - MsgSettingGetBool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &bSoundOn); - MsgSettingGetBool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &bVibrationOn); + if (MsgSettingGetBool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &bSoundOn) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetBool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &bVibrationOn) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); /* Alert setting */ #if 0 /* not used value */ bool bNotiVibrationOn = false; /* alert vibration */ - MsgSettingGetBool(VCONFKEY_SETAPPL_VIBRATE_WHEN_NOTIFICATION_BOOL, &bNotiVibrationOn); + if (MsgSettingGetBool(VCONFKEY_SETAPPL_VIBRATE_WHEN_NOTIFICATION_BOOL, &bNotiVibrationOn) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); #endif bool bMsgSettingNoti = true; /* Alert for message notification */ @@ -326,9 +340,17 @@ void MsgSoundPlayer::MsgGetPlayStatus(bool bVoiceMail, bool *bPlaySound, bool *b MSG_RINGTONE_TYPE_T ringtoneType = MSG_RINGTONE_TYPE_DEFAULT; /*sound type for message notification */ bool bMsgSettingSound = true; - MsgSettingGetBool(MSG_SETTING_VIBRATION, &bMsgSettingVibration); - MsgSettingGetBool(MSG_SETTING_NOTIFICATION, &bMsgSettingNoti); - ringtoneType = (MSG_RINGTONE_TYPE_T)MsgSettingGetInt(MSG_SETTING_RINGTONE_TYPE); + if (MsgSettingGetBool(MSG_SETTING_VIBRATION, &bMsgSettingVibration) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetBool(MSG_SETTING_NOTIFICATION, &bMsgSettingNoti) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + int tmpVal = 0; + if (MsgSettingGetInt(MSG_SETTING_RINGTONE_TYPE, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + ringtoneType = (MSG_RINGTONE_TYPE_T)tmpVal; if (ringtoneType == MSG_RINGTONE_TYPE_SILENT) bMsgSettingSound = false; @@ -349,7 +371,10 @@ void MsgSoundPlayer::MsgGetPlayStatus(bool bVoiceMail, bool *bPlaySound, bool *b /* 2. Call is not active */ MSG_DEBUG("Call is not active."); - int voiceRecording = MsgSettingGetInt(VCONFKEY_RECORDER_STATE); + int voiceRecording = 0; + if (MsgSettingGetInt(VCONFKEY_RECORDER_STATE, &voiceRecording) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (bVoiceMail) { /* 2-1. Voice message */ if (bMsgSettingNoti) { @@ -386,7 +411,9 @@ void MsgSoundPlayer::MsgSoundPlayStart(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_ /* check camera state */ int cameraState = 0; /* camera recording state */ - cameraState = MsgSettingGetInt(VCONFKEY_CAMERA_STATE); + if (MsgSettingGetInt(VCONFKEY_CAMERA_STATE, &cameraState) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } MSG_SEC_DEBUG("Camera state [%d]", cameraState); if (cameraState == VCONFKEY_CAMERA_STATE_RECORDING) { @@ -696,7 +723,9 @@ void MsgSoundPlayer::MsgSoundSetRepeatAlarm() int nRepeatValue = 0; long nRepeatTime = 0; - nRepeatValue = MsgSettingGetInt(MSG_ALERT_REP_TYPE); + if (MsgSettingGetInt(MSG_ALERT_REP_TYPE, &nRepeatValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } switch (nRepeatValue) { case MSG_ALERT_TONE_ONCE: @@ -769,14 +798,22 @@ void MsgSoundPlayer::MsgSoundCreateRepeatAlarm(int RepeatTime) int MsgSoundPlayer::MsgSoundGetUnreadMsgCnt() { int unreadCnt = 0; + int unreadSms = 0; + int unreadMms = 0; #ifndef MSG_WEARABLE_PROFILE /* Get SMS Count */ - unreadCnt = MsgSettingGetInt(VCONFKEY_MESSAGE_RECV_SMS_STATE); + if (MsgSettingGetInt(VCONFKEY_MESSAGE_RECV_SMS_STATE, &unreadSms) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } /* Get MMS Count */ - unreadCnt += MsgSettingGetInt(VCONFKEY_MESSAGE_RECV_MMS_STATE); + if (MsgSettingGetInt(VCONFKEY_MESSAGE_RECV_MMS_STATE, &unreadMms) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + + unreadCnt = unreadSms + unreadMms; MSG_DEBUG("unread count : [%d]", unreadCnt); @@ -801,7 +838,9 @@ void MsgSoundPlayer::MsgSoundInitRepeatAlarm() return; } - nRepeatValue = MsgSettingGetInt(MSG_ALERT_REP_TYPE); + if (MsgSettingGetInt(MSG_ALERT_REP_TYPE, &nRepeatValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } switch (nRepeatValue) { case MSG_ALERT_TONE_ONCE: diff --git a/externals/MsgSpamFilter.cpp b/externals/MsgSpamFilter.cpp index a1ee225..90bd4c3 100755 --- a/externals/MsgSpamFilter.cpp +++ b/externals/MsgSpamFilter.cpp @@ -43,7 +43,8 @@ msg_error_t MsgGetFilterOperation(bool *pSetFlag) { MSG_BEGIN(); - MsgSettingGetBool(MSG_BLOCK_MESSAGE, pSetFlag); + if (MsgSettingGetBool(MSG_BLOCK_MESSAGE, pSetFlag) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); MSG_END(); diff --git a/framework/deliver-handler/MsgDeliverHandler.cpp b/framework/deliver-handler/MsgDeliverHandler.cpp index 30d9b75..b5df455 100755 --- a/framework/deliver-handler/MsgDeliverHandler.cpp +++ b/framework/deliver-handler/MsgDeliverHandler.cpp @@ -59,7 +59,9 @@ void MsgPlayTTSMode(MSG_SUB_TYPE_T msgSubType, msg_message_id_t msgId, bool isFa } bool isTTSOn = false; - MsgSettingGetBool(VCONFKEY_SETAPPL_DRIVINGMODE_DRIVINGMODE, &isTTSOn); + if (MsgSettingGetBool(VCONFKEY_SETAPPL_DRIVINGMODE_DRIVINGMODE, &isTTSOn) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + MSG_DEBUG("VCONFKEY_SETAPPL_DRIVINGMODE_DRIVINGMODE [%d]", isTTSOn); if(isTTSOn) { @@ -67,7 +69,9 @@ void MsgPlayTTSMode(MSG_SUB_TYPE_T msgSubType, msg_message_id_t msgId, bool isFa if (msgSubType == MSG_MWI_VOICE_SMS) { bool isVoiceMailOn = false; - MsgSettingGetBool(VCONFKEY_SETAPPL_DRIVINGMODE_NEWVOICEMAILS, &isVoiceMailOn); + if (MsgSettingGetBool(VCONFKEY_SETAPPL_DRIVINGMODE_NEWVOICEMAILS, &isVoiceMailOn) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + MSG_DEBUG("VCONFKEY_SETAPPL_DRIVINGMODE_NEWVOICEMAILS [%d]", isVoiceMailOn); if (isVoiceMailOn) { isVoiceMail = true; @@ -76,7 +80,9 @@ void MsgPlayTTSMode(MSG_SUB_TYPE_T msgSubType, msg_message_id_t msgId, bool isFa } } else { bool isTTSMsgOn = false; - MsgSettingGetBool(VCONFKEY_SETAPPL_DRIVINGMODE_MESSAGE, &isTTSMsgOn); + if (MsgSettingGetBool(VCONFKEY_SETAPPL_DRIVINGMODE_MESSAGE, &isTTSMsgOn) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + MSG_DEBUG("VCONFKEY_SETAPPL_DRIVINGMODE_MESSAGE [%d]", isTTSMsgOn); if (!isTTSMsgOn || !isFavorites) { return; @@ -442,7 +448,10 @@ msg_error_t MsgHandleSMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti, bool *bO char keyName[MAX_VCONFKEY_NAME_LEN]; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, pMsgInfo->sim_idx); - char *voiceNumber = MsgSettingGetString(keyName); + char *voiceNumber = NULL; + if (MsgSettingGetString(keyName, &voiceNumber) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } if (voiceNumber) { MSG_SEC_DEBUG("Voice Mail Number [%s]", voiceNumber); @@ -451,7 +460,10 @@ msg_error_t MsgHandleSMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti, bool *bO snprintf(pMsgInfo->addressList[0].addressVal, sizeof(pMsgInfo->addressList[0].addressVal), "%s", voiceNumber); memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_ALPHA_ID, pMsgInfo->sim_idx); - char *alphaId = MsgSettingGetString(keyName); + char *alphaId = NULL; + if (MsgSettingGetString(keyName, &alphaId) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } if (alphaId) { memset(pMsgInfo->addressList->displayName, 0x00, sizeof(pMsgInfo->addressList->displayName)); memcpy(pMsgInfo->addressList->displayName, alphaId, sizeof(pMsgInfo->addressList->displayName)-1); @@ -465,7 +477,10 @@ msg_error_t MsgHandleSMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti, bool *bO memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_COUNT, pMsgInfo->sim_idx); - int voicecnt = MsgSettingGetInt(keyName); + int voicecnt = 0; + if (MsgSettingGetInt(keyName, &voicecnt) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } memset(pMsgInfo->msgText, 0x00, sizeof(pMsgInfo->msgText)); snprintf(pMsgInfo->msgText, sizeof(pMsgInfo->msgText), "%d", voicecnt); pMsgInfo->dataSize = strlen(pMsgInfo->msgText); @@ -510,7 +525,11 @@ msg_error_t MsgHandleSMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti, bool *bO MSG_DEBUG("Starting WAP Message Incoming."); #ifndef MSG_WEARABLE_PROFILE - MSG_PUSH_SERVICE_TYPE_T serviceType = (MSG_PUSH_SERVICE_TYPE_T)MsgSettingGetInt(PUSH_SERVICE_TYPE); + int tmpVal = 0; + if (MsgSettingGetInt(PUSH_SERVICE_TYPE, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + MSG_PUSH_SERVICE_TYPE_T serviceType = (MSG_PUSH_SERVICE_TYPE_T)tmpVal; app_control_h svc_handle = NULL; switch (pMsgInfo->msgType.subType) { diff --git a/framework/setting-handler/MsgSettingHandler.cpp b/framework/setting-handler/MsgSettingHandler.cpp index 5135bf5..3f708d5 100755 --- a/framework/setting-handler/MsgSettingHandler.cpp +++ b/framework/setting-handler/MsgSettingHandler.cpp @@ -38,6 +38,7 @@ msg_error_t MsgSetConfigData(const MSG_SETTING_S *pSetting) char keyName[MAX_VCONFKEY_NAME_LEN]; memset(keyName, 0x00, sizeof(keyName)); MSG_SIM_STATUS_T simStatus = MSG_SIM_STATUS_NOT_FOUND; + int tmpVal = 0; #ifdef USE_GCONF err = MsgGconfGetClient(); @@ -61,7 +62,10 @@ msg_error_t MsgSetConfigData(const MSG_SETTING_S *pSetting) case MSG_SMSC_LIST : /* Check SIM is present or not */ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pSetting->option.smscList.simIndex); - simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + simStatus = (MSG_SIM_STATUS_T)tmpVal; if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { MSG_DEBUG("SIM is not present.."); @@ -86,7 +90,10 @@ msg_error_t MsgSetConfigData(const MSG_SETTING_S *pSetting) if (pSetting->option.cbMsgOpt.simIndex != 0) { /* Check SIM is present or not */ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pSetting->option.cbMsgOpt.simIndex); - simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + simStatus = (MSG_SIM_STATUS_T)tmpVal; if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { MSG_DEBUG("SIM is not present.."); @@ -98,7 +105,10 @@ msg_error_t MsgSetConfigData(const MSG_SETTING_S *pSetting) case MSG_VOICEMAIL_OPT : /* Check SIM is present or not */ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pSetting->option.voiceMailOpt.simIndex); - simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + simStatus = (MSG_SIM_STATUS_T)tmpVal; if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { MSG_DEBUG("SIM is not present.."); @@ -133,6 +143,7 @@ msg_error_t MsgGetConfigData(MSG_SETTING_S *pSetting) #endif char keyName[MAX_VCONFKEY_NAME_LEN] = {0, }; MSG_SIM_STATUS_T simStatus = MSG_SIM_STATUS_NOT_FOUND; + int tmpVal = 0; switch (pSetting->type) { case MSG_GENERAL_OPT: @@ -144,7 +155,10 @@ msg_error_t MsgGetConfigData(MSG_SETTING_S *pSetting) case MSG_SMSC_LIST: { /* Check SIM is present or not */ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pSetting->option.smscList.simIndex); - simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + simStatus = (MSG_SIM_STATUS_T)tmpVal; if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { MSG_DEBUG("SIM is not present.."); @@ -168,7 +182,10 @@ msg_error_t MsgGetConfigData(MSG_SETTING_S *pSetting) case MSG_CBMSG_OPT: { /* Check SIM is present or not */ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pSetting->option.cbMsgOpt.simIndex); - simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + simStatus = (MSG_SIM_STATUS_T)tmpVal; if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { MSG_DEBUG("SIM is not present.."); @@ -185,7 +202,10 @@ msg_error_t MsgGetConfigData(MSG_SETTING_S *pSetting) } snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pSetting->option.voiceMailOpt.simIndex); - simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + simStatus = (MSG_SIM_STATUS_T)tmpVal; if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { MSG_DEBUG("SIM is not present.."); @@ -218,7 +238,9 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting) memcpy(&generalOpt, &(pSetting->option.generalOpt), sizeof(MSG_GENERAL_OPT_S)); - MsgSettingGetBool(MSG_KEEP_COPY, &bValue); + if (MsgSettingGetBool(MSG_KEEP_COPY, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != generalOpt.bKeepCopy) { if (MsgSettingSetBool(MSG_KEEP_COPY, generalOpt.bKeepCopy) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MSG_KEEP_COPY); @@ -226,7 +248,9 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MSG_AUTO_ERASE, &bValue); + if (MsgSettingGetBool(MSG_AUTO_ERASE, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != generalOpt.bAutoErase) { if (MsgSettingSetBool(MSG_AUTO_ERASE, generalOpt.bAutoErase) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MSG_AUTO_ERASE); @@ -234,7 +258,9 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MSG_BLOCK_UNKNOWN_MSG, &bValue); + if (MsgSettingGetBool(MSG_BLOCK_UNKNOWN_MSG, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != generalOpt.bBlockUnknownMsg) { if (MsgSettingSetBool(MSG_BLOCK_UNKNOWN_MSG, generalOpt.bBlockUnknownMsg) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MSG_BLOCK_UNKNOWN_MSG); @@ -242,7 +268,9 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MSG_SMS_LIMIT); + if (MsgSettingGetInt(MSG_SMS_LIMIT, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)generalOpt.smsLimitCnt) { if (MsgSettingSetInt(MSG_SMS_LIMIT, (int)generalOpt.smsLimitCnt) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MSG_SMS_LIMIT); @@ -250,7 +278,9 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MSG_MMS_LIMIT); + if (MsgSettingGetInt(MSG_MMS_LIMIT, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)generalOpt.mmsLimitCnt) { if (MsgSettingSetInt(MSG_MMS_LIMIT, (int)generalOpt.mmsLimitCnt) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MSG_MMS_LIMIT); @@ -258,7 +288,9 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MSG_SETTING_NOTIFICATION, &bValue); + if (MsgSettingGetBool(MSG_SETTING_NOTIFICATION, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != generalOpt.bNotification) { if (MsgSettingSetBool(MSG_SETTING_NOTIFICATION, generalOpt.bNotification) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MSG_SETTING_NOTIFICATION); @@ -266,7 +298,9 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MSG_SETTING_VIBRATION, &bValue); + if (MsgSettingGetBool(MSG_SETTING_VIBRATION, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != generalOpt.bVibration) { if (MsgSettingSetBool(MSG_SETTING_VIBRATION, generalOpt.bVibration) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MSG_SETTING_VIBRATION); @@ -274,7 +308,9 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MSG_SETTING_PREVIEW, &bValue); + if (MsgSettingGetBool(MSG_SETTING_PREVIEW, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != generalOpt.bPreview) { if (MsgSettingSetBool(MSG_SETTING_PREVIEW, generalOpt.bPreview) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MSG_SETTING_PREVIEW); @@ -282,7 +318,9 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MSG_SETTING_RINGTONE_TYPE); + if (MsgSettingGetInt(MSG_SETTING_RINGTONE_TYPE, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != generalOpt.ringtoneType) { if (MsgSettingSetInt(MSG_SETTING_RINGTONE_TYPE, generalOpt.ringtoneType) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MSG_SETTING_RINGTONE_TYPE); @@ -296,7 +334,9 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting) return MSG_ERR_SET_SETTING; } } else { - strValue = MsgSettingGetString(MSG_SETTING_RINGTONE_PATH); + if (MsgSettingGetString(MSG_SETTING_RINGTONE_PATH, &strValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } MSG_DEBUG("strValue=[%s], ringtone=[%s]", strValue, generalOpt.ringtonePath); if (g_strcmp0(strValue, generalOpt.ringtonePath) != 0) { @@ -312,7 +352,9 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting) strValue = NULL; } - iValue = MsgSettingGetInt(MSG_ALERT_REP_TYPE); + if (MsgSettingGetInt(MSG_ALERT_REP_TYPE, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)generalOpt.alertTone) { if (MsgSettingSetInt(MSG_ALERT_REP_TYPE, (int)generalOpt.alertTone) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MSG_ALERT_REP_TYPE); @@ -332,7 +374,9 @@ msg_error_t MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting) memcpy(&sendOpt, &(pSetting->option.smsSendOpt), sizeof(MSG_SMS_SENDOPT_S)); - iValue = MsgSettingGetInt(SMS_SEND_DCS); + if (MsgSettingGetInt(SMS_SEND_DCS, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)sendOpt.dcs) { if (MsgSettingSetInt(SMS_SEND_DCS, (int)sendOpt.dcs) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", SMS_SEND_DCS); @@ -340,7 +384,9 @@ msg_error_t MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(SMS_SEND_NETWORK_MODE); + if (MsgSettingGetInt(SMS_SEND_NETWORK_MODE, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)sendOpt.netMode) { if (MsgSettingSetInt(SMS_SEND_NETWORK_MODE, (int)sendOpt.netMode) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", SMS_SEND_NETWORK_MODE); @@ -348,7 +394,9 @@ msg_error_t MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(SMS_SEND_REPLY_PATH, &bValue); + if (MsgSettingGetBool(SMS_SEND_REPLY_PATH, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != sendOpt.bReplyPath) { if (MsgSettingSetBool(SMS_SEND_REPLY_PATH, sendOpt.bReplyPath) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", SMS_SEND_REPLY_PATH); @@ -356,7 +404,9 @@ msg_error_t MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &bValue); + if (MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != sendOpt.bDeliveryReport) { if (MsgSettingSetBool(SMS_SEND_DELIVERY_REPORT, sendOpt.bDeliveryReport) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", SMS_SEND_DELIVERY_REPORT); @@ -364,7 +414,9 @@ msg_error_t MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(SMS_SEND_SAVE_STORAGE); + if (MsgSettingGetInt(SMS_SEND_SAVE_STORAGE, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)sendOpt.saveStorage) { if (MsgSettingSetInt(SMS_SEND_SAVE_STORAGE, (int)sendOpt.saveStorage) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", SMS_SEND_SAVE_STORAGE); @@ -434,7 +486,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) memcpy(&sendOpt, &(pSetting->option.mmsSendOpt), sizeof(MSG_MMS_SENDOPT_S)); - iValue = MsgSettingGetInt(MMS_SEND_MSG_CLASS); + if (MsgSettingGetInt(MMS_SEND_MSG_CLASS, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)sendOpt.msgClass) { if (MsgSettingSetInt(MMS_SEND_MSG_CLASS, (int)sendOpt.msgClass) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_MSG_CLASS); @@ -442,7 +496,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_SEND_PRIORITY); + if (MsgSettingGetInt(MMS_SEND_PRIORITY, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)sendOpt.priority) { if (MsgSettingSetInt(MMS_SEND_PRIORITY, (int)sendOpt.priority) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_PRIORITY); @@ -450,7 +506,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_SEND_EXPIRY_TIME); + if (MsgSettingGetInt(MMS_SEND_EXPIRY_TIME, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)sendOpt.expiryTime) { if (MsgSettingSetInt(MMS_SEND_EXPIRY_TIME, (int)sendOpt.expiryTime) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_EXPIRY_TIME); @@ -458,7 +516,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_SEND_DELIVERY_TIME); + if (MsgSettingGetInt(MMS_SEND_DELIVERY_TIME, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)sendOpt.deliveryTime) { if (MsgSettingSetInt(MMS_SEND_DELIVERY_TIME, (int)sendOpt.deliveryTime) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_DELIVERY_TIME); @@ -466,7 +526,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_SEND_CUSTOM_DELIVERY); + if (MsgSettingGetInt(MMS_SEND_CUSTOM_DELIVERY, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)sendOpt.customDeliveryTime) { if (MsgSettingSetInt(MMS_SEND_CUSTOM_DELIVERY, sendOpt.customDeliveryTime) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_CUSTOM_DELIVERY); @@ -474,7 +536,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MMS_SEND_SENDER_VISIBILITY, &bValue); + if (MsgSettingGetBool(MMS_SEND_SENDER_VISIBILITY, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != sendOpt.bSenderVisibility) { if (MsgSettingSetBool(MMS_SEND_SENDER_VISIBILITY, sendOpt.bSenderVisibility) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_SENDER_VISIBILITY); @@ -482,7 +546,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MMS_SEND_DELIVERY_REPORT, &bValue); + if (MsgSettingGetBool(MMS_SEND_DELIVERY_REPORT, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != sendOpt.bDeliveryReport) { if (MsgSettingSetBool(MMS_SEND_DELIVERY_REPORT, sendOpt.bDeliveryReport) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_DELIVERY_REPORT); @@ -490,7 +556,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MMS_SEND_READ_REPLY, &bValue); + if (MsgSettingGetBool(MMS_SEND_READ_REPLY, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != sendOpt.bReadReply) { if (MsgSettingSetBool(MMS_SEND_READ_REPLY, sendOpt.bReadReply) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_READ_REPLY); @@ -504,7 +572,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) } #endif /* __NOT_USED_BY_DESIGN_CHANGE__ */ - MsgSettingGetBool(MMS_SEND_BODY_REPLYING, &bValue); + if (MsgSettingGetBool(MMS_SEND_BODY_REPLYING, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != sendOpt.bBodyReplying) { if (MsgSettingSetBool(MMS_SEND_BODY_REPLYING, sendOpt.bBodyReplying) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_BODY_REPLYING); @@ -512,7 +582,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MMS_SEND_HIDE_RECIPIENTS, &bValue); + if (MsgSettingGetBool(MMS_SEND_HIDE_RECIPIENTS, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != sendOpt.bHideRecipients) { if (MsgSettingSetBool(MMS_SEND_HIDE_RECIPIENTS, sendOpt.bHideRecipients) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_HIDE_RECIPIENTS); @@ -520,7 +592,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_SEND_REPLY_CHARGING); + if (MsgSettingGetInt(MMS_SEND_REPLY_CHARGING, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != sendOpt.replyCharging) { if (MsgSettingSetInt(MMS_SEND_REPLY_CHARGING, sendOpt.replyCharging) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_REPLY_CHARGING); @@ -528,7 +602,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_SEND_REPLY_CHARGING_DEADLINE); + if (MsgSettingGetInt(MMS_SEND_REPLY_CHARGING_DEADLINE, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)sendOpt.replyChargingDeadline) { if (MsgSettingSetInt(MMS_SEND_REPLY_CHARGING_DEADLINE, sendOpt.replyChargingDeadline) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_REPLY_CHARGING_DEADLINE); @@ -536,7 +612,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_SEND_REPLY_CHARGING_SIZE); + if (MsgSettingGetInt(MMS_SEND_REPLY_CHARGING_SIZE, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)sendOpt.replyChargingSize) { if (MsgSettingSetInt(MMS_SEND_REPLY_CHARGING_SIZE, sendOpt.replyChargingSize) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_REPLY_CHARGING_SIZE); @@ -544,7 +622,9 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_SEND_CREATION_MODE); + if (MsgSettingGetInt(MMS_SEND_CREATION_MODE, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != sendOpt.creationMode) { if (MsgSettingSetInt(MMS_SEND_CREATION_MODE, sendOpt.creationMode) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_SEND_CREATION_MODE); @@ -564,7 +644,9 @@ msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting) memcpy(&recvOpt, &(pSetting->option.mmsRecvOpt), sizeof(MSG_MMS_RECVOPT_S)); - iValue = MsgSettingGetInt(MMS_RECV_HOME_NETWORK); + if (MsgSettingGetInt(MMS_RECV_HOME_NETWORK, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)recvOpt.homeNetwork) { if (MsgSettingSetInt(MMS_RECV_HOME_NETWORK, (int)recvOpt.homeNetwork) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_RECV_HOME_NETWORK); @@ -572,7 +654,9 @@ msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_RECV_ABROAD_NETWORK); + if (MsgSettingGetInt(MMS_RECV_ABROAD_NETWORK, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)recvOpt.abroadNetwok) { if (MsgSettingSetInt(MMS_RECV_ABROAD_NETWORK, (int)recvOpt.abroadNetwok) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_RECV_ABROAD_NETWORK); @@ -580,7 +664,9 @@ msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MMS_RECV_READ_RECEIPT, &bValue); + if (MsgSettingGetBool(MMS_RECV_READ_RECEIPT, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != recvOpt.readReceipt) { if (MsgSettingSetBool(MMS_RECV_READ_RECEIPT, recvOpt.readReceipt) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_RECV_READ_RECEIPT); @@ -588,7 +674,9 @@ msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MMS_RECV_DELIVERY_RECEIPT, &bValue); + if (MsgSettingGetBool(MMS_RECV_DELIVERY_RECEIPT, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != recvOpt.bDeliveryReceipt) { if (MsgSettingSetBool(MMS_RECV_DELIVERY_RECEIPT, recvOpt.bDeliveryReceipt) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_RECV_DELIVERY_RECEIPT); @@ -596,7 +684,9 @@ msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MMS_RECV_REJECT_UNKNOWN, &bValue); + if (MsgSettingGetBool(MMS_RECV_REJECT_UNKNOWN, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != recvOpt.bRejectUnknown) { if (MsgSettingSetBool(MMS_RECV_REJECT_UNKNOWN, recvOpt.bRejectUnknown) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_RECV_REJECT_UNKNOWN); @@ -604,7 +694,9 @@ msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MMS_RECV_REJECT_ADVERTISE, &bValue); + if (MsgSettingGetBool(MMS_RECV_REJECT_ADVERTISE, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != recvOpt.bRejectAdvertisement) { if (MsgSettingSetBool(MMS_RECV_REJECT_ADVERTISE, recvOpt.bRejectAdvertisement) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_RECV_REJECT_ADVERTISE); @@ -624,7 +716,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) memcpy(&styleOpt, &(pSetting->option.mmsStyleOpt), sizeof(MSG_MMS_STYLEOPT_S)); - iValue = MsgSettingGetInt(MMS_STYLE_FONT_SIZE); + if (MsgSettingGetInt(MMS_STYLE_FONT_SIZE, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)styleOpt.fontSize) { if (MsgSettingSetInt(MMS_STYLE_FONT_SIZE, styleOpt.fontSize) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_SIZE); @@ -632,7 +726,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MMS_STYLE_FONT_STYLE_BOLD, &bValue); + if (MsgSettingGetBool(MMS_STYLE_FONT_STYLE_BOLD, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != styleOpt.bFontStyleBold) { if (MsgSettingSetBool(MMS_STYLE_FONT_STYLE_BOLD, styleOpt.bFontStyleBold) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_STYLE_BOLD); @@ -640,7 +736,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MMS_STYLE_FONT_STYLE_ITALIC, &bValue); + if (MsgSettingGetBool(MMS_STYLE_FONT_STYLE_ITALIC, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != styleOpt.bFontStyleItalic) { if (MsgSettingSetBool(MMS_STYLE_FONT_STYLE_ITALIC, styleOpt.bFontStyleItalic) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_STYLE_ITALIC); @@ -648,7 +746,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - MsgSettingGetBool(MMS_STYLE_FONT_STYLE_UNDERLINE, &bValue); + if (MsgSettingGetBool(MMS_STYLE_FONT_STYLE_UNDERLINE, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != styleOpt.bFontStyleUnderline) { if (MsgSettingSetBool(MMS_STYLE_FONT_STYLE_UNDERLINE, styleOpt.bFontStyleUnderline) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_STYLE_UNDERLINE); @@ -656,7 +756,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_STYLE_FONT_COLOR_RED); + if (MsgSettingGetInt(MMS_STYLE_FONT_COLOR_RED, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)styleOpt.fontColorRed) { if (MsgSettingSetInt(MMS_STYLE_FONT_COLOR_RED, styleOpt.fontColorRed) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_COLOR_RED); @@ -664,7 +766,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_STYLE_FONT_COLOR_GREEN); + if (MsgSettingGetInt(MMS_STYLE_FONT_COLOR_GREEN, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)styleOpt.fontColorGreen) { if (MsgSettingSetInt(MMS_STYLE_FONT_COLOR_GREEN, styleOpt.fontColorGreen) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_COLOR_GREEN); @@ -672,7 +776,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_STYLE_FONT_COLOR_BLUE); + if (MsgSettingGetInt(MMS_STYLE_FONT_COLOR_BLUE, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)styleOpt.fontColorBlue) { if (MsgSettingSetInt(MMS_STYLE_FONT_COLOR_BLUE, styleOpt.fontColorBlue) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_COLOR_BLUE); @@ -680,7 +786,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_STYLE_FONT_COLOR_HUE); + if (MsgSettingGetInt(MMS_STYLE_FONT_COLOR_HUE, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)styleOpt.fontColorHue) { if (MsgSettingSetInt(MMS_STYLE_FONT_COLOR_HUE, styleOpt.fontColorHue) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_COLOR_HUE); @@ -688,7 +796,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_STYLE_BG_COLOR_RED); + if (MsgSettingGetInt(MMS_STYLE_BG_COLOR_RED, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)styleOpt.bgColorRed) { if (MsgSettingSetInt(MMS_STYLE_BG_COLOR_RED, styleOpt.bgColorRed) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_BG_COLOR_RED); @@ -696,7 +806,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_STYLE_BG_COLOR_GREEN); + if (MsgSettingGetInt(MMS_STYLE_BG_COLOR_GREEN, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)styleOpt.bgColorGreen) { if (MsgSettingSetInt(MMS_STYLE_BG_COLOR_GREEN, styleOpt.bgColorGreen) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_BG_COLOR_GREEN); @@ -704,7 +816,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_STYLE_BG_COLOR_BLUE); + if (MsgSettingGetInt(MMS_STYLE_BG_COLOR_BLUE, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)styleOpt.bgColorBlue) { if (MsgSettingSetInt(MMS_STYLE_BG_COLOR_BLUE, styleOpt.bgColorBlue) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_BG_COLOR_BLUE); @@ -712,7 +826,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_STYLE_BG_COLOR_HUE); + if (MsgSettingGetInt(MMS_STYLE_BG_COLOR_HUE, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)styleOpt.bgColorHue) { if (MsgSettingSetInt(MMS_STYLE_BG_COLOR_HUE, styleOpt.bgColorHue) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_BG_COLOR_HUE); @@ -720,7 +836,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_STYLE_PAGE_DUR); + if (MsgSettingGetInt(MMS_STYLE_PAGE_DUR, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)styleOpt.pageDur) { if (MsgSettingSetInt(MMS_STYLE_PAGE_DUR, styleOpt.pageDur) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_PAGE_DUR); @@ -728,7 +846,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_STYLE_PAGE_CUSTOM_DUR); + if (MsgSettingGetInt(MMS_STYLE_PAGE_CUSTOM_DUR, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)styleOpt.pageCustomDur) { if (MsgSettingSetInt(MMS_STYLE_PAGE_CUSTOM_DUR, styleOpt.pageCustomDur) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_PAGE_CUSTOM_DUR); @@ -736,7 +856,9 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(MMS_STYLE_PAGE_DUR_MANUAL); + if (MsgSettingGetInt(MMS_STYLE_PAGE_DUR_MANUAL, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)styleOpt.pageDurManual) { if (MsgSettingSetInt(MMS_STYLE_PAGE_DUR_MANUAL, styleOpt.pageDurManual) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_PAGE_DUR_MANUAL); @@ -755,7 +877,9 @@ msg_error_t MsgSetPushMsgOpt(const MSG_SETTING_S *pSetting) memcpy(&pushOpt, &(pSetting->option.pushMsgOpt), sizeof(MSG_PUSHMSG_OPT_S)); - MsgSettingGetBool(PUSH_RECV_OPTION, &bValue); + if (MsgSettingGetBool(PUSH_RECV_OPTION, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != pushOpt.bReceive) { if (MsgSettingSetBool(PUSH_RECV_OPTION, pushOpt.bReceive) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", PUSH_RECV_OPTION); @@ -763,7 +887,9 @@ msg_error_t MsgSetPushMsgOpt(const MSG_SETTING_S *pSetting) } } - iValue = MsgSettingGetInt(PUSH_SERVICE_TYPE); + if (MsgSettingGetInt(PUSH_SERVICE_TYPE, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != (int)pushOpt.serviceType) { if (MsgSettingSetInt(PUSH_SERVICE_TYPE, (int)pushOpt.serviceType) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", PUSH_SERVICE_TYPE); @@ -798,7 +924,9 @@ msg_error_t MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim) if (simIndex != 0) { memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", CB_MAX_SIM_COUNT, simIndex); - cbOpt.maxSimCnt = MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &(cbOpt.maxSimCnt)) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (cbOpt.channelData.channelCnt > cbOpt.maxSimCnt) { MSG_DEBUG("Channel Count [%d] is over Max SIM Count [%d]", cbOpt.channelData.channelCnt, cbOpt.maxSimCnt); @@ -815,7 +943,9 @@ msg_error_t MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", CB_RECEIVE, simIndex); - MsgSettingGetBool(keyName, &bValue); + if (MsgSettingGetBool(keyName, &bValue) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (bValue != cbOpt.bReceive) { if (MsgSettingSetBool(keyName, cbOpt.bReceive) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", keyName); @@ -831,7 +961,9 @@ msg_error_t MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", CB_MAX_SIM_COUNT, simIndex); - iValue = MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != cbOpt.maxSimCnt) { if (MsgSettingSetInt(keyName, cbOpt.maxSimCnt) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", keyName); @@ -883,7 +1015,9 @@ msg_error_t MsgSetVoiceMailOpt(const MSG_SETTING_S *pSetting, bool bSetSim) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, simIndex); - pValue = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &pValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } if (pValue != NULL && strcmp(pValue, voiceMailOpt.mailNumber) == 0) { /* Value is same with previous one. Therefore, we don't need to save it. */ @@ -927,7 +1061,9 @@ msg_error_t MsgSetMsgSizeOpt(const MSG_SETTING_S *pSetting) memcpy(&msgSizeOpt, &(pSetting->option.msgSizeOpt), sizeof(MSG_MSGSIZE_OPT_S)); - iValue = MsgSettingGetInt(MSGSIZE_OPTION); + if (MsgSettingGetInt(MSGSIZE_OPTION, &iValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (iValue != msgSizeOpt.nMsgSize) { if (MsgSettingSetInt(MSGSIZE_OPTION, msgSizeOpt.nMsgSize) != MSG_SUCCESS) { MSG_DEBUG("Error to set config data [%s]", MSGSIZE_OPTION); @@ -945,48 +1081,75 @@ void MsgGetGeneralOpt(MSG_SETTING_S *pSetting) memset(&(pSetting->option.generalOpt), 0x00, sizeof(MSG_GENERAL_OPT_S)); - MsgSettingGetBool(MSG_KEEP_COPY, &pSetting->option.generalOpt.bKeepCopy); + if (MsgSettingGetBool(MSG_KEEP_COPY, &pSetting->option.generalOpt.bKeepCopy) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); - MsgSettingGetBool(MSG_BLOCK_UNKNOWN_MSG, &pSetting->option.generalOpt.bBlockUnknownMsg); + if (MsgSettingGetBool(MSG_BLOCK_UNKNOWN_MSG, &pSetting->option.generalOpt.bBlockUnknownMsg) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); - pSetting->option.generalOpt.smsLimitCnt = MsgSettingGetInt(MSG_SMS_LIMIT); + if (MsgSettingGetInt(MSG_SMS_LIMIT, &(pSetting->option.generalOpt.smsLimitCnt)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.generalOpt.mmsLimitCnt = MsgSettingGetInt(MSG_MMS_LIMIT); + if (MsgSettingGetInt(MSG_MMS_LIMIT, &(pSetting->option.generalOpt.mmsLimitCnt)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - MsgSettingGetBool(MSG_SETTING_NOTIFICATION, &pSetting->option.generalOpt.bNotification); + if (MsgSettingGetBool(MSG_SETTING_NOTIFICATION, &pSetting->option.generalOpt.bNotification) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); - MsgSettingGetBool(MSG_SETTING_VIBRATION, &pSetting->option.generalOpt.bVibration); + if (MsgSettingGetBool(MSG_SETTING_VIBRATION, &pSetting->option.generalOpt.bVibration) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); - MsgSettingGetBool(MSG_SETTING_PREVIEW, &pSetting->option.generalOpt.bPreview); + if (MsgSettingGetBool(MSG_SETTING_PREVIEW, &pSetting->option.generalOpt.bPreview) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); - MsgSettingGetBool(MSG_AUTO_ERASE, &pSetting->option.generalOpt.bAutoErase); + if (MsgSettingGetBool(MSG_AUTO_ERASE, &pSetting->option.generalOpt.bAutoErase) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); - pSetting->option.generalOpt.ringtoneType = MsgSettingGetInt(MSG_SETTING_RINGTONE_TYPE); + if (MsgSettingGetInt(MSG_SETTING_RINGTONE_TYPE, &(pSetting->option.generalOpt.ringtoneType)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - tmpValue = MsgSettingGetString(MSG_SETTING_RINGTONE_PATH); + if (MsgSettingGetString(MSG_SETTING_RINGTONE_PATH, &tmpValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } if (tmpValue != NULL) { strncpy(pSetting->option.generalOpt.ringtonePath, tmpValue, MSG_FILEPATH_LEN_MAX); free(tmpValue); tmpValue = NULL; } - pSetting->option.generalOpt.alertTone = (MSG_ALERT_TONE_T)MsgSettingGetInt(MSG_ALERT_REP_TYPE); + int tmpVal = 0; + if (MsgSettingGetInt(MSG_ALERT_REP_TYPE, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); + + pSetting->option.generalOpt.alertTone = (MSG_ALERT_TONE_T)tmpVal; } void MsgGetSMSSendOpt(MSG_SETTING_S *pSetting) { + int tmpVal = 0; memset(&(pSetting->option.smsSendOpt), 0x00, sizeof(MSG_SMS_SENDOPT_S)); - pSetting->option.smsSendOpt.dcs = (msg_encode_type_t)MsgSettingGetInt(SMS_SEND_DCS); + if (MsgSettingGetInt(SMS_SEND_DCS, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.smsSendOpt.netMode = (MSG_SMS_NETWORK_MODE_T)MsgSettingGetInt(SMS_SEND_NETWORK_MODE); + pSetting->option.smsSendOpt.dcs = (msg_encode_type_t)tmpVal; - MsgSettingGetBool(SMS_SEND_REPLY_PATH, &pSetting->option.smsSendOpt.bReplyPath); + if (MsgSettingGetInt(SMS_SEND_NETWORK_MODE, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &pSetting->option.smsSendOpt.bDeliveryReport); + pSetting->option.smsSendOpt.netMode = (MSG_SMS_NETWORK_MODE_T)tmpVal; - pSetting->option.smsSendOpt.saveStorage = (MSG_SMS_SAVE_STORAGE_T)MsgSettingGetInt(SMS_SEND_SAVE_STORAGE); + if (MsgSettingGetBool(SMS_SEND_REPLY_PATH, &pSetting->option.smsSendOpt.bReplyPath) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &pSetting->option.smsSendOpt.bDeliveryReport) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetInt(SMS_SEND_SAVE_STORAGE, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); + + pSetting->option.smsSendOpt.saveStorage = (MSG_SMS_SAVE_STORAGE_T)tmpVal; } @@ -1002,57 +1165,98 @@ void MsgGetSMSCList(MSG_SETTING_S *pSetting) void MsgGetMMSSendOpt(MSG_SETTING_S *pSetting) { + int tmpVal = 0; memset(&(pSetting->option.mmsSendOpt), 0x00, sizeof(MSG_MMS_SENDOPT_S)); - pSetting->option.mmsSendOpt.msgClass = (MSG_MMS_MSG_CLASS_TYPE_T)MsgSettingGetInt(MMS_SEND_MSG_CLASS); + if (MsgSettingGetInt(MMS_SEND_MSG_CLASS, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); + + pSetting->option.mmsSendOpt.msgClass = (MSG_MMS_MSG_CLASS_TYPE_T)tmpVal; + + if (MsgSettingGetInt(MMS_SEND_PRIORITY, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsSendOpt.priority = (msg_priority_type_t)MsgSettingGetInt(MMS_SEND_PRIORITY); + pSetting->option.mmsSendOpt.priority = (msg_priority_type_t)tmpVal; - pSetting->option.mmsSendOpt.expiryTime = (MSG_MMS_EXPIRY_TIME_T)MsgSettingGetInt(MMS_SEND_EXPIRY_TIME); + if (MsgSettingGetInt(MMS_SEND_EXPIRY_TIME, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsSendOpt.deliveryTime = (MSG_MMS_DELIVERY_TIME_T)MsgSettingGetInt(MMS_SEND_DELIVERY_TIME); + pSetting->option.mmsSendOpt.expiryTime = (MSG_MMS_EXPIRY_TIME_T)tmpVal; - pSetting->option.mmsSendOpt.customDeliveryTime = MsgSettingGetInt(MMS_SEND_CUSTOM_DELIVERY); + if (MsgSettingGetInt(MMS_SEND_DELIVERY_TIME, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - MsgSettingGetBool(MMS_SEND_SENDER_VISIBILITY, &pSetting->option.mmsSendOpt.bSenderVisibility); + pSetting->option.mmsSendOpt.deliveryTime = (MSG_MMS_DELIVERY_TIME_T)tmpVal; - MsgSettingGetBool(MMS_SEND_DELIVERY_REPORT, &pSetting->option.mmsSendOpt.bDeliveryReport); + if (MsgSettingGetInt(MMS_SEND_CUSTOM_DELIVERY, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - MsgSettingGetBool(MMS_SEND_READ_REPLY, &pSetting->option.mmsSendOpt.bReadReply); + if (MsgSettingGetBool(MMS_SEND_SENDER_VISIBILITY, &pSetting->option.mmsSendOpt.bSenderVisibility) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetBool(MMS_SEND_DELIVERY_REPORT, &pSetting->option.mmsSendOpt.bDeliveryReport) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetBool(MMS_SEND_READ_REPLY, &pSetting->option.mmsSendOpt.bReadReply) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); #ifdef __NOT_USED_BY_DESIGN_CHANGE__ - MsgSettingGetBool(MMS_SEND_KEEP_COPY, &pSetting->option.mmsSendOpt.bKeepCopy); + if (MsgSettingGetBool(MMS_SEND_KEEP_COPY, &pSetting->option.mmsSendOpt.bKeepCopy) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); #endif /* __NOT_USED_BY_DESIGN_CHANGE__ */ - MsgSettingGetBool(MMS_SEND_BODY_REPLYING, &pSetting->option.mmsSendOpt.bBodyReplying); + if (MsgSettingGetBool(MMS_SEND_BODY_REPLYING, &pSetting->option.mmsSendOpt.bBodyReplying) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetBool(MMS_SEND_HIDE_RECIPIENTS, &pSetting->option.mmsSendOpt.bHideRecipients) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetInt(MMS_SEND_REPLY_CHARGING, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); + + pSetting->option.mmsSendOpt.replyCharging = (MSG_MMS_REPLY_CHARGING_TYPE_T)tmpVal; - MsgSettingGetBool(MMS_SEND_HIDE_RECIPIENTS, &pSetting->option.mmsSendOpt.bHideRecipients); + if (MsgSettingGetInt(MMS_SEND_REPLY_CHARGING_DEADLINE, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsSendOpt.replyCharging = MsgSettingGetInt(MMS_SEND_REPLY_CHARGING); + pSetting->option.mmsSendOpt.replyChargingDeadline = (unsigned int)tmpVal; - pSetting->option.mmsSendOpt.replyChargingDeadline = MsgSettingGetInt(MMS_SEND_REPLY_CHARGING_DEADLINE); + if (MsgSettingGetInt(MMS_SEND_REPLY_CHARGING_SIZE, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsSendOpt.replyChargingSize = MsgSettingGetInt(MMS_SEND_REPLY_CHARGING_SIZE); + pSetting->option.mmsSendOpt.replyChargingSize = (unsigned int)tmpVal; - pSetting->option.mmsSendOpt.creationMode = MsgSettingGetInt(MMS_SEND_CREATION_MODE); + if (MsgSettingGetInt(MMS_SEND_CREATION_MODE, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); + + pSetting->option.mmsSendOpt.creationMode = (MSG_MMS_CREATION_MODE_T)tmpVal; } void MsgGetMMSRecvOpt(MSG_SETTING_S *pSetting) { + int tmpVal = 0; memset(&(pSetting->option.mmsRecvOpt), 0x00, sizeof(MSG_MMS_RECVOPT_S)); - pSetting->option.mmsRecvOpt.homeNetwork = (MSG_MMS_HOME_RETRIEVE_TYPE_T)MsgSettingGetInt(MMS_RECV_HOME_NETWORK); + if (MsgSettingGetInt(MMS_RECV_HOME_NETWORK, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); + pSetting->option.mmsRecvOpt.homeNetwork = (MSG_MMS_HOME_RETRIEVE_TYPE_T)tmpVal; - pSetting->option.mmsRecvOpt.abroadNetwok = (MSG_MMS_ABROAD_RETRIEVE_TYPE_T)MsgSettingGetInt(MMS_RECV_ABROAD_NETWORK); + if (MsgSettingGetInt(MMS_RECV_ABROAD_NETWORK, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); + pSetting->option.mmsRecvOpt.abroadNetwok = (MSG_MMS_ABROAD_RETRIEVE_TYPE_T)tmpVal; - MsgSettingGetBool(MMS_RECV_READ_RECEIPT, &pSetting->option.mmsRecvOpt.readReceipt); + if (MsgSettingGetBool(MMS_RECV_READ_RECEIPT, &pSetting->option.mmsRecvOpt.readReceipt) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); - MsgSettingGetBool(MMS_RECV_DELIVERY_RECEIPT, &pSetting->option.mmsRecvOpt.bDeliveryReceipt); + if (MsgSettingGetBool(MMS_RECV_DELIVERY_RECEIPT, &pSetting->option.mmsRecvOpt.bDeliveryReceipt) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); - MsgSettingGetBool(MMS_RECV_REJECT_UNKNOWN, &pSetting->option.mmsRecvOpt.bRejectUnknown); + if (MsgSettingGetBool(MMS_RECV_REJECT_UNKNOWN, &pSetting->option.mmsRecvOpt.bRejectUnknown) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); - MsgSettingGetBool(MMS_RECV_REJECT_ADVERTISE, &pSetting->option.mmsRecvOpt.bRejectAdvertisement); + if (MsgSettingGetBool(MMS_RECV_REJECT_ADVERTISE, &pSetting->option.mmsRecvOpt.bRejectAdvertisement) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); } @@ -1060,35 +1264,50 @@ void MsgGetMMSStyleOpt(MSG_SETTING_S *pSetting) { memset(&(pSetting->option.mmsStyleOpt), 0x00, sizeof(MSG_MMS_STYLEOPT_S)); - pSetting->option.mmsStyleOpt.fontSize = MsgSettingGetInt(MMS_STYLE_FONT_SIZE); + if (MsgSettingGetInt(MMS_STYLE_FONT_SIZE, (int *)&(pSetting->option.mmsStyleOpt.fontSize)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - MsgSettingGetBool(MMS_STYLE_FONT_STYLE_BOLD, &pSetting->option.mmsStyleOpt.bFontStyleBold); + if (MsgSettingGetBool(MMS_STYLE_FONT_STYLE_BOLD, &pSetting->option.mmsStyleOpt.bFontStyleBold) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); - MsgSettingGetBool(MMS_STYLE_FONT_STYLE_ITALIC, &pSetting->option.mmsStyleOpt.bFontStyleItalic); + if (MsgSettingGetBool(MMS_STYLE_FONT_STYLE_ITALIC, &pSetting->option.mmsStyleOpt.bFontStyleItalic) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); - MsgSettingGetBool(MMS_STYLE_FONT_STYLE_UNDERLINE, &pSetting->option.mmsStyleOpt.bFontStyleUnderline); + if (MsgSettingGetBool(MMS_STYLE_FONT_STYLE_UNDERLINE, &pSetting->option.mmsStyleOpt.bFontStyleUnderline) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); - pSetting->option.mmsStyleOpt.fontColorRed = MsgSettingGetInt(MMS_STYLE_FONT_COLOR_RED); + if (MsgSettingGetInt(MMS_STYLE_FONT_COLOR_RED, (int *)&(pSetting->option.mmsStyleOpt.fontColorRed)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsStyleOpt.fontColorGreen = MsgSettingGetInt(MMS_STYLE_FONT_COLOR_GREEN); + if (MsgSettingGetInt(MMS_STYLE_FONT_COLOR_GREEN, (int *)&(pSetting->option.mmsStyleOpt.fontColorGreen)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsStyleOpt.fontColorBlue = MsgSettingGetInt(MMS_STYLE_FONT_COLOR_BLUE); + if (MsgSettingGetInt(MMS_STYLE_FONT_COLOR_BLUE, (int *)&(pSetting->option.mmsStyleOpt.fontColorBlue)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsStyleOpt.fontColorHue = MsgSettingGetInt(MMS_STYLE_FONT_COLOR_HUE); + if (MsgSettingGetInt(MMS_STYLE_FONT_COLOR_HUE, (int *)&(pSetting->option.mmsStyleOpt.fontColorHue)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsStyleOpt.bgColorRed = MsgSettingGetInt(MMS_STYLE_BG_COLOR_RED); + if (MsgSettingGetInt(MMS_STYLE_BG_COLOR_RED, (int *)&(pSetting->option.mmsStyleOpt.bgColorRed)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsStyleOpt.bgColorGreen = MsgSettingGetInt(MMS_STYLE_BG_COLOR_GREEN); + if (MsgSettingGetInt(MMS_STYLE_BG_COLOR_GREEN, (int *)&(pSetting->option.mmsStyleOpt.bgColorGreen)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsStyleOpt.bgColorBlue = MsgSettingGetInt(MMS_STYLE_BG_COLOR_BLUE); + if (MsgSettingGetInt(MMS_STYLE_BG_COLOR_BLUE, (int *)&(pSetting->option.mmsStyleOpt.bgColorBlue)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsStyleOpt.bgColorHue = MsgSettingGetInt(MMS_STYLE_BG_COLOR_HUE); + if (MsgSettingGetInt(MMS_STYLE_BG_COLOR_HUE, (int *)&(pSetting->option.mmsStyleOpt.bgColorHue)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsStyleOpt.pageDur = MsgSettingGetInt(MMS_STYLE_PAGE_DUR); + if (MsgSettingGetInt(MMS_STYLE_PAGE_DUR, (int *)&(pSetting->option.mmsStyleOpt.pageDur)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsStyleOpt.pageCustomDur = MsgSettingGetInt(MMS_STYLE_PAGE_CUSTOM_DUR); + if (MsgSettingGetInt(MMS_STYLE_PAGE_CUSTOM_DUR, (int *)&(pSetting->option.mmsStyleOpt.pageCustomDur)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.mmsStyleOpt.pageDurManual = MsgSettingGetInt(MMS_STYLE_PAGE_DUR_MANUAL); + if (MsgSettingGetInt(MMS_STYLE_PAGE_DUR_MANUAL, (int *)&(pSetting->option.mmsStyleOpt.pageDurManual)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); } @@ -1096,9 +1315,14 @@ void MsgGetPushMsgOpt(MSG_SETTING_S *pSetting) { memset(&(pSetting->option.pushMsgOpt), 0x00, sizeof(MSG_PUSHMSG_OPT_S)); - MsgSettingGetBool(PUSH_RECV_OPTION, &pSetting->option.pushMsgOpt.bReceive); + if (MsgSettingGetBool(PUSH_RECV_OPTION, &pSetting->option.pushMsgOpt.bReceive) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + int tmpVal; + if (MsgSettingGetInt(PUSH_SERVICE_TYPE, &tmpVal) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); - pSetting->option.pushMsgOpt.serviceType = (MSG_PUSH_SERVICE_TYPE_T)MsgSettingGetInt(PUSH_SERVICE_TYPE); + pSetting->option.pushMsgOpt.serviceType = (MSG_PUSH_SERVICE_TYPE_T)tmpVal; } @@ -1119,7 +1343,8 @@ void MsgGetCBMsgOpt(MSG_SETTING_S *pSetting) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", CB_RECEIVE, simIndex); - MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.bReceive); + if (MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.bReceive) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); if (simIndex == 0) { MSG_DEBUG("SIM Index = 0, bReceive is gotten"); @@ -1129,7 +1354,9 @@ void MsgGetCBMsgOpt(MSG_SETTING_S *pSetting) #ifndef FEATURE_SMS_CDMA memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", CB_MAX_SIM_COUNT, simIndex); - pSetting->option.cbMsgOpt.maxSimCnt = MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &(pSetting->option.cbMsgOpt.maxSimCnt)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); + #endif err = MsgStoGetCBChannelInfo(dbHandle, &pSetting->option.cbMsgOpt.channelData, simIndex); @@ -1142,7 +1369,8 @@ void MsgGetCBMsgOpt(MSG_SETTING_S *pSetting) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_LANGUAGE, i); - MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.bLanguage[i]); + if (MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.bLanguage[i]) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); } #endif } @@ -1159,7 +1387,9 @@ void MsgGetVoiceMailOpt(MSG_SETTING_S *pSetting) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, simIndex); - tmpValue = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &tmpValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } memset(pSetting->option.voiceMailOpt.mailNumber, 0x00, sizeof(pSetting->option.voiceMailOpt.mailNumber)); if (tmpValue != NULL) { strncpy(pSetting->option.voiceMailOpt.mailNumber, tmpValue, MAX_PHONE_NUMBER_LEN); @@ -1170,7 +1400,9 @@ void MsgGetVoiceMailOpt(MSG_SETTING_S *pSetting) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_ALPHA_ID, simIndex); - tmpValue = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &tmpValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } memset(pSetting->option.voiceMailOpt.alpahId, 0x00, sizeof(pSetting->option.voiceMailOpt.alpahId)); if (tmpValue != NULL) { strncpy(pSetting->option.voiceMailOpt.alpahId, tmpValue, MAX_SIM_XDN_ALPHA_ID_LEN); @@ -1181,7 +1413,8 @@ void MsgGetVoiceMailOpt(MSG_SETTING_S *pSetting) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_COUNT, simIndex); - pSetting->option.voiceMailOpt.voiceCnt = MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &(pSetting->option.voiceMailOpt.voiceCnt)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); } @@ -1189,7 +1422,8 @@ void MsgGetMsgSizeOpt(MSG_SETTING_S *pSetting) { memset(&(pSetting->option.msgSizeOpt), 0x00, sizeof(MSG_MSGSIZE_OPT_S)); - pSetting->option.msgSizeOpt.nMsgSize = MsgSettingGetInt(MSGSIZE_OPTION); + if (MsgSettingGetInt(MSGSIZE_OPTION, &(pSetting->option.msgSizeOpt.nMsgSize)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); } diff --git a/framework/storage-handler/MsgStorageMessage.cpp b/framework/storage-handler/MsgStorageMessage.cpp index f3ead06..cca6132 100755 --- a/framework/storage-handler/MsgStorageMessage.cpp +++ b/framework/storage-handler/MsgStorageMessage.cpp @@ -127,7 +127,10 @@ msg_error_t MsgStoAddMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pS memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_SUBS_ID, pMsg->sim_idx); - char *imsi = MsgSettingGetString(keyName); + char *imsi = NULL; + if (MsgSettingGetString(keyName, &imsi) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } /* Add Message */ memset(sqlQuery, 0x00, sizeof(sqlQuery)); @@ -363,27 +366,48 @@ msg_error_t MsgStoUpdateMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S if (pSendOptInfo != NULL) { /* Get Global setting value if bSetting == false */ if (pSendOptInfo->bSetting == false) { - MsgSettingGetBool(MSG_KEEP_COPY, &pSendOptInfo->bKeepCopy); + if (MsgSettingGetBool(MSG_KEEP_COPY, &pSendOptInfo->bKeepCopy) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); if (pMsg->msgType.mainType == MSG_SMS_TYPE) { - MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &pSendOptInfo->bDeliverReq); - MsgSettingGetBool(SMS_SEND_REPLY_PATH, &pSendOptInfo->option.smsSendOptInfo.bReplyPath); + if (MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &pSendOptInfo->bDeliverReq) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetBool(SMS_SEND_REPLY_PATH, &pSendOptInfo->option.smsSendOptInfo.bReplyPath) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); } else if (pMsg->msgType.mainType == MSG_MMS_TYPE) { - MsgSettingGetBool(MMS_SEND_DELIVERY_REPORT, &pSendOptInfo->bDeliverReq); - MsgSettingGetBool(MMS_SEND_READ_REPLY, &pSendOptInfo->option.mmsSendOptInfo.bReadReq); - pSendOptInfo->option.mmsSendOptInfo.expiryTime.time = (unsigned int)MsgSettingGetInt(MMS_SEND_EXPIRY_TIME); + if (MsgSettingGetBool(MMS_SEND_DELIVERY_REPORT, &pSendOptInfo->bDeliverReq) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetBool(MMS_SEND_READ_REPLY, &pSendOptInfo->option.mmsSendOptInfo.bReadReq) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + int tmpVal = 0; + if (MsgSettingGetInt(MMS_SEND_EXPIRY_TIME, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + pSendOptInfo->option.mmsSendOptInfo.expiryTime.time = (unsigned int)tmpVal; - MSG_MMS_DELIVERY_TIME_T deliveryTime = (MSG_MMS_DELIVERY_TIME_T)MsgSettingGetInt(MMS_SEND_DELIVERY_TIME); + if (MsgSettingGetInt(MMS_SEND_DELIVERY_TIME, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + MSG_MMS_DELIVERY_TIME_T deliveryTime = (MSG_MMS_DELIVERY_TIME_T)tmpVal; if (deliveryTime == MSG_DELIVERY_TIME_CUSTOM) { pSendOptInfo->option.mmsSendOptInfo.bUseDeliveryCustomTime = true; - pSendOptInfo->option.mmsSendOptInfo.deliveryTime.time = (unsigned int)MsgSettingGetInt(MMS_SEND_CUSTOM_DELIVERY); + if (MsgSettingGetInt(MMS_SEND_CUSTOM_DELIVERY, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + pSendOptInfo->option.mmsSendOptInfo.deliveryTime.time = (unsigned int)tmpVal; } else { pSendOptInfo->option.mmsSendOptInfo.bUseDeliveryCustomTime = false; pSendOptInfo->option.mmsSendOptInfo.deliveryTime.time = (unsigned int)deliveryTime; } - pSendOptInfo->option.mmsSendOptInfo.priority = (msg_priority_type_t)MsgSettingGetInt(MMS_SEND_PRIORITY); + if (MsgSettingGetInt(MMS_SEND_PRIORITY, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + pSendOptInfo->option.mmsSendOptInfo.priority = (msg_priority_type_t)tmpVal; } } } @@ -2861,7 +2885,10 @@ msg_error_t MsgStoRestoreMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_SUBS_ID, pMsg->sim_idx); - char *imsi = MsgSettingGetString(keyName); + char *imsi = NULL; + if (MsgSettingGetString(keyName, &imsi) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } /* Add Message */ memset(sqlQuery, 0x00, sizeof(sqlQuery)); @@ -3084,7 +3111,10 @@ msg_error_t MsgStoUpdateIMSI(int sim_idx) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_SUBS_ID, sim_idx); - char *imsi = MsgSettingGetString(keyName); + char *imsi = NULL; + if (MsgSettingGetString(keyName, &imsi) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } MSG_SEC_DEBUG("imsi value exist -> %s", imsi); diff --git a/framework/storage-handler/MsgStorageUtil.cpp b/framework/storage-handler/MsgStorageUtil.cpp index 4dda840..3f7ac9d 100755 --- a/framework/storage-handler/MsgStorageUtil.cpp +++ b/framework/storage-handler/MsgStorageUtil.cpp @@ -263,7 +263,8 @@ msg_error_t MsgStoAutoDeleteConversation(msg_thread_id_t threadId, msg_id_list_s msg_error_t err = MSG_SUCCESS; bool bAutoErase = false; - MsgSettingGetBool(MSG_AUTO_ERASE, &bAutoErase); + if (MsgSettingGetBool(MSG_AUTO_ERASE, &bAutoErase) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); if (bAutoErase) { MSG_DEBUG("threadId [%d]", threadId); @@ -331,8 +332,13 @@ msg_error_t MsgStoAutoDeleteConversation(msg_thread_id_t threadId, msg_id_list_s MSG_DEBUG("currentSmsCnt [%d], currentMmsCnt [%d]", currentSmsCnt, currentMmsCnt); if (currentSmsCnt > 0 || currentMmsCnt > 0) { - limitSmsCnt = MsgSettingGetInt(MSG_SMS_LIMIT); - limitMmsCnt = MsgSettingGetInt(MSG_MMS_LIMIT); + if (MsgSettingGetInt(MSG_SMS_LIMIT, &limitSmsCnt) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + + if (MsgSettingGetInt(MSG_MMS_LIMIT, &limitMmsCnt) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (limitSmsCnt < 0 || limitMmsCnt < 0) { MSG_DEBUG("limitSmsCnt [%d], limitMmsCnt [%d]", limitSmsCnt, limitMmsCnt); diff --git a/framework/submit-handler/MsgSubmitHandler.cpp b/framework/submit-handler/MsgSubmitHandler.cpp index b1d21cb..c570937 100755 --- a/framework/submit-handler/MsgSubmitHandler.cpp +++ b/framework/submit-handler/MsgSubmitHandler.cpp @@ -255,7 +255,11 @@ msg_error_t MsgSubmitReqMMS(MSG_REQUEST_INFO_S *pReqInfo) char keyName[MAX_VCONFKEY_NAME_LEN]; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pReqInfo->msgInfo.sim_idx); - MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName); + int tmpval = 0; + if (MsgSettingGetInt(keyName, &tmpval) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)tmpval; if(simStatus == MSG_SIM_STATUS_NOT_FOUND) { MSG_DEBUG("SIM is not present..."); @@ -301,7 +305,7 @@ msg_error_t MsgUpdateSentMsg(msg_message_id_t MsgId, msg_network_status_t Status if (MsgStoGetMmsSendOpt(MsgId, &sendOpt) == MSG_SUCCESS) bKeepCopy = sendOpt.bKeepCopy; else - ret = MsgSettingGetBool(MSG_KEEP_COPY, &bKeepCopy); + err = MsgSettingGetBool(MSG_KEEP_COPY, &bKeepCopy); } /* Move Msg to SENTBOX */ diff --git a/include/utils/MsgGconfWrapper.h b/include/utils/MsgGconfWrapper.h index 253edd2..95ebb79 100755 --- a/include/utils/MsgGconfWrapper.h +++ b/include/utils/MsgGconfWrapper.h @@ -50,9 +50,9 @@ msg_error_t MsgSettingSetString(const char *pKey, const char *pSetValue); msg_error_t MsgSettingSetInt(const char *pKey, int nSetValue); msg_error_t MsgSettingSetBool(const char *pKey, bool bSetValue); -char* MsgSettingGetString(const char *pKey); -int MsgSettingGetInt(const char *pKey); -int MsgSettingGetBool(const char *pKey, bool *pVal); +msg_error_t MsgSettingGetString(const char *pKey, char **pVal); +msg_error_t MsgSettingGetInt(const char *pKey, int *pVal); +msg_error_t MsgSettingGetBool(const char *pKey, bool *pVal); msg_error_t MsgSettingHandleNewMsg(int SmsCnt, int MmsCnt); msg_error_t MsgSettingSetIndicator(int SmsCnt, int MmsCnt); @@ -60,7 +60,7 @@ msg_error_t MsgSettingSetIndicator(int SmsCnt, int MmsCnt); int MsgSettingGetAutoReject(); bool MsgSettingGetUnknownAutoReject(); -void MsgSettingRegVconfCBCommon(const char *pKey, _vconf_change_cb pCb); -void MsgSettingRemoveVconfCBCommon(const char *pKey, _vconf_change_cb pCb); +msg_error_t MsgSettingRegVconfCBCommon(const char *pKey, _vconf_change_cb pCb); +msg_error_t MsgSettingRemoveVconfCBCommon(const char *pKey, _vconf_change_cb pCb); #endif /* MSG_GCONF_WRAPPER_H */ diff --git a/mapi/msg_transport.cpp b/mapi/msg_transport.cpp index ec97feb..89c43d1 100755 --- a/mapi/msg_transport.cpp +++ b/mapi/msg_transport.cpp @@ -68,6 +68,8 @@ EXPORT_API int msg_reg_sent_status_callback(msg_handle_t handle, msg_sent_status } catch (MsgException& e) { MSG_FATAL("%s", e.what()); if (e.errorCode() == MsgException::SERVER_READY_ERROR) + return MSG_ERR_SERVER_NOT_READY; + else if (e.errorCode() == MsgException::SECURITY_ERROR) return MSG_ERR_PERMISSION_DENIED; else return MSG_ERR_CALLBACK_ERROR; @@ -92,6 +94,8 @@ EXPORT_API int msg_reg_sms_message_callback(msg_handle_t handle, msg_sms_incomin } catch (MsgException& e) { MSG_FATAL("%s", e.what()); if (e.errorCode() == MsgException::SERVER_READY_ERROR) + return MSG_ERR_SERVER_NOT_READY; + else if (e.errorCode() == MsgException::SECURITY_ERROR) return MSG_ERR_PERMISSION_DENIED; else return MSG_ERR_CALLBACK_ERROR; @@ -119,6 +123,8 @@ EXPORT_API int msg_reg_mms_conf_message_callback(msg_handle_t handle, msg_mms_co } catch (MsgException& e) { MSG_FATAL("%s", e.what()); if (e.errorCode() == MsgException::SERVER_READY_ERROR) + return MSG_ERR_SERVER_NOT_READY; + else if (e.errorCode() == MsgException::SECURITY_ERROR) return MSG_ERR_PERMISSION_DENIED; else return MSG_ERR_CALLBACK_ERROR; @@ -143,6 +149,8 @@ EXPORT_API int msg_reg_syncml_message_callback(msg_handle_t handle, msg_syncml_ } catch (MsgException& e) { MSG_FATAL("%s", e.what()); if (e.errorCode() == MsgException::SERVER_READY_ERROR) + return MSG_ERR_SERVER_NOT_READY; + else if (e.errorCode() == MsgException::SECURITY_ERROR) return MSG_ERR_PERMISSION_DENIED; else return MSG_ERR_CALLBACK_ERROR; @@ -167,6 +175,8 @@ EXPORT_API int msg_reg_lbs_message_callback(msg_handle_t handle, msg_lbs_msg_inc } catch (MsgException& e) { MSG_FATAL("%s", e.what()); if (e.errorCode() == MsgException::SERVER_READY_ERROR) + return MSG_ERR_SERVER_NOT_READY; + else if (e.errorCode() == MsgException::SECURITY_ERROR) return MSG_ERR_PERMISSION_DENIED; else return MSG_ERR_CALLBACK_ERROR; @@ -191,6 +201,8 @@ EXPORT_API int msg_reg_syncml_message_operation_callback(msg_handle_t handle, m } catch (MsgException& e) { MSG_FATAL("%s", e.what()); if (e.errorCode() == MsgException::SERVER_READY_ERROR) + return MSG_ERR_SERVER_NOT_READY; + else if (e.errorCode() == MsgException::SECURITY_ERROR) return MSG_ERR_PERMISSION_DENIED; else return MSG_ERR_CALLBACK_ERROR; @@ -218,6 +230,8 @@ EXPORT_API int msg_reg_push_message_callback(msg_handle_t handle, msg_push_msg_ } catch (MsgException& e) { MSG_FATAL("%s", e.what()); if (e.errorCode() == MsgException::SERVER_READY_ERROR) + return MSG_ERR_SERVER_NOT_READY; + else if (e.errorCode() == MsgException::SECURITY_ERROR) return MSG_ERR_PERMISSION_DENIED; else return MSG_ERR_CALLBACK_ERROR; @@ -241,6 +255,8 @@ EXPORT_API int msg_reg_cb_message_callback(msg_handle_t handle, msg_cb_incoming_ } catch (MsgException& e) { MSG_FATAL("%s", e.what()); if (e.errorCode() == MsgException::SERVER_READY_ERROR) + return MSG_ERR_SERVER_NOT_READY; + else if (e.errorCode() == MsgException::SECURITY_ERROR) return MSG_ERR_PERMISSION_DENIED; else return MSG_ERR_CALLBACK_ERROR; @@ -265,6 +281,8 @@ EXPORT_API int msg_reg_report_message_callback(msg_handle_t handle, msg_report_m } catch (MsgException& e) { MSG_FATAL("%s", e.what()); if (e.errorCode() == MsgException::SERVER_READY_ERROR) + return MSG_ERR_SERVER_NOT_READY; + else if (e.errorCode() == MsgException::SECURITY_ERROR) return MSG_ERR_PERMISSION_DENIED; else return MSG_ERR_CALLBACK_ERROR; diff --git a/plugin/mms_plugin/MmsPluginComposer.cpp b/plugin/mms_plugin/MmsPluginComposer.cpp index db4b2af..c9fa98c 100755 --- a/plugin/mms_plugin/MmsPluginComposer.cpp +++ b/plugin/mms_plugin/MmsPluginComposer.cpp @@ -136,15 +136,22 @@ bool composeSendReqHeader(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *p struct tm timeInfo; time_t RawTime = 0; time_t nTimeInSecs = 0; + int tmpVal = 0; MMS_HEADER_DATA_S *pHeaderData = pMsgData->header; if (pSendOptInfo) { if (pSendOptInfo->bSetting == false) { unsigned int settingTime; - priority = (MmsPriority)MsgSettingGetInt(MMS_SEND_PRIORITY); + if (MsgSettingGetInt(MMS_SEND_PRIORITY, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + priority = (MmsPriority)tmpVal; - settingTime = (unsigned int)MsgSettingGetInt(MMS_SEND_EXPIRY_TIME); + if (MsgSettingGetInt(MMS_SEND_EXPIRY_TIME, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + settingTime = (unsigned int)tmpVal; if (settingTime == 0) { expiryTime.type = MMS_TIMETYPE_NONE; expiryTime.time = 0; @@ -153,7 +160,10 @@ bool composeSendReqHeader(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *p expiryTime.time = settingTime; } - settingTime = (unsigned int)MsgSettingGetInt(MMS_SEND_DELIVERY_TIME); + if (MsgSettingGetInt(MMS_SEND_DELIVERY_TIME, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + settingTime = (unsigned int)tmpVal; if (settingTime == 0) { deliveryTime.type = MMS_TIMETYPE_NONE; deliveryTime.time = 0; @@ -162,8 +172,11 @@ bool composeSendReqHeader(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *p deliveryTime.time = (unsigned int)settingTime; } - MsgSettingGetBool(MMS_SEND_DELIVERY_REPORT, &bAskDeliveryReport); - MsgSettingGetBool(MMS_SEND_READ_REPLY, &bAskReadReply); + if (MsgSettingGetBool(MMS_SEND_DELIVERY_REPORT, &bAskDeliveryReport) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetBool(MMS_SEND_READ_REPLY, &bAskReadReply) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); } else { priority = (MmsPriority)pSendOptInfo->option.mmsSendOptInfo.priority; @@ -177,7 +190,10 @@ bool composeSendReqHeader(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *p bAskReadReply = pSendOptInfo->option.mmsSendOptInfo.bReadReq; } - msgClass = (MmsMsgClass)MsgSettingGetInt(MMS_SEND_MSG_CLASS); + if (MsgSettingGetInt(MMS_SEND_MSG_CLASS, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + msgClass = (MmsMsgClass)tmpVal; /* set Header */ time(&RawTime); diff --git a/plugin/mms_plugin/MmsPluginEventHandler.cpp b/plugin/mms_plugin/MmsPluginEventHandler.cpp index f71d8e0..eb614a6 100755 --- a/plugin/mms_plugin/MmsPluginEventHandler.cpp +++ b/plugin/mms_plugin/MmsPluginEventHandler.cpp @@ -112,12 +112,16 @@ TapiHandle *MmsPluginEventHandler::getTelHandle(int sim_idx) return handle_list.handle[sim_idx-1]; } else { int SIM_Status = 0; - SIM_Status = MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT); + if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT, &SIM_Status) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (SIM_Status == 1) { return handle_list.handle[0]; } - SIM_Status = MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT2); + if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT2, &SIM_Status) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (SIM_Status == 1) { return handle_list.handle[1]; } @@ -234,10 +238,15 @@ void MmsPluginEventHandler::handleMmsError(mmsTranQEntity *pRequest) } int dnet_state = 0; - if (msgInfo.sim_idx == 1) - dnet_state = MsgSettingGetInt(VCONFKEY_DNET_STATE); - else if (msgInfo.sim_idx == 2) - dnet_state = MsgSettingGetInt(VCONFKEY_DNET_STATE2); + if (msgInfo.sim_idx == 1) { + if (MsgSettingGetInt(VCONFKEY_DNET_STATE, &dnet_state) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + } else if (msgInfo.sim_idx == 2) { + if (MsgSettingGetInt(VCONFKEY_DNET_STATE2, &dnet_state) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + } int net_cell_type = 0; @@ -249,9 +258,13 @@ void MmsPluginEventHandler::handleMmsError(mmsTranQEntity *pRequest) deinitTelHandle(); bool data_enable = FALSE; - int call_status = MsgSettingGetInt(MSG_MESSAGE_DURING_CALL); + int call_status = 0; + if (MsgSettingGetInt(MSG_MESSAGE_DURING_CALL, &call_status) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } - MsgSettingGetBool(VCONFKEY_3G_ENABLE, &data_enable); + if (MsgSettingGetBool(VCONFKEY_3G_ENABLE, &data_enable) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); MSG_INFO("Call[%d], Data[%d], SubType[%d]", call_status, data_enable, msgInfo.msgType.subType); MSG_INFO("sim_idx[%d], dnet_state[%d], net_cell_type[%d]", msgInfo.sim_idx, dnet_state, net_cell_type); diff --git a/plugin/mms_plugin/MmsPluginHttp.cpp b/plugin/mms_plugin/MmsPluginHttp.cpp index 5900940..82f73e4 100755 --- a/plugin/mms_plugin/MmsPluginHttp.cpp +++ b/plugin/mms_plugin/MmsPluginHttp.cpp @@ -257,7 +257,10 @@ static bool __httpGetHeaderField(MMS_HTTP_HEADER_FIELD_T httpHeaderItem, char *s char szUserAgent[1024 + 1]; char *uagent = NULL; - uagent = MsgSettingGetString(VCONFKEY_BROWSER_USER_AGENT); + if (MsgSettingGetString(VCONFKEY_BROWSER_USER_AGENT, &uagent) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } + if (uagent && strlen(uagent) > 0) { MSG_SEC_INFO("Get UserAgent : %s = %s", VCONFKEY_BROWSER_USER_AGENT, uagent); memset(szUserAgent, 0x00, sizeof(szUserAgent)); @@ -281,7 +284,10 @@ static bool __httpGetHeaderField(MMS_HTTP_HEADER_FIELD_T httpHeaderItem, char *s break; case MMS_HH_UA_PROFILE: { - char *szUAProfile = MsgSettingGetString(MSG_MMS_UA_PROFILE); + char *szUAProfile = NULL; + if (MsgSettingGetString(MSG_MMS_UA_PROFILE, &szUAProfile) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } snprintf((char *)szHeaderBuffer, 1024, "%s", szUAProfile); if (szUAProfile) { @@ -295,7 +301,11 @@ static bool __httpGetHeaderField(MMS_HTTP_HEADER_FIELD_T httpHeaderItem, char *s #if defined(FEATURE_SMS_CDMA) case MMS_HH_MDN: { /* - char *mdn = MsgSettingGetString(MSG_SIM_MSISDN); + char *mdn = NULL; + if (MsgSettingGetString(MSG_SIM_MSISDN, &mdn) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } + if (mdn != NULL && strlen(mdn) > 0) { result = true; snprintf((char *)szHeaderBuffer, 1024, "%s", mdn); diff --git a/plugin/mms_plugin/MmsPluginInternal.cpp b/plugin/mms_plugin/MmsPluginInternal.cpp index db91fcd..3708b7c 100755 --- a/plugin/mms_plugin/MmsPluginInternal.cpp +++ b/plugin/mms_plugin/MmsPluginInternal.cpp @@ -254,8 +254,11 @@ bool MmsPluginInternal::processNotiInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST int roamState = 0; char pPduFilePath[MAX_FULL_PATH_SIZE] = {0}; - roamState = MsgSettingGetInt(VCONFKEY_TELEPHONY_SVC_ROAM); - MsgSettingGetBool(MMS_SEND_REPORT_ALLOWED, &bReportAllowed); + if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SVC_ROAM, &roamState) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetInt() is failed"); + + if (MsgSettingGetBool(MMS_SEND_REPORT_ALLOWED, &bReportAllowed) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); if (checkRejectNotiInd(roamState, bReportAllowed, pPduFilePath)) { MSG_DEBUG("MMS Message Rejected......"); @@ -285,11 +288,18 @@ bool MmsPluginInternal::processNotiInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST return true; } + int tmpVal = 0; if (roamState == VCONFKEY_TELEPHONY_SVC_ROAM_OFF) { - retrieveType = (MSG_MMS_HOME_RETRIEVE_TYPE_T)MsgSettingGetInt(MMS_RECV_HOME_NETWORK); + if (MsgSettingGetInt(MMS_RECV_HOME_NETWORK, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + retrieveType = (MSG_MMS_HOME_RETRIEVE_TYPE_T)tmpVal; MSG_DEBUG("$$$$$$$$$$ MMS_RECV_HOME_NETWORK = %d $$$$$$$$$$$$$", retrieveType); } else { - retrieveType = (MSG_MMS_HOME_RETRIEVE_TYPE_T)MsgSettingGetInt(MMS_RECV_ABROAD_NETWORK); + if (MsgSettingGetInt(MMS_RECV_ABROAD_NETWORK, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + retrieveType = (MSG_MMS_HOME_RETRIEVE_TYPE_T)tmpVal; MSG_DEBUG("$$$$$$$$$$ MMS_RECV_ABROAD_NETWORK = %d $$$$$$$$$$$$$", retrieveType); if (retrieveType == MSG_ABROAD_RESTRICTED) { @@ -316,7 +326,9 @@ bool MmsPluginInternal::processNotiInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST /* Check if current request sim index is different from default network SIM */ /* Convert auto-retrieve to manual retrieve in case sim indexes are different */ int default_sim = 0; - default_sim = MsgSettingGetInt(MSG_NETWORK_SIM); + if (MsgSettingGetInt(MSG_NETWORK_SIM, &default_sim) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } MSG_DEBUG("default_sim = %d, pMsgInfo->sim_idx = %d", default_sim, pMsgInfo->sim_idx); @@ -497,7 +509,10 @@ void MmsPluginInternal::processSendConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTranQEn memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, pMsgInfo->sim_idx); - char *msisdn = MsgSettingGetString(keyName); + char *msisdn = NULL; + if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } MmsPluginStorage::instance()->getAddressInfo(pMsgInfo->msgId, &addressinfo); @@ -582,7 +597,10 @@ void MmsPluginInternal::processRetrieveConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTra memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, pMsgInfo->sim_idx); - char *msisdn = MsgSettingGetString(keyName); + char *msisdn = NULL; + if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } char *normal_msisdn = NULL; if (msisdn) normal_msisdn = msg_normalize_number(msisdn); @@ -840,7 +858,9 @@ void MmsPluginInternal::processRetrieveConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTra } char *msisdn = NULL; - msisdn = MsgSettingGetString(MSG_SIM_MSISDN); + if (MsgSettingGetString(MSG_SIM_MSISDN, &msisdn) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } if (mmsHeader.pFrom) MmsAddrUtilRemovePlmnString(mmsHeader.pFrom->szAddr); @@ -1008,8 +1028,11 @@ bool MmsPluginInternal::checkRejectNotiInd(int roamState, bool bReportAllowed, c bool bRejectAnonymous; bool bRejectAdvertisement; - MsgSettingGetBool(MMS_RECV_REJECT_UNKNOWN, &bRejectAnonymous); - MsgSettingGetBool(MMS_RECV_REJECT_ADVERTISE, &bRejectAdvertisement); + if (MsgSettingGetBool(MMS_RECV_REJECT_UNKNOWN, &bRejectAnonymous) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetBool(MMS_RECV_REJECT_ADVERTISE, &bRejectAdvertisement) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); /* Anonymous Reject */ if (bRejectAnonymous && @@ -1029,8 +1052,12 @@ bool MmsPluginInternal::checkRejectNotiInd(int roamState, bool bReportAllowed, c } /* Message Reject - Roaming Case */ + int tmpVal = 0; if (roamState == VCONFKEY_TELEPHONY_SVC_ROAM_ON) { - retrieveType = (MSG_MMS_HOME_RETRIEVE_TYPE_T)MsgSettingGetInt(MMS_RECV_ABROAD_NETWORK); + if (MsgSettingGetInt(MMS_RECV_ABROAD_NETWORK, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + retrieveType = (MSG_MMS_HOME_RETRIEVE_TYPE_T)tmpVal; if (retrieveType == MSG_ABROAD_REJECT) { MSG_DEBUG("Abroad_Network : Notification Reject... "); encodeNotifyRespInd(mmsHeader.szTrID, MSG_DELIVERY_REPORT_REJECTED, bReportAllowed, pSendFilePath); @@ -1038,7 +1065,10 @@ bool MmsPluginInternal::checkRejectNotiInd(int roamState, bool bReportAllowed, c return true; } } else { - retrieveType = (MSG_MMS_HOME_RETRIEVE_TYPE_T)MsgSettingGetInt(MMS_RECV_HOME_NETWORK); + if (MsgSettingGetInt(MMS_RECV_HOME_NETWORK, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + retrieveType = (MSG_MMS_HOME_RETRIEVE_TYPE_T)tmpVal; if (retrieveType == MSG_HOME_REJECT) { MSG_DEBUG("Home_Network : Notification Reject... "); encodeNotifyRespInd(mmsHeader.szTrID, MSG_DELIVERY_REPORT_REJECTED, bReportAllowed, pSendFilePath); diff --git a/plugin/mms_plugin/MmsPluginMain.cpp b/plugin/mms_plugin/MmsPluginMain.cpp index 519c5ca..0abbbd7 100755 --- a/plugin/mms_plugin/MmsPluginMain.cpp +++ b/plugin/mms_plugin/MmsPluginMain.cpp @@ -242,7 +242,9 @@ msg_error_t MmsUpdateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo) MSG_DEBUG("MmsPlgUpdRejectStatus : Get MMS Transacation id Failed"); memset(pMsgInfo->msgData, 0, MAX_MSG_DATA_LEN + 1); - MsgSettingGetBool(MMS_SEND_REPORT_ALLOWED, &bReportAllowed); + if (MsgSettingGetBool(MMS_SEND_REPORT_ALLOWED, &bReportAllowed) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + if (MmsPluginInternal::instance()->encodeNotifyRespInd(szTrID, MSG_DELIVERY_REPORT_REJECTED, bReportAllowed, pMsgInfo->msgData)) { MSG_DEBUG("MmsPlgUpdRejectStatus : Encode Notify Response Success"); pMsgInfo->dataSize = strlen(pMsgInfo->msgData); diff --git a/plugin/mms_plugin/MmsPluginTransport.cpp b/plugin/mms_plugin/MmsPluginTransport.cpp index ae74d84..88f904f 100755 --- a/plugin/mms_plugin/MmsPluginTransport.cpp +++ b/plugin/mms_plugin/MmsPluginTransport.cpp @@ -59,7 +59,10 @@ void MmsPluginTransport::submitRequest(const MSG_REQUEST_INFO_S *pReqInfo) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, pReqInfo->msgInfo.sim_idx); - char *msisdn = MsgSettingGetString(keyName); + char *msisdn = NULL; + if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } MSG_DEBUG("pReqInfo->msgInfo.msgType.subType [%d]", pReqInfo->msgInfo.msgType.subType); diff --git a/plugin/mms_plugin/MmsPluginUserAgent.cpp b/plugin/mms_plugin/MmsPluginUserAgent.cpp index 1762b17..7841856 100755 --- a/plugin/mms_plugin/MmsPluginUserAgent.cpp +++ b/plugin/mms_plugin/MmsPluginUserAgent.cpp @@ -502,7 +502,8 @@ void MmsPluginUaManager::run() break; } - MsgSettingGetBool(MMS_SEND_REPORT_ALLOWED, &bReportAllowed); + if (MsgSettingGetBool(MMS_SEND_REPORT_ALLOWED, &bReportAllowed) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); MSG_DEBUG("conf received successfully -2"); MSG_DEBUG("reqEntity.eMmsPduType [%d]", reqEntity.eMmsPduType); diff --git a/plugin/sms_cdma_plugin/SmsCdmaPluginCallback.cpp b/plugin/sms_cdma_plugin/SmsCdmaPluginCallback.cpp index e410f0c..6cfcaff 100755 --- a/plugin/sms_cdma_plugin/SmsCdmaPluginCallback.cpp +++ b/plugin/sms_cdma_plugin/SmsCdmaPluginCallback.cpp @@ -76,7 +76,11 @@ void SmsPluginCallback::registerEvent() if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SIM_REFRESHED, TapiEventSimRefreshed, NULL) != TAPI_API_SUCCESS) MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SIM_REFRESHED); - MsgSettingRegVconfCBCommon(VCONFKEY_DNET_STATE, _dnet_state_changed_cb); + msg_error_t err = MSG_SUCCESS; + err = MsgSettingRegVconfCBCommon(VCONFKEY_DNET_STATE, _dnet_state_changed_cb); + if (err != MSG_SUCCESS) { + MSG_DEBUG("MsgSettingRegVconfCBCommon() is failed"); + } /* MsgSettingRegVconfCBCommon(VCONFKEY_TELEPHONY_MDN, _TapiMdnChangedCb); */ } @@ -147,7 +151,10 @@ void TapiEventMsgIncoming(TapiHandle *handle, const char *noti_id, void *data, v sms_trans_msg.data.p2p_msg.telesvc_msg.data.deliver.num_msg = num_msg; - char *voiceNumber = MsgSettingGetString(VOICEMAIL_NUMBER); + char *voiceNumber = NULL; + if (MsgSettingGetString(VOICEMAIL_NUMBER, &voiceNumber) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } if (voiceNumber) { snprintf(sms_trans_msg.data.p2p_msg.address.szData, sizeof(sms_trans_msg.data.p2p_msg.address.szData), "%s", voiceNumber); free(voiceNumber); @@ -519,7 +526,10 @@ void TapiEventGetMsisdnInfo(TapiHandle *handle, int result, void *data, void *us void _dnet_state_changed_cb(keynode_t *key, void* data) { - int dnet_state = MsgSettingGetInt(VCONFKEY_DNET_STATE); + int dnet_state = 0; + if (MsgSettingGetInt(VCONFKEY_DNET_STATE, &dnet_state) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (dnet_state > VCONFKEY_DNET_OFF) { /* Call Event Handler */ diff --git a/plugin/sms_cdma_plugin/SmsCdmaPluginEventHandler.cpp b/plugin/sms_cdma_plugin/SmsCdmaPluginEventHandler.cpp index 2de05f2..4a5adfe 100755 --- a/plugin/sms_cdma_plugin/SmsCdmaPluginEventHandler.cpp +++ b/plugin/sms_cdma_plugin/SmsCdmaPluginEventHandler.cpp @@ -539,7 +539,10 @@ void SmsPluginEventHandler::handleMsgIncoming(sms_trans_p2p_msg_s *p_p2p_msg) if (p_p2p_msg->telesvc_msg.data.deliver.num_msg < 0) p_p2p_msg->telesvc_msg.data.deliver.num_msg = 0; - int voice_cnt = MsgSettingGetInt(VOICEMAIL_COUNT); + int voice_cnt = 0; + if (MsgSettingGetInt(VOICEMAIL_COUNT, &voice_cnt) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } /* repeated msg check for voicemail */ if (voice_cnt == p_p2p_msg->telesvc_msg.data.deliver.num_msg) { @@ -665,7 +668,9 @@ void SmsPluginEventHandler::handleMsgIncoming(sms_trans_p2p_msg_s *p_p2p_msg) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, simIndex); - msisdn = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } MSG_SMS_VLD_INFO("%d, SMS Receive, %s->%s, %s", msgInfo.msgId, \ msgInfo.addressList[0].addressVal, \ @@ -808,7 +813,9 @@ void SmsPluginEventHandler::handleCbMsgIncoming(sms_trans_broadcast_msg_s *p_cb_ memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, simIndex); - msisdn = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } MSG_SMS_VLD_INFO("%d, SMS Receive, %s->%s, %s", msgInfo.msgId, \ msgInfo.addressList[0].addressVal, \ @@ -1180,7 +1187,8 @@ bool SmsPluginEventHandler::checkCbOpt(sms_trans_svc_ctg_t svc_ctg) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", CB_RECEIVE, sim_idx); - MsgSettingGetBool(keyName, &bReceive); + if (MsgSettingGetBool(keyName, &bReceive) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); /* Receive CB Msg = FALSE */ if (!bReceive) { diff --git a/plugin/sms_cdma_plugin/SmsCdmaPluginMain.cpp b/plugin/sms_cdma_plugin/SmsCdmaPluginMain.cpp index 79c53ec..ebb3f26 100755 --- a/plugin/sms_cdma_plugin/SmsCdmaPluginMain.cpp +++ b/plugin/sms_cdma_plugin/SmsCdmaPluginMain.cpp @@ -117,7 +117,9 @@ msg_error_t SmsPlgInitialize() bool bReady = false; for (int i = 0; i < 100; i++) { - MsgSettingGetBool(VCONFKEY_TELEPHONY_READY, &bReady); + if (MsgSettingGetBool(VCONFKEY_TELEPHONY_READY, &bReady) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + MSG_DEBUG("Get VCONFKEY_TELEPHONY_READY [%d].", bReady ? 1 : 0); if (bReady) @@ -209,20 +211,6 @@ msg_error_t SmsPlgSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo) } } - /* Check SIM is present or not */ - /* - MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(MSG_SIM_CHANGED); - - if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { - MSG_DEBUG("SIM is not present.."); - - if (pReqInfo->msgInfo.msgPort.valid == false) - SmsPluginStorage::instance()->updateSentMsg(&(pReqInfo->msgInfo), MSG_NETWORK_SEND_FAIL); - - return MSG_ERR_NO_SIM; - } - */ - sms_request_info_s *request = NULL; request = (sms_request_info_s *)calloc(1, sizeof(sms_request_info_s)); diff --git a/plugin/sms_cdma_plugin/SmsCdmaPluginSetting.cpp b/plugin/sms_cdma_plugin/SmsCdmaPluginSetting.cpp index 69c6347..703462e 100755 --- a/plugin/sms_cdma_plugin/SmsCdmaPluginSetting.cpp +++ b/plugin/sms_cdma_plugin/SmsCdmaPluginSetting.cpp @@ -340,9 +340,8 @@ void SmsPluginSetting::getCbOpt(MSG_SETTING_S *pSetting) memset(&(pSetting->option.cbMsgOpt), 0x00, sizeof(MSG_CBMSG_OPT_S)); - MsgSettingGetBool(CB_RECEIVE, &pSetting->option.cbMsgOpt.bReceive); - - /* pSetting->option.cbMsgOpt.maxSimCnt = MsgSettingGetInt(CB_MAX_SIM_COUNT); */ + if (MsgSettingGetBool(CB_RECEIVE, &pSetting->option.cbMsgOpt.bReceive) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); err = MsgStoGetCBChannelInfo(&dbHandle, &pSetting->option.cbMsgOpt.channelData); MSG_DEBUG("MsgStoAddCBChannelInfo : err=[%d]", err); @@ -354,7 +353,8 @@ void SmsPluginSetting::getCbOpt(MSG_SETTING_S *pSetting) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", CB_LANGUAGE, i); - MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.bLanguage[i]); + if (MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.bLanguage[i]) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); } #endif } diff --git a/plugin/sms_cdma_plugin/SmsCdmaPluginStorage.cpp b/plugin/sms_cdma_plugin/SmsCdmaPluginStorage.cpp index faa651b..85aab56 100755 --- a/plugin/sms_cdma_plugin/SmsCdmaPluginStorage.cpp +++ b/plugin/sms_cdma_plugin/SmsCdmaPluginStorage.cpp @@ -489,13 +489,17 @@ msg_error_t SmsPluginStorage::addSmsSendOption(MSG_MESSAGE_INFO_S *pMsg, MSG_SEN msg_error_t err = MSG_SUCCESS; if (pSendOptInfo->bSetting == false) { - MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &pSendOptInfo->bDeliverReq); - MsgSettingGetBool(SMS_SEND_REPLY_PATH, &pSendOptInfo->option.smsSendOptInfo.bReplyPath); + if (MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &pSendOptInfo->bDeliverReq) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetBool(SMS_SEND_REPLY_PATH, &pSendOptInfo->option.smsSendOptInfo.bReplyPath) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); /* if (pSendOptInfo->bDeliverReq || pSendOptInfo->option.smsSendOptInfo.bReplyPath) { pSendOptInfo->bSetting = true; */ - MsgSettingGetBool(MSG_KEEP_COPY, &pSendOptInfo->bKeepCopy); + if (MsgSettingGetBool(MSG_KEEP_COPY, &pSendOptInfo->bKeepCopy) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); /* } */ } @@ -531,7 +535,8 @@ msg_error_t SmsPluginStorage::checkStorageStatus(MSG_MESSAGE_INFO_S *pMsgInfo) if (err == MSG_ERR_MESSAGE_COUNT_FULL) { bool bAutoErase = false; - MsgSettingGetBool(MSG_AUTO_ERASE, &bAutoErase); + if (MsgSettingGetBool(MSG_AUTO_ERASE, &bAutoErase) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); MSG_DEBUG("bAutoErase: %d", bAutoErase); diff --git a/plugin/sms_cdma_plugin/SmsCdmaPluginTransport.cpp b/plugin/sms_cdma_plugin/SmsCdmaPluginTransport.cpp index e1917f5..07b7423 100755 --- a/plugin/sms_cdma_plugin/SmsCdmaPluginTransport.cpp +++ b/plugin/sms_cdma_plugin/SmsCdmaPluginTransport.cpp @@ -52,7 +52,9 @@ SmsPluginTransport::SmsPluginTransport() msgRef16bit = 0x0000; msgSeqNum = 0x00; - msgSubmitId = MsgSettingGetInt(MSG_MESSAGE_ID_COUNTER); + if (MsgSettingGetInt(MSG_MESSAGE_ID_COUNTER, (int *)&msgSubmitId) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } } @@ -225,7 +227,8 @@ void SmsPluginTransport::convertMsgInfoToSubmit(const MSG_MESSAGE_INFO_S *pMsgIn pSubmit->privacy = SMS_PRIVACY_NOT_RESTRICTED; /* 7. Set Reply option */ - MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, (bool *)&(pSubmit->reply_opt.deliver_ack_req)); + if (MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, (bool *)&(pSubmit->reply_opt.deliver_ack_req)) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); /* 8. Set Alert priority */ pSubmit->alert_priority = SMS_ALERT_MOBILE_DEFAULT; @@ -275,7 +278,9 @@ void SmsPluginTransport::submitRequest(sms_request_info_s *pReqInfo) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, simIndex); - msisdn = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } /* Tapi Data Structure */ TelSmsDatapackageInfo_t tapi_data_pkg; diff --git a/plugin/sms_cdma_plugin/SmsCdmaPluginWapPushHandler.cpp b/plugin/sms_cdma_plugin/SmsCdmaPluginWapPushHandler.cpp index f092d89..020aef6 100755 --- a/plugin/sms_cdma_plugin/SmsCdmaPluginWapPushHandler.cpp +++ b/plugin/sms_cdma_plugin/SmsCdmaPluginWapPushHandler.cpp @@ -880,7 +880,8 @@ void SmsPluginWapPushHandler::handleWapPushCallback(char* pPushHeader, char* pPu /* check Push message receive setting */ bool bPushRecv = false; - MsgSettingGetBool(PUSH_RECV_OPTION, &bPushRecv); + if (MsgSettingGetBool(PUSH_RECV_OPTION, &bPushRecv) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); if ((bPushRecv == false) && (appCode != SMS_WAP_APPLICATION_MMS_UA)) { MSG_DEBUG("Push Message Receive option is OFF. Drop Push Message."); @@ -1144,7 +1145,8 @@ void SmsPluginWapPushHandler::handleWapPushCallback(char* pPushHeader, char* pPu /* check Push message receive setting */ bool bPushRecv = false; int appcode = 0; - MsgSettingGetBool(PUSH_RECV_OPTION, &bPushRecv); + if (MsgSettingGetBool(PUSH_RECV_OPTION, &bPushRecv) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); storageHandler->getnthPushEvent(i, &appcode); MSG_DEBUG("pushEvt_cnt: %d, appcode: %d", pushEvt_cnt, appcode); diff --git a/plugin/sms_plugin/SmsPluginCallback.cpp b/plugin/sms_plugin/SmsPluginCallback.cpp index 214a01e..5b09c26 100755 --- a/plugin/sms_plugin/SmsPluginCallback.cpp +++ b/plugin/sms_plugin/SmsPluginCallback.cpp @@ -445,11 +445,15 @@ void TapiEventGetSimMsg(TapiHandle *handle, int result, void *data, void *user_d memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, msgInfo.sim_idx); - voiceNumber = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &voiceNumber) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_ALPHA_ID, msgInfo.sim_idx); - voiceAlphaId = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &voiceAlphaId) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } memset(msgInfo.addressList[0].addressVal, 0x00, sizeof(msgInfo.addressList[0].addressVal)); memset(msgInfo.addressList[0].displayName, 0x00, sizeof(msgInfo.addressList[0].displayName)); @@ -860,7 +864,9 @@ void TapiEventGetMailboxInfo(TapiHandle *handle, int result, void *data, void *u char *voiceNum = NULL; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, sim_idx); - voiceNum = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &voiceNum) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } if (voiceNum && strlen(voiceNum)) { MSG_DEBUG("Voice mailbox number exist in vconf"); diff --git a/plugin/sms_plugin/SmsPluginCbMsgHandler.cpp b/plugin/sms_plugin/SmsPluginCbMsgHandler.cpp index e082c59..1280b65 100755 --- a/plugin/sms_plugin/SmsPluginCbMsgHandler.cpp +++ b/plugin/sms_plugin/SmsPluginCbMsgHandler.cpp @@ -542,7 +542,8 @@ bool SmsPluginCbMsgHandler::checkCbOpt(SMS_CBMSG_PAGE_S *CbPage, bool *pJavaMsg, char keyName[MAX_VCONFKEY_NAME_LEN]; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", CB_RECEIVE, simIndex); - MsgSettingGetBool(keyName, &bReceive); + if (MsgSettingGetBool(keyName, &bReceive) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); /* Receive CB Msg = FALSE */ if (!bReceive) { @@ -557,7 +558,8 @@ bool SmsPluginCbMsgHandler::checkCbOpt(SMS_CBMSG_PAGE_S *CbPage, bool *pJavaMsg, snprintf(keyName, sizeof(keyname), "%s/%d", CB_LANGUAGE, MSG_CBLANG_TYPE_ALL); bool bAllLang = false; - MsgSettingGetBool(keyName, &bAllLang); + if (MsgSettingGetBool(keyName, &bAllLang) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); if (!bAllLang) { MSG_DEBUG("ALL LANGUAGE = FALSE"); @@ -567,7 +569,8 @@ bool SmsPluginCbMsgHandler::checkCbOpt(SMS_CBMSG_PAGE_S *CbPage, bool *pJavaMsg, bool bLang = false; - MsgSettingGetBool(keyName, &bLang); + if (MsgSettingGetBool(keyName, &bLang) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); if (!bLang || CbPage.pageHeader.langType == MSG_CBLANG_TYPE_MAX) { MSG_DEBUG("LANGUAGE [%d] = FALSE", CbPage.pageHeader.langType); diff --git a/plugin/sms_plugin/SmsPluginConcatHandler.cpp b/plugin/sms_plugin/SmsPluginConcatHandler.cpp index 9c6a649..520aba0 100755 --- a/plugin/sms_plugin/SmsPluginConcatHandler.cpp +++ b/plugin/sms_plugin/SmsPluginConcatHandler.cpp @@ -195,7 +195,10 @@ void SmsPluginConcatHandler::handleConcatMsg(TapiHandle *handle, SMS_TPDU_S *pTp char keyName[MAX_VCONFKEY_NAME_LEN]; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", SIM_TOTAL_COUNT, msg.simIndex); - int totalCnt = MsgSettingGetInt(keyName); + int totalCnt; + if (MsgSettingGetInt(keyName, &totalCnt) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (segCnt > totalCnt) { /* send DeliveryResport as MSG_SUCCESS and return when total sim storage cnt is less than segment cnt. */ diff --git a/plugin/sms_plugin/SmsPluginDSHandler.cpp b/plugin/sms_plugin/SmsPluginDSHandler.cpp index 081ae5e..fc2de4a 100755 --- a/plugin/sms_plugin/SmsPluginDSHandler.cpp +++ b/plugin/sms_plugin/SmsPluginDSHandler.cpp @@ -100,12 +100,16 @@ TapiHandle *SmsPluginDSHandler::getTelHandle(int sim_idx) return handle_list.handle[sim_idx-1]; } else { int SIM_Status = 0; - SIM_Status = MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT); + if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT, &SIM_Status) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (SIM_Status == 1) { return handle_list.handle[0]; } - SIM_Status = MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT2); + if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT2, &SIM_Status) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (SIM_Status == 1) { return handle_list.handle[1]; } @@ -158,14 +162,17 @@ int SmsPluginDSHandler::getActiveSimCount() int active_count = 0; int sim_status = VCONFKEY_TELEPHONY_SIM_UNKNOWN; - sim_status = MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT); + if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT, &sim_status) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } MSG_DEBUG("sim1 status : %d", sim_status); if (sim_status == VCONFKEY_TELEPHONY_SIM_INSERTED) active_count++; sim_status = VCONFKEY_TELEPHONY_SIM_UNKNOWN; - sim_status = MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT2); - + if (MsgSettingGetInt(VCONFKEY_TELEPHONY_SIM_SLOT2, &sim_status) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } MSG_DEBUG("sim2 status : %d", sim_status); if (sim_status == VCONFKEY_TELEPHONY_SIM_INSERTED) active_count++; diff --git a/plugin/sms_plugin/SmsPluginEventHandler.cpp b/plugin/sms_plugin/SmsPluginEventHandler.cpp index 985dccf..7b12b83 100755 --- a/plugin/sms_plugin/SmsPluginEventHandler.cpp +++ b/plugin/sms_plugin/SmsPluginEventHandler.cpp @@ -219,11 +219,15 @@ void SmsPluginEventHandler::handleMsgIncoming(TapiHandle *handle, SMS_TPDU_S *pT memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, msgInfo.sim_idx); - voiceNumber = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &voiceNumber) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_ALPHA_ID, msgInfo.sim_idx); - voiceAlphaId = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &voiceAlphaId) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } memset(msgInfo.addressList[0].addressVal, 0x00, sizeof(msgInfo.addressList[0].addressVal)); memset(msgInfo.addressList[0].displayName, 0x00, sizeof(msgInfo.addressList[0].displayName)); @@ -374,7 +378,9 @@ void SmsPluginEventHandler::handleMsgIncoming(TapiHandle *handle, SMS_TPDU_S *pT char keyName[MAX_VCONFKEY_NAME_LEN]; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, msgInfo.sim_idx); - msisdn = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } MSG_SMS_VLD_INFO("%d, SMS Receive, %s->%s, %s", msgInfo.msgId, \ msgInfo.addressList[0].addressVal, \ diff --git a/plugin/sms_plugin/SmsPluginMain.cpp b/plugin/sms_plugin/SmsPluginMain.cpp index 5c3a876..5b9bcae 100755 --- a/plugin/sms_plugin/SmsPluginMain.cpp +++ b/plugin/sms_plugin/SmsPluginMain.cpp @@ -109,7 +109,9 @@ msg_error_t SmsPlgInitialize() bool bReady = false; for (int i = 0; i < 100; i++) { - MsgSettingGetBool(VCONFKEY_TELEPHONY_READY, &bReady); + if (MsgSettingGetBool(VCONFKEY_TELEPHONY_READY, &bReady) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + MSG_DEBUG("Get VCONFKEY_TELEPHONY_READY [%d].", bReady ? 1 : 0); if (bReady) @@ -214,7 +216,11 @@ msg_error_t SmsPlgSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo) /* Check SIM is present or not */ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, }; snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pReqInfo->msgInfo.sim_idx); - MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName); + int tmpValue = 0; + if (MsgSettingGetInt(keyName, &tmpValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)tmpValue; if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { MSG_DEBUG("SIM is not present.."); @@ -253,7 +259,11 @@ msg_error_t SmsPlgSaveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_ char keyName[MAX_VCONFKEY_NAME_LEN]; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pMsgInfo->sim_idx); - MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName); + int tmpValue = 0; + if (MsgSettingGetInt(keyName, &tmpValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)tmpValue; if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { MSG_DEBUG("SIM is not present.."); @@ -281,7 +291,11 @@ msg_error_t SmsPlgDeleteSimMessage(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMs /* Check SIM is present or not */ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, }; snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, sim_idx); - MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName); + int tmpValue = 0; + if (MsgSettingGetInt(keyName, &tmpValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)tmpValue; if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { MSG_DEBUG("SIM is not present.."); @@ -307,7 +321,11 @@ msg_error_t SmsPlgSetReadStatus(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId /* Check SIM is present or not */ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, }; snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, sim_idx); - MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName); + int tmpValue = 0; + if (MsgSettingGetInt(keyName, &tmpValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)tmpValue; if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { MSG_DEBUG("SIM is not present.."); @@ -335,7 +353,11 @@ msg_error_t SmsPlgSetMemoryStatus(msg_sim_slot_id_t simIndex, msg_error_t Error) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, simIndex); - MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName); + int tmpValue = 0; + if (MsgSettingGetInt(keyName, &tmpValue) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)tmpValue; if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { MSG_DEBUG("SIM is not present.."); @@ -365,14 +387,6 @@ msg_error_t SmsPlgSetMemoryStatus(msg_sim_slot_id_t simIndex, msg_error_t Error) msg_error_t SmsPlgSetConfigData(const MSG_SETTING_S *pSetting) { - /* Check SIM is present or not */ - MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(MSG_SIM_CHANGED); - - if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { - MSG_DEBUG("SIM is not present.."); - return MSG_ERR_NO_SIM; - } - try { SmsPluginSetting::instance()->setConfigData(pSetting); } catch (MsgException& e) { @@ -389,14 +403,6 @@ msg_error_t SmsPlgSetConfigData(const MSG_SETTING_S *pSetting) msg_error_t SmsPlgGetConfigData(MSG_SETTING_S *pSetting) { - /* Check SIM is present or not */ - MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(MSG_SIM_CHANGED); - - if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { - MSG_DEBUG("SIM is not present.."); - return MSG_ERR_NO_SIM; - } - try { SmsPluginSetting::instance()->getConfigData(pSetting); } catch (MsgException& e) { diff --git a/plugin/sms_plugin/SmsPluginParamCodec.cpp b/plugin/sms_plugin/SmsPluginParamCodec.cpp index a3d7709..61e4641 100755 --- a/plugin/sms_plugin/SmsPluginParamCodec.cpp +++ b/plugin/sms_plugin/SmsPluginParamCodec.cpp @@ -515,7 +515,8 @@ time_t SmsPluginParamCodec::convertTime(const SMS_TIMESTAMP_S *time_stamp) MSG_DEBUG("timezone : %d", time_stamp->time.absolute.timeZone); char displayTime[32]; - struct tm * timeTM; + struct tm timeTM; + memset(&timeTM, 0x00, sizeof(tm)); struct tm timeinfo; memset(&timeinfo, 0x00, sizeof(tm)); @@ -541,9 +542,9 @@ time_t SmsPluginParamCodec::convertTime(const SMS_TIMESTAMP_S *time_stamp) rawtime -= (time_stamp->time.absolute.timeZone * (3600/4)); - timeTM = localtime(&rawtime); + localtime_r(&rawtime, &timeTM); memset(displayTime, 0x00, sizeof(displayTime)); - strftime(displayTime, 32, "%Y-%02m-%02d %T %z", timeTM); + strftime(displayTime, 32, "%Y-%02m-%02d %T %z", &timeTM); MSG_DEBUG("displayTime [%s]", displayTime); /* timezone value is tiemzone + daylight. So should not add daylight */ @@ -553,9 +554,10 @@ time_t SmsPluginParamCodec::convertTime(const SMS_TIMESTAMP_S *time_stamp) rawtime -= timezone; #endif - timeTM = localtime(&rawtime); + memset(&timeTM, 0x00, sizeof(tm)); + localtime_r(&rawtime, &timeTM); memset(displayTime, 0x00, sizeof(displayTime)); - strftime(displayTime, 32, "%Y-%02m-%02d %T %z", timeTM); + strftime(displayTime, 32, "%Y-%02m-%02d %T %z", &timeTM); MSG_DEBUG("displayTime [%s]", displayTime); } else { rawtime = time(NULL); diff --git a/plugin/sms_plugin/SmsPluginSetting.cpp b/plugin/sms_plugin/SmsPluginSetting.cpp index 76b7e2a..94ce647 100755 --- a/plugin/sms_plugin/SmsPluginSetting.cpp +++ b/plugin/sms_plugin/SmsPluginSetting.cpp @@ -264,7 +264,8 @@ void SmsPluginSetting::initConfigData(TapiHandle *handle) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", CB_RECEIVE, sim_idx); - MsgSettingGetBool(keyName, &bAPReceive); + if (MsgSettingGetBool(keyName, &bAPReceive) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); if (cbMsgOpt.bReceive == false && bAPReceive == false) { MSG_DEBUG("CB is off in CP and in AP. No need to send CB request to CP. "); @@ -307,7 +308,10 @@ void SmsPluginSetting::initConfigData(TapiHandle *handle) /*==================== Default Voice mail Setting ====================*/ memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_DEFAULT_NUMBER, sim_idx); - char *num = MsgSettingGetString(keyName); + char *num = NULL; + if (MsgSettingGetString(keyName, &num) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } if (num && num[0] != '\0') { MSG_DEBUG("Voicemail Default Number [%s]", num); @@ -326,7 +330,10 @@ void SmsPluginSetting::initConfigData(TapiHandle *handle) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, sim_idx); - char *voicemail = MsgSettingGetString(keyName); + char *voicemail = NULL; + if (MsgSettingGetString(keyName, &voicemail) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } if (!voicemail || voicemail[0] == '\0') { if (MsgSettingSetString(keyName, "") != MSG_SUCCESS) @@ -340,7 +347,10 @@ void SmsPluginSetting::initConfigData(TapiHandle *handle) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, sim_idx); - char *voiceNumber = MsgSettingGetString(keyName); + char *voiceNumber = NULL; + if (MsgSettingGetString(keyName, &voiceNumber) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } if (!voiceNumber || (voiceNumber && voiceNumber[0] == '\0')) { MSG_WARN("Voice Number is Empty!!"); @@ -365,7 +375,10 @@ void SmsPluginSetting::initConfigData(TapiHandle *handle) char keyName[MAX_VCONFKEY_NAME_LEN]; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_COUNT, sim_idx); - if ((mwiCnt = MsgSettingGetInt(keyName)) > 0) + if (MsgSettingGetInt(keyName, &mwiCnt) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + if (mwiCnt > 0) deliverVoiceMsgNoti(sim_idx, mwiCnt); } @@ -598,11 +611,16 @@ void SmsPluginSetting::getCbOpt(MSG_SETTING_S *pSetting, int simIndex) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", CB_RECEIVE, simIndex); - MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.bReceive); + if (MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.bReceive) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", CB_MAX_SIM_COUNT, simIndex); - pSetting->option.cbMsgOpt.maxSimCnt = MsgSettingGetInt(keyName); + int maxSimCnt = 0; + if (MsgSettingGetInt(keyName, &maxSimCnt) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + pSetting->option.cbMsgOpt.maxSimCnt = maxSimCnt; err = MsgStoGetCBChannelInfo(dbHandle, &pSetting->option.cbMsgOpt.channelData, simIndex); if (err != MSG_SUCCESS) @@ -612,7 +630,8 @@ void SmsPluginSetting::getCbOpt(MSG_SETTING_S *pSetting, int simIndex) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", CB_LANGUAGE, i); - MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.bLanguage[i]); + if (MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.bLanguage[i]) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); } } @@ -861,7 +880,11 @@ bool SmsPluginSetting::setCbConfig(const MSG_CBMSG_OPT_S *pCbOpt) memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, i); - simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName); + int tmpVal = 0; + if (MsgSettingGetInt(keyName, &tmpVal) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + simStatus = (MSG_SIM_STATUS_T)tmpVal; if (simStatus == MSG_SIM_STATUS_NOT_FOUND) { MSG_DEBUG("SIM %d is not present..", i); @@ -1884,7 +1907,9 @@ void SmsPluginSetting::deliverVoiceMsgNoti(int simIndex, int mwiCnt) char *voiceNum = NULL; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, simIndex); - voiceNum = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &voiceNum) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } if (voiceNum) { snprintf(msgInfo.addressList[0].addressVal, sizeof(msgInfo.addressList[0].addressVal), "%s", voiceNum); diff --git a/plugin/sms_plugin/SmsPluginSimMsg.cpp b/plugin/sms_plugin/SmsPluginSimMsg.cpp index b57fd8c..4bf3d01 100755 --- a/plugin/sms_plugin/SmsPluginSimMsg.cpp +++ b/plugin/sms_plugin/SmsPluginSimMsg.cpp @@ -287,8 +287,9 @@ msg_error_t SmsPluginSimMsg::saveSimMessage(const MSG_MESSAGE_INFO_S *pMsgInfo, char keyName[MAX_VCONFKEY_NAME_LEN]; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", SIM_USED_COUNT, pMsgInfo->sim_idx); - usedCnt = MsgSettingGetInt(keyName); - + if (MsgSettingGetInt(keyName, &usedCnt) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } usedCnt++; if (MsgSettingSetInt(keyName, usedCnt) != MSG_SUCCESS) @@ -480,10 +481,14 @@ void SmsPluginSimMsg::deleteSimMessage(msg_sim_slot_id_t sim_idx, msg_sim_id_t S char keyName[MAX_VCONFKEY_NAME_LEN]; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", SIM_USED_COUNT, sim_idx); - usedCnt = MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &usedCnt) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", SIM_TOTAL_COUNT, sim_idx); - totalCnt = MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &totalCnt) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (usedCnt == totalCnt) { tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE, NULL, NULL); @@ -514,10 +519,14 @@ bool SmsPluginSimMsg::checkSimMsgFull(msg_sim_slot_id_t sim_idx, unsigned int Se char keyName[MAX_VCONFKEY_NAME_LEN]; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", SIM_USED_COUNT, sim_idx); - usedCnt = MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &usedCnt) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", SIM_TOTAL_COUNT, sim_idx); - totalCnt = MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &totalCnt) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } MSG_DEBUG("Segment Count [%d]", SegCnt); MSG_DEBUG("usedCnt [%d], totalCnt [%d]", usedCnt, totalCnt); @@ -608,8 +617,6 @@ void SmsPluginSimMsg::setSmsOptions(const MSG_MESSAGE_INFO_S* pMsgInfo, SMS_DELI pDeliver->dcs.msgClass = SMS_MSG_CLASS_NONE; pDeliver->dcs.codingGroup = SMS_GROUP_GENERAL; - /* use encoding type of received message instead of message settings */ - /*pDeliver->dcs.codingScheme = (SMS_CODING_SCHEME_T)MsgSettingGetInt(SMS_SEND_DCS);*/ pDeliver->dcs.codingScheme = pMsgInfo->encodeType; MSG_DEBUG("DCS : %d", pDeliver->dcs.codingScheme); @@ -848,7 +855,9 @@ void SmsPluginSimMsg::setSaveClass2MsgEvent(TapiHandle *handle, int simId, int r char keyName[MAX_VCONFKEY_NAME_LEN]; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", SIM_USED_COUNT, pMsgInfo->sim_idx); - usedCnt = MsgSettingGetInt(keyName); + if (MsgSettingGetInt(keyName, &usedCnt) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } usedCnt++; if (MsgSettingSetInt(keyName, usedCnt) != MSG_SUCCESS) diff --git a/plugin/sms_plugin/SmsPluginStorage.cpp b/plugin/sms_plugin/SmsPluginStorage.cpp index 10b7aeb..546682b 100755 --- a/plugin/sms_plugin/SmsPluginStorage.cpp +++ b/plugin/sms_plugin/SmsPluginStorage.cpp @@ -800,10 +800,14 @@ msg_error_t SmsPluginStorage::addSmsSendOption(MSG_MESSAGE_INFO_S *pMsg, MSG_SEN msg_error_t err = MSG_SUCCESS; if (pSendOptInfo->bSetting == false) { - MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &pSendOptInfo->bDeliverReq); - MsgSettingGetBool(SMS_SEND_REPLY_PATH, &pSendOptInfo->option.smsSendOptInfo.bReplyPath); + if (MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &pSendOptInfo->bDeliverReq) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); - MsgSettingGetBool(MSG_KEEP_COPY, &pSendOptInfo->bKeepCopy); + if (MsgSettingGetBool(SMS_SEND_REPLY_PATH, &pSendOptInfo->option.smsSendOptInfo.bReplyPath) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetBool(MSG_KEEP_COPY, &pSendOptInfo->bKeepCopy) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); } MsgDbHandler *dbHandle = getDbHandle(); @@ -845,7 +849,8 @@ msg_error_t SmsPluginStorage::checkStorageStatus(MSG_MESSAGE_INFO_S *pMsgInfo) if (err == MSG_ERR_MESSAGE_COUNT_FULL) { bool bAutoErase = false; - MsgSettingGetBool(MSG_AUTO_ERASE, &bAutoErase); + if (MsgSettingGetBool(MSG_AUTO_ERASE, &bAutoErase) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); MSG_DEBUG("bAutoErase: %d", bAutoErase); diff --git a/plugin/sms_plugin/SmsPluginTransport.cpp b/plugin/sms_plugin/SmsPluginTransport.cpp index bdc976a..4db781d 100755 --- a/plugin/sms_plugin/SmsPluginTransport.cpp +++ b/plugin/sms_plugin/SmsPluginTransport.cpp @@ -109,7 +109,9 @@ void SmsPluginTransport::submitRequest(SMS_REQUEST_INFO_S *pReqInfo) char keyName[MAX_VCONFKEY_NAME_LEN]; memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, pReqInfo->msgInfo.sim_idx); - msisdn = MsgSettingGetString(keyName); + if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } for (int i = 0; i < pReqInfo->msgInfo.nAddressCnt; i++) { /* Make SMS_SUBMIT_DATA_S from MSG_REQUEST_INFO_S */ @@ -622,8 +624,11 @@ void SmsPluginTransport::getSmsSendOption(int simIndex, SMS_SUBMIT_S *pSubmit) pSubmit->bRejectDup = false; pSubmit->bHeaderInd = false; - MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &pSubmit->bStatusReport); - MsgSettingGetBool(SMS_SEND_REPLY_PATH, &pSubmit->bReplyPath); + if (MsgSettingGetBool(SMS_SEND_DELIVERY_REPORT, &pSubmit->bStatusReport) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + + if (MsgSettingGetBool(SMS_SEND_REPLY_PATH, &pSubmit->bReplyPath) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); pSubmit->msgRef = msgRef++; @@ -631,8 +636,11 @@ void SmsPluginTransport::getSmsSendOption(int simIndex, SMS_SUBMIT_S *pSubmit) pSubmit->dcs.msgClass = SMS_MSG_CLASS_NONE; pSubmit->dcs.codingGroup = SMS_GROUP_GENERAL; - pSubmit->dcs.codingScheme = (SMS_CODING_SCHEME_T)MsgSettingGetInt(SMS_SEND_DCS); - + int codingScheme = 0; + if (MsgSettingGetInt(SMS_SEND_DCS, &codingScheme) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } + pSubmit->dcs.codingScheme = (SMS_CODING_SCHEME_T)codingScheme; MSG_DEBUG("DCS : %d", pSubmit->dcs.codingScheme); MSG_SMSC_LIST_S smscList = {0, }; diff --git a/plugin/sms_plugin/SmsPluginWapPushHandler.cpp b/plugin/sms_plugin/SmsPluginWapPushHandler.cpp index 39056c1..f294bb9 100755 --- a/plugin/sms_plugin/SmsPluginWapPushHandler.cpp +++ b/plugin/sms_plugin/SmsPluginWapPushHandler.cpp @@ -939,7 +939,8 @@ void SmsPluginWapPushHandler::handleWapPushCallback(char* pPushHeader, char* pPu /** check Push message receive setting */ bool bPushRecv = false; - MsgSettingGetBool(PUSH_RECV_OPTION, &bPushRecv); + if (MsgSettingGetBool(PUSH_RECV_OPTION, &bPushRecv) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); if ((bPushRecv == false) && (appCode != SMS_WAP_APPLICATION_MMS_UA)) { MSG_DEBUG("Push Message Receive option is OFF. Drop Push Message."); @@ -1234,7 +1235,8 @@ void SmsPluginWapPushHandler::handleWapPushCallback(char* pPushHeader, char* pPu /* check Push message receive setting */ bool bPushRecv = false; int appcode = 0; - MsgSettingGetBool(PUSH_RECV_OPTION, &bPushRecv); + if (MsgSettingGetBool(PUSH_RECV_OPTION, &bPushRecv) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); storageHandler->getnthPushEvent(i, &appcode); MSG_DEBUG("pushEvt_cnt: %d, appcode: %d", pushEvt_cnt, appcode); diff --git a/proxy/MsgHandleControl.cpp b/proxy/MsgHandleControl.cpp index 323c3e4..6c24cf6 100755 --- a/proxy/MsgHandleControl.cpp +++ b/proxy/MsgHandleControl.cpp @@ -49,7 +49,8 @@ void MsgHandle::openHandle() MsgProxyListener::instance()->insertOpenHandleSet(this); /* server is currently booting and service is not available until the end of booting */ - MsgSettingGetBool(VCONFKEY_MSG_SERVER_READY, &bReady); + if (MsgSettingGetBool(VCONFKEY_MSG_SERVER_READY, &bReady) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); if (bReady == false) { THROW(MsgException::SERVER_READY_ERROR, "Msg Server is not ready !!!!!"); diff --git a/proxy/MsgProxyListener.cpp b/proxy/MsgProxyListener.cpp index f235c9f..9e60ef6 100755 --- a/proxy/MsgProxyListener.cpp +++ b/proxy/MsgProxyListener.cpp @@ -29,7 +29,9 @@ void MsgServerRestartCb(keynode_t *key, void* data) bool bReady = false; MSG_DEBUG("Message Service Running State Changed"); /* server is currently booting and service is not available until the end of booting */ - MsgSettingGetBool(VCONFKEY_MSG_SERVER_READY, &bReady); + if (MsgSettingGetBool(VCONFKEY_MSG_SERVER_READY, &bReady) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); + MSG_INFO("Message Service Running State Changed bReady:(%d)", bReady); /* bReady false indicates that server has restarted. Hence the proxylistener needs to be reset */ @@ -105,7 +107,16 @@ MsgProxyListener::MsgProxyListener() : running(0) { clearProxyCBLists(); clearOpenHandleSet(); - MsgSettingRegVconfCBCommon(VCONFKEY_MSG_SERVER_READY, MsgServerRestartCb); + + msg_error_t err = MSG_SUCCESS; + err = MsgSettingRegVconfCBCommon(VCONFKEY_MSG_SERVER_READY, MsgServerRestartCb); + if (err != MSG_SUCCESS) { + if (err == MSG_ERR_PERMISSION_DENIED) { + THROW(MsgException::SECURITY_ERROR, "It must have privilege to access vconf key"); + } else { + THROW(MsgException::SERVER_READY_ERROR, "vconf register fail"); + } + } channel = NULL; eventSourceId = 0; @@ -116,7 +127,16 @@ MsgProxyListener::~MsgProxyListener() { clearProxyCBLists(); clearOpenHandleSet(); - MsgSettingRemoveVconfCBCommon(VCONFKEY_MSG_SERVER_READY, MsgServerRestartCb); + + msg_error_t err = MSG_SUCCESS; + err = MsgSettingRemoveVconfCBCommon(VCONFKEY_MSG_SERVER_READY, MsgServerRestartCb); + if (err != MSG_SUCCESS) { + if (err == MSG_ERR_PERMISSION_DENIED) { + MSG_DEBUG("It must have privilege to access vconf key"); + } else { + MSG_DEBUG("vconf register fail"); + } + } } diff --git a/utils/MsgContact.cpp b/utils/MsgContact.cpp index db9783f..195d406 100755 --- a/utils/MsgContact.cpp +++ b/utils/MsgContact.cpp @@ -259,7 +259,9 @@ msg_error_t MsgCloseContactSvc() msg_error_t MsgInitContactSvc() { #ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED - phonenumberMinMatchDigit = MsgSettingGetInt(PHONENUMBER_MIN_MATCH_DIGIT); + if (MsgSettingGetInt(PHONENUMBER_MIN_MATCH_DIGIT, &phonenumberMinMatchDigit) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } MSG_DEBUG("phonenumberMinMatchDigit [%d]", phonenumberMinMatchDigit); if (phonenumberMinMatchDigit < 1) { @@ -850,11 +852,14 @@ bool checkBlockingMode(char *address, bool *pisFavorites) bool isBlockModeOn = false; bool isblock = true; - MsgSettingGetBool(VCONFKEY_SETAPPL_BLOCKINGMODE_NOTIFICATIONS, &isBlockModeOn); + if (MsgSettingGetBool(VCONFKEY_SETAPPL_BLOCKINGMODE_NOTIFICATIONS, &isBlockModeOn) != MSG_SUCCESS) + MSG_INFO("MsgSettingGetBool() is failed"); int blockModeType = -1; - blockModeType = MsgSettingGetInt(VCONFKEY_SETAPPL_BLOCKINGMODE_ALLOWED_CONTACT_TYPE); + if (MsgSettingGetInt(VCONFKEY_SETAPPL_BLOCKINGMODE_ALLOWED_CONTACT_TYPE, &blockModeType) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetInt() is failed"); + } if (!isBlockModeOn) isblock = false; @@ -948,7 +953,10 @@ bool checkBlockingMode(char *address, bool *pisFavorites) break; } case 3: { /* For Custom allow in blocking mode. */ - char *allowList = MsgSettingGetString(VCONFKEY_SETAPPL_BLOCKINGMODE_ALLOWED_CONTACT_LIST); + char *allowList = NULL; + if (MsgSettingGetString(VCONFKEY_SETAPPL_BLOCKINGMODE_ALLOWED_CONTACT_LIST, &allowList) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } char *temp = NULL; char *personIdStr = strtok_r(allowList, " ,", &temp); while (personIdStr != NULL) { diff --git a/utils/MsgGconfWrapper.cpp b/utils/MsgGconfWrapper.cpp index e3e621e..d839d56 100755 --- a/utils/MsgGconfWrapper.cpp +++ b/utils/MsgGconfWrapper.cpp @@ -21,14 +21,6 @@ #include "MsgGconfWrapper.h" #include "MsgException.h" -#ifdef USE_GCONF - -#define GCONF_SUCCESS 1 - -MSG_GOBJECT_CLIENT_S* pClient = NULL; - -#endif - int autoReject = 0; bool bUnknownAutoReject = false; @@ -45,13 +37,11 @@ msg_error_t MsgSettingSetString(const char *pKey, const char *pSetValue) return MSG_ERR_NULL_POINTER; } -#ifdef USE_GCONF - if (gconf_client_set_string((GConfClient*)pClient, pKey, pSetValue, NULL) != GCONF_SUCCESS) - return MSG_ERR_SET_SETTING; -#else - if (vconf_set_str(pKey, pSetValue) != 0) + if (vconf_set_str(pKey, pSetValue) != 0) { + int vconf_err = vconf_get_ext_errno(); + MSG_DEBUG("Fail to vconf_set_str with [%s], err=[%d]", pKey, vconf_err); return MSG_ERR_SET_SETTING; -#endif + } return MSG_SUCCESS; } @@ -64,13 +54,11 @@ msg_error_t MsgSettingSetInt(const char *pKey, int nSetValue) return MSG_ERR_NULL_POINTER; } -#ifdef USE_GCONF - if (gconf_client_set_int((GConfClient*)pClient, pKey, nSetValue, NULL) != GCONF_SUCCESS) + if (vconf_set_int(pKey, nSetValue) != 0) { + int vconf_err = vconf_get_ext_errno(); + MSG_DEBUG("Fail to vconf_set_int with [%s], err=[%d]", pKey, vconf_err); return MSG_ERR_SET_SETTING; -#else - if (vconf_set_int(pKey, nSetValue) != 0) - return MSG_ERR_SET_SETTING; -#endif + } return MSG_SUCCESS; } @@ -83,70 +71,87 @@ msg_error_t MsgSettingSetBool(const char *pKey, bool bSetValue) return MSG_ERR_NULL_POINTER; } -#ifdef USE_GCONF - if (gconf_client_set_bool((GConfClient*)pClient, pKey, bSetValue, NULL) != GCONF_SUCCESS) - return MSG_ERR_SET_SETTING; -#else - if (vconf_set_bool(pKey, bSetValue) != 0) + if (vconf_set_bool(pKey, bSetValue) != 0) { + int vconf_err = vconf_get_ext_errno(); + MSG_DEBUG("Fail to vconf_set_bool with [%s], err=[%d]", pKey, vconf_err); return MSG_ERR_SET_SETTING; -#endif + } return MSG_SUCCESS; } -char* MsgSettingGetString(const char *pKey) +msg_error_t MsgSettingGetString(const char *pKey, char **pVal) { if (pKey == NULL) { MSG_DEBUG("IN Parameter is NULL"); - return NULL; + return MSG_ERR_NULL_POINTER; } -#ifdef USE_GCONF - return gconf_client_get_string((GConfClient*)pClient, pKey, NULL); -#else - return vconf_get_str(pKey); -#endif + msg_error_t retVal = MSG_SUCCESS; + char *param = NULL; + + param = vconf_get_str(pKey); + if (param == NULL) { + int vconf_err = vconf_get_ext_errno(); + MSG_DEBUG("Fail to vconf_get_str with [%s], err=[%d]", pKey, vconf_err); + if (vconf_err == VCONF_ERROR_FILE_PERM) + retVal = MSG_ERR_PERMISSION_DENIED; + else + retVal = MSG_ERR_UNKNOWN; + } + + *pVal = param; + + return retVal; } -int MsgSettingGetInt(const char *pKey) +msg_error_t MsgSettingGetInt(const char *pKey, int *pVal) { if (pKey == NULL) { MSG_DEBUG("IN Parameter is NULL"); return -1; } - int retVal = 0; + msg_error_t retVal = MSG_SUCCESS; + int param = 0; -#ifdef USE_GCONF - retVal = gconf_client_get_int((GConfClient*)pClient, pKey, NULL); -#else - if (vconf_get_int(pKey, &retVal) < 0) - return -1; -#endif + if (vconf_get_int(pKey, ¶m) < 0) { + int vconf_err = vconf_get_ext_errno(); + MSG_DEBUG("Fail to vconf_get_int with [%s], err=[%d]", pKey, vconf_err); + if (vconf_err == VCONF_ERROR_FILE_PERM) + retVal = MSG_ERR_PERMISSION_DENIED; + else + retVal = MSG_ERR_UNKNOWN; + } + + *pVal = (int)param; return retVal; } -int MsgSettingGetBool(const char *pKey, bool *pVal) +msg_error_t MsgSettingGetBool(const char *pKey, bool *pVal) { if (pKey == NULL) { MSG_DEBUG("IN Parameter is NULL"); return -1; } - int retVal = 0, param = 0; + msg_error_t retVal = MSG_SUCCESS; + int param = 0; -#ifdef USE_GCONF - *pVal = gconf_client_get_bool((GConfClient*)pClient, pKey, NULL); -#else - if (vconf_get_bool(pKey, ¶m) < 0) - return -1; -#endif + if (vconf_get_bool(pKey, ¶m) < 0) { + int vconf_err = vconf_get_ext_errno(); + MSG_DEBUG("Fail to vconf_get_bool with [%s], err=[%d]", pKey, vconf_err); + if (vconf_err == VCONF_ERROR_FILE_PERM) + retVal = MSG_ERR_PERMISSION_DENIED; + else + retVal = MSG_ERR_UNKNOWN; + } - *pVal = (bool)param; + *pVal = (bool)param; return retVal; } @@ -208,20 +213,38 @@ bool MsgSettingGetUnknownAutoReject() return bUnknownAutoReject; } -void MsgSettingRegVconfCBCommon(const char *pKey, _vconf_change_cb pCb) +msg_error_t MsgSettingRegVconfCBCommon(const char *pKey, _vconf_change_cb pCb) { + msg_error_t err = MSG_SUCCESS; + if (vconf_notify_key_changed(pKey, pCb, NULL) < 0) { - MSG_DEBUG("Fail to regist vconf CB with [%s]", pKey); + int vconf_err = vconf_get_ext_errno(); + MSG_DEBUG("Fail to regist vconf CB with [%s], err=[%d]", pKey, vconf_err); + if (vconf_err == VCONF_ERROR_FILE_PERM) + err = MSG_ERR_PERMISSION_DENIED; + else + err = MSG_ERR_UNKNOWN; } else { MSG_DEBUG("Success to regist vconf CB with [%s]", pKey); } + + return err; } -void MsgSettingRemoveVconfCBCommon(const char *pKey, _vconf_change_cb pCb) +msg_error_t MsgSettingRemoveVconfCBCommon(const char *pKey, _vconf_change_cb pCb) { + msg_error_t err = MSG_SUCCESS; + if (vconf_ignore_key_changed(pKey, pCb) < 0) { - MSG_DEBUG("Fail to remove vconf CB with [%s]", pKey); + int vconf_err = vconf_get_ext_errno(); + MSG_DEBUG("Fail to remove vconf CB with [%s], err=[%d]", pKey, vconf_err); + if (vconf_err == VCONF_ERROR_FILE_PERM) + err = MSG_ERR_PERMISSION_DENIED; + else + err = MSG_ERR_UNKNOWN; } else { MSG_DEBUG("Success to remove vconf CB with [%s]", pKey); } + + return err; } diff --git a/utils/MsgUtilFile.cpp b/utils/MsgUtilFile.cpp index acd6d85..3c9c9f8 100755 --- a/utils/MsgUtilFile.cpp +++ b/utils/MsgUtilFile.cpp @@ -1279,7 +1279,7 @@ bool MsgAclInit() acl = acl_from_text(priv_read); if (!acl) { - MSG_ERR("%s: `%s': %s\n", MSG_IPC_DATA_PATH, priv_read, strerror(errno)); + MSG_ERR("%s: `%s': %s\n", MSG_IPC_DATA_PATH, priv_read, g_strerror(errno)); return false; } @@ -1296,7 +1296,7 @@ bool MsgAclInit() ret = acl_set_file((const char *)MSG_IPC_DATA_PATH, ACL_TYPE_ACCESS, acl); if (ret != 0) { - MSG_ERR("acl_set_file Fail : [%d][%s]", ret, strerror(errno)); + MSG_ERR("acl_set_file Fail : [%d][%s]", ret, g_strerror(errno)); } acl_free(acl); diff --git a/utils/MsgUtilStorage.cpp b/utils/MsgUtilStorage.cpp index ad2e9ae..5646e0b 100755 --- a/utils/MsgUtilStorage.cpp +++ b/utils/MsgUtilStorage.cpp @@ -71,7 +71,10 @@ unsigned int MsgStoAddMessageTable(MsgDbHandler *pDbHandle, const MSG_MESSAGE_IN memset(keyName, 0x00, sizeof(keyName)); snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_SUBS_ID, pMsgInfo->sim_idx); - char *imsi = MsgSettingGetString(keyName); + char *imsi = NULL; + if (MsgSettingGetString(keyName, &imsi) != MSG_SUCCESS) { + MSG_INFO("MsgSettingGetString() is failed"); + } /* Add Message */ char sqlQuery[MAX_QUERY_LEN+1];