* @brief This is the placeholder for _NotificationManagerImpl class.
*/
-#include <unique_ptr.h>
-
-#include <appsvc/appsvc.h>
-#include <bundle.h>
-#include <badge.h>
-#include <notification/notification.h>
-#include <appfw/app.h>
-#include <appfw/app_ui_notification.h>
-#include <appinfo.h>
-
#include <FBaseSysLog.h>
-#include <FAppNotificationManager.h>
-#include <FBaseInternalTypes.h>
-#include <FBase_StringConverter.h>
+#include <FBaseRt_LibraryImpl.h>
+
#include "FApp_NotificationManagerImpl.h"
-#include "FApp_AppInfo.h"
-#include "FIoFile.h"
-#include "FAppPkg_PackageManagerImpl.h"
-#include "FApp_Aul.h"
-#include "FApp_AppArg.h"
-#include "FAppPkgPackageAppInfo.h"
-#include "FAppPkg_PackageAppInfoImpl.h"
+#include "FApp_INotificationManagerImpl.h"
using namespace Tizen::Base;
-using namespace Tizen::App;
-using namespace Tizen::App::Package;
-using namespace Tizen::Io;
-
-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;
- }
-}
+const wchar_t OSP_SHELL_SONAME[] = L"libosp-shell-core.so.1";
}
{
_NotificationManagerImpl::_NotificationManagerImpl(void)
+: __pNotiImpl(null)
{
}
-_NotificationManagerImpl::~_NotificationManagerImpl(void)
-{
-}
-
-result
-_NotificationManagerImpl::Construct(void)
-{
- return E_SUCCESS;
-}
-
-const _NotificationManagerImpl*
-_NotificationManagerImpl::GetInstance(const NotificationManager& notiMgr)
-{
- return notiMgr.__pNotificationManagerImpl;
-}
-
-_NotificationManagerImpl*
-_NotificationManagerImpl::GetInstance(NotificationManager& notiMgr)
-{
- return notiMgr.__pNotificationManagerImpl;
-}
-
-int
-_NotificationManagerImpl::GetBadgeNumber(void) const
-{
- unsigned int count = 0;
-
- badge_error_e badgeError = badge_get_count(appinfo_get_appid(), &count);
-
- if (badgeError == BADGE_ERROR_NONE)
- {
- SysLog(NID_APP, "badge_get_count(%d)", count);
- }
- else
- {
- SysLog(NID_APP, "badge_get_count failed(%d).", badgeError);
- return -1;
- }
- 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;
- char* pkgname = NULL;
- char* pIcon = NULL;
- bundle* pKb = NULL;
- service_h svc = NULL;
- _AppArg arg;
- String iconPath;
- ui_notification_h core = NULL;
- PackageAppInfo* pPackageAppInfo = NULL;
-
- 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);
-
- const String& currappId = _AppInfo::GetApplicationId();
-
- pPackageAppInfo = _PackageManagerImpl::GetInstance()->GetPackageAppInfoN(currappId);
- iconPath = _PackageAppInfoImpl::GetInstance(pPackageAppInfo)->GetAppNotificationIconPath();
-
- if (!iconPath.IsEmpty() && File::IsFileExist(iconPath))
- {
- pIcon = _StringConverter::CopyToCharArrayN(iconPath);
- r = ConvertNotificationResult(ui_notification_set_icon(core, pIcon));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set icon failed.", GetErrorMessage(r));
- }
-
- 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)
- {
- badge_error_e badgeError = badge_set_count(appinfo_get_appid(), badgeNumber);
- SysTryLog(NID_APP, badgeError == BADGE_ERROR_NONE, "badge_set_count failed(%d).", badgeError);
- }
-
-CATCH:
- delete pPackageAppInfo;
- delete[] pMsg;
- delete[] pIcon;
- 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
+_NotificationManagerImpl::~_NotificationManagerImpl(void)
{
- result r = E_SUCCESS;
- int retcode = 0;
- String iconPath;
- 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;
- PackageAppInfo* pPackageAppInfo = null;
-
- memset(buffer, 0, 256);
-
- bool inInstalled = _Aul::IsInstalled(appId);
- SysTryReturnResult(NID_APP, inInstalled == true, E_APP_NOT_INSTALLED, "The application %ls is not installed", appId.GetPointer());
-
- if (!isOngoing || !messageText.IsEmpty())
+ if (__pNotiImpl)
{
- 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);
+ typedef void (*NotificationDeletor)(_INotificationManagerImpl*);
- 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());
-
- pPackageAppInfo = _PackageManagerImpl::GetInstance()->GetPackageAppInfoN(appId);
- if (pPackageAppInfo)
- {
- iconPath = pPackageAppInfo->GetAppNotificationIconPath();
-
- if (!iconPath.IsEmpty() && File::IsFileExist(iconPath))
- {
- pIcon = _StringConverter::CopyToCharArrayN(iconPath);
- r = ConvertNotificationResult(ui_notification_set_icon(core, pIcon));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set icon failed.", GetErrorMessage(r));
- }
- else
- {
- iconPath = pPackageAppInfo->GetAppMenuIconPath();
- pIcon = _StringConverter::CopyToCharArrayN(iconPath);
- r = ConvertNotificationResult(ui_notification_set_icon(core, pIcon));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification Set icon path failed.", GetErrorMessage(r));
- }
-
- const String& displayName = pPackageAppInfo->GetAppDisplayName();
- pName = _StringConverter::CopyToCharArrayN(displayName);
-
- r = ConvertNotificationResult(ui_notification_set_title(core, pName));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set title failed.", GetErrorMessage(r));
- }
- else
+ NotificationDeletor pDeleter = reinterpret_cast<NotificationDeletor>(__lib.GetProcAddress(L"DeleteNotificationManagerInstance"));
+ if (pDeleter)
{
- SysLog(NID_APP, "No packageInfo found for %ls", appId.GetPointer());
+ (*pDeleter)(__pNotiImpl);
+ SysLog(NID_APP, "NotificationManager stub deleted.");
}
-
-
- 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));
-
- 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)
- {
- badge_error_e badgeError = badge_set_count(buffer, badgeNumber);
- SysTryLog(NID_APP, badgeError == BADGE_ERROR_NONE, "badge_set_count failed(%d).", badgeError);
}
-
-CATCH:
- delete pPackageAppInfo;
- delete[] pMsg;
- delete[] pIcon;
- delete[] pName;
-
- if (core)
- {
- ui_notification_destroy(core);
- }
- service_destroy(svc);
- return r;
}
result
-_NotificationManagerImpl::RemoveImpl(const char* pAppId, notification_type_e type)
+_NotificationManagerImpl::Construct(void)
{
- result r = E_SUCCESS;
+ 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));
- notification_error_e err = notification_delete_all_by_type(pAppId, type);
- switch (err)
- {
- case NOTIFICATION_ERROR_NONE:
- r = E_SUCCESS;
- break;
-
- case NOTIFICATION_ERROR_INVALID_DATA:
- r = E_INVALID_ARG;
- break;
+ 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.");
- default:
- r = E_SYSTEM;
- break;
- }
+ __pNotiImpl = (*pCreator)();
return r;
}
-result
-_NotificationManagerImpl::RemoveImpl(const AppId& appId, bool isOngoing)
+int
+_NotificationManagerImpl::GetBadgeNumber(void) const
{
- const bool isValidAppId = _Aul::IsInstalled(appId);
- SysTryReturnResult(NID_APP, isValidAppId, E_APP_NOT_INSTALLED, "The application %ls is not installed", appId.GetPointer());
-
- std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
- const notification_type_e notiType = (isOngoing) ? NOTIFICATION_TYPE_ONGOING : NOTIFICATION_TYPE_NOTI;
+ SysTryReturn(NID_APP, __pNotiImpl != null, -1, E_SYSTEM, "[E_SYSTEM] Notification interface error.");
- return RemoveImpl(pAppId.get(), notiType);
+ 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.");
+ SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "badgeNumber is less than 0.");
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.");
+ SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "badgeNumber is less than 0.");
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.");
+ SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "badgeNumber is less than 0.");
- 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];
- unsigned int count = 0;
-
- memset(buffer, 0, 256);
+ SysTryReturn(NID_APP, __pNotiImpl != null, -1, E_SYSTEM, "[E_SYSTEM] Notification interface error.");
- snprintf(buffer, 256, "%ls", appId.GetPointer());
- std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
-
- badge_error_e badgeError = badge_get_count(pAppId.get(), &count);
-
- if (badgeError == BADGE_ERROR_NONE)
- {
- SysLog(NID_APP, "badge_get_count(%d)", count);
- }
- else
+ const int ret = __pNotiImpl->GetBadgeNumber(appId);
+ result r = GetLastResult();
+ if (r == E_APP_NOT_INSTALLED)
{
- SysLog(NID_APP, "badge_get_count failed(%d).", badgeError);
- return -1;
+ SetLastResult(E_OBJ_NOT_FOUND);
}
- return count;
+ return ret;
}
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.");
+ SysTryReturnResult(NID_APP, !messageText.IsEmpty(), E_INVALID_ARG, "MessageText is less than 0.");
- 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.");
+ SysTryReturnResult(NID_APP, !messageText.IsEmpty(), E_INVALID_ARG, "MessageText is less than 0.");
- return OngoingImpl(appId, messageText, launchArguments);
+ return __pNotiImpl->NotifyOngoingActivityByAppId(appId, messageText, launchArguments);
}
+
result
_NotificationManagerImpl::RemoveOngoingActivityNotification(void)
{
- return RemoveImpl(NULL, NOTIFICATION_TYPE_ONGOING);
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
+
+ return __pNotiImpl->RemoveOngoingActivityNotification();
}
+
result
_NotificationManagerImpl::RemoveOngoingActivityNotificationOnBehalf(const AppId& appId)
{
- return RemoveImpl(appId, true);
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
+
+ return __pNotiImpl->RemoveOngoingActivityNotificationByAppId(appId);
}
+
result
_NotificationManagerImpl::RemoveNotification(void)
{
- return RemoveImpl(NULL, NOTIFICATION_TYPE_NOTI);
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
+
+ return __pNotiImpl->RemoveNotification();
}
+
result
_NotificationManagerImpl::RemoveNotificationOnBehalf(const AppId& appId)
{
- return RemoveImpl(appId, false);
+ SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
+
+ return __pNotiImpl->RemoveNotificationByAppId(appId);
}
};