From 3a93170d4e00959a2e7b1c1e7993d4e8a398c1e3 Mon Sep 17 00:00:00 2001 From: Myungki Lee Date: Thu, 14 Dec 2017 15:50:55 +0900 Subject: [PATCH] [NotificationEventListener] Change getlist logic - Use NotificationType.None Change-Id: I3062ac169a3d7f5ff12a682ad1d7f60423f4d183 Signed-off-by: Myungki Lee --- .../NotificationEventArgsEnumerations.cs | 5 ++++ .../NotificationListenerManager.cs | 29 +--------------------- 2 files changed, 6 insertions(+), 28 deletions(-) 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"); -- 2.7.4