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
"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
# -----------------------------------------------------------------------------
${TOP}/Tizen
${TOP}/TimeUtil
${TOP}/Contact
- ${TOP}/Common
+ ${INCLUDE_COMMON}
${platform_pkgs_calendar_INCLUDE_DIRS}
)
#include <JSTizenExceptionFactory.h>
#include <SecurityExceptions.h>
#include <TimeUtilConverter.h>
+#include <TimeTracer.h>
#include "JSCalendarManager.h"
#include "CalendarConverter.h"
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarPrivObject *privateObject =
static_cast<CalendarPrivObject*>(JSObjectGetPrivate(thisObject));
if (dplEvent->getResult()) {
LogDebug("Add result successful.");
+ TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
} else {
ThrowMsg(UnknownException, "Adding failed by unknown reason.");
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarPrivObject *privateObject =
static_cast<CalendarPrivObject*>(JSObjectGetPrivate(thisObject));
CalendarAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, globalContext);
+ TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
}
Catch(UnsupportedException)
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarPrivObject *privateObject =
static_cast<CalendarPrivObject*>(JSObjectGetPrivate(thisObject));
calendar->updateEvent(dplEvent);
if (dplEvent->getResult()) {
+ TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
} else {
ThrowMsg(UnknownException, "Updating failed by unknown reason.");
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarPrivObject *privateObject =
static_cast<CalendarPrivObject*>(JSObjectGetPrivate(thisObject));
CalendarAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, globalContext);
+ TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
}
Catch(UnsupportedException)
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarPrivObject *privateObject =
static_cast<CalendarPrivObject*>(JSObjectGetPrivate(thisObject));
if (dplEvent->getResult()) {
LogInfo("Successfully deleted.");
+ TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
} else {
if (dplEvent->getExceptionCode() == ExceptionCodes::NotFoundException) {
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarPrivObject *privateObject =
static_cast<CalendarPrivObject*>(JSObjectGetPrivate(thisObject));
calendar->deleteEvents(dplEvent);
CalendarAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, globalContext);
-
+ TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
}
Catch(UnsupportedException)
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarPrivObject *privateObject =
static_cast<CalendarPrivObject*>(JSObjectGetPrivate(thisObject));
calendar->findEvents(dplEvent);
CalendarAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, globalContext);
-
+ TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
}
Catch(UnsupportedException)
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarPrivObject *privateObject =
static_cast<CalendarPrivObject*>(JSObjectGetPrivate(thisObject));
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()) {
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarPrivObject *privateObject =
static_cast<CalendarPrivObject*>(JSObjectGetPrivate(thisObject));
CalendarListenerManagerSingleton::Instance().registerListener(listenerItem, globalContext);
LogDebug("Returning the watchId "<<watchId);
+ TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return converter.toJSValueRefLong(watchId);
} else {
ThrowMsg(UnknownException, "Adding change listener failed by unknown reason.");
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarPrivObject *privateObject =
static_cast<CalendarPrivObject*>(JSObjectGetPrivate(thisObject));
DeviceAPI::Common::IListenerItemPtr listenerItem = DPL::StaticPointerCast<DeviceAPI::Common::IListenerItem>(canceller);
CalendarListenerManagerSingleton::Instance().unregisterListener(listenerItem);
+ TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
}
Catch(UnsupportedException)
#include "CalendarAsyncCallbackManager.h"
#include <GlobalContextManager.h>
+#include <TimeTracer.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarEventPrivObject *privateObject =
static_cast<CalendarEventPrivObject*>(JSObjectGetPrivate(thisObject));
m_calendar->expandEventRecurrence(dplEvent);
CalendarAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, globalContext);
-
+ TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
}
Catch(UnsupportedException)
#include "plugin_config.h"
#include <GlobalContextManager.h>
+#include <TimeTracer.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarItemPropertiesPrivObject *privateObject =
static_cast<CalendarItemPropertiesPrivObject*>(JSObjectGetPrivate(thisObject));
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.");
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN("clone(TASK)", 0);
+ TIME_TRACER_ITEM_BEGIN("clone(EVENT)", 0);
CalendarItemPropertiesPrivObject *privateObject =
static_cast<CalendarItemPropertiesPrivObject*>(JSObjectGetPrivate(thisObject));
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 {
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include <SecurityExceptions.h>
+#include <TimeTracer.h>
#include "JSCalendarManager.h"
#include "JSCalendar.h"
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarManagerPrivObject *privateObject = static_cast<CalendarManagerPrivObject*>(JSObjectGetPrivate(thisObject));
AceSecurityStatus status = CALENDAR_CHECK_ACCESS(CALENDAR_FUNCTION_API_GET_CALENDARS);
privateObject->getObject()->getCalendars(dplEvent);
CalendarAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, globalContext);
-
+ TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
}
Catch(UnsupportedException)
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarManagerPrivObject *privateObject = static_cast<CalendarManagerPrivObject*>(JSObjectGetPrivate(thisObject));
AceSecurityStatus status = CALENDAR_CHECK_ACCESS(CALENDAR_FUNCTION_API_GET_DEFAULT_CALENDAR);
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
+ TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarManagerPrivObject *privateObject = static_cast<CalendarManagerPrivObject*>(JSObjectGetPrivate(thisObject));
AceSecurityStatus status = CALENDAR_CHECK_ACCESS(CALENDAR_FUNCTION_API_GET_UNIFIED_CALENDAR);
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
+ TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
+ TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CalendarManagerPrivObject *privateObject = static_cast<CalendarManagerPrivObject*>(JSObjectGetPrivate(thisObject));
AceSecurityStatus status = CALENDAR_CHECK_ACCESS(CALENDAR_FUNCTION_API_GET_CALENDAR);
// 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.");
#include "CalendarAsyncCallbackManager.h"
#include "CalendarListenerManager.h"
+#include <TimeTracer.h>
#include <GlobalContextManager.h>
namespace DeviceAPI {
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) {
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) {
*/
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)
{
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] ============================");
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);
// 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
dplEvent->setSortMode(fConverter->toSortMode(sortModeObj));
}
IMediacontentManagerPtr contentMgr = privateObject->getObject();
+
dplEvent->setPrivateData( DPL::StaticPointerCast<IEventPrivateData> (cbm));
dplEvent->setForAsynchronousCall(&MediacontentManagerController::getInstance());
contentMgr->browseFolder(dplEvent);
priv->setTitle(validator.toString(1, false, "")); //title
- JSObjectRef notiInitDict = validator.toObject(2, true);
-
+ JSObjectRef notiInitDict = validator.toObject(2, true);
+
if (notiInitDict)
{
//content
{
LogWarning("notification's icon path convertion is failed." << err.getMessage().c_str());
}
-
+
}
setPrivateObject(context, obj, priv);
}
else
{
- priv->setIconPath("");
+ priv->setSubIconPath("");
}
// number
{
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
{
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
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;
}
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");