From: Kyeonghun Lee Date: Tue, 5 Apr 2016 07:26:01 +0000 (+0900) Subject: replace some deprecated APIs with public APIs X-Git-Tag: submit/tizen/20160406.043211~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d35fe7a1ed2cd493b8f00966bdd49c69d936ba46;p=platform%2Fcore%2Fmessaging%2Fmsg-service.git replace some deprecated APIs with public APIs Change-Id: If820f3f0acd0b3ffa12db6a663b86342135adb49 Signed-off-by: Kyeonghun Lee --- diff --git a/externals/MsgNotificationWrapper.cpp b/externals/MsgNotificationWrapper.cpp index a6b5d6d..fd6921a 100755 --- a/externals/MsgNotificationWrapper.cpp +++ b/externals/MsgNotificationWrapper.cpp @@ -377,7 +377,7 @@ void MsgDeleteNotification(msg_notification_type_t noti_type, int simIndex) int noti_err = NOTIFICATION_ERROR_NONE; if (noti_type == MSG_NOTI_TYPE_ALL) { - noti_err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI); + noti_err = notification_delete_all(NOTIFICATION_TYPE_NOTI); } else if (noti_type == MSG_NOTI_TYPE_VOICE_1 || noti_type == MSG_NOTI_TYPE_VOICE_2 || noti_type == MSG_NOTI_TYPE_SIM) { int notiId = 0; @@ -392,7 +392,7 @@ void MsgDeleteNotification(msg_notification_type_t noti_type, int simIndex) } if (noti_err != NOTIFICATION_ERROR_NONE) { - MSG_DEBUG("Fail to notification_delete_all_by_type noti_err [%d]", noti_err); + MSG_DEBUG("Fail to notification_delete_all noti_err [%d]", noti_err); } updatePrivId(noti_type, 0, simIndex); diff --git a/manager/CMakeLists.txt b/manager/CMakeLists.txt index 7dcf195..0ad7195 100755 --- a/manager/CMakeLists.txt +++ b/manager/CMakeLists.txt @@ -31,7 +31,7 @@ INCLUDE_DIRECTORIES( ) INCLUDE(FindPkgConfig) -pkg_check_modules(mgr_pkgs REQUIRED glib-2.0 dlog alarm-service appcore-agent badge bundle callmgr_client contacts-service2 capi-appfw-application capi-appfw-package-manager notification vconf feedback capi-media-player capi-media-sound-manager) +pkg_check_modules(mgr_pkgs REQUIRED glib-2.0 dlog alarm-service appcore-agent badge callmgr_client contacts-service2 capi-appfw-application capi-appfw-package-manager notification vconf feedback capi-media-player capi-media-sound-manager) INCLUDE_DIRECTORIES(${mgr_pkgs_INCLUDE_DIRS}) LINK_DIRECTORIES(${mgr_pkgs_LIBRARY_DIRS}) diff --git a/manager/src/msg-manager-notification.cpp b/manager/src/msg-manager-notification.cpp index 3bac497..b92f1ed 100644 --- a/manager/src/msg-manager-notification.cpp +++ b/manager/src/msg-manager-notification.cpp @@ -26,9 +26,8 @@ #include #include -#include +#include #include -#include #include #include #include @@ -233,7 +232,7 @@ void MsgMgrInitReportNotiList() notification_list_h noti_list = NULL; notification_list_h head_noti_list = NULL; int noti_err = NOTIFICATION_ERROR_NONE; - bundle *b = NULL; + app_control_h app_control = NULL; noti_err = notification_get_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list); if (noti_err != NOTIFICATION_ERROR_NONE) { @@ -249,26 +248,29 @@ void MsgMgrInitReportNotiList() char tempAddr[MAX_ADDRESS_VAL_LEN+1]; memset(tempAddr, 0x00, sizeof(tempAddr)); - noti_err = notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, &b); + noti_err = notification_get_launch_option(noti, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, &app_control); if (noti_err != NOTIFICATION_ERROR_NONE) { MSG_MGR_DEBUG("notification_get_excute_option() failed!!"); break; } - char *bundle_addr = NULL; + char *addr = NULL; - int ret = bundle_get_str(b, "address", &bundle_addr); - if (ret == BUNDLE_ERROR_NONE && bundle_addr != NULL) { - if (isExistAddressInReportTable(bundle_addr)) { + int ret = app_control_get_extra_data(app_control, "address", &addr); + if (ret == APP_CONTROL_ERROR_NONE && addr != NULL) { + if (isExistAddressInReportTable(addr)) { report_notification_s *info = new report_notification_s; memset(info, 0x00, sizeof(report_notification_s)); notification_get_id(noti, NULL, &(info->priv_id)); - snprintf(info->addressVal, sizeof(info->addressVal), "%s", bundle_addr); + snprintf(info->addressVal, sizeof(info->addressVal), "%s", addr); msg_report_notification_list = g_list_append(msg_report_notification_list, (void *)info); MSG_MGR_SEC_DEBUG("appended list data = [priv_id = %d address = %s]", info->priv_id, info->addressVal); } + + g_free(addr); + addr = NULL; } noti_list = notification_list_get_next(noti_list); @@ -611,31 +613,17 @@ void setProperty(notification_h noti_h, MSG_MGR_NOTI_INFO_S *noti_info) MSG_MGR_DEBUG("Fail to notification_set_led."); } - /* set execute option */ - bundle *bundle_data = NULL; - bundle *reply_msg = NULL; - - app_control_to_bundle(noti_info->svc_h, &bundle_data); - - if (bundle_data == NULL) { - MSG_MGR_DEBUG("bundle is NULL"); - } - /* set execute option and property */ switch (noti_info->type) { case MSG_MGR_NOTI_TYPE_NORMAL: { if (noti_info->count > 1) { - notification_set_execute_option(noti_h, NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH, NULL, NULL, bundle_data); - notification_set_execute_option(noti_h, NOTIFICATION_EXECUTE_TYPE_RESPONDING, NULL, NULL, NULL); + notification_set_launch_option(noti_h, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, noti_info->svc_h); } else { if (noti_info->svc_h) { /* overwrite bundle key "type" */ /* addServiceExtraData(noti_info->svc_h, "type", "reply"); */ addServiceExtraData(noti_info->svc_h, "show_list", "list_show"); - - app_control_to_bundle(noti_info->svc_h, &reply_msg); } - notification_set_execute_option(noti_h, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, bundle_data); - notification_set_execute_option(noti_h, NOTIFICATION_EXECUTE_TYPE_RESPONDING, NULL, NULL, reply_msg); + notification_set_launch_option(noti_h, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, noti_info->svc_h); } notification_set_property(noti_h, NOTIFICATION_PROP_DISABLE_AUTO_DELETE); @@ -643,22 +631,17 @@ void setProperty(notification_h noti_h, MSG_MGR_NOTI_INFO_S *noti_info) } case MSG_MGR_NOTI_TYPE_CB: case MSG_MGR_NOTI_TYPE_SIM: { - if (noti_info->count > 1) { - notification_set_execute_option(noti_h, NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH, NULL, NULL, bundle_data); - } else { - notification_set_execute_option(noti_h, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, bundle_data); - } - + notification_set_launch_option(noti_h, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, noti_info->svc_h); notification_set_property(noti_h, NOTIFICATION_PROP_DISABLE_AUTO_DELETE|NOTIFICATION_PROP_VOLATILE_DISPLAY); break; } case MSG_MGR_NOTI_TYPE_FAILED: { - notification_set_execute_option(noti_h, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, bundle_data); + notification_set_launch_option(noti_h, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, noti_info->svc_h); notification_set_property(noti_h, NOTIFICATION_PROP_DISABLE_AUTO_DELETE); break; } case MSG_MGR_NOTI_TYPE_SIM_FULL: { - notification_set_execute_option(noti_h, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, bundle_data); + notification_set_launch_option(noti_h, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, noti_info->svc_h); break; } case MSG_MGR_NOTI_TYPE_VOICE_1: @@ -668,11 +651,11 @@ void setProperty(notification_h noti_h, MSG_MGR_NOTI_INFO_S *noti_info) case MSG_MGR_NOTI_TYPE_SMS_DELIVERY_REPORT: case MSG_MGR_NOTI_TYPE_MMS_READ_REPORT: case MSG_MGR_NOTI_TYPE_MMS_DELIVERY_REPORT: { - notification_set_execute_option(noti_h, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, bundle_data); + notification_set_launch_option(noti_h, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, noti_info->svc_h); break; } default: - MSG_MGR_DEBUG("No matching type for notification_set_execute_option() [%d]", noti_info->type); + MSG_MGR_DEBUG("No matching type for notification_set_launch_option() [%d]", noti_info->type); break; } diff --git a/manager/src/msg-manager.cpp b/manager/src/msg-manager.cpp index d054016..19c7629 100644 --- a/manager/src/msg-manager.cpp +++ b/manager/src/msg-manager.cpp @@ -7,7 +7,6 @@ extern "C" #include #include #include -#include #include #include #include