throw UnknownException("get notification title error");
}
- std::string notiTitle(title);
+ std::string notiTitle;
+ if (title)
+ {
+ notiTitle = title;
+ LoggerI(" get title : " << title);
+ }
+
return notiTitle;
}
else
throw UnknownException("get notification icon path error");
}
- std::string notiIconPath(iconPath);
- LoggerI("icon Path = " << iconPath);
+ std::string notiIconPath;
+ if (iconPath)
+ {
+ notiIconPath = iconPath;
+ LoggerI("icon Path = " << iconPath);
+ }
//if icon path invalid, return empty string.
if ( notiIconPath.find(DEFAULT_ICON_PATH,0) == std::string::npos)
{
throw UnknownException("get notification sound error");
}
-
- LoggerI(" sound type = " << type << " path = " << soundPath);
- if ( type == NOTIFICATION_SOUND_TYPE_USER_DATA )
- {
- LoggerI("soundPath = " << soundPath);
- return std::string(soundPath);
- }
- else
+
+ std::string strSoundPath;
+ if (soundPath)
{
- return std::string("");
+ LoggerI(" soudn type=" << type);
+ if ( type == NOTIFICATION_SOUND_TYPE_USER_DATA)
+ {
+ LoggerI("soundPath = " << soundPath);
+ strSoundPath = soundPath;
+ }
}
+
+ LoggerI("soundPath :" << strSoundPath);
+ return strSoundPath;
+
}
else
{
if (m_service)
{
- if (!appId.empty())
+ m_launchFlag = true;
+ if (service_set_app_id(m_service, appId.c_str())!= SERVICE_ERROR_NONE)
{
- m_launchFlag = true;
- if (service_set_app_id(m_service, appId.c_str())!= SERVICE_ERROR_NONE)
- {
- throw UnknownException("service set appId error");
- }
+ throw UnknownException("service set appId error");
}
}
std::string hexCode = "0123456789abcdef";
if (color.length() == 7 && !color.compare(0, 1, "#") )
{
- for ( int i = 1 ; i < color.length() ; i++)
+ for ( size_t i = 1 ; i < color.length() ; i++)
{
if (std::string::npos == hexCode.find(color[i]))
return false;
LoggerI("color.length()=" << color.length());
if (color.length() == 0)
{
- if (notification_set_led(m_notiHandle, NOTIFICATION_LED_OP_OFF, NULL) != NOTIFICATION_ERROR_NONE)
+ if (notification_set_led(m_notiHandle, NOTIFICATION_LED_OP_OFF, 0) != NOTIFICATION_ERROR_NONE)
{
throw UnknownException("set notification led ");
}
{
for ( int idx = 0; idx < MAX_NOTIFICATION_DETAIL_INFO_LENGTH; idx++)
{
- std::string main = getInformation(idx);
- std::string sub = getSubInformation(idx);
- LoggerI("Main : " << main << " Sub : " << sub);
- NotificationDetailInfo *info = new NotificationDetailInfo(m_notiHandle, idx, main, sub);
- m_detailInfos.push_back(info);
+ if (!isNullInformation(idx))
+ {
+ std::string main = getInformation(idx);
+ std::string sub = getSubInformation(idx);
+
+ LoggerI("Main : [" << main << "] Sub : ['" << sub <<"]");
+
+ NotificationDetailInfo *info = new NotificationDetailInfo(m_notiHandle, idx, main, sub);
+ m_detailInfos.push_back(info);
+ }
}
}
else
NotificationDetailInfo* info = *it;
if ( idx < MAX_NOTIFICATION_DETAIL_INFO_LENGTH )
{
+
LoggerI("main " << info->getMainText() << " sub " << info->getSubText() );
setInformation(info->getMainText(), idx);
setSubInformation(info->getSubText(), idx);
}
+bool StatusNotification::isNullInformation(int index)
+{
+ if (m_notiHandle)
+ {
+ notification_text_type_e type = NOTIFICATION_TEXT_TYPE_NONE;
+ switch (index)
+ {
+ case 0:
+ type = NOTIFICATION_TEXT_TYPE_INFO_1;
+ break;
+ case 1:
+ type = NOTIFICATION_TEXT_TYPE_INFO_2;
+ break;
+ case 2:
+ type = NOTIFICATION_TEXT_TYPE_INFO_3;
+ break;
+ default :
+ type = NOTIFICATION_TEXT_TYPE_NONE;
+ }
+ char *info = NULL;
+
+ if (NOTIFICATION_TEXT_TYPE_NONE != type && notification_get_text(m_notiHandle, type, &info) != NOTIFICATION_ERROR_NONE)
+ {
+ throw UnknownException("Detail Info index value is invalid or mainText value getting is failed in Detail Info.");
+ }
+
+ if (info)
+ {
+ LoggerI("is not null");
+ return false;
+ }
+ else
+ {
+ LoggerI("is null");
+ return true;
+ }
+
+ }
+ else
+ {
+ LoggerW("noti Handle is NULL");
+ throw UnknownException( "notification handle is null");
+ }
+}
+
std::string StatusNotification::getSubInformation(int index)
{
if (m_notiHandle)
if ( type != NOTIFICATION_TEXT_TYPE_NONE)
{
- if (getInformation(idx).compare(info))
+ if (getInformation(idx).compare(info) || isNullInformation(idx))
{
if (notification_set_text(m_notiHandle, type, info.c_str(),
NULL, NOTIFICATION_VARIABLE_TYPE_NONE) != NOTIFICATION_ERROR_NONE)