From: Myungki Lee Date: Thu, 14 Dec 2017 06:50:55 +0000 (+0900) Subject: [NotificationEventListener] Change getlist logic X-Git-Tag: 4.0.1-preview1-00043^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F83%2F163983%2F1;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NotificationEventListener] Change getlist logic - Use NotificationType.None Change-Id: I3062ac169a3d7f5ff12a682ad1d7f60423f4d183 Signed-off-by: Myungki Lee (cherry picked from commit 3a93170d4e00959a2e7b1c1e7993d4e8a398c1e3) --- 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");