Fix binding NotificationDisplayAppList in Indicatory style
authorSeungha Son <seungha.son@samsung.com>
Thu, 18 May 2017 23:40:53 +0000 (08:40 +0900)
committerSeungha Son <seungha.son@samsung.com>
Tue, 23 May 2017 04:25:38 +0000 (13:25 +0900)
Signed-off-by: Seungha Son <seungha.son@samsung.com>
Change-Id: Ia8ed3b1814fe67cb51ed30f2d661704360da6197

src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs

index 8c5014b..b7eee0d 100755 (executable)
@@ -25,28 +25,35 @@ namespace Tizen.Applications.Notifications
             int flag;
             NotificationError ret = NotificationError.None;
             Notification.IndicatorStyle style = (Notification.IndicatorStyle)notification.GetStyle("Indicator");
+            Interop.Notification.GetApplist(notification.Handle, out flag);
 
-            ret = Interop.Notification.SetText(notification.Handle, NotificationText.FirstMainText, style.SubText, null, -1);
-            if (ret != NotificationError.None)
+            if (string.IsNullOrEmpty(style.SubText) == false)
             {
-                throw NotificationErrorFactory.GetException(ret, "unable to set indicator text");
+                ret = Interop.Notification.SetText(notification.Handle, NotificationText.FirstMainText, style.SubText, null, -1);
+                if (ret != NotificationError.None)
+                {
+                    throw NotificationErrorFactory.GetException(ret, "unable to set indicator text");
+                }
+                flag |= (int)NotificationDisplayApplist.Ticker;
             }
 
-            ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.IconForIndicator, style.IconPath);
-            if (ret != NotificationError.None)
+            if (string.IsNullOrEmpty(style.IconPath) == false)
             {
-                throw NotificationErrorFactory.GetException(ret, "unable to set indicator image");
+                ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.IconForIndicator, style.IconPath);
+                if (ret != NotificationError.None)
+                {
+                    throw NotificationErrorFactory.GetException(ret, "unable to set indicator image");
+                }
+                flag |= (int)NotificationDisplayApplist.Indicator;
             }
-
-            Interop.Notification.GetApplist(notification.Handle, out flag);
-            Interop.Notification.SetApplist(notification.Handle, flag | (int)NotificationDisplayApplist.Indicator | (int)NotificationDisplayApplist.Ticker);
+            Interop.Notification.SetApplist(notification.Handle, flag);
         }
 
         internal static void BindSafeHandle(Notification notification)
         {
             int appList;
             Interop.Notification.GetApplist(notification.Handle, out appList);
-            if ((appList & ((int)NotificationDisplayApplist.Ticker | (int)NotificationDisplayApplist.Indicator)) != 0)
+            if ((appList & (int)NotificationDisplayApplist.Ticker) != 0 || (appList & (int)NotificationDisplayApplist.Indicator) != 0)
             {
                 string path, text;
                 Notification.IndicatorStyle indicator = new Notification.IndicatorStyle();
index fb94bec..d897dcf 100755 (executable)
@@ -64,7 +64,7 @@ namespace Tizen.Applications.NotificationEventListener
                 lockStyle.Thumbnail = path;
             }
 
-            if ((styleList & ((int)NotificatioDisplayApplist.Ticker | (int)NotificatioDisplayApplist.Indicator)) != 0)
+            if ((styleList & (int)NotificatioDisplayApplist.Ticker) != 0 || (styleList & (int)NotificatioDisplayApplist.Indicator) != 0)
             {
                 NotificationEventArgs.IndicatorStyleArgs indicatorStyle = new NotificationEventArgs.IndicatorStyleArgs();
                 eventargs.Style.Add(indicatorStyle.Key, indicatorStyle);