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"
39 #include "FAppPkg_PackageManagerImpl.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::App::Package;
47 using namespace Tizen::Shell;
49 extern "C" int service_create_request(bundle *data, service_h *service);
50 extern "C" int service_to_bundle(service_h service, bundle** data);
56 ConvertNotificationResult(int error)
60 case NOTIFICATION_ERROR_NONE:
62 case NOTIFICATION_ERROR_INVALID_DATA:
64 case NOTIFICATION_ERROR_NO_MEMORY:
65 return E_OUT_OF_MEMORY;
66 case NOTIFICATION_ERROR_FROM_DB:
68 case NOTIFICATION_ERROR_ALREADY_EXIST_ID:
69 return E_OPERATION_FAILED;
70 case NOTIFICATION_ERROR_NOT_EXIST_ID:
71 return E_OPERATION_FAILED;
73 return E_OPERATION_FAILED;
80 static int length = (_AppInfo::GetApiVersion() < _API_VERSION_2_1) ? 127 : MAX_NOTIFICATION_MESSAGE_LENGTH;
86 IsPosted(ui_notification_h handle)
88 struct ui_notification_s
108 ui_notification_s* pStruct = reinterpret_cast<ui_notification_s*>(handle);
110 return pStruct->posted;
115 namespace Tizen { namespace Shell
118 _NotificationManagerImpl::_NotificationManagerImpl(void)
119 : __pNotificationManager(null)
123 _NotificationManagerImpl::~_NotificationManagerImpl(void)
128 _NotificationManagerImpl::Construct(void)
130 result r = E_SUCCESS;
132 __pNotificationManager = new (std::nothrow) _NotificationManagerProxy;
133 SysTryReturnResult(NID_APP, __pNotificationManager != null, E_OUT_OF_MEMORY, "__pNotificationManagerProxy creation failed.");
135 r = __pNotificationManager->Construct();
136 SysTryCatch(NID_APP, !IsFailed(r), , r, "__pNotificationManager->Construct() failed [%s].", GetErrorMessage(r));
141 delete __pNotificationManager;
142 __pNotificationManager = null;
147 const _NotificationManagerImpl*
148 _NotificationManagerImpl::GetInstance(const NotificationManager& notiMgr)
150 return notiMgr.__pNotificationManagerImpl;
153 _NotificationManagerImpl*
154 _NotificationManagerImpl::GetInstance(NotificationManager& notiMgr)
156 return notiMgr.__pNotificationManagerImpl;
160 _NotificationManagerImpl::GetBadgeNumber(void) const
163 notification_get_badge(NULL, NOTIFICATION_GROUP_ID_NONE, &count);
168 _NotificationManagerImpl::OngoingImpl(const String& messageText, const String& launchArguments) const
170 return NotifyImpl(messageText, -1, launchArguments, true);
174 _NotificationManagerImpl::OngoingImpl(const AppId& appId, const String& messageText, const String& launchArguments) const
177 return NotifyImpl(appId, messageText, -1, launchArguments, true);
181 _NotificationManagerImpl::NotifyImpl(const String& messageText, int badgeNumber,
182 const String& launchArguments,
183 bool isOngoing) const
185 result r = E_SUCCESS;
187 notification_h core = NULL;
188 char* pkgname = NULL;
190 bundle* service_data = NULL;
191 service_h svc = NULL;
194 if (!messageText.IsEmpty())
196 SysTryReturnResult(NID_APP,
197 messageText.GetLength() <= GetMessageLength(), E_INVALID_ARG,
198 "MessageText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
202 core = notification_new(NOTIFICATION_TYPE_ONGOING, NOTIFICATION_GROUP_ID_DEFAULT, NOTIFICATION_PRIV_ID_NONE);
203 SysTryReturnResult(NID_APP, core!= NULL , E_SYSTEM, "Notification creation failed ");
207 core = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_DEFAULT, NOTIFICATION_PRIV_ID_NONE);
208 SysTryReturnResult(NID_APP, core!= NULL , E_SYSTEM, "Notification creation failed ");
211 pMsg = _StringConverter::CopyToCharArrayN(messageText);
212 notification_set_text(core, NOTIFICATION_TEXT_TYPE_CONTENT, pMsg, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
214 app_get_package(&pkgname);
215 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.");
217 r = arg.Construct(launchArguments);
218 SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
220 pKb = arg.GetBundle();
221 service_create_request(pKb, &svc);
222 service_set_package(svc, pkgname);
224 if (service_to_bundle(svc, &service_data) == SERVICE_ERROR_NONE)
226 notification_set_property(core, 0);
227 notification_set_execute_option(core, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data);
228 SysLog(NID_APP, "Sending notification[%ls] for package %s.", messageText.GetPointer(), pkgname);
231 r = ConvertNotificationResult(notification_insert(core, NULL));
232 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
235 if (badgeNumber >= 0)
237 notification_set_badge(NULL, NOTIFICATION_GROUP_ID_NONE, badgeNumber);
238 SysLog(NID_APP, "Badge number is set to %d.", badgeNumber);
250 notification_free(core);
257 _NotificationManagerImpl::NotifyImpl(const AppId& appId, const String& messageText, int badgeNumber,
258 const String& launchArguments,
259 bool isOngoing) const
261 result r = E_SUCCESS;
265 notification_h core = NULL;
268 bundle* service_data = NULL;
269 service_h svc = NULL;
272 memset(buffer, 0, 256);
274 bool b = _PackageManagerImpl::IsAppInstalled(appId);
276 SysTryReturnResult(NID_APP, b == true, E_APP_NOT_INSTALLED, "The application %ls is not installed", appId.GetPointer());
278 if (isOngoing || !messageText.IsEmpty())
280 SysTryReturnResult(NID_APP,
281 messageText.GetLength() <= GetMessageLength(), E_INVALID_ARG,
282 "MessageText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
286 core = notification_new(NOTIFICATION_TYPE_ONGOING, NOTIFICATION_GROUP_ID_DEFAULT, NOTIFICATION_PRIV_ID_NONE);
287 SysTryReturnResult(NID_APP, core!= NULL , E_SYSTEM, "Notification creation failed ");
291 core = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_DEFAULT, NOTIFICATION_PRIV_ID_NONE);
292 SysTryReturnResult(NID_APP, core!= NULL , E_SYSTEM, "Notification creation failed ");
295 pMsg = _StringConverter::CopyToCharArrayN(messageText);
296 notification_set_text(core, NOTIFICATION_TEXT_TYPE_CONTENT, pMsg, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
298 snprintf(buffer, 256, "%ls", appId.GetPointer());
300 app_manager_get_app_icon_path(buffer, &pIcon);
301 notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIcon);
303 app_manager_get_app_name(buffer, &pName);
304 notification_set_text(core, NOTIFICATION_TEXT_TYPE_TITLE, pName, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
306 r = arg.Construct(launchArguments);
307 SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
309 pKb = arg.GetBundle();
310 service_create_request(pKb, &svc);
311 service_set_app_id(svc, buffer);
313 if (service_to_bundle(svc, &service_data) == SERVICE_ERROR_NONE)
315 notification_set_property(core, 0);
316 notification_set_execute_option(core, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data);
317 SysLog(NID_APP, "Sending notification[%ls] for package %s.", messageText.GetPointer(), buffer);
320 r = ConvertNotificationResult(notification_insert(core,NULL));
321 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
324 if (badgeNumber >= 0)
326 notification_set_badge(buffer, NOTIFICATION_GROUP_ID_NONE, badgeNumber);
327 SysLog(NID_APP, "Badge number is set to %d.", badgeNumber);
335 notification_free(core);
353 _NotificationManagerImpl::NotifyMessageImpl(const NotificationRequest& notiMessage, bool isOngoing)
355 result r = E_SUCCESS;
357 notification_h core = NULL;
358 char* pkgname = NULL;
359 char* pTitleText = NULL;
360 char* pIconPath = NULL;
361 char* pSoundPath = NULL;
363 bundle* service_data = NULL;
364 service_h svc = NULL;
367 const String& messageText = notiMessage.GetAlertText();
368 const String& launchArguments = notiMessage.GetAppMessage();
369 const String& titleText = notiMessage.GetTitleText();
370 const String& iconPath = notiMessage.GetIconFilePath();
371 const String& soundPath = notiMessage.GetSoundFilePath();
372 const int badgeNumber = notiMessage.GetBadgeNumber();
373 const int badgeOffset = notiMessage.GetBadgeOffset();
375 if (isOngoing || !messageText.IsEmpty())
377 SysTryReturnResult(NID_APP,
378 messageText.GetLength() <= GetMessageLength(), E_INVALID_ARG,
379 "MessageText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
383 core = notification_new(NOTIFICATION_TYPE_ONGOING, NOTIFICATION_GROUP_ID_DEFAULT, NOTIFICATION_PRIV_ID_NONE);
384 SysTryReturnResult(NID_APP, core!= NULL , E_SYSTEM, "Notification creation failed ");
388 core = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_DEFAULT, NOTIFICATION_PRIV_ID_NONE);
389 SysTryReturnResult(NID_APP, core!= NULL , E_SYSTEM, "Notification creation failed ");
392 std::unique_ptr<char[]> pMsg(_StringConverter::CopyToCharArrayN(messageText));
396 notification_set_text(core, NOTIFICATION_TEXT_TYPE_CONTENT, pMsg.get(), NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
399 if (!titleText.IsEmpty())
401 pTitleText = _StringConverter::CopyToCharArrayN(titleText);
402 notification_set_text(core, NOTIFICATION_TEXT_TYPE_TITLE, pTitleText, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
405 if (!iconPath.IsEmpty())
407 pIconPath = _StringConverter::CopyToCharArrayN(iconPath);
408 notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIconPath);
411 if (!soundPath.IsEmpty())
413 pSoundPath = _StringConverter::CopyToCharArrayN(soundPath);
414 notification_set_sound(core, NOTIFICATION_SOUND_TYPE_USER_DATA, pSoundPath);
417 app_get_id(&pkgname);
418 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.");
420 r = arg.Construct(launchArguments);
421 SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
423 pKb = arg.GetBundle();
424 service_create_request(pKb, &svc);
425 service_set_app_id(svc, pkgname);
427 if (service_to_bundle(svc, &service_data) == SERVICE_ERROR_NONE)
429 notification_set_property(core, 0);
430 notification_set_execute_option(core, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data);
431 SysLog(NID_APP, "Sending notification[%ls] for package %s.", messageText.GetPointer(), pkgname);
436 OngoingActivityType activityType = notiMessage.GetOngoingActivityType();
437 progress = notiMessage.GetOngoingActivityProgress();
438 switch (activityType)
440 case ONGOING_ACTIVITY_TYPE_PROGRESS_PERCENTAGE:
441 r = ConvertNotificationResult(notification_insert(core,NULL));
442 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
443 r = ConvertNotificationResult(notification_update_progress(core, NOTIFICATION_PRIV_ID_NONE, progress/100.));
444 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification update failure.", GetErrorMessage(r));
446 case ONGOING_ACTIVITY_TYPE_PROGRESS_BYTE:
447 r = ConvertNotificationResult(notification_insert(core,NULL));
448 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
449 r = ConvertNotificationResult(notification_update_size(core, NOTIFICATION_PRIV_ID_NONE, progress));
450 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification update failure.", GetErrorMessage(r));
452 case ONGOING_ACTIVITY_TYPE_TEXT:
453 r = ConvertNotificationResult(notification_insert(core,NULL));
454 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
457 r = E_OPERATION_FAILED;
458 // ui_notification_set_content() is done already
464 r = ConvertNotificationResult(notification_insert(core,NULL));
465 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
470 SysTryReturnResult(NID_APP, 0, E_INVALID_ARG, "MessageText is Empty");
473 if (badgeNumber >= 0)
475 notification_set_badge(NULL, NOTIFICATION_GROUP_ID_NONE, badgeNumber);
476 SysLog(NID_APP, "Badge number is set to %d.", badgeNumber);
479 if (badgeOffset != 0)
481 // badge offset is exclusive to badge number
484 notification_error_e noti_err = notification_get_badge(NULL, NOTIFICATION_GROUP_ID_NONE, &count);
485 if (noti_err == NOTIFICATION_ERROR_NONE)
487 count += badgeOffset;
490 notification_set_badge(NULL, NOTIFICATION_GROUP_ID_NONE, count);
491 SysLog(NID_APP, "Badge number is set to %d.", count);
506 notification_free(core);
513 _NotificationManagerImpl::NotifyMessageImpl(const AppId& appId, const NotificationRequest& notiMessage, bool isOngoing)
515 return __pNotificationManager->NotifyMessage(appId, notiMessage, isOngoing);
520 _NotificationManagerImpl::Notify(int badgeNumber) const
522 SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
524 if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
526 badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
529 String messageText = String(L"");
530 String appMessage = String(L"");
532 return NotifyImpl(messageText, badgeNumber, appMessage, false);
536 _NotificationManagerImpl::Notify(const String& messageText) const
538 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
540 String appMessage = String(L"");
542 return NotifyImpl(messageText, -1, appMessage, false);
546 _NotificationManagerImpl::Notify(const String& messageText, int badgeNumber) const
548 SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
549 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
551 if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
553 badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
556 String appMessage = String(L"");
558 return NotifyImpl(messageText, badgeNumber, appMessage, false);
562 _NotificationManagerImpl::Notify(const String& messageText, int badgeNumber, const String& launchArguments) const
564 SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
565 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
566 SysTryReturnResult(NID_APP,
567 launchArguments != null && launchArguments.GetLength() > 0, E_INVALID_ARG,
568 "launchArguments is less than 0.");
570 SysTryReturnResult(NID_APP,
571 launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
572 "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
574 if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
576 badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
579 return NotifyImpl(messageText, badgeNumber, launchArguments, false);
583 _NotificationManagerImpl::GetBadgeNumber(const AppId& appId) const
585 bool b = _PackageManagerImpl::IsAppInstalled(appId);
587 SysTryReturn(NID_APP, b == true, -1, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The application %ls is not installed",
593 memset(buffer, 0, 256);
595 snprintf(buffer, 256, "%ls", appId.GetPointer());
597 notification_get_badge(buffer, NOTIFICATION_GROUP_ID_NONE, &count);
604 _NotificationManagerImpl::NotifyByAppId(const AppId& appId, int badgeNumber) const
606 SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
608 String messageText = String(L"");
609 String appMessage = String(L"");
610 return NotifyImpl(appId, messageText, badgeNumber, appMessage);
614 _NotificationManagerImpl::NotifyByAppId(const AppId& appId, const String& messageText) const
616 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
618 return NotifyImpl(appId, messageText, -1, String(L""));
622 _NotificationManagerImpl::NotifyByAppId(const AppId& appId, const String& messageText, int badgeNumber) const
624 SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
625 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
627 return NotifyImpl(appId, messageText, badgeNumber, String(L""));
631 _NotificationManagerImpl::NotifyByAppId(const AppId& appId, const String& messageText, const String& launchArguments) const
633 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
634 SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
635 SysTryReturnResult(NID_APP,
636 launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
637 "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
639 return NotifyImpl(appId, messageText, -1, launchArguments);
643 _NotificationManagerImpl::NotifyByAppId(const AppId& appId, const String& messageText, int badgeNumber,
644 const String& launchArguments) const
646 SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
647 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
648 SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
649 SysTryReturnResult(NID_APP,
650 launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
651 "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
653 return NotifyImpl(appId, messageText, badgeNumber, launchArguments);
657 _NotificationManagerImpl::NotifyOngoingActivity(const String& messageText) const
659 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
661 return OngoingImpl(messageText, String(L""));
665 _NotificationManagerImpl::NotifyOngoingActivity(const String& messageText, const String& launchArguments) const
667 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
668 SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
669 SysTryReturnResult(NID_APP,
670 launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
671 "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
673 return OngoingImpl(messageText, launchArguments);
677 _NotificationManagerImpl::NotifyOngoingActivityByAppId(const AppId& appId, const String& messageText) const
679 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
681 return OngoingImpl(appId, messageText, String(L""));
685 _NotificationManagerImpl::NotifyOngoingActivityByAppId(const AppId& appId, const String& messageText,
686 const String& launchArguments) const
688 SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
689 SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
690 SysTryReturnResult(NID_APP,
691 launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
692 "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
694 return OngoingImpl(appId, messageText, launchArguments);
698 _NotificationManagerImpl::RemoveOngoingActivityNotification(void)
700 result r = E_SUCCESS;
702 notification_error_e err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_ONGOING);
705 case NOTIFICATION_ERROR_NONE:
709 case NOTIFICATION_ERROR_INVALID_DATA:
714 r = E_OPERATION_FAILED;
722 _NotificationManagerImpl::RemoveOngoingActivityNotificationByAppId(const AppId& appId)
724 return __pNotificationManager->RemoveNotification(appId, true);
728 _NotificationManagerImpl::RemoveNotification(void)
730 result r = E_SUCCESS;
732 notification_error_e err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
735 case NOTIFICATION_ERROR_NONE:
739 case NOTIFICATION_ERROR_INVALID_DATA:
744 r = E_OPERATION_FAILED;
752 _NotificationManagerImpl::RemoveNotificationByAppId(const AppId& appId)
754 return __pNotificationManager->RemoveNotification(appId,false);