#include "FApp_AppArg.h"
#include "FShell_NotificationManagerImpl.h"
#include "FShell_NotificationManagerProxy.h"
+#include "FAppPkgPackageAppInfo.h"
+#include "FAppPkg_PackageAppInfoImpl.h"
using namespace Tizen::Base;
using namespace Tizen::App;
char* pMsg = null;
notification_h core = NULL;
char* pkgname = NULL;
+ char* pIcon = null;
bundle* pKb = NULL;
bundle* service_data = NULL;
service_h svc = NULL;
_AppArg arg;
+ String iconPath;
+ PackageAppInfo* pPackageAppInfo = null;
if (!messageText.IsEmpty())
{
pMsg = _StringConverter::CopyToCharArrayN(messageText);
notification_set_text(core, NOTIFICATION_TEXT_TYPE_CONTENT, pMsg, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+ const String& currappId = _AppInfo::GetApplicationId();
+
+ pPackageAppInfo = _PackageManagerImpl::GetInstance()->GetPackageAppInfoN(currappId);
+ iconPath = _PackageAppInfoImpl::GetInstance(pPackageAppInfo)->GetAppNotificationIconPath();
+
+ if (!iconPath.IsEmpty())
+ {
+ pIcon = _StringConverter::CopyToCharArrayN(iconPath);
+ r = ConvertNotificationResult(notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, 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.");
}
CATCH:
+ delete pPackageAppInfo;
delete[] pMsg;
+ delete[] pIcon;
if (pkgname)
{
free(pkgname);
}
-
if (core)
{
notification_free(core);
{
result r = E_SUCCESS;
char* pMsg = null;
- char* pIcon = NULL;
+ char* pIcon = null;
+ char* pDefaultIconPath = NULL;
char* pName = NULL;
notification_h core = NULL;
char buffer[256];
bundle* service_data = NULL;
service_h svc = NULL;
_AppArg arg;
+ String iconPath;
+ PackageAppInfo* pPackageAppInfo = null;
memset(buffer, 0, 256);
- bool b = _Aul::IsInstalled(appId);
- SysTryReturnResult(NID_APP, b == true, E_APP_NOT_INSTALLED, "The application %ls is not installed", appId.GetPointer());
+ bool isInstalled = _Aul::IsInstalled(appId);
+ SysTryReturnResult(NID_APP, isInstalled == true, E_APP_NOT_INSTALLED, "The application %ls is not installed", appId.GetPointer());
if (isOngoing || !messageText.IsEmpty())
{
snprintf(buffer, 256, "%ls", appId.GetPointer());
- app_manager_get_app_icon_path(buffer, &pIcon);
- r = ConvertNotificationResult(notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIcon));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set icon failed.", GetErrorMessage(r));
+ pPackageAppInfo = _PackageManagerImpl::GetInstance()->GetPackageAppInfoN(appId);
+ iconPath = _PackageAppInfoImpl::GetInstance(pPackageAppInfo)->GetAppNotificationIconPath();
+
+ if (!iconPath.IsEmpty())
+ {
+ pIcon = _StringConverter::CopyToCharArrayN(iconPath);
+ r = ConvertNotificationResult(notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIcon));
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set icon failed.", GetErrorMessage(r));
+ }
+ else
+ {
+ app_manager_get_app_icon_path(buffer, &pDefaultIconPath);
+ r = ConvertNotificationResult(notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pDefaultIconPath));
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification Set icon path failed.", GetErrorMessage(r));
+ }
app_manager_get_app_name(buffer, &pName);
r = ConvertNotificationResult(notification_set_text(core, NOTIFICATION_TEXT_TYPE_TITLE, pName, NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
CATCH:
delete[] pMsg;
-
- if (core)
+ delete[] pIcon;
+ delete pPackageAppInfo;
+ if (pDefaultIconPath)
{
- notification_free(core);
+ free(pDefaultIconPath);
}
-
- if (pIcon)
+ if (core)
{
- free(pIcon);
+ notification_free(core);
}
if (pName)
notification_h core = NULL;
char* pkgname = NULL;
char* pTitleText = NULL;
- char* pIconPath = NULL;
+ char* pIconPath = null;
char* pSoundPath = NULL;
bundle* pKb = NULL;
bundle* service_data = NULL;
service_h svc = NULL;
_AppArg arg;
+ String appiconPath;
+ PackageAppInfo* pPackageAppInfo = null;
const String& messageText = notiMessage.GetAlertText();
const String& launchArguments = notiMessage.GetAppMessage();
r = ConvertNotificationResult(notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIconPath));
SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set icon failed.", GetErrorMessage(r));
}
+ else
+ {
+ const String& currappId = _AppInfo::GetApplicationId();
+ pPackageAppInfo = _PackageManagerImpl::GetInstance()->GetPackageAppInfoN(currappId);
+
+ appiconPath = _PackageAppInfoImpl::GetInstance(pPackageAppInfo)->GetAppNotificationIconPath();
+
+ if (!iconPath.IsEmpty())
+ {
+ pIconPath = _StringConverter::CopyToCharArrayN(appiconPath);
+ r = ConvertNotificationResult(notification_set_image(core, NOTIFICATION_IMAGE_TYPE_ICON, pIconPath));
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set icon failed.", GetErrorMessage(r));
+ }
+ }
if (!soundPath.IsEmpty())
{
delete[] pIconPath;
delete[] pTitleText;
delete[] pSoundPath;
+ delete pPackageAppInfo;
+
if (pkgname)
{
free(pkgname);