Fix DCM-1114 : Use **_set_** APIs and notification_set_display_applist for update...
authorSeungWon Lee <lsw2000.lee@samsung.com>
Thu, 28 Mar 2013 07:36:35 +0000 (16:36 +0900)
committerSeungWon Lee <lsw2000.lee@samsung.com>
Thu, 28 Mar 2013 07:36:35 +0000 (16:36 +0900)
Change-Id: I3b6aa2370db24d93c1e496234aad8334a7db6b6d
Signed-off-by: SeungWon Lee <lsw2000.lee@samsung.com>
src/core/FShell_NotificationManagerImpl.cpp

index e1d6367..00b6d62 100644 (file)
@@ -829,8 +829,12 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
 
        if (service_to_bundle(hSvc, &service_data) == SERVICE_ERROR_NONE)
        {
-               notification_set_property(notiHandle, 0);
-               notification_set_execute_option(notiHandle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data);
+               r = ConvertNotificationResult(notification_set_property(notiHandle, 0));
+               SysTryLog(NID_APP, !IsFailed(r), "[%s] notification_set_property failed.", GetErrorMessage(r));
+               r = ConvertNotificationResult(notification_set_execute_option(notiHandle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,
+                                                                                                                                         NULL, NULL, service_data));
+               SysTryLog(NID_APP, !IsFailed(r), "[%s] Nnotification_set_execute_option failed.", GetErrorMessage(r));
+               SysLog(NID_APP, "notification_set_execute_option");
        }
        else
        {
@@ -863,43 +867,34 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                case ONGOING_ACTIVITY_TYPE_PROGRESS_PERCENTAGE:
                        if (needUpdate)
                        {
-                               ConvertNotificationResult(notification_update_size(notiHandle, notiPrivateId, 0));      // Reset for override BYTE type
-                               r = ConvertNotificationResult(notification_update_progress(notiHandle, notiPrivateId, progress/100.));
+                               r = ConvertNotificationResult(notification_set_size(notiHandle, 0));    // Reset for override BYTE type
+                               SysTryLog(NID_APP, !IsFailed(r), "[%s] notification_set_size failure.", GetErrorMessage(r));
                        }
-                       else
-                       {
-                               r = ConvertNotificationResult(notification_set_progress(notiHandle, progress/100.));
-                       }
-                       SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification update failure.", GetErrorMessage(r));
+                       r = ConvertNotificationResult(notification_set_progress(notiHandle, progress/100.));
+                       SysTryLog(NID_APP, !IsFailed(r), "[%s] notification_set_progress failure.", GetErrorMessage(r));
                        break;
 
                case ONGOING_ACTIVITY_TYPE_PROGRESS_BYTE:
                        if (needUpdate)
                        {
-                               ConvertNotificationResult(notification_update_progress(notiHandle, notiPrivateId, 0.0));        // Reset for override PERCENTAGE type
-                               r = ConvertNotificationResult(notification_update_size(notiHandle, notiPrivateId, progress));
+                               r = ConvertNotificationResult(notification_set_progress(notiHandle, 0.0));      // Reset for override PERCENTAGE type
+                               SysTryLog(NID_APP, !IsFailed(r), "[%s] notification_set_progress failure.", GetErrorMessage(r));
                        }
-                       else
-                       {
-                               r = ConvertNotificationResult(notification_set_size(notiHandle, progress));
-                       }
-                       SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification update failure.", GetErrorMessage(r));
+                       r = ConvertNotificationResult(notification_set_size(notiHandle, progress));
+                       SysTryLog(NID_APP, !IsFailed(r), "[%s] notification_set_size failure.", GetErrorMessage(r));
                        break;
 
                case ONGOING_ACTIVITY_TYPE_TEXT:
-                       ConvertNotificationResult(notification_update_progress(notiHandle, notiPrivateId, 0.0));        // Reset the progress
-                       ConvertNotificationResult(notification_update_size(notiHandle, notiPrivateId, 0));
+                       r = ConvertNotificationResult(notification_set_progress(notiHandle, 0.0));      // Reset the progress
+                       SysTryLog(NID_APP, !IsFailed(r), "[%s] notification_set_size failure.", GetErrorMessage(r));
+                       r = ConvertNotificationResult(notification_set_size(notiHandle, 0));
+                       SysTryLog(NID_APP, !IsFailed(r), "[%s] notification_set_size failure.", GetErrorMessage(r));
                        break;
 
                default:
                        r = E_OPERATION_FAILED;
                        break;
                }
-               if (needUpdate)
-               {
-                       r = ConvertNotificationResult(notification_update_content(notiHandle, notiPrivateId, pMsg.get()));
-               }
-               SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification update failure.", GetErrorMessage(r));
        }
 
        // insert for new notification
@@ -917,12 +912,26 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                        __notifyPrivateId = notiPrivateId;
                }
        }
-
-       // notification_update just for non ongoing and text type ongoing only.
-       if (needUpdate && !isOngoing)
+       else
        {
-               notification_update(notiHandle);
-               SysLog(NID_APP, "Notification update from notiPrivateId(%d)", notiPrivateId);
+               int previousDisplaySet = NOTIFICATION_DISPLAY_APP_ALL;
+               if (isOngoing)
+               {
+                       r = ConvertNotificationResult(notification_get_display_applist(notiHandle, &previousDisplaySet));
+                       SysTryLog(NID_APP, !IsFailed(r), "[%s] notification_set_display_applist failure.", GetErrorMessage(r));
+                       int newDisplaySet = previousDisplaySet & ~NOTIFICATION_DISPLAY_APP_TICKER;
+                       r = ConvertNotificationResult(notification_set_display_applist(notiHandle, newDisplaySet));
+                       SysTryLog(NID_APP, !IsFailed(r), "[%s] notification_set_display_applist failure.", GetErrorMessage(r));
+               }
+
+               r = ConvertNotificationResult(notification_update(notiHandle));
+               SysTryLog(NID_APP, !IsFailed(r), "[%s] notification_update failure. notiPrivateId(%d)", GetErrorMessage(r), notiPrivateId);
+
+               if (isOngoing)
+               {
+                       r = ConvertNotificationResult(notification_set_display_applist(notiHandle, previousDisplaySet));
+                       SysTryLog(NID_APP, !IsFailed(r), "[%s] notification_set_display_applist failure.", GetErrorMessage(r));
+               }
        }