resolve TSAM-8527: refresh notification condition check error fixed 23/90823/2 accepted/tizen/3.0/ivi/20161011.055320 accepted/tizen/3.0/mobile/20161015.033918 accepted/tizen/3.0/wearable/20161015.083527 accepted/tizen/common/20161005.165353 accepted/tizen/ivi/20161006.075547 accepted/tizen/mobile/20161006.075515 accepted/tizen/wearable/20161006.075531 submit/tizen/20161005.053629 submit/tizen_3.0_ivi/20161010.000005 submit/tizen_3.0_mobile/20161015.000005 submit/tizen_3.0_wearable/20161015.000004
authorKyeonghun Lee <kh9090.lee@samsung.com>
Tue, 4 Oct 2016 10:02:38 +0000 (19:02 +0900)
committerKyeonghun Lee <kh9090.lee@samsung.com>
Tue, 4 Oct 2016 10:41:52 +0000 (19:41 +0900)
Change-Id: I748f636e524c2d0095fc6debbfeca6bd69d349d1

externals/MsgNotificationWrapper.cpp
framework/main.cpp
include/externals/MsgNotificationWrapper.h
manager/inc/msg-manager-notification.h
manager/src/msg-manager-notification.cpp
manager/src/msg-manager.cpp

index e3eff0b..bfeb8f0 100755 (executable)
@@ -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);
 }
index e33bec5..ee579b9 100755 (executable)
@@ -66,7 +66,7 @@ void* InitMsgServer(void*)
                }
 
                MsgInitSensor();
-               MsgInitMsgMgr();
+               MsgBootMsgMgr();
 
                /* plugin manager initialize */
                MsgPluginManager::instance()->initialize();
index 7a59dd9..9304549 100755 (executable)
@@ -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
index 7b4beae..1367fbb 100644 (file)
@@ -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);
index 081d327..2b5b491 100644 (file)
@@ -110,6 +110,7 @@ typedef struct _del_noti_info_s
 ===================================================================================================*/
 
 void MsgMgrInitReportNotiList();
+void MsgInitNotiCb(void *data);
 void MsgRefreshNotiCb(void *data);
 void MsgMgrDeleteNotiCb(void *data);
 
@@ -270,11 +271,41 @@ void MsgMgrInitNoti()
 
        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);
index 63aaab7..6c7cd9b 100644 (file)
@@ -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);