From: Myungki Lee Date: Thu, 14 Dec 2017 06:50:55 +0000 (+0900) Subject: [NotificationEventListener] Change getlist logic X-Git-Tag: 5.0.0-preview1-00412^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F37%2F163937%2F2;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NotificationEventListener] Change getlist logic - Use NotificationType.None Change-Id: I3062ac169a3d7f5ff12a682ad1d7f60423f4d183 Signed-off-by: Myungki Lee --- diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs index 7ed4c3c..31a5b09 100755 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs +++ b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs @@ -182,6 +182,11 @@ namespace Tizen.Applications.NotificationEventListener internal enum NotificationType { /// + /// Type none. + /// + None = -1, + + /// /// Notification type. /// Notification = 0, diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs index 89a3f4b..d0c8382 100755 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs +++ b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs @@ -353,34 +353,7 @@ namespace Tizen.Applications.NotificationEventListener IntPtr currentList = IntPtr.Zero; IList list = new List(); - err = Interop.NotificationEventListener.GetList(NotificationType.Notification, -1, out notificationList); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - throw NotificationEventListenerErrorFactory.GetException(err, "unable to get notification list"); - } - - if (notificationList != IntPtr.Zero) - { - currentList = notificationList; - while (currentList != IntPtr.Zero) - { - IntPtr notification; - NotificationEventArgs eventargs = new NotificationEventArgs(); - - notification = Interop.NotificationEventListener.GetData(currentList); - - eventargs = NotificationEventArgsBinder.BindObject(notification, false); - - list.Add(eventargs); - - currentList = Interop.NotificationEventListener.GetNext(currentList); - } - - Interop.NotificationEventListener.NotificationListFree(notificationList); - notificationList = IntPtr.Zero; - } - - err = Interop.NotificationEventListener.GetList(NotificationType.Ongoing, -1, out notificationList); + err = Interop.NotificationEventListener.GetList(NotificationType.None, -1, out notificationList); if (err != Interop.NotificationEventListener.ErrorCode.None) { throw NotificationEventListenerErrorFactory.GetException(err, "unable to get notification list");