[Notification] removeAll
authorRyszard Matuszyk <r.matuszyk@samsung.com>
Tue, 17 Mar 2015 10:44:18 +0000 (11:44 +0100)
committerRyszard Matuszyk <r.matuszyk@samsung.com>
Tue, 17 Mar 2015 10:58:59 +0000 (11:58 +0100)
[Verification] Build required

Change-Id: I91eb560d72ba302019ceac70ade55b0c96ab83f1
Signed-off-by: Ryszard Matuszyk <r.matuszyk@samsung.com>
src/notification/notification_manager.cc

index dfbe73db2b7f424b6d22bd895866924d2bcb8ac5..ce50be1c1495f30fc5bdcb85a22946c7aa4159e9 100644 (file)
@@ -41,6 +41,20 @@ PlatformResult NotificationManager::Remove(const picojson::object& args) {
 }
 
 PlatformResult NotificationManager::RemoveAll() {
+  int ret = notification_delete_all(NOTIFICATION_TYPE_NOTI);
+  if (ret != NOTIFICATION_ERROR_NONE) {
+    LoggerE("Notification remove all failed: %d", ret);
+    return PlatformResult(ErrorCode::UNKNOWN_ERR,
+                          "Notification noti remove all failed");
+  }
+
+  ret = notification_delete_all(NOTIFICATION_TYPE_ONGOING);
+  if (ret != NOTIFICATION_ERROR_NONE) {
+    LoggerE("Notification remove all failed: %d", ret);
+    return PlatformResult(ErrorCode::UNKNOWN_ERR,
+                          "Notification ongoing remove all failed");
+  }
+
   return PlatformResult(ErrorCode::NO_ERROR);
 }