diff options
author | seunggi.hong <seunggi.hong@samsung.com> | 2015-07-02 10:14:04 +0900 |
---|---|---|
committer | seunggi.hong <seunggi.hong@samsung.com> | 2015-07-02 19:02:46 +0900 |
commit | 7c25f680b3ce306040f174215ca8fb94b6935d23 (patch) | |
tree | 2dd3dacadc8ba0c41a9ccaae9c2c33683da39ca1 /externals | |
parent | 0859ffeb3761c4a30f028e13f0af22088736df7b (diff) | |
download | msg-service-7c25f680b3ce306040f174215ca8fb94b6935d23.tar.gz msg-service-7c25f680b3ce306040f174215ca8fb94b6935d23.tar.bz2 msg-service-7c25f680b3ce306040f174215ca8fb94b6935d23.zip |
3.0 Migration
Change-Id: I7938878d56d94bb1152c05343cd420d10d6cd086
Diffstat (limited to 'externals')
-rwxr-xr-x | externals/CMakeLists.txt | 6 | ||||
-rwxr-xr-x | externals/MsgNotificationWrapper.cpp | 93 | ||||
-rwxr-xr-x | externals/MsgSoundPlayer.cpp | 9 | ||||
-rwxr-xr-x | externals/MsgSpamFilter.cpp | 8 |
4 files changed, 63 insertions, 53 deletions
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index d2773e7..326fbb2 100755 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -8,7 +8,7 @@ IF("${CMAKE_BUILD_TYPE}" STREQUAL "") ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") -SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -O0 -g -Wall") +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -O2 -g -Wall") ########################################################## # Define Framework Utils @@ -18,7 +18,7 @@ SET(EXTERNALS-SRCS ${CMAKE_SOURCE_DIR}/externals/MsgSoundPlayer.cpp ${CMAKE_SOURCE_DIR}/externals/MsgNotificationWrapper.cpp ${CMAKE_SOURCE_DIR}/externals/MsgSpamFilter.cpp -# ${CMAKE_SOURCE_DIR}/externals/MsgLbs.cpp + ${CMAKE_SOURCE_DIR}/externals/MsgLbs.cpp ${CMAKE_SOURCE_DIR}/externals/MsgSensorWrapper.cpp ${CMAKE_SOURCE_DIR}/externals/MsgAlarm.cpp ${CMAKE_SOURCE_DIR}/externals/MsgDevicedWrapper.cpp @@ -43,7 +43,7 @@ ADD_DEFINITIONS("-DFEATURE_JAVA_MMS") IF(_TIZEN_I586_ENABLED) ADD_DEFINITIONS("-DTIZEN_I586_ENABLED") ENDIF(_TIZEN_I586_ENABLED) -SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}") SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") diff --git a/externals/MsgNotificationWrapper.cpp b/externals/MsgNotificationWrapper.cpp index 64ac709..be0baa7 100755 --- a/externals/MsgNotificationWrapper.cpp +++ b/externals/MsgNotificationWrapper.cpp @@ -34,12 +34,14 @@ extern "C" { +#include <bundle_internal.h> +#include <app_control_internal.h> #ifndef MSG_WEARABLE_PROFILE -#include <app_control.h> -#include <notification.h> +#include <notification_list.h> +#include <notification_text_domain.h> #include <notification_internal.h> #include <feedback.h> -#include <badge.h> +#include <badge_internal.h> #endif // MSG_WEARABLE_PROFILE } @@ -337,6 +339,7 @@ msg_error_t MsgDeleteReportNotification(const char *addr) msg_error_t MsgAddReportNotification(msg_notification_type_t noti_type, MSG_MESSAGE_INFO_S *msg_info) { msg_error_t msg_err = MSG_SUCCESS; + #ifndef MSG_WEARABLE_PROFILE notification_h noti_h = NULL; @@ -375,10 +378,11 @@ msg_error_t MsgRefreshNotification(msg_notification_type_t noti_type, bool bFeed { msg_error_t msg_err = MSG_SUCCESS; + #ifndef MSG_WEARABLE_PROFILE notification_h noti_h = NULL; bool bNotification = true; - bool bReplyPopup = false; +// bool bReplyPopup = false; MSG_NOTI_INFO_S noti_info; memset(¬i_info, 0x00, sizeof(MSG_NOTI_INFO_S)); @@ -409,7 +413,7 @@ msg_error_t MsgRefreshNotification(msg_notification_type_t noti_type, bool bFeed if (bNotification == false) { MSG_DEBUG("Msg Alert notification is off."); - return msg_err; + goto __END_OF_REFRESH_NOTI; } createInfoData(¬i_info, bTicker); @@ -424,6 +428,7 @@ msg_error_t MsgRefreshNotification(msg_notification_type_t noti_type, bool bFeed setNotification(noti_h, ¬i_info, bFeedback); +#if 0 if (MsgSettingGetBool(VCONFKEY_MESSAGE_POPUP_DISPLAY_ENABLE , &bReplyPopup) != MSG_SUCCESS) { MSG_DEBUG("MsgSettingGetBool is failed."); } @@ -432,6 +437,7 @@ msg_error_t MsgRefreshNotification(msg_notification_type_t noti_type, bool bFeed MSG_DEBUG("Msg reply popup is on."); sendMsgReplyPopup(¬i_info); } +#endif __END_OF_REFRESH_NOTI : clearInfoData(noti_h, ¬i_info); @@ -443,6 +449,7 @@ __END_OF_REFRESH_NOTI : msg_error_t MsgAddNotification(msg_notification_type_t noti_type, MSG_MESSAGE_INFO_S *msg_info) { msg_error_t msg_err = MSG_SUCCESS; + #ifndef MSG_WEARABLE_PROFILE notification_h noti_h = NULL; @@ -550,7 +557,7 @@ bool isExistAddressInReportTable(const char *addr) memset(sqlQuery, 0x00, sizeof(sqlQuery)); snprintf(sqlQuery, sizeof(sqlQuery), "SELECT * FROM %s WHERE ADDRESS_VAL LIKE '%%%%%s'", MSGFW_SMS_REPORT_TABLE_NAME, normalAddr); - if (dbHandle->getTable(sqlQuery, &rowCnt) == MSG_SUCCESS) { + if (dbHandle->getTable(sqlQuery, &rowCnt, NULL) == MSG_SUCCESS) { dbHandle->freeTable(); return true; } @@ -559,7 +566,7 @@ bool isExistAddressInReportTable(const char *addr) memset(sqlQuery, 0x00, sizeof(sqlQuery)); snprintf(sqlQuery, sizeof(sqlQuery), "SELECT * FROM %s WHERE ADDRESS_VAL LIKE '%%%%%s'", MSGFW_REPORT_TABLE_NAME, normalAddr); - if (dbHandle->getTable(sqlQuery, &rowCnt) == MSG_SUCCESS) { + if (dbHandle->getTable(sqlQuery, &rowCnt, NULL) == MSG_SUCCESS) { dbHandle->freeTable(); return true; } @@ -573,6 +580,7 @@ bool isExistAddressInReportTable(const char *addr) void MsgInitReportNotiList() { MSG_BEGIN(); + #ifndef MSG_WEARABLE_PROFILE msg_report_notification_list = NULL; @@ -647,9 +655,10 @@ msg_error_t MsgInitNoti() MSG_DEBUG("Notification server is not available. Init is defered"); #ifndef MSG_NOTI_INTEGRATION MSG_NOTI_INFO_S *delNotiInfo = (MSG_NOTI_INFO_S *)calloc(1, sizeof(MSG_NOTI_INFO_S)); - delNotiInfo->type = MSG_NOTI_TYPE_SIM; - delNotiInfo->sim_idx = -1; - + if (delNotiInfo) { + delNotiInfo->type = MSG_NOTI_TYPE_SIM; + delNotiInfo->sim_idx = -1; + } notification_add_deferred_task(MsgDeleteNotiCb, (void *)delNotiInfo); #endif notification_add_deferred_task(MsgRefreshNotiCb, (void *)NULL); @@ -667,8 +676,10 @@ msg_error_t MsgDeleteNoti(msg_notification_type_t noti_type, int simIndex) MSG_NOTI_INFO_S *delNotiInfo = (MSG_NOTI_INFO_S *)calloc(1, sizeof(MSG_NOTI_INFO_S)); - delNotiInfo->type = noti_type; - delNotiInfo->sim_idx = simIndex; + if (delNotiInfo) { + delNotiInfo->type = noti_type; + delNotiInfo->sim_idx = simIndex; + } bNotiSvcReady = notification_is_service_ready(); @@ -758,7 +769,7 @@ msg_error_t MsgInsertBadge(unsigned int unreadMsgCnt) if (!exist) { /* create badge */ - err = badge_new(MSG_DEFAULT_APP_ID); + err = badge_create(MSG_DEFAULT_APP_ID, "/usr/bin/msg-server"); if (err != BADGE_ERROR_NONE) { MSG_DEBUG("Fail to badge_new : %d", err); return MSG_ERR_UNKNOWN; @@ -971,11 +982,12 @@ void createInfoData(MSG_NOTI_INFO_S *noti_info, bool bTicker) addServiceExtraData(noti_info->svc_h, "msgId", noti_info->msg_id); addServiceExtraData(noti_info->svc_h, "http://tizen.org/appcontrol/data/notification", "new_message"); +#if 0 bool bReplyPopup = false; if (MsgSettingGetBool(VCONFKEY_MESSAGE_POPUP_DISPLAY_ENABLE , &bReplyPopup) != MSG_SUCCESS) { MSG_DEBUG("MsgSettingGetBool is failed."); } - +#endif noti_info->applist = NOTIFICATION_DISPLAY_APP_ALL^NOTIFICATION_DISPLAY_APP_TICKER; } break; @@ -1099,15 +1111,12 @@ void createInfoData(MSG_NOTI_INFO_S *noti_info, MSG_MESSAGE_INFO_S *msg_info) if (dialNumber && strlen(dialNumber) > 0) snprintf(noti_info->number, sizeof(noti_info->number), "%s", dialNumber); - setServiceAppId(noti_info->svc_h, "org.tizen.call"); - - addServiceExtraData(noti_info->svc_h, "launch-type", "MO"); - - addServiceExtraData(noti_info->svc_h, "number", "VOICEMAIL"); - - char slot_id[5] = {0,}; - snprintf(slot_id, sizeof(slot_id), "%d", msg_info->sim_idx - 1); - addServiceExtraData(noti_info->svc_h, "slot_id", slot_id); + if (noti_info->svc_h) { + char telnum[256] = {0,}; + app_control_set_operation(noti_info->svc_h, APP_CONTROL_OPERATION_CALL); + snprintf(telnum, sizeof(telnum), "tel:%s", noti_info->number); + app_control_set_uri(noti_info->svc_h, telnum); + } MSG_FREE(voiceNumber); MSG_FREE(voiceAlphaId); @@ -1131,13 +1140,12 @@ void createInfoData(MSG_NOTI_INFO_S *noti_info, MSG_MESSAGE_INFO_S *msg_info) snprintf(noti_info->text, sizeof(noti_info->text), "%s", msg_info->msgText); if (noti_info->type == MSG_NOTI_TYPE_MWI) { - setServiceAppId(noti_info->svc_h, "org.tizen.call"); - addServiceExtraData(noti_info->svc_h, "launch-type", "MO"); - addServiceExtraData(noti_info->svc_h, "number", "VOICEMAIL"); - - char slot_id[5] = {0,}; - snprintf(slot_id, sizeof(slot_id), "%d", msg_info->sim_idx - 1); - addServiceExtraData(noti_info->svc_h, "slot_id", slot_id); + if (noti_info->svc_h) { + char telnum[256] = {0,}; + app_control_set_operation(noti_info->svc_h, APP_CONTROL_OPERATION_CALL); + snprintf(telnum, sizeof(telnum), "tel:%s", noti_info->number); + app_control_set_uri(noti_info->svc_h, telnum); + } } else { setServiceAppId(noti_info->svc_h, "org.tizen.msg-ui-class0"); @@ -1789,20 +1797,24 @@ msg_error_t MsgInsertInstantMessage(msg_notification_type_t noti_type) break; } - notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_TICKER); - notification_post(noti); + if (notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_TICKER) != NOTIFICATION_ERROR_NONE) + MSG_DEBUG("Fail to notification_set_display_applist"); + + if (notification_post(noti) != NOTIFICATION_ERROR_NONE) + MSG_DEBUG("Fail to notification_post"); _END_OF_INSTANT_NOTI: - notification_delete(noti); - + if (notification_delete(noti) != NOTIFICATION_ERROR_NONE) + MSG_DEBUG("Fail to notification_delete"); if (notiMsg) { free(notiMsg); notiMsg = NULL; } if (noti) { - notification_free(noti); + if (notification_free(noti) != NOTIFICATION_ERROR_NONE) + MSG_DEBUG("Fail to notification_free"); noti = NULL; } @@ -1867,7 +1879,7 @@ void setSoundAndVibration(notification_h noti_h, char *addressVal, bool bVoiceMa } char *msg_tone_file_path = NULL; - AutoPtr<char> buf(&msg_tone_file_path); + unique_ptr<char*, void(*)(char**)> buf(&msg_tone_file_path, unique_ptr_deleter); MsgSoundPlayer::instance()->MsgGetRingtonePath(contactInfo.alerttonePath, &msg_tone_file_path); @@ -1895,7 +1907,7 @@ void setSoundAndVibration(notification_h noti_h, char *addressVal, bool bVoiceMa setNotiSound(noti_h, NOTIFICATION_SOUND_TYPE_DEFAULT, NULL); #ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED } -#endif +#endif // MSG_CONTACTS_SERVICE_NOT_SUPPORTED } else { setNotiSound(noti_h, NOTIFICATION_SOUND_TYPE_NONE, NULL); } @@ -2023,10 +2035,9 @@ msg_error_t getLatestMsgInfo(MSG_NOTI_INFO_S *noti_info, bool isForInstantMessag #endif MSG_DEBUG("sqlQuery [%s]", sqlQuery); - int rowCnt = 0; - int index = 2; + int rowCnt = 0, index = 0; - msg_err = dbhandler->getTable(sqlQuery, &rowCnt); + msg_err = dbhandler->getTable(sqlQuery, &rowCnt, &index); MSG_DEBUG("getTable() ret=[%d], rowCnt=[%d]", msg_err, rowCnt); //contacts-service is not used for gear @@ -2307,7 +2318,7 @@ msg_error_t getLatestMsgInfo(MSG_NOTI_INFO_S *noti_info, bool isForInstantMessag dbhandler->finalizeQuery(); - if (dbhandler->getTable(sqlQuery, ¬i_info->count) != MSG_SUCCESS) { + if (dbhandler->getTable(sqlQuery, ¬i_info->count, NULL) != MSG_SUCCESS) { MSG_DEBUG("getTable is failed"); dbhandler->freeTable(); return MSG_ERR_DB_GETTABLE; diff --git a/externals/MsgSoundPlayer.cpp b/externals/MsgSoundPlayer.cpp index e9b14e1..254570e 100755 --- a/externals/MsgSoundPlayer.cpp +++ b/externals/MsgSoundPlayer.cpp @@ -113,11 +113,10 @@ void MsgSensorCBStop() // return FALSE; //} +#ifndef MSG_WEARABLE_PROFILE static int MsgSoundPlayCallback(int message, void *param, void *user_param) { - -#ifndef MSG_WEARABLE_PROFILE switch (message) { case MM_MESSAGE_BEGIN_OF_STREAM: @@ -140,11 +139,11 @@ static int MsgSoundPlayCallback(int message, void *param, void *user_param) break; } -#endif // MSG_WEARABLE_PROFILE - return 1; } +#endif // MSG_WEARABLE_PROFILE + /*================================================================================================== IMPLEMENTATION OF MsgSoundPlayer - Member Functions ==================================================================================================*/ @@ -449,7 +448,7 @@ void MsgSoundPlayer::MsgSoundPlayStart(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_ #endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED /* get ringtone file path */ char *msg_tone_file_path = NULL; - AutoPtr<char> buf(&msg_tone_file_path); + unique_ptr<char*, void(*)(char**)> buf(&msg_tone_file_path, unique_ptr_deleter); if (soundType == MSG_SOUND_PLAY_EMERGENCY) { msg_tone_file_path = new char[MAX_SOUND_FILE_LEN+1]; diff --git a/externals/MsgSpamFilter.cpp b/externals/MsgSpamFilter.cpp index 86900c7..ec47690 100755 --- a/externals/MsgSpamFilter.cpp +++ b/externals/MsgSpamFilter.cpp @@ -101,7 +101,7 @@ bool MsgCheckFilter(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S *pMsgInfo) MSGFW_FILTER_TABLE_NAME, MSG_FILTER_BY_ADDRESS_INCLUDE, pMsgInfo->addressList[0].addressVal, MSGFW_FILTER_TABLE_NAME, MSG_FILTER_BY_ADDRESS_END, pMsgInfo->addressList[0].addressVal); - err = pDbHandle->getTable(sqlQuery, &rowCnt); + err = pDbHandle->getTable(sqlQuery, &rowCnt, NULL); if (rowCnt > 0) { MSG_SEC_DEBUG("Msg is Filtered by Address : [%s]", pMsgInfo->addressList[0].addressVal); @@ -124,7 +124,7 @@ bool MsgCheckFilter(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S *pMsgInfo) rowCnt = 0; - err = pDbHandle->getTable(sqlQuery, &rowCnt); + err = pDbHandle->getTable(sqlQuery, &rowCnt, NULL); if (err != MSG_SUCCESS) { MSG_DEBUG("Fail to getTable()."); @@ -135,7 +135,7 @@ bool MsgCheckFilter(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S *pMsgInfo) char filterValue[MAX_FILTER_VALUE_LEN+1]; char* pData = NULL; - AutoPtr<char> buf(&pData); + unique_ptr<char*, void(*)(char**)> buf(&pData, unique_ptr_deleter); int fileSize = 0; bool bFiltered = false; @@ -281,7 +281,7 @@ bool MsgCheckFilterByWord(MsgDbHandler *pDbHandle, const char *pMsgText) snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILTER_VALUE FROM %s WHERE FILTER_TYPE = %d;", MSGFW_FILTER_TABLE_NAME, MSG_FILTER_BY_WORD); - err = pDbHandle->getTable(sqlQuery, &rowCnt); + err = pDbHandle->getTable(sqlQuery, &rowCnt, NULL); if (err != MSG_SUCCESS) { MSG_DEBUG("Fail to getTable()."); |