From 90d6b0cce885a4627eb6afa0d01db4d2ee6dbe0f Mon Sep 17 00:00:00 2001 From: Jiban Prakash Date: Fri, 1 Nov 2013 21:26:25 +0900 Subject: [PATCH 1/1] Added new method to the NotificationManager Interface Change-Id: I3adb8ff8a85977bd239d0869fd05d7416ee60249 Signed-off-by: Jiban Prakash --- src/app/FApp_NotificationManagerImpl.cpp | 15 +++++++++++++-- src/app/inc/FApp_INotificationManagerImpl.h | 15 +++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/app/FApp_NotificationManagerImpl.cpp b/src/app/FApp_NotificationManagerImpl.cpp index d4579be..cbd7a03 100644 --- a/src/app/FApp_NotificationManagerImpl.cpp +++ b/src/app/FApp_NotificationManagerImpl.cpp @@ -83,7 +83,13 @@ _NotificationManagerImpl::GetBadgeNumber(void) const { SysTryReturn(NID_APP, __pNotiImpl != null, -1, E_SYSTEM, "[E_SYSTEM] Notification interface error."); - return __pNotiImpl->GetBadgeNumber(); + int res = __pNotiImpl->GetBadgeNumber(); + if (GetLastResult() == E_OPERATION_FAILED) + { + SetLastResult(E_SUCCESS); + return -1; + } + return res; } @@ -145,6 +151,11 @@ _NotificationManagerImpl::GetBadgeNumber(const AppId& appId) const SetLastResult(E_OBJ_NOT_FOUND); } + if (GetLastResult() == E_OPERATION_FAILED) + { + SetLastResult(E_SUCCESS); + return -1; + } return ret; } @@ -211,7 +222,7 @@ _NotificationManagerImpl::NotifyOngoingActivity(const String& messageText) const { SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error."); - return __pNotiImpl->NotifyOngoingActivity(messageText, String(L"")); + return __pNotiImpl->NotifyOngoingActivity(messageText); } diff --git a/src/app/inc/FApp_INotificationManagerImpl.h b/src/app/inc/FApp_INotificationManagerImpl.h index c481132..8cec396 100644 --- a/src/app/inc/FApp_INotificationManagerImpl.h +++ b/src/app/inc/FApp_INotificationManagerImpl.h @@ -84,6 +84,21 @@ public: virtual result RemoveNotification(void) = 0; /** + * Notifies the user about the ongoing activity using a message. + * + * @return An error code + * @param[in] messageText The notification message + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid, or + * the length of @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy. + * @exception E_INVALID_STATE This instance is in an invalid state. @n + * The Construct() method is not called. + */ + virtual result NotifyOngoingActivity(const Tizen::Base::String& messageText) = 0; + + /** * Notifies the user about the ongoing activity using a message. @n * @c launchArguments is specified as input parameter for Application::OnUserEventReceivedN() or can be obtained by * invoking Application::GetAppArgumentListN(), especially within Application::OnAppInitializing(). -- 2.7.4