updated the Notification icon implementation code
authorJiban Prakash <p.jiban@samsung.com>
Wed, 6 Feb 2013 07:28:58 +0000 (12:58 +0530)
committerJiban Prakash <p.jiban@samsung.com>
Wed, 6 Feb 2013 07:28:58 +0000 (12:58 +0530)
Change-Id: I3585881500d84b4020fc74da0a096bbeca8e932a
Signed-off-by: Jiban Prakash <p.jiban@samsung.com>
src/core/FShell_NotificationManagerImpl.cpp

index 0bd4792..fa156a7 100644 (file)
@@ -37,6 +37,7 @@
 #include <FBase_StringConverter.h>
 #include "FApp_AppInfo.h"
 #include "FApp_Aul.h"
+#include "FIoFile.h"
 #include "FAppPkg_PackageManagerImpl.h"
 #include "FApp_AppArg.h"
 #include "FShell_NotificationManagerImpl.h"
@@ -47,6 +48,7 @@
 using namespace Tizen::Base;
 using namespace Tizen::App;
 using namespace Tizen::App::Package;
+using namespace Tizen::Io;
 using namespace Tizen::Shell;
 
 extern "C" int service_create_request(bundle *data, service_h *service);
@@ -214,7 +216,7 @@ _NotificationManagerImpl::NotifyImpl(const String& messageText, int badgeNumber,
                pPackageAppInfo = _PackageManagerImpl::GetInstance()->GetPackageAppInfoN(currappId);
                iconPath = _PackageAppInfoImpl::GetInstance(pPackageAppInfo)->GetAppNotificationIconPath();
 
-               if (!iconPath.IsEmpty())
+               if (!iconPath.IsEmpty() && File::IsFileExist(iconPath))
                {
                        pIcon = _StringConverter::CopyToCharArrayN(iconPath);
                        r = ConvertNotificationResult(notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIcon));
@@ -313,7 +315,7 @@ _NotificationManagerImpl::NotifyImpl(const AppId& appId, const String& messageTe
                pPackageAppInfo = _PackageManagerImpl::GetInstance()->GetPackageAppInfoN(appId);
                iconPath = _PackageAppInfoImpl::GetInstance(pPackageAppInfo)->GetAppNotificationIconPath();
 
-               if (!iconPath.IsEmpty())
+               if (!iconPath.IsEmpty() && File::IsFileExist(iconPath))
                {
                        pIcon = _StringConverter::CopyToCharArrayN(iconPath);
                        r = ConvertNotificationResult(notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIcon));
@@ -433,7 +435,7 @@ _NotificationManagerImpl::NotifyMessageImpl(const NotificationRequest& notiMessa
                        SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set title text failed.", GetErrorMessage(r));
                }
 
-               if (!iconPath.IsEmpty())
+               if (!iconPath.IsEmpty() )
                {
                        pIconPath = _StringConverter::CopyToCharArrayN(iconPath);
                        r = ConvertNotificationResult(notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIconPath));
@@ -446,7 +448,7 @@ _NotificationManagerImpl::NotifyMessageImpl(const NotificationRequest& notiMessa
 
                        appiconPath = _PackageAppInfoImpl::GetInstance(pPackageAppInfo)->GetAppNotificationIconPath();
 
-                       if (!iconPath.IsEmpty())
+                       if (!appiconPath.IsEmpty() && File::IsFileExist(appiconPath))
                        {
                                pIconPath = _StringConverter::CopyToCharArrayN(appiconPath);
                                r = ConvertNotificationResult(notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIconPath));