fixed prevent issue related to Notification Manager for osp-shell
authorJiban Prakash <p.jiban@samsung.com>
Wed, 9 Jan 2013 07:09:38 +0000 (12:39 +0530)
committerJiban Prakash <p.jiban@samsung.com>
Wed, 9 Jan 2013 07:09:38 +0000 (12:39 +0530)
Change-Id: I89bc030b0e1add4130c00b19dae8414ba9244ef2
Signed-off-by: Jiban Prakash <p.jiban@samsung.com>
src/core/FShell_NotificationManagerImpl.cpp

index 2712c53..58699ce 100644 (file)
@@ -249,7 +249,7 @@ CATCH:
        {
                notification_free(core);
        }
-
+       service_destroy(svc);
        return r;
 }
 
@@ -298,10 +298,12 @@ _NotificationManagerImpl::NotifyImpl(const AppId& appId, const String& messageTe
                snprintf(buffer, 256, "%ls", appId.GetPointer());
 
                app_manager_get_app_icon_path(buffer, &pIcon);
-               notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIcon);
+               r = ConvertNotificationResult(notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIcon));
+               SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set icon failed.", GetErrorMessage(r));
 
                app_manager_get_app_name(buffer, &pName);
-               notification_set_text(core, NOTIFICATION_TEXT_TYPE_TITLE, pName, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+               r = ConvertNotificationResult(notification_set_text(core, NOTIFICATION_TEXT_TYPE_TITLE, pName, NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
+               SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set title text failed.", GetErrorMessage(r));
 
                r = arg.Construct(launchArguments);
                SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
@@ -344,7 +346,7 @@ CATCH:
        {
                free(pName);
        }
-
+       service_destroy(svc);
        return r;
 }
 
@@ -393,25 +395,29 @@ _NotificationManagerImpl::NotifyMessageImpl(const NotificationRequest& notiMessa
 
                if (pMsg)
                {
-                       notification_set_text(core, NOTIFICATION_TEXT_TYPE_CONTENT, pMsg.get(), NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+                       r = ConvertNotificationResult(notification_set_text(core, NOTIFICATION_TEXT_TYPE_CONTENT, pMsg.get(), NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
+                       SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set title text failed.", GetErrorMessage(r));
                }
 
                if (!titleText.IsEmpty())
                {
                        pTitleText = _StringConverter::CopyToCharArrayN(titleText);
-                       notification_set_text(core, NOTIFICATION_TEXT_TYPE_TITLE, pTitleText, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+                       r = ConvertNotificationResult(notification_set_text(core, NOTIFICATION_TEXT_TYPE_TITLE, pTitleText, NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
+                       SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set title text failed.", GetErrorMessage(r));
                }
 
                if (!iconPath.IsEmpty())
                {
                        pIconPath = _StringConverter::CopyToCharArrayN(iconPath);
-                       notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIconPath);
+                       r = ConvertNotificationResult(notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIconPath));
+                       SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set icon failed.", GetErrorMessage(r));
                }
 
                if (!soundPath.IsEmpty())
                {
                        pSoundPath = _StringConverter::CopyToCharArrayN(soundPath);
-                       notification_set_sound(core, NOTIFICATION_SOUND_TYPE_USER_DATA, pSoundPath);
+                       r = ConvertNotificationResult(notification_set_sound(core, NOTIFICATION_SOUND_TYPE_USER_DATA, pSoundPath));
+                       SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set sound failed.", GetErrorMessage(r));
                }
 
                app_get_id(&pkgname);
@@ -505,7 +511,7 @@ CATCH:
        {
                notification_free(core);
        }
-
+       service_destroy(svc);
        return r;
 }