[Notification] Fix for push service daemon notifications. 26/82426/2
authorTomasz Marciniak <t.marciniak@samsung.com>
Tue, 2 Aug 2016 12:55:56 +0000 (14:55 +0200)
committerTomasz Marciniak <t.marciniak@samsung.com>
Wed, 3 Aug 2016 09:38:01 +0000 (11:38 +0200)
[Verification] Code compiles. TCT pass rate 100%

Change-Id: If4f3ea10366ad2982bb3f8faa3c01e04563d5e47
Signed-off-by: Tomasz Marciniak <t.marciniak@samsung.com>
src/notification/status_notification.cc

index 9b03933a7444a56027960668c72b7cde9d5f1fb1..cc0e1357b88f1c6546b6c38255c47780f60ceb5a 100644 (file)
@@ -1108,6 +1108,12 @@ PlatformResult StatusNotification::ToJson(int id,
       GetImage(noti_handle, NOTIFICATION_IMAGE_TYPE_LIST_5, &progress_type);
   if (status.IsError())
     return status;
+
+  //push service daemon doesn't set progress type
+  //so use default if notification type is different from "PROGRESS"
+  if ("PROGRESS" != noti_type_str) {
+    progress_type = progress_type == kProgressTypeByte ? progress_type : kProgressTypePercentage;
+  }
   out["progressType"] = picojson::value(progress_type);
 
   double progress_value;