From: Kyeonghun Lee Date: Tue, 4 Oct 2016 10:02:38 +0000 (+0900) Subject: resolve TSAM-8527: refresh notification condition check error fixed X-Git-Tag: submit/tizen/20161005.053629^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a812729f7f8a02bfcabd18aa60550ff354e38597;p=platform%2Fcore%2Fmessaging%2Fmsg-service.git resolve TSAM-8527: refresh notification condition check error fixed Change-Id: I748f636e524c2d0095fc6debbfeca6bd69d349d1 --- diff --git a/externals/MsgNotificationWrapper.cpp b/externals/MsgNotificationWrapper.cpp index e3eff0b..bfeb8f0 100755 --- a/externals/MsgNotificationWrapper.cpp +++ b/externals/MsgNotificationWrapper.cpp @@ -450,7 +450,13 @@ msg_error_t MsgInsertTicker(const char* pTickerMsg, const char* pLocaleTickerMsg } -void MsgInitMsgMgr() +void MsgBootMsgMgr() { - msg_launch_app(MSG_MGR_APP_ID, NULL); + bundle *bundle_data = bundle_create(); + + bundle_add_str(bundle_data, "cmd", "on_boot"); + + msg_launch_app(MSG_MGR_APP_ID, bundle_data); + + bundle_free(bundle_data); } diff --git a/framework/main.cpp b/framework/main.cpp index e33bec5..ee579b9 100755 --- a/framework/main.cpp +++ b/framework/main.cpp @@ -66,7 +66,7 @@ void* InitMsgServer(void*) } MsgInitSensor(); - MsgInitMsgMgr(); + MsgBootMsgMgr(); /* plugin manager initialize */ MsgPluginManager::instance()->initialize(); diff --git a/include/externals/MsgNotificationWrapper.h b/include/externals/MsgNotificationWrapper.h index 7a59dd9..9304549 100755 --- a/include/externals/MsgNotificationWrapper.h +++ b/include/externals/MsgNotificationWrapper.h @@ -113,6 +113,6 @@ void MsgSoundPlayStart(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_SOUND_TYPE_T sou void MsgRefreshAllNotification(bool bWithSimNoti, bool bFeedback, msg_active_notification_type_t active_type); -void MsgInitMsgMgr(); +void MsgBootMsgMgr(); #endif diff --git a/manager/inc/msg-manager-notification.h b/manager/inc/msg-manager-notification.h index 7b4beae..1367fbb 100644 --- a/manager/inc/msg-manager-notification.h +++ b/manager/inc/msg-manager-notification.h @@ -288,6 +288,7 @@ typedef struct _msg_mgr_message_info_s { ==================================================================================================*/ void MsgMgrInitNoti(); +void MsgMgrOnBoot(); int MsgMgrInsertOnlyActiveNotification(msg_mgr_notification_type_t noti_type, MSG_MGR_MESSAGE_INFO_S *msg_info); int MsgMgrRefreshNotification(msg_mgr_notification_type_t noti_type, bool bFeedback, msg_mgr_active_notification_type_t active_type); diff --git a/manager/src/msg-manager-notification.cpp b/manager/src/msg-manager-notification.cpp index 081d327..2b5b491 100644 --- a/manager/src/msg-manager-notification.cpp +++ b/manager/src/msg-manager-notification.cpp @@ -110,6 +110,7 @@ typedef struct _del_noti_info_s ===================================================================================================*/ void MsgMgrInitReportNotiList(); +void MsgInitNotiCb(void *data); void MsgRefreshNotiCb(void *data); void MsgMgrDeleteNotiCb(void *data); @@ -268,13 +269,43 @@ void MsgMgrInitNoti() bNotiSvcReady = notification_is_service_ready(); + if (bNotiSvcReady == true) { + MSG_MGR_DEBUG("Notification server is available"); + MsgMgrInitReportNotiList(); + } else { + MSG_MGR_DEBUG("Notification server is not available. Init is defered"); + notification_add_deferred_task(MsgInitNotiCb, NULL); + } + + is_init = true; +} + + +void MsgInitNotiCb(void *data) +{ + MsgMgrInitReportNotiList(); + + if (data) { + free(data); + data = NULL; + } + + return; +} + + +void MsgMgrOnBoot() +{ + bool bNotiSvcReady = false; + + bNotiSvcReady = notification_is_service_ready(); + if (bNotiSvcReady == true) { MSG_MGR_DEBUG("Notification server is available"); #ifndef MSG_NOTI_INTEGRATION MsgDeleteNotification(MSG_MGR_NOTI_TYPE_SIM, -1); #endif MsgMgrRefreshAllNotification(false, true, MSG_MGR_ACTIVE_NOTI_TYPE_INSTANT); /* On Booting */ - MsgMgrInitReportNotiList(); } else { MSG_MGR_DEBUG("Notification server is not available. Init is defered"); #ifndef MSG_NOTI_INTEGRATION @@ -285,17 +316,14 @@ void MsgMgrInitNoti() } notification_add_deferred_task(MsgDeleteNotiCb, (void *)delNotiInfo); #endif - notification_add_deferred_task(MsgRefreshNotiCb, (void *)NULL); + notification_add_deferred_task(MsgRefreshNotiCb, NULL); } - - is_init = true; } void MsgRefreshNotiCb(void *data) { MsgMgrRefreshAllNotification(false, true, MSG_MGR_ACTIVE_NOTI_TYPE_INSTANT); - MsgMgrInitReportNotiList(); if (data) { free(data); diff --git a/manager/src/msg-manager.cpp b/manager/src/msg-manager.cpp index 63aaab7..6c7cd9b 100644 --- a/manager/src/msg-manager.cpp +++ b/manager/src/msg-manager.cpp @@ -642,6 +642,11 @@ void _change_pm_state_func(app_control_h app_control) MsgMgrChangePmState(); } +void _on_boot_func(app_control_h app_control) +{ + MsgMgrOnBoot(); +} + void service_app_control(app_control_h app_control, void *data) { MSG_MGR_INFO("service_app_control called"); @@ -683,6 +688,8 @@ void service_app_control(app_control_h app_control, void *data) _sound_play_start_func(app_control); } else if (g_strcmp0(cmd, "change_pm_state") == 0) { _change_pm_state_func(app_control); + } else if (g_strcmp0(cmd, "on_boot") == 0) { + _on_boot_func(app_control); } g_free(cmd);