2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FShell_NotificationManagerImpl.cpp
20 * @brief This is the placeholder for _NotificationManagerImpl class.
23 #include <unique_ptr.h>
24 #include <appsvc/appsvc.h>
26 #include <notification/notification.h>
27 #include <appfw/app.h>
28 #include <appfw/app_manager.h>
29 #include <appfw/app_ui_notification.h>
31 #include <FBaseSysLog.h>
32 #include <FAppTypes.h>
33 #include <FShellNotificationManager.h>
34 #include <FShellNotificationRequest.h>
36 #include <FBaseInternalTypes.h>
37 #include <FBase_StringConverter.h>
38 #include "FApp_AppInfo.h"
40 #include "FApp_AppArg.h"
41 #include "FShell_NotificationManagerImpl.h"
42 #include "FShell_NotificationManagerProxy.h"
44 using namespace Tizen::Base;
45 using namespace Tizen::App;
46 using namespace Tizen::Shell;
48 extern "C" int service_create_request(bundle *data, service_h *service);
49 extern "C" int service_to_bundle(service_h service, bundle** data);
55 ConvertNotificationResult(int error)
59 case NOTIFICATION_ERROR_NONE:
61 case NOTIFICATION_ERROR_INVALID_DATA:
63 case NOTIFICATION_ERROR_NO_MEMORY:
64 return E_OUT_OF_MEMORY;
65 case NOTIFICATION_ERROR_FROM_DB:
67 case NOTIFICATION_ERROR_ALREADY_EXIST_ID:
68 return E_OPERATION_FAILED;
69 case NOTIFICATION_ERROR_NOT_EXIST_ID:
70 return E_OPERATION_FAILED;
72 return E_OPERATION_FAILED;
79 static int length = (_AppInfo::GetApiVersion() < _API_VERSION_2_1) ? 127 : MAX_NOTIFICATION_MESSAGE_LENGTH;
85 IsPosted(ui_notification_h handle)
87 struct ui_notification_s
107 ui_notification_s* pStruct = reinterpret_cast<ui_notification_s*>(handle);
109 return pStruct->posted;
114 namespace Tizen { namespace Shell
117 _NotificationManagerImpl::_NotificationManagerImpl(void)
118 : __pNotificationManager(null)
122 _NotificationManagerImpl::~_NotificationManagerImpl(void)
127 _NotificationManagerImpl::Construct(void)
129 result r = E_SUCCESS;
131 __pNotificationManager = new (std::nothrow) _NotificationManagerProxy;
132 SysTryReturnResult(NID_APP, __pNotificationManager != null, E_OUT_OF_MEMORY, "__pNotificationManagerProxy creation failed.");
134 r = __pNotificationManager->Construct();
135 SysTryCatch(NID_APP, !IsFailed(r), , r, "__pNotificationManager->Construct() failed [%s].", GetErrorMessage(r));
140 delete __pNotificationManager;
141 __pNotificationManager = null;
146 const _NotificationManagerImpl*
147 _NotificationManagerImpl::GetInstance(const NotificationManager& notiMgr)
149 return notiMgr.__pNotificationManagerImpl;
152 _NotificationManagerImpl*
153 _NotificationManagerImpl::GetInstance(NotificationManager& notiMgr)
155 return notiMgr.__pNotificationManagerImpl;
159 _NotificationManagerImpl::GetBadgeNumber(void) const
162 notification_get_badge(NULL, NOTIFICATION_GROUP_ID_NONE, &count);
167 _NotificationManagerImpl::OngoingImpl(const String& messageText, const String& launchArguments) const
169 return NotifyImpl(messageText, -1, launchArguments, true);
173 _NotificationManagerImpl::OngoingImpl(const AppId& appId, const String& messageText, const String& launchArguments) const
176 return NotifyImpl(appId, messageText, -1, launchArguments, true);
180 _NotificationManagerImpl::NotifyImpl(const String& messageText, int badgeNumber,
181 const String& launchArguments,
182 bool isOngoing) const
184 result r = E_SUCCESS;
186 notification_h core = NULL;
187 char* pkgname = NULL;
189 bundle* service_data = NULL;
190 service_h svc = NULL;
193 if (!messageText.IsEmpty())
195 SysTryReturnResult(NID_APP,
196 messageText.GetLength() <= GetMessageLength(), E_INVALID_ARG,
197 "MessageText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
201 core = notification_new(NOTIFICATION_TYPE_ONGOING, NOTIFICATION_GROUP_ID_DEFAULT, NOTIFICATION_PRIV_ID_NONE);
202 SysTryReturnResult(NID_APP, core!= NULL , E_SYSTEM, "Notification creation failed ");
206 core = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_DEFAULT, NOTIFICATION_PRIV_ID_NONE);
207 SysTryReturnResult(NID_APP, core!= NULL , E_SYSTEM, "Notification creation failed ");
210 pMsg = _StringConverter::CopyToCharArrayN(messageText);
211 notification_set_text(core, NOTIFICATION_TEXT_TYPE_CONTENT, pMsg, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
213 app_get_package(&pkgname);
214 SysTryCatch(NID_APP, pkgname != NULL, r = E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] Cannot acquire package name for current application.");
216 r = arg.Construct(launchArguments);
217 SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
219 pKb = arg.GetBundle();
220 service_create_request(pKb, &svc);
221 service_set_package(svc, pkgname);
223 if (service_to_bundle(svc, &service_data) == SERVICE_ERROR_NONE)
225 notification_set_property(core, 0);
226 notification_set_execute_option(core, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data);
227 SysLog(NID_APP, "Sending notification[%ls] for package %s.", messageText.GetPointer(), pkgname);
230 r = ConvertNotificationResult(notification_insert(core, NULL));
231 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
234 if (badgeNumber >= 0)
236 notification_set_badge(NULL, NOTIFICATION_GROUP_ID_NONE, badgeNumber);
237 SysLog(NID_APP, "Badge number is set to %d.", badgeNumber);
249 notification_free(core);
256 _NotificationManagerImpl::NotifyImpl(const AppId& appId, const String& messageText, int badgeNumber,
257 const String& launchArguments,
258 bool isOngoing) const
260 result r = E_SUCCESS;
264 notification_h core = NULL;
267 bundle* service_data = NULL;
268 service_h svc = NULL;
271 memset(buffer, 0, 256);
273 bool b = _Aul::IsInstalled(appId);
275 SysTryReturnResult(NID_APP, b == true, E_APP_NOT_INSTALLED, "The application %ls is not installed", appId.GetPointer());
277 if (isOngoing || !messageText.IsEmpty())
279 SysTryReturnResult(NID_APP,
280 messageText.GetLength() <= GetMessageLength(), E_INVALID_ARG,
281 "MessageText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
285 core = notification_new(NOTIFICATION_TYPE_ONGOING, NOTIFICATION_GROUP_ID_DEFAULT, NOTIFICATION_PRIV_ID_NONE);
286 SysTryReturnResult(NID_APP, core!= NULL , E_SYSTEM, "Notification creation failed ");
290 core = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_DEFAULT, NOTIFICATION_PRIV_ID_NONE);
291 SysTryReturnResult(NID_APP, core!= NULL , E_SYSTEM, "Notification creation failed ");
294 pMsg = _StringConverter::CopyToCharArrayN(messageText);
295 notification_set_text(core, NOTIFICATION_TEXT_TYPE_CONTENT, pMsg, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
297 snprintf(buffer, 256, "%ls", appId.GetPointer());
299 app_manager_get_app_icon_path(buffer, &pIcon);
300 notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIcon);
302 app_manager_get_app_name(buffer, &pName);
303 notification_set_text(core, NOTIFICATION_TEXT_TYPE_TITLE, pName, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
305 r = arg.Construct(launchArguments);
306 SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
308 pKb = arg.GetBundle();
309 service_create_request(pKb, &svc);
310 service_set_app_id(svc, buffer);
312 if (service_to_bundle(svc, &service_data) == SERVICE_ERROR_NONE)
314 notification_set_property(core, 0);
315 notification_set_execute_option(core, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data);
316 SysLog(NID_APP, "Sending notification[%ls] for package %s.", messageText.GetPointer(), buffer);
319 r = ConvertNotificationResult(notification_insert(core,NULL));
320 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
323 if (badgeNumber >= 0)
325 notification_set_badge(buffer, NOTIFICATION_GROUP_ID_NONE, badgeNumber);
326 SysLog(NID_APP, "Badge number is set to %d.", badgeNumber);
334 notification_free(core);
352 _NotificationManagerImpl::NotifyMessageImpl(const NotificationRequest& notiMessage, bool isOngoing)
354 result r = E_SUCCESS;
356 notification_h core = NULL;
357 char* pkgname = NULL;
358 char* pTitleText = NULL;
359 char* pIconPath = NULL;
360 char* pSoundPath = NULL;
362 bundle* service_data = NULL;
363 service_h svc = NULL;
366 const String& messageText = notiMessage.GetAlertText();
367 const String& launchArguments = notiMessage.GetAppMessage();
368 const String& titleText = notiMessage.GetTitleText();
369 const String& iconPath = notiMessage.GetIconFilePath();
370 const String& soundPath = notiMessage.GetSoundFilePath();
371 const int badgeNumber = notiMessage.GetBadgeNumber();
372 const int badgeOffset = notiMessage.GetBadgeOffset();
374 if (isOngoing || !messageText.IsEmpty())
376 SysTryReturnResult(NID_APP,
377 messageText.GetLength() <= GetMessageLength(), E_INVALID_ARG,
378 "MessageText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
382 core = notification_new(NOTIFICATION_TYPE_ONGOING, NOTIFICATION_GROUP_ID_DEFAULT, NOTIFICATION_PRIV_ID_NONE);
383 SysTryReturnResult(NID_APP, core!= NULL , E_SYSTEM, "Notification creation failed ");
387 core = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_DEFAULT, NOTIFICATION_PRIV_ID_NONE);
388 SysTryReturnResult(NID_APP, core!= NULL , E_SYSTEM, "Notification creation failed ");
391 std::unique_ptr<char[]> pMsg(_StringConverter::CopyToCharArrayN(messageText));
395 notification_set_text(core, NOTIFICATION_TEXT_TYPE_CONTENT, pMsg.get(), NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
398 if (!titleText.IsEmpty())
400 pTitleText = _StringConverter::CopyToCharArrayN(titleText);
401 notification_set_text(core, NOTIFICATION_TEXT_TYPE_TITLE, pTitleText, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
404 if (!iconPath.IsEmpty())
406 pIconPath = _StringConverter::CopyToCharArrayN(iconPath);
407 notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIconPath);
410 if (!soundPath.IsEmpty())
412 pSoundPath = _StringConverter::CopyToCharArrayN(soundPath);
413 notification_set_sound(core, NOTIFICATION_SOUND_TYPE_USER_DATA, pSoundPath);
416 app_get_id(&pkgname);
417 SysTryCatch(NID_APP, pkgname != NULL, r = E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] Cannot acquire package name for current application.");
419 r = arg.Construct(launchArguments);
420 SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
422 pKb = arg.GetBundle();
423 service_create_request(pKb, &svc);
424 service_set_app_id(svc, pkgname);
426 if (service_to_bundle(svc, &service_data) == SERVICE_ERROR_NONE)
428 notification_set_property(core, 0);
429 notification_set_execute_option(core, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data);
430 SysLog(NID_APP, "Sending notification[%ls] for package %s.", messageText.GetPointer(), pkgname);
435 OngoingActivityType activityType = notiMessage.GetOngoingActivityType();
436 progress = notiMessage.GetOngoingActivityProgress();
437 switch (activityType)
439 case ONGOING_ACTIVITY_TYPE_PROGRESS_PERCENTAGE:
440 r = ConvertNotificationResult(notification_insert(core,NULL));
441 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
442 r = ConvertNotificationResult(notification_update_progress(core, NOTIFICATION_PRIV_ID_NONE, progress/100.));
443 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification update failure.", GetErrorMessage(r));
445 case ONGOING_ACTIVITY_TYPE_PROGRESS_BYTE:
446 r = ConvertNotificationResult(notification_insert(core,NULL));
447 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
448 r = ConvertNotificationResult(notification_update_size(core, NOTIFICATION_PRIV_ID_NONE, progress));
449 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification update failure.", GetErrorMessage(r));
451 case ONGOING_ACTIVITY_TYPE_TEXT:
452 r = ConvertNotificationResult(notification_insert(core,NULL));
453 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
456 r = E_OPERATION_FAILED;
457 // ui_notification_set_content() is done already
463 r = ConvertNotificationResult(notification_insert(core,NULL));
464 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
469 SysTryReturnResult(NID_APP, 0, E_INVALID_ARG, "MessageText is Empty");
472 if (badgeNumber >= 0)
474 notification_set_badge(NULL, NOTIFICATION_GROUP_ID_NONE, badgeNumber);
475 SysLog(NID_APP, "Badge number is set to %d.", badgeNumber);
478 if (badgeOffset != 0)
480 // badge offset is exclusive to badge number
483 notification_error_e noti_err = notification_get_badge(NULL, NOTIFICATION_GROUP_ID_NONE, &count);
484 if (noti_err == NOTIFICATION_ERROR_NONE)
486 count += badgeOffset;
489 notification_set_badge(NULL, NOTIFICATION_GROUP_ID_NONE, count);
490 SysLog(NID_APP, "Badge number is set to %d.", count);
505 notification_free(core);
512 _NotificationManagerImpl::NotifyMessageImpl(const AppId& appId, const NotificationRequest& notiMessage, bool isOngoing)
514 return __pNotificationManager->NotifyMessage(appId, notiMessage, isOngoing);
519 _NotificationManagerImpl::Notify(int badgeNumber) const
521 SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
523 if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
525 badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
528 String messageText = String(L"");
529 String appMessage = String(L"");
531 return NotifyImpl(messageText, badgeNumber, appMessage, false);
535 _NotificationManagerImpl::Notify(const String& messageText) const
537 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
539 String appMessage = String(L"");
541 return NotifyImpl(messageText, -1, appMessage, false);
545 _NotificationManagerImpl::Notify(const String& messageText, int badgeNumber) const
547 SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
548 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
550 if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
552 badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
555 String appMessage = String(L"");
557 return NotifyImpl(messageText, badgeNumber, appMessage, false);
561 _NotificationManagerImpl::Notify(const String& messageText, int badgeNumber, const String& launchArguments) const
563 SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
564 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
565 SysTryReturnResult(NID_APP,
566 launchArguments != null && launchArguments.GetLength() > 0, E_INVALID_ARG,
567 "launchArguments is less than 0.");
569 SysTryReturnResult(NID_APP,
570 launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
571 "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
573 if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
575 badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
578 return NotifyImpl(messageText, badgeNumber, launchArguments, false);
582 _NotificationManagerImpl::GetBadgeNumber(const AppId& appId) const
584 bool b = _Aul::IsInstalled(appId);
586 SysTryReturn(NID_APP, b == true, -1, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The application %ls is not installed",
592 memset(buffer, 0, 256);
594 snprintf(buffer, 256, "%ls", appId.GetPointer());
596 notification_get_badge(buffer, NOTIFICATION_GROUP_ID_NONE, &count);
603 _NotificationManagerImpl::NotifyByAppId(const AppId& appId, int badgeNumber) const
605 SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
607 String messageText = String(L"");
608 String appMessage = String(L"");
609 return NotifyImpl(appId, messageText, badgeNumber, appMessage);
613 _NotificationManagerImpl::NotifyByAppId(const AppId& appId, const String& messageText) const
615 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
617 return NotifyImpl(appId, messageText, -1, String(L""));
621 _NotificationManagerImpl::NotifyByAppId(const AppId& appId, const String& messageText, int badgeNumber) const
623 SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
624 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
626 return NotifyImpl(appId, messageText, badgeNumber, String(L""));
630 _NotificationManagerImpl::NotifyByAppId(const AppId& appId, const String& messageText, const String& launchArguments) const
632 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
633 SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
634 SysTryReturnResult(NID_APP,
635 launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
636 "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
638 return NotifyImpl(appId, messageText, -1, launchArguments);
642 _NotificationManagerImpl::NotifyByAppId(const AppId& appId, const String& messageText, int badgeNumber,
643 const String& launchArguments) const
645 SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
646 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
647 SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
648 SysTryReturnResult(NID_APP,
649 launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
650 "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
652 return NotifyImpl(appId, messageText, badgeNumber, launchArguments);
656 _NotificationManagerImpl::NotifyOngoingActivity(const String& messageText) const
658 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
660 return OngoingImpl(messageText, String(L""));
664 _NotificationManagerImpl::NotifyOngoingActivity(const String& messageText, const String& launchArguments) const
666 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
667 SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
668 SysTryReturnResult(NID_APP,
669 launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
670 "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
672 return OngoingImpl(messageText, launchArguments);
676 _NotificationManagerImpl::NotifyOngoingActivityByAppId(const AppId& appId, const String& messageText) const
678 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
680 return OngoingImpl(appId, messageText, String(L""));
684 _NotificationManagerImpl::NotifyOngoingActivityByAppId(const AppId& appId, const String& messageText,
685 const String& launchArguments) const
687 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
688 SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
689 SysTryReturnResult(NID_APP,
690 launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
691 "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
693 return OngoingImpl(appId, messageText, launchArguments);
697 _NotificationManagerImpl::RemoveOngoingActivityNotification(void)
699 result r = E_SUCCESS;
701 notification_error_e err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_ONGOING);
704 case NOTIFICATION_ERROR_NONE:
708 case NOTIFICATION_ERROR_INVALID_DATA:
713 r = E_OPERATION_FAILED;
721 _NotificationManagerImpl::RemoveOngoingActivityNotificationByAppId(const AppId& appId)
723 return __pNotificationManager->RemoveNotification(appId, true);
727 _NotificationManagerImpl::RemoveNotification(void)
729 result r = E_SUCCESS;
731 notification_error_e err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
734 case NOTIFICATION_ERROR_NONE:
738 case NOTIFICATION_ERROR_INVALID_DATA:
743 r = E_OPERATION_FAILED;
751 _NotificationManagerImpl::RemoveNotificationByAppId(const AppId& appId)
753 return __pNotificationManager->RemoveNotification(appId,false);