[NotificationEventListener] Change getlist logic 37/163937/2 5.0.0-preview1-00412
authorMyungki Lee <mk5004.lee@samsung.com>
Thu, 14 Dec 2017 06:50:55 +0000 (15:50 +0900)
committerMyungki Lee <mk5004.lee@samsung.com>
Thu, 14 Dec 2017 07:05:19 +0000 (16:05 +0900)
- Use NotificationType.None

Change-Id: I3062ac169a3d7f5ff12a682ad1d7f60423f4d183
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs

index 7ed4c3c..31a5b09 100755 (executable)
@@ -182,6 +182,11 @@ namespace Tizen.Applications.NotificationEventListener
     internal enum NotificationType
     {
         /// <summary>
+        /// Type none.
+        /// </summary>
+        None = -1,
+
+        /// <summary>
         /// Notification type.
         /// </summary>
         Notification = 0,
index 89a3f4b..d0c8382 100755 (executable)
@@ -353,34 +353,7 @@ namespace Tizen.Applications.NotificationEventListener
             IntPtr currentList = IntPtr.Zero;
             IList<NotificationEventArgs> list = new List<NotificationEventArgs>();
 
-            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");