Update change log and spec for wrt-plugins-tizen_0.4.69
authorHyunju Cheon <hyunju.cheon@samsung.com>
Fri, 11 Oct 2013 10:41:25 +0000 (19:41 +0900)
committerHyunju Cheon <hyunju.cheon@samsung.com>
Fri, 11 Oct 2013 11:44:05 +0000 (20:44 +0900)
[model] REDWOOD
[binary_type] PDA
[customer] OPEN

[Messaging] Force close occur while install chatter

[Issue#] N_SE-54842
[Problem] Force close occur while install chatter
[Cause] Force close occur while install chatter
[Solution] remove log for message body contents

[Messaging] removeConversation bug fix

[Issue#] P131004-02914
[Problem] removeConversation throw exception
[Cause] throw exception for emptyConversation remove
[Solution] change logic for emptyConversation remove

[NFC] Modify the crash issue when closing Orange Wallet

[Issue] N/A
[Problem] Crash occurs when closing Orange Wallet
[Cause] When NFCAdapter is finalized, it tries to unset tag/peer listners. Before unsetting tag/peer listners, it checks NFC's status. If NFC's status is off, it sends exception. But ~NFCAdapter doesn'
[Solution] The ~NFCAdapter will catch exceptions.

[Messaging] conversationId bug fix for removed msg

[Issue] N/A
[Problem] conversationId bug fix for removed msg
[Cause] conversationId bug fix for removed msg
[Solution] conversationId bug fix for removed msg

[Power] Fix tct error

[Issue#] PowerManager_setScreenBrightness_successful
[Problem] get wrong value
[Cause] N/A
[Solution] Modify code.

[Messaging] sync to async loadMessageBody for SMS, MMS

[Issue] N/A
[Problem] sync to async loadMessageBody
[Cause] sync to async loadMessageBody
[Solution] sync to async loadMessageBody

[Systeminfo] device capability value bug

[Issue#] N/A
[Problem] When get input keyboard layout value, get wrong value.
[Cause] N/A
[Solution] Modify code.

[team] WebAPI
[request] N/A
[horizontal_expansion] N/A

UnitTC passed.

Change-Id: Ic830988842dae584ecf698c7d5c7beb96028c508

42 files changed:
packaging/wrt-plugins-tizen.spec
src/Common/CMakeLists.txt
src/Common/JSTizenSecurityObject.cpp [new file with mode: 0755]
src/Common/JSTizenSecurityObject.h [new file with mode: 0755]
src/Common/Security.h [new file with mode: 0644]
src/Common/SecurityAccessor.cpp [new file with mode: 0644]
src/Common/SecurityAccessor.h [new file with mode: 0644]
src/Filesystem/FilesystemUtils.cpp
src/Filesystem/FilesystemUtils.h
src/Messaging/AttachmentFactory.cpp [changed mode: 0755->0644]
src/Messaging/Attachments.cpp [changed mode: 0755->0644]
src/Messaging/BinarySms.cpp [changed mode: 0755->0644]
src/Messaging/CallbackNumber.cpp [changed mode: 0755->0644]
src/Messaging/Conversation.cpp
src/Messaging/ConversationFilterValidator.cpp [changed mode: 0755->0644]
src/Messaging/ConversationQueryGenerator.cpp [changed mode: 0755->0644]
src/Messaging/DBus/Connection.cpp [changed mode: 0755->0644]
src/Messaging/EmailUtils.cpp [changed mode: 0755->0644]
src/Messaging/FolderQueryGenerator.cpp [changed mode: 0755->0644]
src/Messaging/IAttachment.cpp [changed mode: 0755->0644]
src/Messaging/IBinarySms.cpp [changed mode: 0755->0644]
src/Messaging/IEmail.cpp [changed mode: 0755->0644]
src/Messaging/IMessage.cpp [changed mode: 0755->0644]
src/Messaging/IMessagingService.cpp [changed mode: 0755->0644]
src/Messaging/IMms.cpp [changed mode: 0755->0644]
src/Messaging/ISms.cpp [changed mode: 0755->0644]
src/Messaging/JSConversation.cpp [changed mode: 0755->0644]
src/Messaging/JSMessage.cpp
src/Messaging/JSMessage.h [changed mode: 0755->0644]
src/Messaging/JSMessageBody.cpp
src/Messaging/JSMessagingService.cpp
src/Messaging/Messaging.cpp
src/Messaging/Messaging.h
src/Messaging/Mms.cpp
src/Messaging/ReqReceiverMessage.cpp
src/Messaging/StorageChangesConversationGenerator.cpp
src/Messaging/StorageChangesMessageGenerator.cpp
src/Messaging/log.h [changed mode: 0755->0644]
src/Messaging/plugin_initializer.cpp [changed mode: 0755->0644]
src/NFC/NFCAdapter.cpp
src/Power/PowerManager.cpp
src/Systeminfo/JSDeviceCapabilitiesInfo.cpp

index af2a5e5..3fe43df 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       wrt-plugins-tizen
 Summary:    JavaScript plugins for WebRuntime
-Version:    0.4.68
+Version:    0.4.69
 Release:    0
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
@@ -110,6 +110,8 @@ make %{?jobs:-j%jobs}
 %install
 rm -rf %{buildroot}
 %make_install
+mkdir -p %{buildroot}/usr/share/license
+cp LICENSE %{buildroot}/usr/share/license/%{name}
 
 %post
 
@@ -120,6 +122,7 @@ rm -rf %{buildroot}
 %manifest wrt-plugins-tizen.manifest 
 %{_libdir}/wrt-plugins/*
 /usr/etc/tizen-apis/*
+/usr/share/license/%{name}
 
 %files devel
 %{_includedir}/*
index 0394933..910087d 100755 (executable)
@@ -12,6 +12,8 @@ SET(SRCS
   WebAPIError.cpp
   PropertyBag.cpp
   JSArray.cpp
+  SecurityAccessor.cpp
+  JSTizenSecurityObject.cpp
 )
 
 ADD_LIBRARY(${COMMON_TARGET_NAME} SHARED ${SRCS})
diff --git a/src/Common/JSTizenSecurityObject.cpp b/src/Common/JSTizenSecurityObject.cpp
new file mode 100755 (executable)
index 0000000..8328467
--- /dev/null
@@ -0,0 +1,116 @@
+//
+// Tizen Web Device API
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+
+#include "JSTizenSecurityObject.h"
+
+#include <string>
+
+#include "PlatformException.h"
+#include "JSStringRefWrapper.h"
+#include "Logger.h"
+
+#define CLASS_NAME "TizenSecurityObject"
+
+#define TIZEN_SECURITY_PROPERTY_NAME "__tizenobj"
+
+namespace DeviceAPI {
+namespace Common {
+
+JSClassDefinition JSTizenSecurityObject::m_classInfo = {
+       0,
+       kJSClassAttributeNone,
+       CLASS_NAME,
+       0,
+       NULL, // staticValues
+       NULL, // staticFunctions
+       initialize,
+       finalize,
+       NULL, // hasProperty,
+       NULL, // getProperty,
+       NULL, // setProperty,
+       NULL, // deleteProperty,
+       NULL, // getPropertyNames,
+       NULL, // callAsFunction,
+       NULL, // callAsConstructor,
+       NULL, // hasInstance,
+       NULL  // convertToType
+};
+
+JSClassRef JSTizenSecurityObject::m_jsClassRef = JSClassCreate(JSTizenSecurityObject::getClassInfo());
+
+const JSClassRef JSTizenSecurityObject::getClassRef()
+{
+       if (!m_jsClassRef)
+               m_jsClassRef = JSClassCreate(&m_classInfo);
+
+       return m_jsClassRef;
+}
+
+const JSClassDefinition* JSTizenSecurityObject::getClassInfo()
+{
+       return &m_classInfo;
+}
+
+void JSTizenSecurityObject::initialize(JSContextRef context, JSObjectRef object)
+{
+       if(!JSObjectGetPrivate(object))
+       {
+               LoggerE("JSTizenSecurityObject has been created with no priv object.");
+       }
+}
+
+void JSTizenSecurityObject::finalize(JSObjectRef object)
+{
+}
+
+void JSObjectSetSecurityAccessor(JSContextRef context, JSObjectRef object, SecurityAccessor* securityAccessor)
+{
+       JSObjectRef jsSecurityObj = JSObjectMake(context, JSTizenSecurityObject::getClassRef(), static_cast<void*>(securityAccessor));
+
+       DeviceAPI::Common::JSStringRefWrapper securityObjName(TIZEN_SECURITY_PROPERTY_NAME);
+
+       JSValueRef exception = NULL;
+       JSObjectSetProperty(context, object, securityObjName.get(), jsSecurityObj,
+                       kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete, &exception);
+
+       if(exception != NULL)
+               throw(InvalidValuesException("Failed to assign security module."));
+}
+
+SecurityAccessor* JSObjectGetSecurityAccessor(JSContextRef context, JSObjectRef object)
+{
+       DeviceAPI::Common::JSStringRefWrapper securityObjName(TIZEN_SECURITY_PROPERTY_NAME);
+
+       JSValueRef exception = NULL;
+       JSValueRef jsSecurityVal = JSObjectGetProperty(context, object, securityObjName.get(), &exception);
+       if(exception != NULL)
+               throw(InvalidValuesException("Failed to get security module. (no property)"));
+
+       JSObjectRef jsSecurityObj = JSValueToObject(context, jsSecurityVal, &exception);
+       if(exception != NULL)
+               throw(InvalidValuesException("Failed to get security module. (not a object)"));
+
+       SecurityAccessor *priv = static_cast<SecurityAccessor*>(JSObjectGetPrivate(jsSecurityObj));
+       if(priv == NULL)
+               throw(InvalidValuesException("Failed to get security module. (no priv)"));
+
+       return priv;
+}
+
+} // Common
+} // DeviceAPI
diff --git a/src/Common/JSTizenSecurityObject.h b/src/Common/JSTizenSecurityObject.h
new file mode 100755 (executable)
index 0000000..8734c4c
--- /dev/null
@@ -0,0 +1,55 @@
+//
+// Tizen Web Device API
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+
+#ifndef __TIZEN_COMMON_JS_TIZEN_SECURITY_OBJECT_H__
+#define __TIZEN_COMMON_JS_TIZEN_SECURITY_OBJECT_H__
+
+#include <JavaScriptCore/JavaScript.h>
+#include "SecurityAccessor.h"
+
+namespace DeviceAPI {
+namespace Common {
+
+class JSTizenSecurityObject
+{
+private:
+       static const JSClassDefinition* getClassInfo();
+
+       static const JSClassRef getClassRef();
+
+       static JSClassDefinition m_classInfo;
+
+       static JSClassRef m_jsClassRef;
+
+       static void initialize(JSContextRef context, JSObjectRef object);
+
+       static void finalize(JSObjectRef object);
+
+       friend void JSObjectSetSecurityAccessor(JSContextRef context, JSObjectRef object, SecurityAccessor* securityAccessor);
+
+       friend SecurityAccessor* JSObjectGetSecurityAccessor(JSContextRef context, JSObjectRef object);
+};
+
+void JSObjectSetSecurityAccessor(JSContextRef context, JSObjectRef object, SecurityAccessor* securityAccessor);
+
+SecurityAccessor* JSObjectGetSecurityAccessor(JSContextRef context, JSObjectRef object);
+
+} // Common
+} // DeviceAPI
+
+#endif // __TIZEN_COMMON_JS_TIZEN_SECURITY_OBJECT_H__
diff --git a/src/Common/Security.h b/src/Common/Security.h
new file mode 100644 (file)
index 0000000..23aca61
--- /dev/null
@@ -0,0 +1,121 @@
+//
+// Tizen Web Device API
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef __TIZEN_COMMON_SECURITY_H__
+#define __TIZEN_COMMON_SECURITY_H__
+
+#include <Commons/FunctionDeclaration.h>
+#include "SecurityAccessor.h"
+#include "JSTizenSecurityObject.h"
+#include "JSWebAPIErrorFactory.h"
+
+#define DEFINE_GLOBAL_SECURITY_ACCESSOR(Variable_Name) \
+       DeviceAPI::Common::SecurityAccessor* Variable_Name = NULL
+
+#define INITAILIZE_GLOBAL_SECURITY_ACCESSOR(Variable_Name, AceCheckAccessFunction_Name) \
+       do { \
+               Variable_Name = new DeviceAPI::Common::SecurityAccessor(&AceCheckAccessFunction_Name); \
+       } while(0)
+
+#define FINALIZE_GLOBAL_SECURITY_ACCESSOR(Variable_Name) \
+       do { \
+               if(Variable_Name) { \
+                       delete Variable_Name; \
+                       Variable_Name = NULL; \
+               } \
+       } while(0)
+
+#define DEFINE_JSOBJECT_SECURITY_ACCESSOR_SETTER(Function_Name, SecurityAccessor_Object) \
+       void Function_Name(java_script_context_t ctx, \
+                       js_object_instance_t, \
+                       js_object_instance_t obj) \
+       { \
+               DeviceAPI::Common::JSObjectSetSecurityAccessor(static_cast<JSContextRef>(ctx), \
+                               static_cast<JSObjectRef>(obj), SecurityAccessor_Object); \
+       }
+
+#define DEFINE_SECURITY_ACCESSOR_SETTER(Function_Name, PrivObjectType, SecurityAccessor_Object) \
+       void Function_Name(java_script_context_t, \
+                       js_object_instance_t, \
+                       js_object_instance_t object) \
+       { \
+               PrivObjectType* priv = \
+                               static_cast<PrivObjectType*>(JSObjectGetPrivate(static_cast<JSObjectRef>(object))); \
+               DeviceAPI::Common::SecurityAccessor* accessor = \
+                               static_cast<DeviceAPI::Common::SecurityAccessor*>(priv); \
+               accessor->copyAceCheckAccessFunction(SecurityAccessor_Object); \
+       }
+
+
+#define TIZEN_CHECK_ACCESS(context, exception, privateObject, functionName) \
+       do { \
+               using namespace WrtDeviceApis::Commons; \
+               DeviceAPI::Common::SecurityAccessor* accessor = \
+                               static_cast<DeviceAPI::Common::SecurityAccessor*>(privateObject); \
+               if(accessor->isInitialized() == false) { \
+                       return JSWebAPIErrorFactory::postException(context, exception, \
+                                       JSWebAPIErrorFactory::UNKNOWN_ERROR, "Internal security error"); \
+               } \
+               AceSecurityStatus status = accessor->invokeAceCheckAccessFunction(functionName); \
+               switch (status) { \
+               case AceSecurityStatus::InternalError: \
+                       return JSWebAPIErrorFactory::postException(context, exception, \
+                                       JSWebAPIErrorFactory::UNKNOWN_ERROR, "Internal error"); \
+                       break; \
+               case AceSecurityStatus::PrivacyDenied: \
+                       return JSWebAPIErrorFactory::postException(context, exception, \
+                                       JSWebAPIErrorFactory::SECURITY_ERROR, "The user blocks an application from calling this method."); \
+                       break; \
+               case AceSecurityStatus::AccessDenied: \
+                       return JSWebAPIErrorFactory::postException(context, exception, \
+                                       JSWebAPIErrorFactory::SECURITY_ERROR, "The application does not have the privilege to call this method."); \
+                       break; \
+               default: \
+                       break; \
+               } \
+       } while(0)
+
+#define TIZEN_ASYNC_CBM_ACCESS(context, privateObject, cbm, functionName) \
+       do { \
+               using namespace WrtDeviceApis::Commons; \
+               DeviceAPI::Common::SecurityAccessor* accessor = \
+                               static_cast<DeviceAPI::Common::SecurityAccessor*>(privateObject); \
+               if(accessor->isInitialized() == false) { \
+                       cbm->callOnError(JSWebAPIErrorFactory::makeErrorObject(context, \
+                                       JSWebAPIErrorFactory::UNKNOWN_ERROR, "Internal security error")); \
+                       return JSValueMakeNull(context); \
+               } \
+               AceSecurityStatus status = accessor->invokeAceCheckAccessFunction(functionName); \
+               switch (status) { \
+               case AceSecurityStatus::InternalError: \
+                       cbm->callOnError(JSWebAPIErrorFactory::makeErrorObject(context, \
+                                       JSWebAPIErrorFactory::UNKNOWN_ERROR, "Internal error")); \
+                       return JSValueMakeNull(context); \
+               case AceSecurityStatus::PrivacyDenied: \
+                       cbm->callOnError(JSWebAPIErrorFactory::makeErrorObject(context, \
+                                       JSWebAPIErrorFactory::SECURITY_ERROR, "The user blocks an application from calling this method.")); \
+                       return JSValueMakeNull(context); \
+               case AceSecurityStatus::AccessDenied: \
+                       cbm->callOnError(JSWebAPIErrorFactory::makeErrorObject(context, \
+                                       JSWebAPIErrorFactory::SECURITY_ERROR, "The application does not have the privilege to call this method.")); \
+                       return JSValueMakeNull(context); \
+               default: \
+                       break; \
+               } \
+       } while (0)
+
+#endif // __TIZEN_COMMON_SECURITY_H__
diff --git a/src/Common/SecurityAccessor.cpp b/src/Common/SecurityAccessor.cpp
new file mode 100644 (file)
index 0000000..fa4b899
--- /dev/null
@@ -0,0 +1,84 @@
+//
+// Tizen Web Device API
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include "SecurityAccessor.h"
+
+namespace DeviceAPI {
+namespace Common {
+
+SecurityAccessor::SecurityAccessor() :
+               m_aceCheckAccessFunc(NULL),
+               m_aceCheckAccessFuncInited(false)
+{
+}
+
+SecurityAccessor::SecurityAccessor(const AceCheckAccessFunction aceCheckAccessFunc) :
+               m_aceCheckAccessFunc(aceCheckAccessFunc),
+               m_aceCheckAccessFuncInited(true)
+{
+}
+
+SecurityAccessor::SecurityAccessor(const SecurityAccessor &securityAccessor) :
+               m_aceCheckAccessFunc(securityAccessor.m_aceCheckAccessFunc),
+               m_aceCheckAccessFuncInited(true)
+{
+}
+
+SecurityAccessor::SecurityAccessor(const SecurityAccessor *securityAccessor) :
+               m_aceCheckAccessFunc(securityAccessor->m_aceCheckAccessFunc),
+               m_aceCheckAccessFuncInited(true)
+{
+}
+
+SecurityAccessor::~SecurityAccessor()
+{
+}
+
+void SecurityAccessor::copyAceCheckAccessFunction(const SecurityAccessor &securityAccessor)
+{
+       setAceCheckAccessFunction(securityAccessor.m_aceCheckAccessFunc);
+}
+
+void SecurityAccessor::copyAceCheckAccessFunction(const SecurityAccessor *securityAccessor)
+{
+       setAceCheckAccessFunction(securityAccessor->m_aceCheckAccessFunc);
+}
+
+bool SecurityAccessor::isInitialized() const
+{
+       return m_aceCheckAccessFuncInited;
+}
+
+WrtDeviceApis::Commons::AceSecurityStatus SecurityAccessor::invokeAceCheckAccessFunction(const char *functionName) const
+{
+       if(m_aceCheckAccessFuncInited)
+               return m_aceCheckAccessFunc(functionName);
+       else
+               return WrtDeviceApis::Commons::AceSecurityStatus::InternalError;
+}
+
+void SecurityAccessor::setAceCheckAccessFunction(const AceCheckAccessFunction aceCheckAccessFunc)
+{
+       if(!m_aceCheckAccessFuncInited)
+       {
+               m_aceCheckAccessFunc = aceCheckAccessFunc;
+               m_aceCheckAccessFuncInited = true;
+       }
+}
+
+} // Common
+} // DeviceAPI
diff --git a/src/Common/SecurityAccessor.h b/src/Common/SecurityAccessor.h
new file mode 100644 (file)
index 0000000..3265650
--- /dev/null
@@ -0,0 +1,55 @@
+//
+// Tizen Web Device API
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef __TIZEN_COMMON_SECURITY_ACCESSOR_H__
+#define __TIZEN_COMMON_SECURITY_ACCESSOR_H__
+
+#include <Commons/FunctionDeclaration.h>
+#include "JSWebAPIErrorFactory.h"
+
+namespace DeviceAPI {
+namespace Common {
+
+typedef WrtDeviceApis::Commons::AceSecurityStatus (*AceCheckAccessFunction)(const char *);
+
+class SecurityAccessor
+{
+public:
+       SecurityAccessor();
+       SecurityAccessor(const AceCheckAccessFunction aceCheckAccessFunc);
+       SecurityAccessor(const SecurityAccessor &securityAccessor);
+       SecurityAccessor(const SecurityAccessor *securityAccessor);
+       virtual ~SecurityAccessor();
+
+       virtual void copyAceCheckAccessFunction(const SecurityAccessor &securityAccessor);
+       virtual void copyAceCheckAccessFunction(const SecurityAccessor *securityAccessor);
+
+       virtual bool isInitialized() const;
+
+       virtual WrtDeviceApis::Commons::AceSecurityStatus invokeAceCheckAccessFunction(const char *functionName) const;
+
+private:
+       AceCheckAccessFunction m_aceCheckAccessFunc;
+       bool m_aceCheckAccessFuncInited;
+
+       void setAceCheckAccessFunction(const AceCheckAccessFunction aceCheckAccessFunc);
+};
+
+} // Common
+} // DeviceAPI
+
+#endif // __TIZEN_COMMON_SECURITY_ACCESSOR_H__
index 8ac3232..40f00ad 100644 (file)
@@ -76,7 +76,7 @@ const PathToRootMap DLL_EXPORT & getPathToRootMap()
 }
 
 IPathPtr DLL_EXPORT fromVirtualPath(JSContextRef context,
-                         const std::string& arg)
+                         const std::string arg)
 {
        LoggerD("arg:[" << arg << "]");
 
@@ -128,7 +128,7 @@ IPathPtr DLL_EXPORT fromVirtualPath(JSContextRef context,
        return result;
 }
 
-std::string DLL_EXPORT toVirtualPath(JSContextRef context, const std::string& arg) {
+std::string DLL_EXPORT toVirtualPath(JSContextRef context, const std::string arg) {
 
     int widgetId = WrtAccessSingleton::Instance().getWidgetId();
     WidgetDB::Api::IWidgetDBPtr widgetDB =
index 4eb9e0d..19564af 100755 (executable)
@@ -27,9 +27,9 @@ namespace Filesystem {
 namespace Utils{
 
 IPathPtr fromVirtualPath(JSContextRef context,
-                                          const std::string& arg);
+                                          const std::string arg);
 
-std::string toVirtualPath(JSContextRef context, const std::string& arg);
+std::string toVirtualPath(JSContextRef context, const std::string arg);
 
 bool isPathValid(const std::string& path);
 bool isUriPath(const std::string& path);
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index cf39a5f..4a04bd6 100644 (file)
@@ -825,7 +825,7 @@ bool Conversation::makeEmptyConversation(unsigned int threadIndex, MessageType m
        if(msgType == EMPTY_MESSAGE_CONVERSATION)
        {
                m_type = SMS;
-               m_Id = 0;
+               m_Id = threadIndex;
        }
        else
        {
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index e1d26de..ec2120b 100644 (file)
@@ -549,7 +549,6 @@ JSObjectRef DLL_EXPORT JSMessage::constructor(JSContextRef context,
                 if (!JSValueIsUndefined(context, htmlBodyData))
                 {
                     std::string body = JSUtil::JSValueToString(context, htmlBodyData);
-                    LoggerD("html body : " << body);
                     email->setHtmlBody(body);
                 }
 
@@ -561,7 +560,6 @@ JSObjectRef DLL_EXPORT JSMessage::constructor(JSContextRef context,
             if (!JSValueIsUndefined(context, plainBodyData) )
             {
                 std::string body = JSUtil::JSValueToString(context, plainBodyData);
-                LoggerD("plain body  : " << body);
                 msg->setBody(body);
             }
         }
old mode 100755 (executable)
new mode 100644 (file)
index 480a7ef..77206b0 100644 (file)
@@ -161,7 +161,6 @@ JSValueRef JSMessageBody::getProperty(JSContextRef context,
         }
         else if (JSStringIsEqualToUTF8CString(propertyName, PLAINBODY)) {
            std::string body = msg->getBody();
-           LoggerD("getPlainBody plainBody" << body );
            return JSUtil::toJSValueRef(context, body);
         }
         else if (JSStringIsEqualToUTF8CString(propertyName, HTMLBODY)) {
@@ -170,7 +169,6 @@ JSValueRef JSMessageBody::getProperty(JSContextRef context,
            if (msg->getMessageType() == EMAIL) {
                IEmailPtr email = MessageFactory::convertToEmail(msg);
                emailHtmlBody = email->getHtmlBody();
-               LoggerD("Html Body : " << emailHtmlBody );
            }
            return JSUtil::toJSValueRef(context, emailHtmlBody);
         }
@@ -247,7 +245,6 @@ bool JSMessageBody::setProperty(JSContextRef context,
             IMessagePtr msg = getMessage(context, object);
             std::string body = JSUtil::JSValueToString(context, value);
             msg->setBody(body);
-            LoggerD("setPlainBody plainBody" << body );
             return true;
         }
         else if (JSStringIsEqualToUTF8CString(propertyName, HTMLBODY)) {
@@ -257,7 +254,6 @@ bool JSMessageBody::setProperty(JSContextRef context,
             {
                 IEmailPtr email = MessageFactory::convertToEmail(msg);
                 std::string body = JSUtil::JSValueToString(context, value);
-                LoggerD("input String : " << body);
                 email->setHtmlBody(body);
                 return true;
             }
index 7c0d3e7..5205242 100644 (file)
@@ -563,18 +563,7 @@ JSValueRef JSMessagingService::loadMessageBody(JSContextRef context,
             if (msgType == EMAIL)
             {
                 IEmailPtr email = MessageFactory::convertToEmail(event->m_message);
-                if (email && email->isBodyDownloaded() > 0)
-                {
-                    callbackManager->callOnSuccess(converter->toJSValueRef(msg));
-                    return JSValueMakeUndefined(context);
-                }
-            }
-            else
-            {
-                callbackManager->callOnSuccess(converter->toJSValueRef(msg));
-                    return JSValueMakeUndefined(context);
             }
-
             privateData->setMessageJSValueRef(arguments[0]); //set Message JSValueRef.
         }
         LoggerI(" Checked Message Type " );
index 8949a91..c9dbf6d 100644 (file)
@@ -1159,6 +1159,11 @@ void Messaging::addOnMessageReceived(
 
         m_dbusConnection->open(DBUS_BUS_SYSTEM);
     }
+    if(m_onConversationReceived.size() == 1)
+    {
+        makeMsgConvIdList();
+    }
+
 }
 
 void Messaging::addOnMessageReceived(
@@ -1278,6 +1283,10 @@ void Messaging::removeOnMessageConvReceived(EmitterConversationReceived::IdType
         m_onMessageReceivedHandleMgr = MsgServiceHandleMgrPtr(NULL);
         m_dbusConnection->close();
     }
+    if(m_onConversationReceived.size() == 0)
+    {
+        removeMsgConvIdList();
+    }
 }
 
 void Messaging::removeOnMessageFolderReceived(EmitterFolderReceived::IdType id)
@@ -1586,8 +1595,10 @@ void Messaging::onMessageStorageChanged(msg_handle_t handle,
                        
                 if(storageChangeType == MSG_STORAGE_CHANGE_DELETE)
                 {
-                    IMessagePtr message = MessageFactory::createMessage(EMPTY_MESSAGE, pMsgIdList->msgIdList[index]);
-                    IConversationPtr conversation(new Conversation());                                 
+                    int tempInt = pMsgIdList->msgIdList[index];
+                    IMessagePtr message = MessageFactory::createMessage(EMPTY_MESSAGE, tempInt);
+                    tempInt = this_->getMsgConvId(tempInt);
+                    IConversationPtr conversation(new Conversation(tempInt, EMPTY_MESSAGE_CONVERSATION));
                     EventMessageReceivedPtr event(new EventMessageReceived());
                     event->setMessage(message);
                     event->setConversation(conversation);
@@ -1597,7 +1608,7 @@ void Messaging::onMessageStorageChanged(msg_handle_t handle,
                     if(this_->m_onMessageReceived.size() > 0){
                         this_->m_onMessageReceived.emit(event);
                     }
-                    if(this_->m_onConversationReceived.size() > 0){
+                    if((this_->m_onConversationReceived.size() > 0)&& this_->isMsgConvIdNoMoreExist(tempInt)){
                         this_->m_onConversationReceived.emit(event);
                     }
                 }
@@ -1624,7 +1635,7 @@ void Messaging::onMessageStorageChanged(msg_handle_t handle,
                     LoggerD("msgType : " << msgType);
                     if((msgType > MSG_TYPE_INVALID) && ( msgType <= MSG_TYPE_SMS_REJECT))
                     {
-                        if(msgType  != MSG_TYPE_MMS_NOTI)
+                        if(msgType != MSG_TYPE_MMS_NOTI)
                         {
                             int msgId = 0;
                             msg_get_int_value(msg, MSG_MESSAGE_ID_INT, &msgId);
@@ -1658,6 +1669,10 @@ void Messaging::onMessageStorageChanged(msg_handle_t handle,
                             if(this_->m_onConversationReceived.size() > 0){
                                 int emitCheck = 0;
                                 LoggerD("Message Status = " << message->getMessageStatus());
+                                if(storageChangeType == MSG_STORAGE_CHANGE_INSERT)
+                                {
+                                    this_->addMsgConvIdList(msgId, conversation->getConvId());
+                                }
                                 if((conversation->getMessageCount() == 1)  && (storageChangeType == MSG_STORAGE_CHANGE_INSERT))
                                 {
                                     emitCheck = 1;
@@ -1722,6 +1737,10 @@ void Messaging::onMessageStorageChanged(msg_handle_t handle,
                             if(this_->m_onConversationReceived.size() > 0){
                                 int emitCheck = 0;
                                 LoggerD("Message Status = " << message->getMessageStatus());
+                                if(storageChangeType == MSG_STORAGE_CHANGE_INSERT)
+                                {
+                                    this_->addMsgConvIdList(msgId, conversation->getConvId());
+                                }
                                 if((conversation->getMessageCount() == 1)  && (storageChangeType == MSG_STORAGE_CHANGE_INSERT))
                                 {
                                     emitCheck = 1;
@@ -2607,7 +2626,7 @@ bool Messaging::deleteConversations(const std::vector<IConversationPtr>& convers
        LoggerD("Enter");
 
        if (conversations.size() == 0)
-               return false;
+               return true;
        
        if (conversations[0]->getType() == EMAIL)
        {
@@ -2748,5 +2767,69 @@ std::vector<IMessageFolderPtr> Messaging::queryFolders(const DeviceAPI::Tizen::F
 
 }
 
+void Messaging::makeMsgConvIdList()
+{
+       msg_handle_t handle = MsgGetCommonHandle();
+       msg_struct_t listCond = NULL;
+       msg_struct_list_s msgList = {0,};
+       int msgCount, tempInt_1, tempInt_2;
+       msg_error_t err =  MSG_SUCCESS;
+
+       err = msg_get_message_list(handle, 0, 0, 0, 0, &msgList);
+
+       msgCount = msgList.nCount;
+
+       for(int i=0; i<msgCount; i++)
+       {
+               msg_get_int_value(msgList.msg_struct_info[i], MSG_MESSAGE_ID_INT, &tempInt_1);
+               msg_get_int_value(msgList.msg_struct_info[i], MSG_MESSAGE_THREAD_ID_INT, &tempInt_2);
+               LoggerD("tempInt_1 : " << tempInt_1 << " tempInt_2 : " << tempInt_2);
+               m_msgConvIdList.insert(std::pair<int,int>(tempInt_1, tempInt_2));
+       }
+       msg_release_list_struct(&msgList);
+
+}
+
+void Messaging::addMsgConvIdList(int msgId, int convId)
+{
+       m_msgConvIdList.insert(std::pair<int,int>(msgId, convId));
+}
+
+int Messaging::getMsgConvId(int msgId)
+{
+       int ret = 0;
+       std::map<int,int>::iterator it = m_msgConvIdList.find(msgId);   //find reqeuset
+
+       if (m_msgConvIdList.end() != it) {
+               ret = it->second;
+               m_msgConvIdList.erase(msgId);
+       }
+       return ret;
+}
+
+bool Messaging::isMsgConvIdNoMoreExist(int convId)
+{
+       if (convId > 0) {
+               std::map<int,int>::iterator it = m_msgConvIdList.begin();
+               for (; it != m_msgConvIdList.end(); it++)
+               {
+                       if(convId == it->second)
+                       {
+                               return FALSE;
+                       }
+               }
+       }
+       else
+       {
+               return FALSE;
+       }
+       return TRUE;
+}
+
+void Messaging::removeMsgConvIdList()
+{
+       m_msgConvIdList.clear();
+}
+
 }
 }
index f203691..36ae37b 100644 (file)
@@ -53,32 +53,8 @@ class Messaging : public IMessaging,
 
   public:
     virtual ~Messaging();
-
-/*
-    virtual void getNumberOfMessages(MessageType msgType,
-            FolderType folder,
-            int* readed,
-            int* unReaded);
-
-    virtual std::vector<IMessagePtr> findMessages(
-            const std::vector<MessageType>& msgTypes,
-            FolderType folder,
-            const DeviceAPI::Tizen::FilterPtr& filter);
-
-    virtual std::vector<IMessagePtr> findMessages(
-            const std::vector<MessageType>& msgTypes,
-            const std::string &folder,
-            const DeviceAPI::Tizen::FilterPtr& filter);
-
-    virtual std::vector<IMessagePtr> findMessages(const DeviceAPI::Tizen::FilterPtr& filter,
-               const DeviceAPI::Tizen::SortModePtr& sortMode, const long limit, const long offset);
-*/             
     virtual std::vector<IMessagePtr> findMessages(const DeviceAPI::Tizen::FilterPtr& filter,
                const DeviceAPI::Tizen::SortModePtr& sortMode, const long limit, const long offset, const int type);
-//    virtual std::vector<IMessagePtr> findMessages(const DeviceAPI::Tizen::FilterPtr& filter);
-
-//    virtual std::vector<std::string> getMessageIds(MessageType msgType,
-//            FolderType folder);
 
     virtual void createFolder(MessageType msgType,
             const std::string& userFolder);
@@ -121,8 +97,6 @@ class Messaging : public IMessaging,
 
     std::vector<IConversationPtr> queryConversations(const DeviceAPI::Tizen::FilterPtr& filter, const DeviceAPI::Tizen::SortModePtr& sortMode, int type, long limit=0, long offset=0);
 
-//    bool deleteConversations(const DeviceAPI::Tizen::SortModePtr& sortMode, const DeviceAPI::Tizen::FilterPtr& filter);
-
     bool deleteConversations(const std::vector<IConversationPtr>& conversations);
 
     std::vector<IMessageFolderPtr> queryFolders(const DeviceAPI::Tizen::FilterPtr& filter);
@@ -166,51 +140,6 @@ class Messaging : public IMessaging,
 //            MSG_MSGID_LIST_S *pMsgIdList,
             msg_id_list_s *pMsgIdList,
             void* data);
-/*
-    static void onSmsReceived(MSG_HANDLE_T handle,
-            msg_message_t msg,
-            void* data);
-    static void onMmsReceived(MSG_HANDLE_T handle,
-            msg_message_t msg,
-            void* data);
-*/
-  private:
-/*
-    void getNumberOfEmails(FolderType folder,
-            int* read,
-            int* unread);
-
-    void getNumberOfSms(FolderType folder,
-            int* read,
-            int* unread);
-
-    void getNumberOfMms(FolderType folder,
-            int* read,
-            int* unread);
-
-    void getNumberOfSmsMms(FolderType folder,
-            int* read,
-            int* unread,
-            MessageType msgType);
-
-    virtual std::vector<IMessagePtr> findSms(FolderType folder,
-               const DeviceAPI::Tizen::FilterPtr& filter);
-
-    virtual std::vector<IMessagePtr> findMms(FolderType folder,
-               const DeviceAPI::Tizen::FilterPtr& filter);
-
-    virtual std::vector<IMessagePtr> findEmail(FolderType folder,
-               const DeviceAPI::Tizen::FilterPtr& filter);
-
-    virtual std::vector<IMessagePtr> findEmail(const std::string &folder,
-               const DeviceAPI::Tizen::FilterPtr& filter);
-
-    std::vector<std::string> getSmsIds(FolderType folder);
-
-    std::vector<std::string> getMmsIds(FolderType folder);
-
-    std::vector<std::string> getEmailIds(FolderType folder);
-*/
 
     void createMsgServiceFolder(const std::string& userFolder);
 
@@ -224,6 +153,15 @@ class Messaging : public IMessaging,
 
     std::vector<std::string> getFolderNamesEmail();
 
+    void makeMsgConvIdList();
+
+    void addMsgConvIdList(int msgId, int convId);
+
+    int getMsgConvId(int msgId);
+
+    bool isMsgConvIdNoMoreExist(int convId);
+
+    void removeMsgConvIdList();
 
     void printErrorMessage(int errorCode);
 
@@ -234,6 +172,9 @@ class Messaging : public IMessaging,
     MsgServiceHandleMgrPtr m_onMessageReceivedHandleMgr;
     DBus::ConnectionPtr m_dbusConnection;
     DPL::Thread* m_dbusWorkerThread;
+
+    typedef std::map<int, int> convIdList;
+    convIdList m_msgConvIdList;
 };
 }
 }
index 4fcffeb..35f3aec 100644 (file)
@@ -457,7 +457,6 @@ void Mms::readBodyAndAttachments(msg_struct_t& messageData)
                                } else {
                                        LoggerE("body is not set");
                                }
-                               LoggerD("message body: '" << getBody() << "'");
                                fclose(f);
                        } 
                        else 
@@ -613,7 +612,6 @@ void Mms::readBody(msg_struct_t& messageData)
                                } else {
                                        LoggerE("body is not set");
                                }
-                               LoggerD("message body: '" << getBody() << "'");
                                fclose(f);
                        } 
                        else 
@@ -929,8 +927,6 @@ void Mms::updateBodyAndAttachments()
                         
                                fclose(f);
 
-                               LoggerD("getBodyRef(): " << getBodyRef());
-
                                msg_set_int_value(mms_struct, MSG_MMS_ROOTLAYOUT_WIDTH_INT, ROOT_LAYOUT_WIDTH);
                                msg_set_int_value(mms_struct, MSG_MMS_ROOTLAYOUT_HEIGHT_INT, ROOT_LAYOUT_HEIGHT);
                                msg_set_int_value(mms_struct, MSG_MMS_ROOTLAYOUT_BGCOLOR_INT, WHITE_COLOR);
index d4a6267..29047e2 100644 (file)
@@ -521,10 +521,9 @@ void ReqReceiverMessage::OnRequestReceived(const EventMessagingServicePtr& event
                                        }
                                }
                                else {
-                               LoggerD(" invaild message. ");
+                                       LoggerD(" invaild message. ");
                                        event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException);
-                               }
-
+                               }
                        }
                        else
                        {
index bcfa3ae..ac2c2c4 100644 (file)
@@ -431,8 +431,7 @@ namespace Messaging {
                        if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_PREVIEW)==0){
                                LoggerD("<<< value:[" << value << "]");
                                LoggerD("<<< value->toString():[" << value->toString() << "]");
-                               LoggerD("<<< m_body:[" << m_preview << "]");
-  
+
                                valueString = m_preview;
                                if(getMatchFlagResult(value, valueString, matchFlag))
                                {
index 127ec50..a6e6412 100644 (file)
@@ -135,22 +135,7 @@ namespace DeviceAPI {
                        m_priority = msg->getPriority();
                        m_subject = msg->getSubject();
                        m_messageStatus = msg->getMessageStatus();
-               
-                       
-                       LoggerD("m_type:" << m_type );
-                       LoggerD("m_folder:" << m_folder );
-                       LoggerD("m_dateTime year:" << m_dateTime.tm_year + 1900 );
-                       LoggerD("m_dateTime mon:" << m_dateTime.tm_mon );
-                       LoggerD("m_dateTime day:" << m_dateTime.tm_mday );
-                       LoggerD("m_dateTime hour:" << m_dateTime.tm_hour );
-                       LoggerD("m_dateTime min:" << m_dateTime.tm_min );
-                       LoggerD("m_dateTime sec:" << m_dateTime.tm_sec );                       
-                       LoggerD("m_from:" << m_from );
-                       LoggerD("m_body:" << m_body );
-                       LoggerD("m_isRead:" << m_isRead );
-                       LoggerD("m_priority:" << m_priority );
-                       LoggerD("m_subject:" << m_subject );
-                       
+
                }
 
                StorageChangesMessageGenerator::~StorageChangesMessageGenerator() {
@@ -620,7 +605,6 @@ namespace DeviceAPI {
                        if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_BODY)==0){
                                LoggerD("<<< value:[" << value << "]");
                                LoggerD("<<< value->toString():[" << value->toString() << "]");
-                               LoggerD("<<< m_body:[" << m_body << "]");
 
                                valueString = m_body;
                                if(getMatchFlagResult(value, valueString, matchFlag))
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 4ef78ab..f66839e 100755 (executable)
@@ -41,8 +41,12 @@ NFCAdapter::NFCAdapter() {
 
 NFCAdapter::~NFCAdapter() {
        LoggerD("Enter");
-       unsetTagListener();
-       unsetPeerListener();
+       try {
+               unsetTagListener();
+               unsetPeerListener();
+       } catch(...) {
+               LoggerE("ignore exception");
+       }
        m_EventNFCChangedSetPoweredPtr.Reset();
 }
 
index 6c703e7..9c33b43 100755 (executable)
@@ -185,17 +185,21 @@ void PowerManager::release(PowerResource resource){
 }
 
 double PowerManager::getScreenBrightness(){
-    int brightness;
+    int brightness, maxBrightness, ret;
     brightness = getPlatformBrightness();
     LOGI("Brightness value: %d", brightness);
-    return brightness/100.0;
+    ret = device_get_max_brightness(0, &maxBrightness);
+    if( ret != 0 ){
+        LoggerE("Platform error while getting brightness: %d", ret);
+        throw UnknownException("Platform error while getting max brightness");
+    }    
+    return (double)brightness/(double)maxBrightness;
 }
 
 void PowerManager::setScreenBrightness(double brightness){
-    int ret;
+    int ret, maxBrightness;
     if( brightness > 1 || brightness < 0 )
         throw InvalidValuesException("brightness should be 0 <= brightness <= 1");
-    int maxBrightness;
     ret = device_get_max_brightness(0, &maxBrightness);
     if( ret != 0 ){
         LoggerE("Platform error while setting restore brightness: %d", ret);
@@ -265,8 +269,6 @@ void PowerManager::removeScreenStateChangedCallback(Common::CallbackUserData * c
 }
 
 void PowerManager::setPlatformBrightness(int brightness){
-
-
     if( mCurrentState.mState == PowerState::SCREENDIM ){
         mCurrentBrightness = brightness;
         LOGI("Current state is not normal state the value is saved in cache: %d", brightness);
@@ -275,6 +277,8 @@ void PowerManager::setPlatformBrightness(int brightness){
     }else
         mShouldBeReadFromCache = false;
 
+    LoggerD("brightness : " << brightness);
+
     int ret = device_set_brightness(0, brightness);
     if( ret != 0){
         LoggerE("Platform error while setting %d brightness: %d", brightness, ret);
index ed90aa4..ee2a5c8 100755 (executable)
@@ -303,15 +303,10 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR
             }
             return convert.toJSValueRef(deviceCapabilitiesInfo->inputKeyboard);
         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_INPUTKEYBOARD_LAYOUT)) {
-            char* inputKeyboardLayout = NULL;
-            if(system_info_get_platform_string("tizen.org/feature/input.keyboard.layout", &inputKeyboardLayout) == SYSTEM_INFO_ERROR_NONE) {
-                if (inputKeyboardLayout) {
-                    deviceCapabilitiesInfo->inputKeyboardLayout = true;
-                    free(inputKeyboardLayout);
+            bool inputKeyboard = false;
+            if(system_info_get_platform_bool("tizen.org/feature/input.keyboard", &inputKeyboard) == SYSTEM_INFO_ERROR_NONE) {
+                deviceCapabilitiesInfo->inputKeyboardLayout = inputKeyboard;
                 } else {
-                    deviceCapabilitiesInfo->inputKeyboardLayout = false;
-                }
-            } else {
                 LoggerE("get fail inputKeyboardLayout value");
                 return JSValueMakeUndefined(context);
             }