From d34cbc5f0a778bf2c2c7f8b4dd79833c9af6f664 Mon Sep 17 00:00:00 2001 From: Dongjin Choi Date: Fri, 31 May 2013 20:11:30 +0900 Subject: [PATCH] Update change log and spec for wrt-plugins-tizen_0.4.38 [model] REDWOOD [binary_type] PDA [customer] OPEN [Issue] N/A [Problem] email conversation listener bug fix [Cause] email conversation listener bug fix [Solution] email conversation listener bug fix [Issue] N/A [Problem] find email has no mimeType for attachment [Cause] mimeType is not set [Solution] mimeType set for attachment [Issue] N_SE-39969 [Problem] the settig of filter have a error in platform [Cause] N/A [Solution] modify the code to set the filter [Systeminfo] Remove 'SYSTEM_INFO_KEY_CPS_SUPPORTED' key [Issue] N/A [Problem] Old notification privilege don't work [Cause] backward compatibility was not guaranteed. [Solution] inserted backward compatibility. [team] WebAPI [request] N/A [horizontal_expansion] N/A --- packaging/wrt-plugins-tizen.spec | 2 +- src/Calendar/CalendarConverter.cpp | 2 +- src/Calendar/JSCalendarAlarm.cpp | 4 +-- src/Content/ContentManager.cpp | 2 +- src/Filesystem/EventCopy.cpp | 4 +-- src/Filesystem/EventCreate.cpp | 2 -- src/Filesystem/EventListNodes.cpp | 9 ++++--- src/Filesystem/EventMove.cpp | 4 +-- src/Filesystem/EventRemove.cpp | 2 -- src/Filesystem/FilesystemUtils.cpp | 1 - src/Filesystem/JSStorage.cpp | 4 ++- src/Filesystem/Path.cpp | 1 - src/Filesystem/ResponseDispatcher.cpp | 9 ------- src/Filesystem/Stream.cpp | 2 -- src/Filesystem/plugin_config.cpp | 6 ----- src/Messaging/Conversation.cpp | 31 ++++++++++++++++++++-- src/Messaging/Conversation.h | 1 + src/Messaging/Email.cpp | 14 ++++++++++ src/Messaging/IMessagingTypes.h | 2 ++ src/Messaging/MessageFilterConverter.cpp | 1 + src/Messaging/Messaging.cpp | 6 ++--- src/Messaging/MessagingListener.cpp | 3 +-- ...StorageChangesMessageFilterValidatorFactory.cpp | 2 ++ .../StorageChangesMessageFilterValidatorFactory.h | 1 + src/Messaging/StorageChangesMessageGenerator.cpp | 20 ++++++++++++++ src/Messaging/StorageChangesMessageGenerator.h | 2 +- src/Notification/config.xml | 11 +++++++- src/Systeminfo/JSDeviceCapabilitiesInfo.cpp | 14 +++++++--- src/TimeUtil/JSTZDate.cpp | 4 +-- src/TimeUtil/JSTimeDuration.cpp | 6 ++--- src/TimeUtil/TimeUtilConverter.cpp | 2 +- src/TimeUtil/TimeUtilConverter.h | 2 +- 32 files changed, 119 insertions(+), 57 deletions(-) diff --git a/packaging/wrt-plugins-tizen.spec b/packaging/wrt-plugins-tizen.spec index 7243995..968efa0 100755 --- a/packaging/wrt-plugins-tizen.spec +++ b/packaging/wrt-plugins-tizen.spec @@ -1,6 +1,6 @@ Name: wrt-plugins-tizen Summary: JavaScript plugins for WebRuntime -Version: 0.4.36 +Version: 0.4.38 Release: 0 Group: Development/Libraries License: Apache License, Version 2.0 diff --git a/src/Calendar/CalendarConverter.cpp b/src/Calendar/CalendarConverter.cpp index 9bc0a6d..920a6d6 100755 --- a/src/Calendar/CalendarConverter.cpp +++ b/src/Calendar/CalendarConverter.cpp @@ -713,7 +713,7 @@ EventAlarmPtr CalendarConverter::toEventAlarm(JSValueRef alarm) } if (!JSValueIsUndefined(m_context, beforeData)) { TimeUtilConverter timeConverter(m_context); - result->setDuration(timeConverter.getDurationPropertis(beforeData)); + result->setDuration(timeConverter.getDurationProperties(beforeData)); } if (!JSValueIsUndefined(m_context, methodData)) { result->setMethod(toEventAlarmType(toString(methodData))); diff --git a/src/Calendar/JSCalendarAlarm.cpp b/src/Calendar/JSCalendarAlarm.cpp index 39beb03..973aaab 100755 --- a/src/Calendar/JSCalendarAlarm.cpp +++ b/src/Calendar/JSCalendarAlarm.cpp @@ -151,7 +151,7 @@ JSObjectRef DLL_EXPORT JSCalendarAlarm::constructor(JSContextRef context, } } else if (JSValueIsObjectOfClass(context, arguments[0], JSTimeDuration::getClassRef())){ LoggerD("before case"); - alarm->setDuration(timeConverter.getDurationPropertis(arguments[0])); + alarm->setDuration(timeConverter.getDurationProperties(arguments[0])); if (argumentCount>=2) { alarm->setMethod(converter.toEventAlarmType(converter.toString(arguments[1]))); @@ -287,7 +287,7 @@ bool JSCalendarAlarm::setProperty(JSContextRef context, ThrowMsg(ConversionException, "Wrong before type."); } TimeUtilConverter timeConverter(context); - alarm->setDuration(timeConverter.getDurationPropertis(value)); + alarm->setDuration(timeConverter.getDurationProperties(value)); return true; } else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_CALENDAR_ALARM_DESCRIPTION)) { alarm->setDescription(converter.toString(value)); diff --git a/src/Content/ContentManager.cpp b/src/Content/ContentManager.cpp index 6c1ca0a..1dcf289 100755 --- a/src/Content/ContentManager.cpp +++ b/src/Content/ContentManager.cpp @@ -727,7 +727,7 @@ void MediacontentManager::OnRequestReceived(const IEventFindFolderPtr &eFolder) //set filter if ( MEDIA_CONTENT_ERROR_NONE == media_filter_create(&filter)) { - string condition="FOLDER_STORAGE_TYPE = 0 OR FOLDER_STORAGE_TYPE = 1"; + string condition="(FOLDER_STORAGE_TYPE = 0 OR FOLDER_STORAGE_TYPE = 1)"; LoggerI("condition:" + condition); media_filter_set_condition(filter, condition.c_str(), MEDIA_CONTENT_COLLATE_DEFAULT ); //set condition if ( MEDIA_CONTENT_ERROR_NONE != diff --git a/src/Filesystem/EventCopy.cpp b/src/Filesystem/EventCopy.cpp index 84e567c..cfe7346 100755 --- a/src/Filesystem/EventCopy.cpp +++ b/src/Filesystem/EventCopy.cpp @@ -17,7 +17,7 @@ #include "EventCopy.h" -#include + namespace DeviceAPI { namespace Filesystem { @@ -27,8 +27,6 @@ EventCopy::EventCopy(const IPathPtr& src, m_dest(dest), m_options(OPT_NONE) { - Assert(src && "Source path not set."); - Assert(dest && "Destination path not set."); } IPathPtr EventCopy::getDestination() const diff --git a/src/Filesystem/EventCreate.cpp b/src/Filesystem/EventCreate.cpp index ce8d84d..343a394 100755 --- a/src/Filesystem/EventCreate.cpp +++ b/src/Filesystem/EventCreate.cpp @@ -18,7 +18,6 @@ #include "EventCreate.h" -#include namespace DeviceAPI { namespace Filesystem { @@ -28,7 +27,6 @@ EventCreate::EventCreate(const IPathPtr& path, m_type(type), m_options(OPT_NONE) { - Assert(path && "Path is not set."); } IPathPtr EventCreate::getPath() const diff --git a/src/Filesystem/EventListNodes.cpp b/src/Filesystem/EventListNodes.cpp index f5b1659..c169442 100755 --- a/src/Filesystem/EventListNodes.cpp +++ b/src/Filesystem/EventListNodes.cpp @@ -17,7 +17,7 @@ #include "EventListNodes.h" -#include +#include #include "INode.h" #include "Enums.h" @@ -25,7 +25,10 @@ namespace DeviceAPI { namespace Filesystem { EventListNodes::EventListNodes(const INodePtr& node) : m_node(node) { - Assert(m_node && "Node can't be NULL."); + if (node == NULL) + { + ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Can not new an object"); + } } INodePtr EventListNodes::getNode() const @@ -55,4 +58,4 @@ void EventListNodes::setResult(const NodeList& list) } // Filesystem -} // TizenApis \ No newline at end of file +} // TizenApis diff --git a/src/Filesystem/EventMove.cpp b/src/Filesystem/EventMove.cpp index f721e16..fd9afcc 100755 --- a/src/Filesystem/EventMove.cpp +++ b/src/Filesystem/EventMove.cpp @@ -17,7 +17,6 @@ #include "EventMove.h" -#include namespace DeviceAPI { namespace Filesystem { @@ -27,8 +26,7 @@ EventMove::EventMove(const IPathPtr& src, m_dest(dest), m_options(OPT_NONE) { - Assert(src && "Source path not set."); - Assert(dest && "Destination path not set."); + } IPathPtr EventMove::getDestination() const diff --git a/src/Filesystem/EventRemove.cpp b/src/Filesystem/EventRemove.cpp index 9c0da9b..2253943 100755 --- a/src/Filesystem/EventRemove.cpp +++ b/src/Filesystem/EventRemove.cpp @@ -17,7 +17,6 @@ #include "EventRemove.h" -#include namespace DeviceAPI { namespace Filesystem { @@ -25,7 +24,6 @@ EventRemove::EventRemove(const IPathPtr& path) : m_path(path), m_options(OPT_NONE) { - Assert(m_path && "Path is not set."); } IPathPtr EventRemove::getPath() const diff --git a/src/Filesystem/FilesystemUtils.cpp b/src/Filesystem/FilesystemUtils.cpp index f4b0b35..e351ff3 100644 --- a/src/Filesystem/FilesystemUtils.cpp +++ b/src/Filesystem/FilesystemUtils.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include "Enums.h" #include "IManager.h" diff --git a/src/Filesystem/JSStorage.cpp b/src/Filesystem/JSStorage.cpp index 25027ef..35f4f01 100644 --- a/src/Filesystem/JSStorage.cpp +++ b/src/Filesystem/JSStorage.cpp @@ -128,9 +128,11 @@ JSValueRef JSStorage::getProperty(JSContextRef context, JSValueRef* exception) { JSStoragePriv *priv = static_cast(JSObjectGetPrivate(object)); - assert(priv && "Private object not set."); Try { + if (!priv) { + ThrowMsg(Commons::PlatformException, "Can not new an object"); + } StorageProperties *storages = priv->getObject(); Converter convert(context); diff --git a/src/Filesystem/Path.cpp b/src/Filesystem/Path.cpp index 1232a91..453b946 100644 --- a/src/Filesystem/Path.cpp +++ b/src/Filesystem/Path.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include "Path.h" diff --git a/src/Filesystem/ResponseDispatcher.cpp b/src/Filesystem/ResponseDispatcher.cpp index 4f2d96f..3eda79a 100644 --- a/src/Filesystem/ResponseDispatcher.cpp +++ b/src/Filesystem/ResponseDispatcher.cpp @@ -62,7 +62,6 @@ void ResponseDispatcher::OnAnswerReceived(const EventResolvePtr& event) LoggerD("ENTER"); EventGetNodeDataPtr data = DPL::DynamicPointerCast(event->getPrivateData()); - Assert(NULL != data); FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data->getCallbackManager()); @@ -103,7 +102,6 @@ void ResponseDispatcher::OnAnswerReceived(const EventListNodesPtr& event) DPL::DynamicPointerCast(event->getPrivateData()); JSCallbackManagerPtr data = privData->getCallbackManager(); - Assert(NULL != data); FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data); @@ -132,7 +130,6 @@ void ResponseDispatcher::OnAnswerReceived(const EventOpenPtr& event) LoggerD("ENTER"); DPL::SharedPtr data = DPL::DynamicPointerCast(event->getPrivateData()); - Assert(NULL != data); FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data); @@ -157,7 +154,6 @@ void ResponseDispatcher::OnAnswerReceived(const EventCopyPtr& event) LoggerD("ENTER"); DPL::SharedPtr data = DPL::DynamicPointerCast(event->getPrivateData()); - Assert(NULL != data); FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data); @@ -188,7 +184,6 @@ void ResponseDispatcher::OnAnswerReceived(const EventMovePtr& event) LoggerD("ENTER"); DPL::SharedPtr data = DPL::DynamicPointerCast(event->getPrivateData()); - Assert(NULL != data); FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data); @@ -220,7 +215,6 @@ void ResponseDispatcher::OnAnswerReceived(const EventRemovePtr& event) LoggerD("--| ENTER"); DPL::SharedPtr data = DPL::DynamicPointerCast(event->getPrivateData()); - Assert(NULL != data); FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data); @@ -246,7 +240,6 @@ void ResponseDispatcher::OnAnswerReceived(const EventReadTextPtr& event) LoggerD("--| ENTER"); DPL::SharedPtr data = DPL::DynamicPointerCast(event->getPrivateData()); - Assert(NULL != data); FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data); @@ -292,7 +285,6 @@ void ResponseDispatcher::OnAnswerReceived(const EventReadTextPtr& event) void ResponseDispatcher::OnAnswerReceived(const EventGetStoragePtr& event) { DPL::SharedPtr data = DPL::DynamicPointerCast(event->getPrivateData()); - Assert(NULL != data); FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data); @@ -322,7 +314,6 @@ void ResponseDispatcher::OnAnswerReceived(const EventGetStoragePtr& event) void ResponseDispatcher::OnAnswerReceived(const EventListStoragesPtr& event) { DPL::SharedPtr data = DPL::DynamicPointerCast(event->getPrivateData()); - Assert(NULL != data); FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data); diff --git a/src/Filesystem/Stream.cpp b/src/Filesystem/Stream.cpp index c0e9af7..2660193 100644 --- a/src/Filesystem/Stream.cpp +++ b/src/Filesystem/Stream.cpp @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -38,7 +37,6 @@ Stream::Stream(const NodePtr& parent, m_parent(parent), m_mode(mode) { - Assert(m_parent && "Stream needs to have parent."); std::ios_base::openmode mode_ = std::ios_base::binary; if (mode & AM_READ) { mode_ |= std::ios_base::in; } diff --git a/src/Filesystem/plugin_config.cpp b/src/Filesystem/plugin_config.cpp index 40ec29c..e0ca0b2 100755 --- a/src/Filesystem/plugin_config.cpp +++ b/src/Filesystem/plugin_config.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -357,9 +356,6 @@ void setFilesystemPermDevCaps(int permissions, WrtDeviceApis::Commons::AceFunction* outFunction) { using namespace WrtDeviceApis::Commons; - - Assert(outFunction && (permissions != Filesystem::PERM_NONE)); - AceDeviceCapParam paramLocation = AceDeviceCapParam( FILESYSTEM_PARAM_LOCATION, path); @@ -400,8 +396,6 @@ void setFilesystemAccessModeDevCaps(int accessMode, { using namespace WrtDeviceApis::Commons; - Assert(outFunction); - AceDeviceCapParam paramLocation = AceDeviceCapParam( FILESYSTEM_PARAM_LOCATION, path); diff --git a/src/Messaging/Conversation.cpp b/src/Messaging/Conversation.cpp index e400bbf..a01494c 100644 --- a/src/Messaging/Conversation.cpp +++ b/src/Messaging/Conversation.cpp @@ -46,9 +46,9 @@ Conversation::Conversation(unsigned int threadId, MessageType msgType) { makeConversationFromEmailThreadId(threadId); } - else if(msgType == EMPTY_MESSAGE) + else if((msgType == EMPTY_MESSAGE_CONVERSATION)||(msgType == EMPTY_EMAIL_CONVERSATION)) { - // do nothing + makeEmptyConversation(threadId, msgType); } else { @@ -750,6 +750,33 @@ bool Conversation::makeConversationFromEmailThreadId(unsigned int emailTreadId) return m_result; } + +void Conversation::makeEmptyConversation(unsigned int threadIndex, MessageType msgType) +{ + LoggerD("Enter"); + if(msgType == EMPTY_MESSAGE_CONVERSATION) + { + m_type = SMS; + m_Id = 0; + } + else + { + m_type = EMAIL; + m_Id = threadIndex; + } + m_time = 0; + m_messageCount = 0; + m_unreadMessages = 0; + m_preview = ""; + m_read = false; + m_from = ""; + m_subject = ""; + m_lastMessageId = 0; + m_direction = 0; + m_result = true; +} + + Conversation::~Conversation() { } diff --git a/src/Messaging/Conversation.h b/src/Messaging/Conversation.h index ce4eda2..1185b16 100644 --- a/src/Messaging/Conversation.h +++ b/src/Messaging/Conversation.h @@ -68,6 +68,7 @@ public: // void makeConversationFromThread(msg_thread_view_t msg_thread); void makeConversationFromThread(msg_struct_t msg_thread); bool makeConversationFromEmailThreadId(unsigned int emailTreadId); + void makeEmptyConversation(unsigned int threadIndex, MessageType msgType); void setConvId(const int id); #if 0 // setter diff --git a/src/Messaging/Email.cpp b/src/Messaging/Email.cpp index fde5680..98b8302 100644 --- a/src/Messaging/Email.cpp +++ b/src/Messaging/Email.cpp @@ -609,6 +609,10 @@ void Email::readBody() { tmpAtt->setAttachmentID(attachment[i].attachment_id); tmpAtt->setDownloaded(attachment[i].save_status); tmpAtt->setIsInlineAttachment((bool)attachment[i].inline_content_status); + if(attachment[i].attachment_mime_type) + { + tmpAtt->setMimeType(attachment[i].attachment_mime_type); + } tmpAtt->setNth(i+1); LoggerD(" setNth(i+1) : " << i+1); if(attachment[i].inline_content_status == 0) @@ -1310,11 +1314,16 @@ void Email::updateAttachments() attachment_info->attachment_path = String::strdup( buf ); attachment_info->save_status = true; attachment_info->inline_content_status = 0; + if(att->getMimeType().size() > 0) + { + attachment_info->attachment_mime_type = String::strdup(att->getMimeType()); + } LoggerD("attachment_info->attachment_name=" << attachment_info->attachment_name); LoggerD("attachment_info->attachment_path=" << attachment_info->attachment_path); LoggerD("attachment_info->save_status=" << attachment_info->save_status); LoggerD("attachment_info->inline_content_status=" << attachment_info->inline_content_status); + LoggerD("attachment_info->attachment_mime_type=" << attachment_info->attachment_mime_type); LoggerD("Copy Command=" << cp_cmd.str()); if (EINA_TRUE != ecore_file_is_dir(att->getFullPath().c_str())) { @@ -1393,6 +1402,10 @@ void Email::updateAttachments() attachment_info->save_status = true; attachment_info->inline_content_status = 1; LoggerD("attachment_info->inline_content_status=" << attachment_info->inline_content_status); + if(att->getMimeType().size() > 0) + { + attachment_info->attachment_mime_type = String::strdup(att->getMimeType()); + } LoggerD("Copy Command=" << cp_cmd.str()); if (EINA_TRUE != ecore_file_is_dir(att->getFullPath().c_str())) { @@ -1402,6 +1415,7 @@ void Email::updateAttachments() ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to copy file"); } } + LoggerD("attachment_info->attachment_mime_type=" << attachment_info->attachment_mime_type); /* int result = system(cp_cmd.str().c_str()); diff --git a/src/Messaging/IMessagingTypes.h b/src/Messaging/IMessagingTypes.h index bb2a7a6..779e169 100644 --- a/src/Messaging/IMessagingTypes.h +++ b/src/Messaging/IMessagingTypes.h @@ -38,6 +38,8 @@ enum MessageType BINARYSMS, VIRTUAL_MESSAGE, EMPTY_MESSAGE, + EMPTY_MESSAGE_CONVERSATION, + EMPTY_EMAIL_CONVERSATION, MESSAGETYPE_COUNT }; diff --git a/src/Messaging/MessageFilterConverter.cpp b/src/Messaging/MessageFilterConverter.cpp index 3a35d2e..5374cc6 100644 --- a/src/Messaging/MessageFilterConverter.cpp +++ b/src/Messaging/MessageFilterConverter.cpp @@ -102,6 +102,7 @@ static PropertyStructArray propertiesFolders = static PropertyStructArray propertiesMessagesChange = { + { ATTRIBUTE_ID, PrimitiveType_String }, { ATTRIBUTE_SERVICE_ID, PrimitiveType_String }, { ATTRIBUTE_CONVERSATION_ID, PrimitiveType_String }, { ATTRIBUTE_FOLDER_ID, PrimitiveType_String }, diff --git a/src/Messaging/Messaging.cpp b/src/Messaging/Messaging.cpp index 44cd54b..6478111 100644 --- a/src/Messaging/Messaging.cpp +++ b/src/Messaging/Messaging.cpp @@ -1375,7 +1375,7 @@ void Messaging::OnEventReceived(const DBus::MessageEvent& event) stream >> id; IMessagePtr msg = MessageFactory::createMessage(EMPTY_MESSAGE, id); - IConversationPtr conversation(new Conversation()); + IConversationPtr conversation(new Conversation(mail_id, EMPTY_EMAIL_CONVERSATION)); FolderType folder = msg->getCurrentFolder(); jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_DELETED); @@ -1401,7 +1401,7 @@ void Messaging::OnEventReceived(const DBus::MessageEvent& event) LoggerI("Email received. mail_id: " << mail_id); IMessagePtr msg = MessageFactory::createMessage(EMAIL, mail_id); - IConversationPtr conversation(new Conversation(thread_id, EMAIL)); + IConversationPtr conversation(new Conversation(mail_id, EMAIL)); FolderType folder = msg->getCurrentFolder(); jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_UPDATED); @@ -1421,7 +1421,7 @@ void Messaging::OnEventReceived(const DBus::MessageEvent& event) { // TODO also RECEIVE_THREAD_ITEM? LoggerI("Email received. delete thread Id : " << mail_id); - IConversationPtr conversation(new Conversation()); + IConversationPtr conversation(new Conversation(mail_id, EMPTY_EMAIL_CONVERSATION)); conversation->setConvId(mail_id); jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_DELETED); jsEvent->setConversation(conversation); diff --git a/src/Messaging/MessagingListener.cpp b/src/Messaging/MessagingListener.cpp index 1e1d5e7..f37431b 100644 --- a/src/Messaging/MessagingListener.cpp +++ b/src/Messaging/MessagingListener.cpp @@ -547,7 +547,7 @@ void MessagingListener::onAnswerReceived( DeviceAPI::Tizen::FilterPtr filter = multiCallbacks->getFilter(); IMessagePtr msg = event->getMessage(); - if(filter != NULL && msg->getMessageType() != EMPTY_MESSAGE) + if(filter != NULL) { LoggerD("Filter exist"); StorageChangesMessageGeneratorPtr queryGenerator(new StorageChangesMessageGenerator(event->getMessage(), event->getConversation())); @@ -555,7 +555,6 @@ void MessagingListener::onAnswerReceived( DeviceAPI::Tizen::IFilterVisitorPtr filterVisitor = DPL::StaticPointerCast(queryGenerator); filter->travel(filterVisitor, 0); std::vector msgs; // for msg - // IMessagePtr msg = event->getMessage(); if(queryGenerator->getCompareResult()) { LoggerD("Message call back"); diff --git a/src/Messaging/StorageChangesMessageFilterValidatorFactory.cpp b/src/Messaging/StorageChangesMessageFilterValidatorFactory.cpp index b2ccf23..7489fe0 100755 --- a/src/Messaging/StorageChangesMessageFilterValidatorFactory.cpp +++ b/src/Messaging/StorageChangesMessageFilterValidatorFactory.cpp @@ -22,6 +22,7 @@ using namespace DeviceAPI::Tizen; namespace DeviceAPI { namespace Messaging { + const std::string StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_ID = "id"; const std::string StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_SERVICE_ID = "serviceId"; const std::string StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_CONVERSATION_ID = "conversationId"; const std::string StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_FOLDER_ID = "folderId"; @@ -42,6 +43,7 @@ namespace DeviceAPI { static PropertyStructArray properties = { + {StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_ID.c_str(), DeviceAPI::Tizen::PrimitiveType_String}, {StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_SERVICE_ID.c_str(), DeviceAPI::Tizen::PrimitiveType_String}, {StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_CONVERSATION_ID.c_str(), DeviceAPI::Tizen::PrimitiveType_String}, {StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_FOLDER_ID.c_str(), DeviceAPI::Tizen::PrimitiveType_String}, diff --git a/src/Messaging/StorageChangesMessageFilterValidatorFactory.h b/src/Messaging/StorageChangesMessageFilterValidatorFactory.h index eeea490..8f8faca 100644 --- a/src/Messaging/StorageChangesMessageFilterValidatorFactory.h +++ b/src/Messaging/StorageChangesMessageFilterValidatorFactory.h @@ -34,6 +34,7 @@ namespace DeviceAPI { static StorageChangesMessageFilterValidatorPtr getStorageChangesMessageFilterValidator(); public: + static const std::string ATTRIBUTE_ID; static const std::string ATTRIBUTE_SERVICE_ID; static const std::string ATTRIBUTE_CONVERSATION_ID; static const std::string ATTRIBUTE_FOLDER_ID; diff --git a/src/Messaging/StorageChangesMessageGenerator.cpp b/src/Messaging/StorageChangesMessageGenerator.cpp index 90985f9..127ec50 100644 --- a/src/Messaging/StorageChangesMessageGenerator.cpp +++ b/src/Messaging/StorageChangesMessageGenerator.cpp @@ -38,6 +38,7 @@ namespace DeviceAPI { m_messageType(MESSAGE_TYPE_NOT_INITIALIZED) , m_serviceId(-1) { + m_id = msg->getIdRef(); m_type = msg->getMessageType(); m_folder = msg->getCurrentFolder(); m_dateTime = msg->getDateTime(); @@ -451,6 +452,25 @@ namespace DeviceAPI { std::string valueString; // Check msg_type and filter_type + if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_ID)==0){ + LoggerD("<<< value:[" << value << "]"); + LoggerD("<<< value->toString():[" << value->toString() << "]"); + LoggerD("<<< m_id:[" << m_id << "]"); + + valueString = m_id; + if(getMatchFlagResult(value, valueString, matchFlag)) + { + m_result.push_back(TRUE); + LoggerD("<<< id is same"); + } + else + { + m_result.push_back(FALSE); + LoggerD("<<< id is different"); + } + return; + } + if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_SERVICE_ID)==0){ LoggerD("<<< value:[" << value << "]"); int nType = atoi(value->toString().c_str()); diff --git a/src/Messaging/StorageChangesMessageGenerator.h b/src/Messaging/StorageChangesMessageGenerator.h index e4ce2d6..1ba9070 100644 --- a/src/Messaging/StorageChangesMessageGenerator.h +++ b/src/Messaging/StorageChangesMessageGenerator.h @@ -89,7 +89,7 @@ namespace DeviceAPI { std::vector m_result; std::vector m_operand; -// std::string m_id; + std::string m_id; MessageType m_type; FolderType m_folder; struct tm m_dateTime; diff --git a/src/Notification/config.xml b/src/Notification/config.xml index ed780b9..a63a880 100644 --- a/src/Notification/config.xml +++ b/src/Notification/config.xml @@ -12,4 +12,13 @@ notification - \ No newline at end of file + + http://tizen.org/privilege/notification.read + + + + http://tizen.org/privilege/notification.write + notification + + + diff --git a/src/Systeminfo/JSDeviceCapabilitiesInfo.cpp b/src/Systeminfo/JSDeviceCapabilitiesInfo.cpp index 3f3a715..c850b31 100755 --- a/src/Systeminfo/JSDeviceCapabilitiesInfo.cpp +++ b/src/Systeminfo/JSDeviceCapabilitiesInfo.cpp @@ -444,10 +444,18 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR return convert.toJSValueRef(deviceCapabilitiesInfo->cameraBackFlash); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_LOCATION)) { bool location = false; - if (system_info_get_value_bool(SYSTEM_INFO_KEY_CPS_SUPPORTED, &location) == SYSTEM_INFO_ERROR_NONE) { - LoggerD("location : " << location); - deviceCapabilitiesInfo->location = location; + bool locationGps = false; + bool locationWps = false; + if (system_info_get_value_bool(SYSTEM_INFO_KEY_GPS_SUPPORTED, &locationGps) == SYSTEM_INFO_ERROR_NONE) { + LoggerD("locationGps : " << locationGps); + } + if (system_info_get_value_bool(SYSTEM_INFO_KEY_WPS_SUPPORTED, &locationWps) == SYSTEM_INFO_ERROR_NONE) { + LoggerD("locationWps : " << locationWps); + } + if (locationGps || locationWps) { + location = true; } + deviceCapabilitiesInfo->location = location; return convert.toJSValueRef(deviceCapabilitiesInfo->location); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_LOCATIONGPS)) { bool locationGps = false; diff --git a/src/TimeUtil/JSTZDate.cpp b/src/TimeUtil/JSTZDate.cpp index 1364cda..4cd51e1 100644 --- a/src/TimeUtil/JSTZDate.cpp +++ b/src/TimeUtil/JSTZDate.cpp @@ -540,9 +540,9 @@ JSValueRef JSTZDate::addDuration(JSContextRef context, JSObjectRef function, DurationProperties duration; if (argumentCount == 0) - duration= converter.getDurationPropertis(JSValueMakeUndefined(context)); + duration= converter.getDurationProperties(JSValueMakeUndefined(context)); else - duration= converter.getDurationPropertis(arguments[0]); + duration= converter.getDurationProperties(arguments[0]); LoggerD("unit : " << duration.unit << " Length:" << duration.length); TZDatePrivObject* privateObject = static_cast(JSObjectGetPrivate(thisObject)); diff --git a/src/TimeUtil/JSTimeDuration.cpp b/src/TimeUtil/JSTimeDuration.cpp index 5e15c3d..cd36745 100755 --- a/src/TimeUtil/JSTimeDuration.cpp +++ b/src/TimeUtil/JSTimeDuration.cpp @@ -247,12 +247,12 @@ JSValueRef JSTimeDuration::diffTimeDuration(JSContextRef context, JSObjectRef th TimeUtilConverter converter(context); - DurationProperties first = converter.getDurationPropertis(thisObject); + DurationProperties first = converter.getDurationProperties(thisObject); DurationProperties second; if (argumentCount == 0) - second= converter.getDurationPropertis(JSValueMakeUndefined(context)); + second= converter.getDurationProperties(JSValueMakeUndefined(context)); else - second= converter.getDurationPropertis(arguments[0]); + second= converter.getDurationProperties(arguments[0]); DurationProperties diff; if (first.unit > second.unit) { diff --git a/src/TimeUtil/TimeUtilConverter.cpp b/src/TimeUtil/TimeUtilConverter.cpp index 68cb952..fb931ae 100755 --- a/src/TimeUtil/TimeUtilConverter.cpp +++ b/src/TimeUtil/TimeUtilConverter.cpp @@ -108,7 +108,7 @@ DurationPropertiesPtr TimeUtilConverter::getDuration(JSValueRef value) { return duration; } -DurationProperties TimeUtilConverter::getDurationPropertis(JSValueRef value) { +DurationProperties TimeUtilConverter::getDurationProperties(JSValueRef value) { DurationProperties duration; duration.length = getDurationLength(value); duration.unit = getDurationUnit(value); diff --git a/src/TimeUtil/TimeUtilConverter.h b/src/TimeUtil/TimeUtilConverter.h index 878311e..3962903 100755 --- a/src/TimeUtil/TimeUtilConverter.h +++ b/src/TimeUtil/TimeUtilConverter.h @@ -50,7 +50,7 @@ class TimeUtilConverter : public Converter JSObjectRef makeDurationObject(const DurationProperties &duration); JSObjectRef makeMillisecondDurationObject(const long long length); DurationPropertiesPtr getDuration(JSValueRef value); - DurationProperties getDurationPropertis(JSValueRef value); + DurationProperties getDurationProperties(JSValueRef value); long long getDurationLength(JSValueRef value); long long getDurationLength(JSObjectRef object); short getDurationUnit(JSValueRef value); -- 2.7.4