//
-// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
* @brief This is the placeholder for _NotificationManagerImpl class.
*/
-#include <unique_ptr.h>
-#include <appsvc/appsvc.h>
-#include <bundle.h>
-#include <notification/notification.h>
-#include <appfw/app.h>
-#include <appfw/app_manager.h>
-#include <appfw/app_ui_notification.h>
-
#include <FBaseSysLog.h>
-#include <FAppNotificationManager.h>
-#include <FBaseInternalTypes.h>
-#include <FBase_StringConverter.h>
+#include <FBaseRt_LibraryImpl.h>
+
#include "FApp_NotificationManagerImpl.h"
-#include "FApp_NotificationManagerProxy.h"
-#include "FApp_AppInfo.h"
-#include "FAppPkg_PackageManagerImpl.h"
-#include "FApp_Aul.h"
-#include "FApp_AppArg.h"
+#include "FApp_INotificationManagerImpl.h"
using namespace Tizen::Base;
-using namespace Tizen::App;
-using namespace Tizen::App::Package;
-
-extern "C" int service_create_request(bundle *data, service_h *service);
+using namespace Tizen::Base::Runtime;
namespace
{
-result
-ConvertNotificationResult(int error)
-{
- switch (error)
- {
- case UI_NOTIFICATION_ERROR_NONE:
- return E_SUCCESS;
- case UI_NOTIFICATION_ERROR_INVALID_PARAMETER:
- return E_INVALID_ARG;
- case UI_NOTIFICATION_ERROR_OUT_OF_MEMORY:
- return E_OUT_OF_MEMORY;
- case UI_NOTIFICATION_ERROR_DB_FAILED:
- return E_DATABASE;
- case UI_NOTIFICATION_ERROR_NO_SUCH_FILE:
- return E_SYSTEM;
- case UI_NOTIFICATION_ERROR_INVALID_STATE:
- return E_SYSTEM;
- default:
- return E_SYSTEM;
- }
-}
-
-ui_notification_progress_type_e
-ConvertToNotificationProgressType(int progressType)
-{
- switch (progressType)
- {
- case ONGOING_ACTIVITY_TYPE_TEXT:
- return UI_NOTIFICATION_PROGRESS_TYPE_PERCENTAGE;
- case ONGOING_ACTIVITY_TYPE_PROGRESS_BYTE:
- return UI_NOTIFICATION_PROGRESS_TYPE_SIZE;
- case ONGOING_ACTIVITY_TYPE_PROGRESS_PERCENTAGE:
- return UI_NOTIFICATION_PROGRESS_TYPE_PERCENTAGE;
- default:
- return UI_NOTIFICATION_PROGRESS_TYPE_PERCENTAGE;
- }
-}
-
-bool
-IsPosted(ui_notification_h handle)
-{
- struct ui_notification_s
- {
- void* raw_handle;
- bool ongoing;
- bool posted;
- bool removed;
- char *icon;
- struct tm *time;
- char *title;
- char *content;
- service_h service;
- char *sound;
- bool vibration;
- };
-
- if (handle == NULL)
- {
- return false;
- }
-
- ui_notification_s* pStruct = reinterpret_cast<ui_notification_s*>(handle);
-
- return pStruct->posted;
-}
+const wchar_t OSP_SHELL_SONAME[] = L"libosp-shell-core.so.1";
}
{
_NotificationManagerImpl::_NotificationManagerImpl(void)
-: __pNotificationManager(null)
+: __pNotiImpl(null)
{
}
+
_NotificationManagerImpl::~_NotificationManagerImpl(void)
{
+ if (__pNotiImpl)
+ {
+ typedef void (*NotificationDeletor)(_INotificationManagerImpl*);
+
+ NotificationDeletor pDeleter = reinterpret_cast<NotificationDeletor>(__lib.GetProcAddress(L"DeleteNotificationManagerInstance"));
+ if (pDeleter)
+ {
+ (*pDeleter)(__pNotiImpl);
+ SysLog(NID_APP, "NotificationManager stub deleted.");
+ }
+ }
}
+
result
_NotificationManagerImpl::Construct(void)
{
- result r = E_SUCCESS;
-
- __pNotificationManager = new (std::nothrow) _NotificationManagerProxy;
- SysTryReturnResult(NID_APP, __pNotificationManager != null, E_OUT_OF_MEMORY, "__pNotificationManagerProxy creation failed.");
+ result r = __lib.Construct(OSP_SHELL_SONAME, _LIBRARY_LOAD_OPTION_NODELETE | _LIBRARY_LOAD_OPTION_LAZY);
+ SysTryReturnResult(NID_APP, !IsFailed(r), E_SYSTEM, "A system error has occurred : %s.", GetErrorMessage(r));
- r = __pNotificationManager->Construct();
- SysTryCatch(NID_APP, !IsFailed(r), , r, "__pNotificationManager->Construct() failed [%s].", GetErrorMessage(r));
+ typedef _INotificationManagerImpl* (*NotificationCreator)(void);
+ NotificationCreator pCreator = reinterpret_cast<NotificationCreator>(__lib.GetProcAddress(L"CreateNotificationManagerInstance"));
+ SysTryReturnResult(NID_APP, pCreator != null, E_SYSTEM, "No notification instance factory found.");
- return E_SUCCESS;
-
-CATCH:
- delete __pNotificationManager;
- __pNotificationManager = null;
+ __pNotiImpl = (*pCreator)();
return r;
}
-const _NotificationManagerImpl*
-_NotificationManagerImpl::GetInstance(const NotificationManager& notiMgr)
-{
- return notiMgr.__pNotificationManagerImpl;
-}
-
-_NotificationManagerImpl*
-_NotificationManagerImpl::GetInstance(NotificationManager& notiMgr)
-{
- return notiMgr.__pNotificationManagerImpl;
-}
int
_NotificationManagerImpl::GetBadgeNumber(void) const
{
- int count = -1;
- notification_get_badge(NULL, NOTIFICATION_GROUP_ID_NONE, &count);
- return count;
-}
-
-result
-_NotificationManagerImpl::OngoingImpl(const String& messageText, const String& launchArguments) const
-{
- return NotifyImpl(messageText, -1, launchArguments, true);
-}
-
-result
-_NotificationManagerImpl::OngoingImpl(const AppId& appId, const String& messageText, const String& launchArguments) const
-{
-
- return NotifyImpl(appId, messageText, -1, launchArguments, true);
-}
-
-result
-_NotificationManagerImpl::NotifyImpl(const String& messageText, int badgeNumber,
- const String& launchArguments,
- bool isOngoing) const
-{
- result r = E_SUCCESS;
- int retcode = 0;
- char* pMsg = null;
- ui_notification_h core = NULL;
- char* pkgname = NULL;
- bundle* pKb = NULL;
- service_h svc = NULL;
- _AppArg arg;
-
- if (!messageText.IsEmpty())
- {
- SysTryReturnResult(NID_APP,
- messageText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "MessageText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
-
- retcode = ui_notification_create(isOngoing, &core);
- SysTryReturnResult(NID_APP, retcode == UI_NOTIFICATION_ERROR_NONE, E_SYSTEM, "Notification creation error : 0x%x.", retcode);
-
- pMsg = _StringConverter::CopyToCharArrayN(messageText);
-
- int ret = ui_notification_set_content(core, pMsg);
- SysTryLog(NID_APP, ret == UI_NOTIFICATION_ERROR_NONE, "Setting notification content failure : %d.", ret);
-
- app_get_package(&pkgname);
- 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.");
-
- r = arg.Construct(launchArguments);
- SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
-
- pKb = arg.GetBundle();
- service_create_request(pKb, &svc);
-
- service_set_package(svc, pkgname);
- r = ConvertNotificationResult(ui_notification_set_service(core, svc));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set service failed.", GetErrorMessage(r));
-
- SysLog(NID_APP, "Sending notification[%ls] for package %s.", messageText.GetPointer(), pkgname);
-
- r = ConvertNotificationResult(ui_notification_post(core));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
- }
-
- if (badgeNumber >= 0)
- {
- notification_set_badge(NULL, NOTIFICATION_GROUP_ID_NONE, badgeNumber);
- SysLog(NID_APP, "Badge number is set to %d.", badgeNumber);
- }
-
-CATCH:
- delete[] pMsg;
- if (pkgname)
- {
- free(pkgname);
- }
-
- if (core)
- {
- ui_notification_destroy(core);
- }
- service_destroy(svc);
- return r;
-}
-
-result
-_NotificationManagerImpl::NotifyImpl(const AppId& appId, const String& messageText, int badgeNumber,
- const String& launchArguments,
- bool isOngoing) const
-{
- result r = E_SUCCESS;
- int retcode = 0;
- char* pMsg = null;
- char* pIcon = NULL;
- char* pName = NULL;
- ui_notification_h core = NULL;
- char buffer[256];
- bundle* pKb = NULL;
- service_h svc = NULL;
- _AppArg arg;
-
- memset(buffer, 0, 256);
-
- bool b = _Aul::IsInstalled(appId);
-
- SysTryReturnResult(NID_APP, b == true, E_APP_NOT_INSTALLED, "The application %ls is not installed", appId.GetPointer());
-
- if (!isOngoing || !messageText.IsEmpty())
- {
- SysTryReturnResult(NID_APP,
- messageText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "MessageText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
-
- retcode = ui_notification_create(isOngoing, &core);
- SysTryReturnResult(NID_APP, retcode == UI_NOTIFICATION_ERROR_NONE, E_SYSTEM, "Notification creation error : 0x%x.", retcode);
-
- pMsg = _StringConverter::CopyToCharArrayN(messageText);
-
- int ret = ui_notification_set_content(core, pMsg);
- SysTryLog(NID_APP, ret == UI_NOTIFICATION_ERROR_NONE, "Setting notification content failure : %d.", ret);
-
- snprintf(buffer, 256, "%ls", appId.GetPointer());
-
- app_manager_get_app_icon_path(buffer, &pIcon);
- r = ConvertNotificationResult(ui_notification_set_icon(core, pIcon));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set icon failed.", GetErrorMessage(r));
-
- app_manager_get_app_name(buffer, &pName);
- r = ConvertNotificationResult(ui_notification_set_title(core, pName));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set title failed.", GetErrorMessage(r));
-
- r = arg.Construct(launchArguments);
- SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
-
- pKb = arg.GetBundle();
- service_create_request(pKb, &svc);
-
- service_set_app_id(svc, buffer);
- r = ConvertNotificationResult(ui_notification_set_service(core, svc));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set service failed.", GetErrorMessage(r));
+ SysTryReturn(NID_APP, __pNotiImpl != null, -1, E_SYSTEM, "[E_SYSTEM] Notification interface error.");
- SysLog(NID_APP, "Sending notification[%ls] for package %s.", messageText.GetPointer(), buffer);
-
- r = ConvertNotificationResult(ui_notification_post(core));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
- }
-
- if (badgeNumber >= 0)
- {
- notification_set_badge(buffer, NOTIFICATION_GROUP_ID_NONE, badgeNumber);
- SysLog(NID_APP, "Badge number is set to %d.", badgeNumber);
- }
-
-CATCH:
- delete[] pMsg;
-
- if (core)
- {
- ui_notification_destroy(core);
- }
-
- if (pIcon)
- {
- free(pIcon);
- }
-
- if (pName)
- {
- free(pName);
- }
- service_destroy(svc);
- return r;
+ return __pNotiImpl->GetBadgeNumber();
}
result
_NotificationManagerImpl::Notify(int badgeNumber) const
{
- SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
-
- if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
- {
- badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
- }
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
String messageText = String(L"");
String appMessage = String(L"");
- return NotifyImpl(messageText, badgeNumber, appMessage, false);
+ return __pNotiImpl->Notify(messageText, badgeNumber, appMessage);
}
+
result
_NotificationManagerImpl::Notify(const String& messageText) const
{
- SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
String appMessage = String(L"");
- return NotifyImpl(messageText, -1, appMessage, false);
+ return __pNotiImpl->Notify(messageText, -1, appMessage);
}
+
result
_NotificationManagerImpl::Notify(const String& messageText, int badgeNumber) const
{
- SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
- SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
-
- if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
- {
- badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
- }
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
String appMessage = String(L"");
- return NotifyImpl(messageText, badgeNumber, appMessage, false);
+ return __pNotiImpl->Notify(messageText, badgeNumber, appMessage);
}
+
result
_NotificationManagerImpl::Notify(const String& messageText, int badgeNumber, const String& launchArguments) const
{
- SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
- SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
- SysTryReturnResult(NID_APP,
- launchArguments != null && launchArguments.GetLength() > 0, E_INVALID_ARG,
- "launchArguments is less than 0.");
-
- SysTryReturnResult(NID_APP,
- launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
- "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
-
- if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
- {
- badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
- }
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
- return NotifyImpl(messageText, badgeNumber, launchArguments, false);
+ return __pNotiImpl->Notify(messageText, badgeNumber, launchArguments);
}
int
_NotificationManagerImpl::GetBadgeNumber(const AppId& appId) const
{
- bool b = _Aul::IsInstalled(appId);
-
- SysTryReturn(NID_APP, b == true, -1, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The application %ls is not installed",
- appId.GetPointer());
-
- char buffer[256];
- int count = -1;
-
- memset(buffer, 0, 256);
-
- snprintf(buffer, 256, "%ls", appId.GetPointer());
-
- notification_get_badge(buffer, NOTIFICATION_GROUP_ID_NONE, &count);
+ SysTryReturn(NID_APP, __pNotiImpl != null, -1, E_SYSTEM, "[E_SYSTEM] Notification interface error.");
- return count;
+ return __pNotiImpl->GetBadgeNumber(appId);
}
result
_NotificationManagerImpl::NotifyOnBehalf(const AppId& appId, int badgeNumber) const
{
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
String messageText = String(L"");
String appMessage = String(L"");
- return NotifyImpl(appId, messageText, badgeNumber, appMessage);
+
+ return __pNotiImpl->NotifyByAppId(appId, messageText, -1, appMessage);
}
+
result
_NotificationManagerImpl::NotifyOnBehalf(const AppId& appId, const String& messageText) const
{
- SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
- return NotifyImpl(appId, messageText, -1, String(L""));
+ return __pNotiImpl->NotifyByAppId(appId, messageText, -1, String(L""));
}
+
result
_NotificationManagerImpl::NotifyOnBehalf(const AppId& appId, const String& messageText, int badgeNumber) const
{
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
- SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
- return NotifyImpl(appId, messageText, badgeNumber, String(L""));
+ return __pNotiImpl->NotifyByAppId(appId, messageText, badgeNumber, String(L""));
}
+
result
_NotificationManagerImpl::NotifyOnBehalf(const AppId& appId, const String& messageText, const String& launchArguments) const
{
- SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
- SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
- SysTryReturnResult(NID_APP,
- launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
- "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
- return NotifyImpl(appId, messageText, -1, launchArguments);
+ return __pNotiImpl->NotifyByAppId(appId, messageText, -1, launchArguments);
}
+
result
_NotificationManagerImpl::NotifyOnBehalf(const AppId& appId, const String& messageText, int badgeNumber,
const String& launchArguments) const
{
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
- SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
- SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
- SysTryReturnResult(NID_APP,
- launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
- "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
- return NotifyImpl(appId, messageText, badgeNumber, launchArguments);
+ return __pNotiImpl->NotifyByAppId(appId, messageText, badgeNumber, launchArguments);
}
+
result
_NotificationManagerImpl::NotifyOngoingActivity(const String& messageText) const
{
- SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
- return OngoingImpl(messageText, String(L""));
+ return __pNotiImpl->NotifyOngoingActivity(messageText, String(L""));
}
+
result
_NotificationManagerImpl::NotifyOngoingActivity(const String& messageText, const String& launchArguments) const
{
- SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
- SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
- SysTryReturnResult(NID_APP,
- launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
- "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
- return OngoingImpl(messageText, launchArguments);
+ return __pNotiImpl->NotifyOngoingActivity(messageText, launchArguments);
}
+
result
_NotificationManagerImpl::NotifyOngoingActivityOnBehalf(const AppId& appId, const String& messageText) const
{
- SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
- return OngoingImpl(appId, messageText, String(L""));
+ return __pNotiImpl->NotifyOngoingActivityByAppId(appId, messageText, String(L""));
}
+
result
_NotificationManagerImpl::NotifyOngoingActivityOnBehalf(const AppId& appId, const String& messageText,
const String& launchArguments) const
{
- SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
- SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
- SysTryReturnResult(NID_APP,
- launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
- "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
- return OngoingImpl(appId, messageText, launchArguments);
+ return __pNotiImpl->NotifyOngoingActivityByAppId(appId, messageText, launchArguments);
}
+
result
_NotificationManagerImpl::RemoveOngoingActivityNotification(void)
{
- result r = E_SUCCESS;
-
- notification_error_e err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_ONGOING);
- switch (err)
- {
- case NOTIFICATION_ERROR_NONE:
- r = E_SUCCESS;
- break;
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
- case NOTIFICATION_ERROR_INVALID_DATA:
- r = E_INVALID_ARG;
- break;
-
- default:
- r = E_SYSTEM;
- break;
- }
-
- return r;
+ return __pNotiImpl->RemoveOngoingActivityNotification();
}
+
result
_NotificationManagerImpl::RemoveOngoingActivityNotificationOnBehalf(const AppId& appId)
{
- return __pNotificationManager->RemoveNotification(appId, true);
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
+
+ return __pNotiImpl->RemoveOngoingActivityNotificationByAppId(appId);
}
+
result
_NotificationManagerImpl::RemoveNotification(void)
{
- result r = E_SUCCESS;
-
- notification_error_e err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
- switch (err)
- {
- case NOTIFICATION_ERROR_NONE:
- r = E_SUCCESS;
- break;
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
- case NOTIFICATION_ERROR_INVALID_DATA:
- r = E_INVALID_ARG;
- break;
-
- default:
- r = E_SYSTEM;
- break;
- }
-
- return r;
+ return __pNotiImpl->RemoveNotification();
}
+
result
_NotificationManagerImpl::RemoveNotificationOnBehalf(const AppId& appId)
{
- return __pNotificationManager->RemoveNotification(appId,false);
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
+
+ return __pNotiImpl->RemoveNotificationByAppId(appId);
}
};