From 36e12ae79c8314c9ae6e7a0526ce907c693b25f4 Mon Sep 17 00:00:00 2001 From: Dongjin Choi Date: Tue, 16 Apr 2013 18:18:05 +0900 Subject: [PATCH] Update change log and spec for wrt-plugins-tizen_0.4.19 --- packaging/wrt-plugins-tizen.spec | 4 ++-- src/CMakeLists.txt | 14 ------------ src/Calendar/CMakeLists.txt | 2 +- src/Calendar/JSCalendar.cpp | 23 +++++++++++++++++-- src/Calendar/JSCalendarEvent.cpp | 4 +++- src/Calendar/JSCalendarItemProperties.cpp | 7 ++++++ src/Calendar/JSCalendarManager.cpp | 10 +++++++- src/Calendar/plugin_initializer.cpp | 6 +++-- src/Common/TimeTracer/TimeTracer.c | 9 +++++++- src/Content/JSContentManager.cpp | 24 +++++++++++-------- src/Notification/JSStatusNotification.cpp | 8 +++---- src/Notification/StatusNotification.cpp | 38 ++++++++++++++++++++++--------- 12 files changed, 101 insertions(+), 48 deletions(-) diff --git a/packaging/wrt-plugins-tizen.spec b/packaging/wrt-plugins-tizen.spec index 6509631..a826d2e 100755 --- a/packaging/wrt-plugins-tizen.spec +++ b/packaging/wrt-plugins-tizen.spec @@ -1,7 +1,7 @@ Name: wrt-plugins-tizen Summary: JavaScript plugins for WebRuntime -Version: 0.4.17 -Release: 2 +Version: 0.4.19 +Release: 0 Group: Development/Libraries License: Apache License, Version 2.0 Source0: %{name}-%{version}.tar.gz diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9ff73f7..983e7bb 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,20 +33,6 @@ SET(LIBS_TEST "standaloneconsole" ) -#set(LIBS_COMMON -# ${LIBS_COMMON} -# ${COMMON_TARGET_NAME} -#) -# -#add_subdir(Common/StandaloneConsole) -#add_subdir(Common/TimeTracer) -# -#set(LIBS_TEST -# ${LIBS_COMMON} -# "standaloneconsole" -# "timetracer" -#) - # ----------------------------------------------------------------------------- # Plugin Modules # ----------------------------------------------------------------------------- diff --git a/src/Calendar/CMakeLists.txt b/src/Calendar/CMakeLists.txt index 9084841..205d9d7 100755 --- a/src/Calendar/CMakeLists.txt +++ b/src/Calendar/CMakeLists.txt @@ -8,7 +8,7 @@ INCLUDE_DIRECTORIES( ${TOP}/Tizen ${TOP}/TimeUtil ${TOP}/Contact - ${TOP}/Common + ${INCLUDE_COMMON} ${platform_pkgs_calendar_INCLUDE_DIRS} ) diff --git a/src/Calendar/JSCalendar.cpp b/src/Calendar/JSCalendar.cpp index 2026920..61646cb 100755 --- a/src/Calendar/JSCalendar.cpp +++ b/src/Calendar/JSCalendar.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include "JSCalendarManager.h" #include "CalendarConverter.h" @@ -144,6 +145,7 @@ JSValueRef JSCalendar::add(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); @@ -188,6 +190,7 @@ JSValueRef JSCalendar::add(JSContextRef context, if (dplEvent->getResult()) { LogDebug("Add result successful."); + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return JSValueMakeUndefined(context); } else { ThrowMsg(UnknownException, "Adding failed by unknown reason."); @@ -222,6 +225,7 @@ JSValueRef JSCalendar::addBatch(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); @@ -274,6 +278,7 @@ JSValueRef JSCalendar::addBatch(JSContextRef context, CalendarAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, globalContext); + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return JSValueMakeUndefined(context); } Catch(UnsupportedException) @@ -305,6 +310,7 @@ JSValueRef JSCalendar::update(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); @@ -352,6 +358,7 @@ JSValueRef JSCalendar::update(JSContextRef context, calendar->updateEvent(dplEvent); if (dplEvent->getResult()) { + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return JSValueMakeUndefined(context); } else { ThrowMsg(UnknownException, "Updating failed by unknown reason."); @@ -391,6 +398,7 @@ JSValueRef JSCalendar::updateBatch(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); @@ -451,6 +459,7 @@ JSValueRef JSCalendar::updateBatch(JSContextRef context, CalendarAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, globalContext); + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return JSValueMakeUndefined(context); } Catch(UnsupportedException) @@ -487,6 +496,7 @@ JSValueRef JSCalendar::remove(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); @@ -536,6 +546,7 @@ JSValueRef JSCalendar::remove(JSContextRef context, if (dplEvent->getResult()) { LogInfo("Successfully deleted."); + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return JSValueMakeUndefined(context); } else { if (dplEvent->getExceptionCode() == ExceptionCodes::NotFoundException) { @@ -579,6 +590,7 @@ JSValueRef JSCalendar::removeBatch(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); @@ -657,7 +669,7 @@ JSValueRef JSCalendar::removeBatch(JSContextRef context, calendar->deleteEvents(dplEvent); CalendarAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, globalContext); - + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return JSValueMakeUndefined(context); } Catch(UnsupportedException) @@ -694,6 +706,7 @@ JSValueRef JSCalendar::find(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); @@ -764,7 +777,7 @@ JSValueRef JSCalendar::find(JSContextRef context, calendar->findEvents(dplEvent); CalendarAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, globalContext); - + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return JSValueMakeUndefined(context); } Catch(UnsupportedException) @@ -801,6 +814,7 @@ JSValueRef JSCalendar::get(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); @@ -853,6 +867,7 @@ JSValueRef JSCalendar::get(JSContextRef context, if (dplEvent->getResult()) { LogDebug("Successfully got an item."); if (CalendarEvent::EVENT_TYPE==calendar->getType()) { + TIME_TRACER_ITEM_END(__FUNCTION__, 0); // Use global context for the expandRecurrence api in event. return JSCalendarEvent::createJSCalendarEvent(globalContext, dplEvent->getItem()); } else if (CalendarEvent::TASK_TYPE==calendar->getType()) { @@ -902,6 +917,7 @@ JSValueRef JSCalendar::addChangeListener(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); @@ -983,6 +999,7 @@ JSValueRef JSCalendar::addChangeListener(JSContextRef context, CalendarListenerManagerSingleton::Instance().registerListener(listenerItem, globalContext); LogDebug("Returning the watchId "<(JSObjectGetPrivate(thisObject)); @@ -1053,6 +1071,7 @@ JSValueRef JSCalendar::removeChangeListener(JSContextRef context, DeviceAPI::Common::IListenerItemPtr listenerItem = DPL::StaticPointerCast(canceller); CalendarListenerManagerSingleton::Instance().unregisterListener(listenerItem); + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return JSValueMakeUndefined(context); } Catch(UnsupportedException) diff --git a/src/Calendar/JSCalendarEvent.cpp b/src/Calendar/JSCalendarEvent.cpp index b376b6a..58ce6c0 100755 --- a/src/Calendar/JSCalendarEvent.cpp +++ b/src/Calendar/JSCalendarEvent.cpp @@ -40,6 +40,7 @@ #include "CalendarAsyncCallbackManager.h" #include +#include using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; @@ -257,6 +258,7 @@ JSValueRef JSCalendarEvent::expandRecurrence(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarEventPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); @@ -322,7 +324,7 @@ JSValueRef JSCalendarEvent::expandRecurrence(JSContextRef context, m_calendar->expandEventRecurrence(dplEvent); CalendarAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, globalContext); - + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return JSValueMakeUndefined(context); } Catch(UnsupportedException) diff --git a/src/Calendar/JSCalendarItemProperties.cpp b/src/Calendar/JSCalendarItemProperties.cpp index 42e18c0..0c49bb2 100755 --- a/src/Calendar/JSCalendarItemProperties.cpp +++ b/src/Calendar/JSCalendarItemProperties.cpp @@ -42,6 +42,7 @@ #include "plugin_config.h" #include +#include using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; @@ -193,6 +194,7 @@ JSValueRef JSCalendarItemProperties::convertToString(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarItemPropertiesPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); @@ -230,6 +232,7 @@ JSValueRef JSCalendarItemProperties::convertToString(JSContextRef context, calendar->exportEventToString(dplEvent); if (dplEvent->getResult()) { + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return converter.toJSValueRef(dplEvent->getEventString()); } else { ThrowMsg(UnknownException, "Converting to string failed by unknown reason."); @@ -269,6 +272,8 @@ JSValueRef JSCalendarItemProperties::clone(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN("clone(TASK)", 0); + TIME_TRACER_ITEM_BEGIN("clone(EVENT)", 0); CalendarItemPropertiesPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); @@ -296,8 +301,10 @@ JSValueRef JSCalendarItemProperties::clone(JSContextRef context, clonedItem->setRecurrenceId(UNDEFINED_ITEM_ID); if (CalendarEvent::TASK_TYPE==clonedItem->getCalendarType()) { + TIME_TRACER_ITEM_END("clone(TASK)", 0); return JSCalendarTask::createJSCalendarTask(context, clonedItem); } else if (CalendarEvent::EVENT_TYPE==clonedItem->getCalendarType()) { + TIME_TRACER_ITEM_END("clone(EVENT)", 0); // Use global context for potential async api invocation. return JSCalendarEvent::createJSCalendarEvent(globalContext, clonedItem); } else { diff --git a/src/Calendar/JSCalendarManager.cpp b/src/Calendar/JSCalendarManager.cpp index 3be83ac..0defb46 100755 --- a/src/Calendar/JSCalendarManager.cpp +++ b/src/Calendar/JSCalendarManager.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "JSCalendarManager.h" #include "JSCalendar.h" @@ -109,6 +110,7 @@ JSValueRef JSCalendarManager::getCalendars(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarManagerPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); AceSecurityStatus status = CALENDAR_CHECK_ACCESS(CALENDAR_FUNCTION_API_GET_CALENDARS); @@ -150,7 +152,7 @@ JSValueRef JSCalendarManager::getCalendars(JSContextRef context, privateObject->getObject()->getCalendars(dplEvent); CalendarAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, globalContext); - + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return JSValueMakeUndefined(context); } Catch(UnsupportedException) @@ -182,6 +184,7 @@ JSValueRef JSCalendarManager::getDefaultCalendar(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarManagerPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); AceSecurityStatus status = CALENDAR_CHECK_ACCESS(CALENDAR_FUNCTION_API_GET_DEFAULT_CALENDAR); @@ -245,6 +248,7 @@ JSValueRef JSCalendarManager::getDefaultCalendar(JSContextRef context, return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage()); } + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return JSValueMakeUndefined(context); } @@ -255,6 +259,7 @@ JSValueRef JSCalendarManager::getUnifiedCalendar(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarManagerPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); AceSecurityStatus status = CALENDAR_CHECK_ACCESS(CALENDAR_FUNCTION_API_GET_UNIFIED_CALENDAR); @@ -319,6 +324,7 @@ JSValueRef JSCalendarManager::getUnifiedCalendar(JSContextRef context, return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage()); } + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return JSValueMakeUndefined(context); } @@ -329,6 +335,7 @@ JSValueRef JSCalendarManager::getCalendar(JSContextRef context, const JSValueRef arguments[], JSValueRef* exception) { + TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0); CalendarManagerPrivObject *privateObject = static_cast(JSObjectGetPrivate(thisObject)); AceSecurityStatus status = CALENDAR_CHECK_ACCESS(CALENDAR_FUNCTION_API_GET_CALENDAR); @@ -366,6 +373,7 @@ JSValueRef JSCalendarManager::getCalendar(JSContextRef context, // Process the result. if (dplEvent->getResult()) { if( dplEvent->getCalendar() ) { + TIME_TRACER_ITEM_END(__FUNCTION__, 0); return converter.toJSValueRefCalendar(dplEvent->getCalendar()); } else { ThrowMsg(NotFoundException, "Calendar not found."); diff --git a/src/Calendar/plugin_initializer.cpp b/src/Calendar/plugin_initializer.cpp index 0d10388..a9005ca 100755 --- a/src/Calendar/plugin_initializer.cpp +++ b/src/Calendar/plugin_initializer.cpp @@ -32,6 +32,7 @@ #include "CalendarAsyncCallbackManager.h" #include "CalendarListenerManager.h" +#include #include namespace DeviceAPI { @@ -43,7 +44,7 @@ using namespace WrtDeviceApis::Commons; void on_widget_start_callback(int widgetId) { LogDebug("[Tizen\\Calendar] on_widget_start_callback (" << widgetId << ")"); - + TIME_TRACER_INIT(); Try { WrtAccessSingleton::Instance().initialize(widgetId); } Catch (Exception) { @@ -54,7 +55,8 @@ void on_widget_start_callback(int widgetId) void on_widget_stop_callback(int widgetId) { LogDebug("[Tizen\\Calendar] on_widget_stop_callback (" << widgetId << ")"); - + TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"Calendar"); + TIME_TRACER_RELEASE(); Try { WrtAccessSingleton::Instance().deinitialize(widgetId); } Catch (Exception) { diff --git a/src/Common/TimeTracer/TimeTracer.c b/src/Common/TimeTracer/TimeTracer.c index ad0a25e..9348157 100644 --- a/src/Common/TimeTracer/TimeTracer.c +++ b/src/Common/TimeTracer/TimeTracer.c @@ -96,6 +96,10 @@ static int __get_time_tracer_item_index(char* name) */ int time_tracer_init(void) { + if (g_items) { + LOGW("[%s] Ignored. Already Initialized.", __FUNCTION__); + return 0; + } g_items = (time_tracer_item **) malloc(TIME_TRACER_ITEM_MAX * sizeof(time_tracer_item *)); if(!g_items) { @@ -355,7 +359,10 @@ void time_tracer_export_report(int direction, char* name) g_items[i]->last_timestamp - g_first_time, //end timestamp g_items[i]->mismatch_count ); // # of mismatch (begin - end mismatch) - LOG(LOG_ERROR, LOG_TAG, format,i,g_items[i]->name, g_items[i]->total_elapsed_time, g_items[i]->invoke_count, (g_items[i]->total_elapsed_time == 0)?0:(int)(g_items[i]->total_elapsed_time / g_items[i]->invoke_count), g_items[i]->min_elapsed_time, g_items[i]->max_elapsed_time, g_items[i]->first_timestamp - g_first_time, g_items[i]->last_timestamp - g_first_time, g_items[i]->mismatch_count ); +#if 0 + LOGE("[%%3d] %%-%ds |\tTotal:%%ld,\tCnt:%%ld,\tAvg:%%ld,\tMin:%%ld,\tMax:%%ld,\tStart:%%lu,\tEnd:%%lu,\tMismatch:%%ld", + i,g_items[i]->name, g_items[i]->total_elapsed_time, g_items[i]->invoke_count, (g_items[i]->total_elapsed_time == 0)?0:(int)(g_items[i]->total_elapsed_time / g_items[i]->invoke_count), g_items[i]->min_elapsed_time, g_items[i]->max_elapsed_time, g_items[i]->first_timestamp - g_first_time, g_items[i]->last_timestamp - g_first_time, g_items[i]->mismatch_count ); +#endif } fprintf(fp, "TIME TRACER REPORT [END] ============================\n"); LOGE("TIME TRACER REPORT [END] ============================"); diff --git a/src/Content/JSContentManager.cpp b/src/Content/JSContentManager.cpp index 7f0e5ad..41140e0 100755 --- a/src/Content/JSContentManager.cpp +++ b/src/Content/JSContentManager.cpp @@ -251,11 +251,14 @@ JSValueRef JSMediacontentManager::findItems( folderId = argValidator.toString(2, true); if(!folderId.empty()){ - if(folderId == "null" || folderId == "undefined"){ + if(folderId != "null" ){ + dplEvent->setFolderID(folderId); + } + else if(folderId == "undefined"){ throw InvalidValuesException("folderId is not valid."); } - dplEvent->setFolderID(folderId); } + //filter filterObj = argValidator.toObject(3,true); @@ -264,13 +267,15 @@ JSValueRef JSMediacontentManager::findItems( // count if(argumentCount >= 6){ - long count = argValidator.toLong(5, true, -1); - if( count >= 0L ){ - dplEvent->setLimit(count); - } - else{ - throw InvalidValuesException( "count should be positive."); - } +// if(!JSValueIsNull(context, arguments[5]) && !JSValueIsUndefined(context, arguments[5])){ + long count = argValidator.toLong(5, true, 0); + if( count >= 0L ){ + dplEvent->setLimit(count); + } + else{ + throw InvalidValuesException( "count should be positive."); + } +// } } if(argumentCount >= 7){ // offset @@ -299,6 +304,7 @@ JSValueRef JSMediacontentManager::findItems( dplEvent->setSortMode(fConverter->toSortMode(sortModeObj)); } IMediacontentManagerPtr contentMgr = privateObject->getObject(); + dplEvent->setPrivateData( DPL::StaticPointerCast (cbm)); dplEvent->setForAsynchronousCall(&MediacontentManagerController::getInstance()); contentMgr->browseFolder(dplEvent); diff --git a/src/Notification/JSStatusNotification.cpp b/src/Notification/JSStatusNotification.cpp index 780def8..e3bdbfa 100755 --- a/src/Notification/JSStatusNotification.cpp +++ b/src/Notification/JSStatusNotification.cpp @@ -124,8 +124,8 @@ JSObjectRef JSStatusNotification::constructor(JSContextRef context, priv->setTitle(validator.toString(1, false, "")); //title - JSObjectRef notiInitDict = validator.toObject(2, true); - + JSObjectRef notiInitDict = validator.toObject(2, true); + if (notiInitDict) { //content @@ -339,7 +339,7 @@ JSObjectRef JSStatusNotification::constructor(JSContextRef context, { LogWarning("notification's icon path convertion is failed." << err.getMessage().c_str()); } - + } setPrivateObject(context, obj, priv); @@ -403,7 +403,7 @@ StatusNotification* JSStatusNotification::getPrivateObject(JSContextRef context, } else { - priv->setIconPath(""); + priv->setSubIconPath(""); } // number diff --git a/src/Notification/StatusNotification.cpp b/src/Notification/StatusNotification.cpp index e1adddd..ad8e5d5 100755 --- a/src/Notification/StatusNotification.cpp +++ b/src/Notification/StatusNotification.cpp @@ -128,13 +128,12 @@ StatusNotification::StatusNotification(NotificationType statusType) : { LogInfo("noti =" << noti); setNotificationHandle((void*)noti); -#if 0 - if ( statusType == NOTI_TYPE_PROGRESS) - { - notification_update_progress(noti, NOTIFICATION_PRIV_ID_NONE, getProgressValue()); + + if (NOTIFICATION_TYPE_ONGOING == type) + { //ongoing no ticker. + LogInfo("ongoing type"); + notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY |NOTIFICATION_DISPLAY_APP_INDICATOR ); } -#endif - } else { @@ -630,10 +629,22 @@ void StatusNotification::setSoundPath(const std::string& sound) if (sound.empty()) { LogInfo("sound path is NULL"); - if (notification_set_sound(m_notiHandle,NOTIFICATION_SOUND_TYPE_DEFAULT, sound.c_str()) != NOTIFICATION_ERROR_NONE) + if ( NOTI_TYPE_ONGOING == getNotiType() || NOTI_TYPE_PROGRESS == getNotiType()) { - throw UnknownException("set notification sound error"); + LogInfo("Ongoing Type" ); + if (notification_set_sound(m_notiHandle,NOTIFICATION_SOUND_TYPE_NONE, NULL) != NOTIFICATION_ERROR_NONE) + { + throw UnknownException("set notification sound error"); + } } + else + { + if (notification_set_sound(m_notiHandle,NOTIFICATION_SOUND_TYPE_DEFAULT, sound.c_str()) != NOTIFICATION_ERROR_NONE) + { + throw UnknownException("set notification sound error"); + } + } + } } else @@ -654,7 +665,7 @@ bool StatusNotification::getDefaultVibration() throw UnknownException("set notification sound error"); } - if (vib_type == NOTIFICATION_VIBRATION_TYPE_DEFAULT) + if (NOTIFICATION_VIBRATION_TYPE_DEFAULT == vib_type || NOTIFICATION_VIBRATION_TYPE_USER_DATA == vib_type) { return true; } @@ -678,14 +689,19 @@ void StatusNotification::setDefaultVibration(const bool& vibration) if (m_notiHandle) { notification_vibration_type_e vib_type = NOTIFICATION_VIBRATION_TYPE_NONE; - + LogInfo("old vibration = " << getDefaultVibration()); if (getDefaultVibration() != vibration) { if (vibration) { vib_type = NOTIFICATION_VIBRATION_TYPE_DEFAULT; } - + else + { + vib_type = NOTIFICATION_VIBRATION_TYPE_NONE; + } + LogInfo("type vibration type= " << vib_type); + if (notification_set_vibration(m_notiHandle, vib_type , NULL) != NOTIFICATION_ERROR_NONE) { throw UnknownException("set notification sound error"); -- 2.7.4