* @return An error code
* @param[in] badgeNumber The badge number
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
- * - The specified input parameter is invalid.
- * - The specified @c badgeNumber is less than @c 0 or the @c badgeNumber is greater than Shell::MAX_NOTIFICATION_BADGE_NUMBER.
+ * @exception E_INVALID_ARG The specified input parameter is invalid, or
+ * the specified @c badgeNumber is less than @c 0.
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
* @return An error code
* @param[in] messageText The notification message
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
- * - The specified input parameter is invalid.
- * - The specified @c messageText is empty or the length of @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH.
+ * @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_OPERATION_FAILED The operation has failed.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
* @param[in] messageText The notification message
* @param[in] badgeNumber The badge number
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
- * - The specified @c messageText is empty or the length of @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH.
- * - The specified @c badgeNumber is less than @c 0 or the @c badgeNumber is greater than Shell::MAX_NOTIFICATION_BADGE_NUMBER.
+ * @exception E_INVALID_ARG The specified @c badgeNumber is less than @c 0, or
+ * the length of @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH.
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
* @param[in] launchArguments The message for the application
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG Either of the following conditions has occurred: @n
- * - A specified input parameter is invalid.
- * - The specified @c badgeNumber is less than @c 0 or the @c badgeNumber is greater than Shell::MAX_NOTIFICATION_BADGE_NUMBER.
- * - The specified @c messageText is empty or the length of @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
- * - The specified @c launchArguments is empty or the length of @c launchArguments is greater than Shell::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
+ * - A specified input parameter is invalid. @n
+ * - The specified @c badgeNumber is less than @c 0. @n
+ * - The length of the specified @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
+ * - The length of the specified @c launchArguments is greater than Shell::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
* @return An error code
* @param[in] request The notification request
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG A specified input parameter is invalid.
+ * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
+ * - The specified @c request does not have valid badge number value in @c request. @n
+ * - The specified @c request does not have alert text in @c request. @n
+ * - The specified @c request has invalid icon file path in @c request.
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
* @param[in] request The notification request
* @exception E_SUCCESS The method is successful.
* @exception E_APP_NOT_INSTALLED The application is not installed.
- * @exception E_INVALID_ARG A specified input parameter is invalid.
+ * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
+ * - The specified @c request does not have valid badge number value in @c request. @n
+ * - The specified @c request does not have alert text in @c request. @n
+ * - The specified @c request has invalid icon file path in @c request.
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
* @return An error code
* @param[in] messageText The notification message
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
- * - The specified input parameter is invalid.
- * - The specified @c messageText is empty or the length of @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH.
+ * @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_OPERATION_FAILED The operation has failed.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG Either of the following conditions has occurred: @n
* - A specified input parameter is invalid. @n
- * - The specified @c messageText is empty or the length of @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
- * - The specified @c launchArguments is empty or the length of @c launchArguments is greater than Shell::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
+ * - The length of the specified @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
+ * - The length of the specified @c launchArguments is greater than Shell::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
* @return An error code
* @param[in] request The notification request
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG A specified input parameter is invalid.
+ * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
+ * - The specified @c request does not have either alert text or progress value in @c request. @n
+ * - The specified @c request has invalid icon file path in @c request.
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
* @param[in] appId The application ID
* @param[in] request The notification request
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG A specified input parameter is invalid.
+ * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
+ * - The specified @c request does not have either alert text or progress value in @c request. @n
+ * - The specified @c request has invalid icon file path in @c request.
* @exception E_APP_NOT_INSTALLED The application is not installed.
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @return An error code
* @param[in] messageText The notification message
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
- * - The specified input parameter is invalid.
- * - The specified @c messageText is empty or the length of @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH.
+ * @exception E_INVALID_ARG The specified input parameter is invalid.
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @remarks Message is displayed in the status bar.
* The maximum size is 16 kilo bytes.
* @param[in] request The notification request
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG A specified input parameter is invalid.
+ * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
+ * - The specified @c request does not have valid badge number value in @c request. @n
+ * - The specified @c request does not have alert text in @c request. @n
+ * - The specified @c request has invalid icon file path in @c request.
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @remarks For more information on the implicit AppControl resolution, see <a href="../org.tizen.native.appprogramming/html/guide/app/resolving_appcontrols.htm">Resolving AppControls</a>.
* The maximum size is 16 kilo bytes.
* @param[in] request The notification request
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG A specified input parameter is invalid.
+ * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
+ * - The specified @c request does not have either alert text or progress value in @c request. @n
+ * - The specified @c request has invalid icon file path in @c request.
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @remarks For more information on the implicit AppControl resolution, see <a href="../org.tizen.native.appprogramming/html/guide/app/resolving_appcontrols.htm">Resolving AppControls</a>.
* @return An error code
* @param[in] appMessage The message for the application
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG The specified @c appMessage is empty or the length of @c appMessage is greater than Shell::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
+ * @exception E_INVALID_ARG The length of @c appMessage is greater than Shell::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
* @exception E_INVALID_OPERATION This instance is not bound to the application.
* @remarks This method returns @c E_INVALID_OPERATION if %NotificationRequest instance is not bound to the application.
*/
* @return An error code
* @param[in] title The title text
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG The specified @c title is empty or the length of @c title is greater than Shell::MAX_NOTIFICATION_TITLE_LENGTH.
+ * @exception E_INVALID_ARG The length of @c title is greater than Shell::MAX_NOTIFICATION_TITLE_LENGTH.
*/
result SetTitleText(const Tizen::Base::String& title);
SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION);
- SysTryReturn(NID_SHELL, !IsFailed(r), -1, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+ SysTryReturnResult(NID_SHELL, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
return __pNotificationManagerImpl->GetBadgeNumber();
}
SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION);
- SysTryReturn(NID_SHELL, !IsFailed(r), -1, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+ SysTryReturnResult(NID_SHELL, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
return __pNotificationManagerImpl->GetBadgeNumber(appId);
}
int
_NotificationManagerImpl::GetBadgeNumber(void) const
{
- ClearLastResult();
-
Tizen::App::App* pApp = Tizen::App::App::GetInstance();
std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(pApp->GetAppId()));
SysTryReturn(NID_SHELL, count != -1, count, E_OPERATION_FAILED, "[%s] The operation has failed. Badge may not exist.",
GetErrorMessage(E_OPERATION_FAILED));
+ ClearLastResult();
return count;
}
result
_NotificationManagerImpl::Notify(int badgeNumber)
{
- SysTryReturnResult(NID_SHELL, badgeNumber >= 0 && badgeNumber <= MAX_NOTIFICATION_BADGE_NUMBER, E_INVALID_ARG,
- "badgeNumber is less than 0 or greater than MAX_NOTIFICATION_BADGE_NUMBER.");
+ SysTryReturnResult(NID_SHELL, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
+
+ if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
+ {
+ badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
+ }
Tizen::App::App* pApp = Tizen::App::App::GetInstance();
std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(pApp->GetAppId()));
result
_NotificationManagerImpl::Notify(const String& messageText)
{
- SysTryReturnResult(NID_SHELL, messageText.GetLength() > 0 && messageText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "messageText is less than 1 or greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
+ SysTryReturnResult(NID_SHELL, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
NotificationRequest request;
request.SetAlertText(messageText);
result
_NotificationManagerImpl::Notify(const String& messageText, int badgeNumber)
{
- SysTryReturnResult(NID_SHELL, badgeNumber >= 0 && badgeNumber <= MAX_NOTIFICATION_BADGE_NUMBER, E_INVALID_ARG,
- "badgeNumber is less than 0 or greater than MAX_NOTIFICATION_BADGE_NUMBER.");
- SysTryReturnResult(NID_SHELL, messageText.GetLength() > 0 && messageText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "messageText is less than 1 or greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
+ SysTryReturnResult(NID_SHELL, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
+ SysTryReturnResult(NID_SHELL, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
+
+ if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
+ {
+ badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
+ }
NotificationRequest request;
request.SetAlertText(messageText);
result
_NotificationManagerImpl::Notify(const String& messageText, int badgeNumber, const String& launchArguments)
{
- SysTryReturnResult(NID_SHELL, badgeNumber >= 0 && badgeNumber <= MAX_NOTIFICATION_BADGE_NUMBER, E_INVALID_ARG,
- "badgeNumber is less than 0 or greater than MAX_NOTIFICATION_BADGE_NUMBER.");
- SysTryReturnResult(NID_SHELL, messageText.GetLength() > 0 && messageText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "messageText is less than 1 or greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
- SysTryReturnResult(NID_SHELL, launchArguments.GetLength() > 0 && launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
- "launchArguments is less than 1 or greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
+ SysTryReturnResult(NID_SHELL, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
+ SysTryReturnResult(NID_SHELL, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
+ SysTryReturnResult(NID_SHELL, launchArguments != null && launchArguments.GetLength() > 0, E_INVALID_ARG,
+ "launchArguments is less than 0.");
+
+ SysTryReturnResult(NID_SHELL, 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;
+ }
NotificationRequest request;
request.SetAlertText(messageText);
int
_NotificationManagerImpl::GetBadgeNumber(const AppId& appId) const
{
- ClearLastResult();
-
bool b = _Aul::IsInstalled(appId);
SysTryReturn(NID_SHELL, b == true, -1, E_APP_NOT_INSTALLED, "[E_OBJ_NOT_FOUND] The application %ls is not installed",
appId.GetPointer());
SysTryReturn(NID_SHELL, count != -1, count, E_OPERATION_FAILED, "[%s] The operation has failed. Badge may not exist.",
GetErrorMessage(E_OPERATION_FAILED));
+ ClearLastResult();
return count;
}
result
_NotificationManagerImpl::NotifyOngoingActivity(const String& messageText)
{
- SysTryReturnResult(NID_SHELL, messageText.GetLength() > 0 && messageText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "messageText is less than 1 or greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
+ SysTryReturnResult(NID_SHELL, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
NotificationRequest request;
request.SetAlertText(messageText);
result
_NotificationManagerImpl::NotifyOngoingActivity(const String& messageText, const String& launchArguments)
{
- SysTryReturnResult(NID_SHELL, messageText.GetLength() > 0 && messageText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "messageText is less than 1 or greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
+ SysTryReturnResult(NID_SHELL, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
SysTryReturnResult(NID_SHELL, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
SysTryReturnResult(NID_SHELL, launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
"launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
result
_NotificationManagerImpl::NotifyTextMessage(const String& messageText) const
{
- SysTryReturnResult(NID_SHELL, messageText.GetLength() > 0 && messageText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "messageText is less than 1 or greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
+ SysTryReturnResult(NID_SHELL, !messageText.IsEmpty(), E_INVALID_ARG, "MessageText is less than 0.");
std::unique_ptr<char[]> pMsg(_StringConverter::CopyToCharArrayN(messageText));
int res = notification_status_message_post(pMsg.get());
r = E_INVALID_ARG;
break;
case NOTIFICATION_ERROR_IO:
- r = E_OPERATION_FAILED;
+ r = E_SYSTEM;
break;
default:
- r = E_OPERATION_FAILED;
+ r = E_SYSTEM;
break;
}
// Set - content text
if (pMsg.get())
{
- r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_CONTENT, pMsg.get(), NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
+ r = notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_CONTENT, pMsg.get(), NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set Title Text failed.", GetErrorMessage(r));
}
// Set - icon file path
// Set - sound file path
if (pSoundPath.get())
{
- if (isOngoing && needUpdate)
- {
- r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_NONE, NULL));
- }
- else
- {
- r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_USER_DATA, pSoundPath.get()));
- }
+ r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_USER_DATA, pSoundPath.get()));
}
else
{
- if (isOngoing && needUpdate)
- {
- r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_NONE, NULL));
- }
- else
- {
- r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_DEFAULT, NULL));
- }
+ r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_DEFAULT, NULL));
}
SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Notification Set sound failed.", GetErrorMessage(r));
pBundle = arg.GetBundle();
service_create_request(pBundle, &hSvc);
- SysTryCatch(NID_SHELL, hSvc != null, r = E_OPERATION_FAILED, r, "[E_OPERATION_FAILED] A system error has been occurred. service_create_request failed.");
+ SysTryCatch(NID_SHELL, hSvc != null, r = E_SYSTEM, r, "[%s] A system error has been occurred. service_create_request failed.", GetErrorMessage(E_SYSTEM));
if (notifyType == NOTIFY_TYPE_SIMPLE || notifyType == NOTIFY_TYPE_APP_ID)
{
else
if (notifyType == NOTIFY_TYPE_APP_CONTROL)
{
- std::unique_ptr<char[]> pOperationIdChar(_StringConverter::CopyToCharArrayN(*pOperationId));
- int retVal = service_set_operation(hSvc, pOperationIdChar.get());
- SysTryCatch(NID_SHELL, retVal == SERVICE_ERROR_NONE, r = E_OPERATION_FAILED, r, "[E_OPERATION_FAILED] A system error has been occurred. service_create_request failed.");
+ std::unique_ptr<char[]> pOperationIdChar(_StringConverter::CopyToCharArrayN(*pOperationId));
+ service_set_operation(hSvc, pOperationIdChar.get());
if (pUriData)
{
std::unique_ptr<char[]> pUri(_StringConverter::CopyToCharArrayN(*pUriData));
SysLog(NID_SHELL, "All [%s] notification deleted.", onGoing ? "Ongoing" : "Normal");
}
- SysTryReturnResult(NID_SHELL, err == NOTIFICATION_ERROR_NONE, E_OPERATION_FAILED, "Failed to RemoveNotification with reason (%d).", err);
+ switch (err)
+ {
+ case NOTIFICATION_ERROR_NONE:
+ r = E_SUCCESS;
+ break;
+
+ case NOTIFICATION_ERROR_INVALID_DATA:
+ r = E_INVALID_ARG;
+ break;
+
+ default:
+ r = E_SYSTEM;
+ break;
+ }
+
return r;
}
SysLog(NID_SHELL, "All [%s] notification deleted.", onGoing ? "Ongoing" : "Normal");
}
- SysTryReturnResult(NID_SHELL, err == NOTIFICATION_ERROR_NONE, E_OPERATION_FAILED, "Failed to RemoveNotificationByAppId with reason (%d).", err);
+ switch (err)
+ {
+ case NOTIFICATION_ERROR_NONE:
+ r = E_SUCCESS;
+ break;
+
+ case NOTIFICATION_ERROR_INVALID_DATA:
+ r = E_INVALID_ARG;
+ break;
+
+ default:
+ r = E_SYSTEM;
+ break;
+ }
+
return r;
}
_NotificationManagerImpl::AddBadgeEventListener(IBadgeEventListener& listener)
{
SysTryReturnResult(NID_SHELL, !__badgeEventListenerList.Contains(&listener), E_OBJ_ALREADY_EXIST, "The listener is already added.");
- SysLog(NID_SHELL, "AddBadgeEventListener (%x)", &listener);
+ SysLog(NID_SHELL, "(%x)", &listener);
result r = _BadgeManagerImpl::GetInstance()->AddPrimaryBadgeEventListener(*this);
SysTryReturnResult(NID_SHELL, !IsFailed(r), E_SYSTEM, "Failed to AddPrimaryBadgeEventListener with reason (%s)", GetErrorMessage(r) );
result
_NotificationManagerImpl::RemoveBadgeEventListener(IBadgeEventListener& listener)
{
- SysLog(NID_SHELL, "RemoveBadgeEventListener (%x)", &listener);
+ SysLog(NID_SHELL, "(%x)", &listener);
result r = __badgeEventListenerList.Remove(&listener);
SysTryReturn(NID_SHELL, !IsFailed(r), r, r, "Failed to RemoveBadgeEventListener with reason (%s)", GetErrorMessage(r) );
_NotificationRequestImpl::SetAlertText(const String& alertText)
{
SysTryReturnResult(NID_SHELL, alertText.GetLength() > 0 && alertText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "alertText is less than 1 or alertText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
+ "AlertText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
__alertText = alertText;
return E_SUCCESS;
result
_NotificationRequestImpl::SetAppMessage(const String& appMessage)
{
- SysTryReturnResult(NID_SHELL, appMessage.GetLength() > 0 && appMessage.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "appMessage is less than 1 or appMessage is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
+ SysTryReturnResult(NID_SHELL, appMessage.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
+ "AppMessage is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
SysTryReturnResult(NID_SHELL, __appBinding, E_INVALID_OPERATION,
"The Notification instance is not bound to Application");
result
_NotificationRequestImpl::SetTitleText(const String& titleText)
{
- SysTryReturnResult(NID_SHELL, titleText.GetLength() > 0 && titleText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "titleText is less than 1 or titleText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
-
+ SysTryReturnResult(NID_SHELL, titleText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
+ "TitleText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
__titleText = titleText;
return E_SUCCESS;
}
// use int type instead of OngoingActivityType to evade weired gcc optimization
int activitytype = static_cast<int>(GetOngoingActivityType());
- SysTryReturnResult(NID_SHELL, activitytype > ONGOING_ACTIVITY_TYPE_TEXT && activitytype <= ONGOING_ACTIVITY_TYPE_PROGRESS_PERCENTAGE,
+ SysTryReturnResult(NID_SHELL, activitytype >= ONGOING_ACTIVITY_TYPE_TEXT && activitytype <= ONGOING_ACTIVITY_TYPE_PROGRESS_PERCENTAGE,
E_INVALID_OPERATION,"Invalid activity Type %d.", activitytype);
if (activitytype == ONGOING_ACTIVITY_TYPE_PROGRESS_PERCENTAGE)
result
_NotificationRequestImpl::SetNotificationCountText(const Tizen::Base::String& notificationCountText)
{
- SysTryReturnResult(NID_SHELL, notificationCountText.GetLength() > 0 && notificationCountText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "notificationCountText is less than 1 or notificationCountText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
+ SysTryReturnResult(NID_SHELL, notificationCountText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
+ "Invalid argument is used. CountText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
__notificationCountText = notificationCountText;
return E_SUCCESS;
}