[Notification] remove
authorRyszard Matuszyk <r.matuszyk@samsung.com>
Tue, 17 Mar 2015 12:39:50 +0000 (13:39 +0100)
committerRafal Galka <r.galka@samsung.com>
Thu, 19 Mar 2015 07:43:52 +0000 (16:43 +0900)
[Verification] Build required

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

index 2333fcc12127fb3de769ee83638b30466260261b..d4d7cbb1b5bb86f5066141714aae8e0f36910c6b 100644 (file)
@@ -37,6 +37,14 @@ PlatformResult NotificationManager::Update(const picojson::object& args) {
 }
 
 PlatformResult NotificationManager::Remove(const picojson::object& args) {
+  int id = std::stoi(FromJson<std::string>(args, "id"));
+
+  int ret = notification_delete_by_priv_id(NULL, NOTIFICATION_TYPE_NONE, id);
+  if (ret != NOTIFICATION_ERROR_NONE) {
+      LoggerE("Cannot remove notification error: %d", ret);
+      return PlatformResult(ErrorCode::UNKNOWN_ERR, "Cannot remove notification error");
+  }
+
   return PlatformResult(ErrorCode::NO_ERROR);
 }