fix legacy noti tc failure
authorYoung Ik Cho <youngik.cho@samsung.com>
Mon, 28 Oct 2013 03:11:05 +0000 (12:11 +0900)
committerYoung Ik Cho <youngik.cho@samsung.com>
Mon, 28 Oct 2013 03:11:05 +0000 (12:11 +0900)
Change-Id: I1ea61120edd3485e7b8790cfb199b6f7b0362d66
Signed-off-by: Young Ik Cho <youngik.cho@samsung.com>
src/app/FApp_NotificationManagerImpl.cpp

index a3b2224..b9db124 100644 (file)
@@ -90,6 +90,7 @@ result
 _NotificationManagerImpl::Notify(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"");
@@ -113,6 +114,7 @@ result
 _NotificationManagerImpl::Notify(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.");
 
        String appMessage = String(L"");
 
@@ -124,6 +126,7 @@ result
 _NotificationManagerImpl::Notify(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.");
 
        return __pNotiImpl->Notify(messageText, badgeNumber, launchArguments);
 }
@@ -133,7 +136,15 @@ _NotificationManagerImpl::GetBadgeNumber(const AppId& appId) const
 {
        SysTryReturn(NID_APP, __pNotiImpl != null, -1, E_SYSTEM, "[E_SYSTEM] Notification interface error.");
 
-       return __pNotiImpl->GetBadgeNumber(appId);
+
+       const int ret = __pNotiImpl->GetBadgeNumber(appId);
+       result r = GetLastResult();
+       if (r == E_APP_NOT_INSTALLED)
+       {
+               SetLastResult(E_OBJ_NOT_FOUND);
+       }
+
+       return ret;
 }
 
 
@@ -211,6 +222,7 @@ result
 _NotificationManagerImpl::NotifyOngoingActivityOnBehalf(const AppId& appId, const String& messageText) const
 {
        SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
+       SysTryReturnResult(NID_APP, !messageText.IsEmpty(), E_INVALID_ARG, "MessageText is less than 0.");
 
        return __pNotiImpl->NotifyOngoingActivityByAppId(appId, messageText, String(L""));
 }
@@ -221,6 +233,7 @@ _NotificationManagerImpl::NotifyOngoingActivityOnBehalf(const AppId& appId, cons
                                                                                                                const String& launchArguments) const
 {
        SysTryReturnResult(NID_APP, __pNotiImpl != null, E_SYSTEM, "Notification interface error.");
+       SysTryReturnResult(NID_APP, !messageText.IsEmpty(), E_INVALID_ARG, "MessageText is less than 0.");
 
        return __pNotiImpl->NotifyOngoingActivityByAppId(appId, messageText, launchArguments);
 }