Update change log and spec for wrt-plugins-tizen_0.4.65
authorDongjin Choi <milkelf.choi@samsung.com>
Thu, 5 Sep 2013 08:18:21 +0000 (17:18 +0900)
committerDongjin Choi <milkelf.choi@samsung.com>
Thu, 5 Sep 2013 08:18:21 +0000 (17:18 +0900)
[model] REDWOOD
[binary_type] PDA
[customer] OPEN

[Issue] N/A
[Problem] remove build warning
[Cause] remove build warning
[Solution] remove build warning

[DataControl] check max query & data

[Issue] N/A
[Problem] makeEmptyConversation bug fix
[Cause] makeEmptyConversation bug fix
[Solution] makeEmptyConversation bug fix

[Common] remove finger-print, key cn, root cn

[Issue#] N/A
[Problem] SEC TC Fail
[Cause] They don't check if NFC is on
[Solution] It will raise ServiceNotAvailableError if NFC is off.

[Issue] N/A
[Problem] when setScreenBrightness() api is called, exception is occured if input parameter is zero.
[Cause] plaform throw exception when get zero.
[Solution] use minimum value when get zero.

[Issue] N/A
[Problem] Mms and Email using /tmp folder for Body and attachment file
[Cause] Mms and Email using /tmp folder for Body and attachment file
[Solution] /tmp file path change to wiget file path

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

UnitTC passed.

49 files changed:
packaging/wrt-plugins-tizen.spec
src/Alarm/config.xml
src/Application/config.xml
src/Bluetooth/config.xml
src/Bookmark/config.xml
src/Calendar/config.xml
src/Callhistory/config.xml
src/Contact/config.xml
src/Content/config.xml
src/DataControl/DataControlConverter.cpp
src/DataControl/DataControlConverter.h
src/DataControl/DataType.h
src/DataControl/JSMappedDataControlConsumer.cpp
src/DataControl/JSSQLDataControlConsumer.cpp
src/DataControl/config.xml
src/DataSync/config.xml
src/Download/config.xml
src/Filesystem/Manager.cpp
src/Filesystem/config.xml
src/MessagePort/config.xml
src/Messaging/Conversation.cpp
src/Messaging/Email.cpp
src/Messaging/EmailService.cpp
src/Messaging/EmailService.h
src/Messaging/IMessage.cpp
src/Messaging/IMessage.h [changed mode: 0755->0644]
src/Messaging/JSConversation.cpp
src/Messaging/JSMessagingServiceManager.cpp
src/Messaging/Messaging.cpp
src/Messaging/Messaging.h
src/Messaging/Mms.cpp
src/Messaging/WidgetFilePathMgr.h [new file with mode: 0644]
src/Messaging/config.xml
src/NFC/NFCAdapter.cpp
src/NFC/config.xml
src/NetworkBearerSelection/config.xml
src/Notification/config.xml
src/Package/config.xml
src/Power/PowerManager.cpp
src/Power/config.xml
src/Push/config.xml
src/SecureElement/config.xml
src/SystemSetting/config.xml
src/Systeminfo/config.xml
src/TimeUtil/JSTZDate.cpp
src/TimeUtil/config.xml
src/Tizen/config.xml
src/WebSetting/CMakeLists.txt
src/WebSetting/config.xml

index d728114..c5ba5cb 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       wrt-plugins-tizen
 Summary:    JavaScript plugins for WebRuntime
-Version:    0.4.64
+Version:    0.4.65
 Release:    0
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index 0e01835..05f5f62 100755 (executable)
@@ -3,10 +3,6 @@
 <plugin-properties>
        <library-name>libwrt-plugins-tizen-alarm.so</library-name>
        <feature-install-uri>alarm.install.uri</feature-install-uri>
-       <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-       <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-       <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
-
        <api-feature>
         <name>http://tizen.org/privilege/alarm</name>
                <device-capability>alarm</device-capability>
index 415b85d..df09164 100755 (executable)
@@ -3,9 +3,6 @@
 <plugin-properties>
        <library-name>libwrt-plugins-tizen-application.so</library-name>
        <feature-install-uri>application.install.uri</feature-install-uri>
-       <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-       <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-       <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/application.launch</name>
index f79ff77..e3c942f 100644 (file)
@@ -3,10 +3,6 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-bluetooth.so</library-name>
     <feature-install-uri>bluetooth.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
-
     <api-feature>
         <name>http://tizen.org/privilege/bluetooth.gap</name>
         <device-capability>bluetooth.gap</device-capability>
index a513eea..e29d62f 100755 (executable)
@@ -3,9 +3,6 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-bookmark.so</library-name>
     <feature-install-uri>bookmark.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/bookmark.read</name>
index 9a389c7..5d4b0dc 100755 (executable)
@@ -3,10 +3,6 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-calendar.so</library-name>
     <feature-install-uri>calendar.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
-
     <api-feature>
         <name>http://tizen.org/privilege/calendar.read</name>
         <device-capability>calendar.read</device-capability>
@@ -17,4 +13,4 @@
         <device-capability>calendar.write</device-capability>
     </api-feature>
 
-</plugin-properties>
\ No newline at end of file
+</plugin-properties>
index 6c048df..43e81ae 100755 (executable)
@@ -3,10 +3,6 @@
 <plugin-properties>
        <library-name>libwrt-plugins-tizen-callhistory.so</library-name>
        <feature-install-uri>callhistory.install.uri</feature-install-uri>
-       <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-       <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-       <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
-
        <api-feature>
                <name>http://tizen.org/privilege/callhistory.read</name>
                <device-capability>callhistory.read</device-capability>
index 78e7009..337261d 100755 (executable)
@@ -3,10 +3,7 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-contact.so</library-name>
     <feature-install-uri>contact.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
-
+    
     <api-feature>
         <name>http://tizen.org/privilege/contact.read</name>
         <device-capability>contact.read</device-capability>
index 2522e4b..3bff72a 100755 (executable)
@@ -3,9 +3,6 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-content.so</library-name>
     <feature-install-uri>content.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/content.read</name>
index 26ef477..556f115 100644 (file)
@@ -124,6 +124,30 @@ JSValueRef DataControlConverter::toFunction(const JSValueRef& arg)
        return NULL;
 }
 
+void DataControlConverter::checkRowDataSize(const RowData* data, const std::string& where)
+{
+       unsigned long dataSize = 0;
+       
+       if (data == NULL)
+       {
+               ThrowMsg(InvalidArgumentException, "No data to handle");
+       }
+
+       std::map<std::string, std::string>::const_iterator it;
+       
+       for (it = data->m_Data.begin(); it != data->m_Data.end(); ++it)
+       {
+               dataSize += (unsigned long)it->first.size();
+               dataSize += (unsigned long)it->second.size();
+       }
+       dataSize += where.size();
+
+       if (dataSize > ROW_DATA_MAX)
+       {
+               ThrowMsg(InvalidArgumentException, "Data is too big");
+       }
+}
+
 RowData* DataControlConverter::toRowDataPtr(const JSValueRef& arg)
 {
        if (JSValueIsNull(m_context, arg) || JSValueIsUndefined(m_context, arg) 
index 1cf4d1e..5e9545c 100755 (executable)
@@ -40,6 +40,7 @@ class DataControlConverter : public WrtDeviceApis::CommonsJavaScript::Converter
        std::string toString(int arg);
        std::string toString(const JSStringRef& arg);
        unsigned long toULong(const JSValueRef& arg);
+       void checkRowDataSize(const RowData* data, const std::string& where);
 };
 
 }
index 306bdf9..565e674 100644 (file)
@@ -28,6 +28,8 @@
 #define OSP_PKGINFO_SQL_TYPE "Sql"
 #define OSP_PKGINFO_MAP_TYPE "Map"
 
+#define PROTOCOL_DATA_MAX 16 * 1024
+#define ROW_DATA_MAX 1024 * 1024
 
 enum _DataControlRequestType
 {
index db00b12..4bf3573 100644 (file)
@@ -27,6 +27,7 @@
 #include <TimeTracer.h>
 #include <ArgumentValidator.h> 
 #include <JSUtil.h>  
+#include "DataType.h"
 #include "DataControlFactory.h"
 #include "JSMappedDataControlConsumer.h"
 #include "DataControlAsyncCallbackManager.h"
@@ -225,6 +226,16 @@ JSValueRef JSMappedDataControlConsumer::addValue(
                unsigned int reqId = converter.toULong(reserveArguments[0]);
                std::string key = converter.toString(reserveArguments[1]);
                std::string value = converter.toString(reserveArguments[2]);
+
+               unsigned long dataSize = key.size() + value.size();
+               
+               if (dataSize > PROTOCOL_DATA_MAX) 
+               {
+                       return JSWebAPIErrorFactory::postException(context, exception, 
+                               JSWebAPIErrorFactory::INVALID_VALUES_ERROR, "Data is too big");
+               }
+
+               
                successCallback = converter.toFunctionOrNull(reserveArguments[3]);
                errorCallBack = converter.toFunctionOrNull(reserveArguments[4]);
 
@@ -344,6 +355,15 @@ JSValueRef JSMappedDataControlConsumer::updateValue(
                successCallback = converter.toFunctionOrNull(reserveArguments[4]);
                errorCallBack = converter.toFunctionOrNull(reserveArguments[5]);
 
+               unsigned long dataSize = key.size() + oldValue.size() + newValue.size();
+               
+               if (dataSize > PROTOCOL_DATA_MAX) 
+               {
+                       return JSWebAPIErrorFactory::postException(context, exception, 
+                               JSWebAPIErrorFactory::INVALID_VALUES_ERROR, "Data is too big");
+               }
+
+
                cbm->setOnSuccess(successCallback);
                cbm->setOnError(errorCallBack);
 
@@ -458,6 +478,16 @@ JSValueRef JSMappedDataControlConsumer::getValue(
 
                unsigned int reqId = converter.toULong(reserveArguments[0]);
                std::string key = converter.toString(reserveArguments[1]);
+
+               
+               unsigned long dataSize = key.size();
+               
+               if (dataSize > PROTOCOL_DATA_MAX) 
+               {
+                       return JSWebAPIErrorFactory::postException(context, exception, 
+                               JSWebAPIErrorFactory::INVALID_VALUES_ERROR, "Data is too big");
+               }
+
                successCallback = converter.toFunctionOrNull(reserveArguments[2]);
                errorCallBack = converter.toFunctionOrNull(reserveArguments[3]);
 
@@ -567,6 +597,15 @@ JSValueRef JSMappedDataControlConsumer::removeValue(
                unsigned int reqId = converter.toULong(reserveArguments[0]);
                std::string key = converter.toString(reserveArguments[1]);
                std::string value = converter.toString(reserveArguments[2]);
+
+               unsigned long dataSize = key.size() + value.size();
+               
+               if (dataSize > PROTOCOL_DATA_MAX) 
+               {
+                       return JSWebAPIErrorFactory::postException(context, exception, 
+                               JSWebAPIErrorFactory::INVALID_VALUES_ERROR, "Data is too big");
+               }
+
                successCallback = converter.toFunctionOrNull(reserveArguments[3]);
                errorCallBack = converter.toFunctionOrNull(reserveArguments[4]);
 
index f9b2f9e..eed4bb0 100644 (file)
@@ -27,6 +27,7 @@
 #include <TimeTracer.h>
 #include <ArgumentValidator.h> 
 #include <JSUtil.h>  
+#include "DataType.h"
 #include "DataControlFactory.h"
 #include "JSSQLDataControlConsumer.h"
 #include "DataControlAsyncCallbackManager.h"
@@ -221,6 +222,18 @@ JSValueRef JSSQLDataControlConsumer::insert(
                
                unsigned int reqId = converter.toULong(reserveArguments[0]);
                RowData* rowData = converter.toRowDataPtr(reserveArguments[1]);
+               std::string dummyWhere = "";
+
+               try 
+               {
+                       converter.checkRowDataSize(rowData, dummyWhere);
+               }
+               catch (const WrtDeviceApis::Commons::Exception& ex) 
+               {
+                       return JSWebAPIErrorFactory::postException(context, exception, 
+                               JSWebAPIErrorFactory::INVALID_VALUES_ERROR, ex.GetMessage());
+               }
+               
                unsigned int colSize = rowData->m_Data.size();
                successCallback = converter.toFunctionOrNull(reserveArguments[2]);
                errorCallBack = converter.toFunctionOrNull(reserveArguments[3]);
@@ -335,6 +348,17 @@ JSValueRef JSSQLDataControlConsumer::update(
                RowData* rowData = converter.toRowDataPtr(reserveArguments[1]);
                unsigned int colSize = rowData->m_Data.size();
                std::string where = converter.toString(reserveArguments[2]);            
+
+               try 
+               {
+                       converter.checkRowDataSize(rowData, where);
+               }
+               catch (const WrtDeviceApis::Commons::Exception& ex) 
+               {
+                       return JSWebAPIErrorFactory::postException(context, exception, 
+                               JSWebAPIErrorFactory::INVALID_VALUES_ERROR, ex.GetMessage());
+               }
+               
                successCallback = converter.toFunctionOrNull(reserveArguments[3]);
                errorCallBack = converter.toFunctionOrNull(reserveArguments[4]);
 
@@ -450,6 +474,7 @@ JSValueRef JSSQLDataControlConsumer::select(
                EventSelectPtr event(new EventSelect);
 
                unsigned int reqId = converter.toULong(reserveArguments[0]);
+               unsigned long dataSize = 0;
 
                LoggerD(reqId);
 
@@ -457,12 +482,20 @@ JSValueRef JSSQLDataControlConsumer::select(
 
                if (columns.size() == 0)
                        Throw(WrtDeviceApis::Commons::ConversionException);
-               
+
+               for (size_t index = 0; index < columns.size(); index++) 
+               {
+                       dataSize += columns[index].size();
+               }
 
                std::string where = converter.toString(reserveArguments[2]);
-               
-               LoggerD(where);
-               
+               dataSize += where.size();
+
+               if (dataSize > PROTOCOL_DATA_MAX) 
+               {
+                       return JSWebAPIErrorFactory::postException(context, exception, 
+                               JSWebAPIErrorFactory::INVALID_VALUES_ERROR, "Data is too big");
+               }
 
                successCallback = converter.toFunctionOrNull(reserveArguments[3]);
                errorCallBack = converter.toFunctionOrNull(reserveArguments[4]);
@@ -588,6 +621,15 @@ JSValueRef JSSQLDataControlConsumer::remove(
                successCallback = converter.toFunctionOrNull(reserveArguments[2]);
                errorCallBack = converter.toFunctionOrNull(reserveArguments[3]);
 
+               unsigned long dataSize = where.size();
+               
+               if (dataSize > PROTOCOL_DATA_MAX) 
+               {
+                       return JSWebAPIErrorFactory::postException(context, exception, 
+                               JSWebAPIErrorFactory::INVALID_VALUES_ERROR, "Data is too big");
+               }
+               
+
                cbm->setOnSuccess(successCallback);
                cbm->setOnError(errorCallBack);
 
index e723d5f..9d0447d 100755 (executable)
@@ -3,9 +3,7 @@
 <plugin-properties>
        <library-name>libwrt-plugins-tizen-datacontrol.so</library-name>
        <feature-install-uri>datacontrol.install.uri</feature-install-uri>
-       <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-       <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-       <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
+       
        <api-feature>
                <name>http://tizen.org/privilege/datacontrol.consumer</name>
                <device-capability>datacontrol.consumer</device-capability>
index b079257..8486e4f 100755 (executable)
@@ -3,13 +3,10 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-datasync.so</library-name>
     <feature-install-uri>datasync.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/datasync</name>
         <device-capability>datasync</device-capability>
     </api-feature>
 
-</plugin-properties>
\ No newline at end of file
+</plugin-properties>
index 83cc87c..f5db19c 100755 (executable)
@@ -3,13 +3,10 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-download.so</library-name>
     <feature-install-uri>download.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/download</name>
         <device-capability>download</device-capability>
     </api-feature>
 
-</plugin-properties>
\ No newline at end of file
+</plugin-properties>
index e177e37..fb89f82 100644 (file)
@@ -552,11 +552,15 @@ void Manager::OnRequestReceived(const EventCopyPtr& event)
 
                std::string realSrc = src->getFullPath();
                std::string realDest = dest->getFullPath();
-
+               
                if (realSrc == realDest) {
                        ThrowMsg(Commons::PlatformException,
                        "Destination is same as source.");
                }
+               else if (src->getPath() == dest->getPath() && dest->getName() == "") {
+                       ThrowMsg(Commons::PlatformException,
+                       "Destination is same as source.");
+               }
 
 
 
@@ -650,6 +654,10 @@ void Manager::OnRequestReceived(const EventMovePtr& event)
             ThrowMsg(Commons::PlatformException,
                      "Destination is same as source.");
         }
+               else if (src->getPath() == dest->getPath() && dest->getName() == "") {
+                       ThrowMsg(Commons::PlatformException,
+                       "Destination is same as source.");
+               }
 
         INodePtr parent;
         Try {
index 60e69e7..42c4ef2 100755 (executable)
@@ -3,9 +3,6 @@
 <plugin-properties>
   <library-name>libwrt-plugins-tizen-filesystem.so</library-name>
   <feature-install-uri>filesystem.install.uri</feature-install-uri>
-  <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-  <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-  <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
   <api-feature>
       <name>http://tizen.org/privilege/filesystem.read</name>
index c028149..99ea66d 100644 (file)
@@ -3,9 +3,6 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-messageport.so</library-name>
     <feature-install-uri>messageport.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/messageport</name>
index 072efa0..cf39a5f 100644 (file)
@@ -841,8 +841,9 @@ bool Conversation::makeEmptyConversation(unsigned int threadIndex, MessageType m
        m_subject = "";
        m_lastMessageId = 0;
        m_direction = 0;
+       m_result = true;
 
-       return true;
+       return m_result;
 }
 
 
index eb8dc9f..2334790 100644 (file)
@@ -382,7 +382,7 @@ void Email::create( EmailAccountInfo& account )
        //MailSender::getInstance();
 
        LoggerD("account ID : " << m_accountId);
-       ScopedMail mail(EmailService::createMailData(account));
+       ScopedMail mail(EmailService::createMailData(account, getWidgetPath()));
 
        setEmailAccount(account);       //save account
 
@@ -692,14 +692,12 @@ void Email::updateBody()
        locationChecker = EmailUtils::isFrameworkEmailData(m_mail->file_path_plain);
        if(locationChecker == true)     // already exist palin body file on email frame work, we can not update that file so make new temp file
        {
-               LoggerD("create new plain body");
                char buf[] = "XXXXXX";
                mode_t mask = umask(S_IWGRP | S_IWOTH);
                error = mkstemp(buf);
                umask(mask);
                std::string bodyFile = buf;
-               bodyFile = EmailUtils::TMP_DIR_PREFIX+bodyFile;
-               LoggerD("bodyFile : " << bodyFile);
+               bodyFile = getWidgetPath()+EmailUtils::TMP_DIR_SEPERATOR+bodyFile;
 
                FILE* f = fopen(bodyFile.c_str(), "w");
                if (NULL != f) {
@@ -724,14 +722,12 @@ void Email::updateBody()
        locationChecker = EmailUtils::isFrameworkEmailData(m_mail->file_path_html);
        if((locationChecker == true) || (!m_mail->file_path_html))      // html file is not exist or exist on email frame work then create tmp html file
        {
-               LoggerD("create new html body");
                char buf[] = "XXXXXX";
                mode_t mask = umask(S_IWGRP | S_IWOTH);
                error = mkstemp(buf);
                umask(mask);
                std::string htmlFile = buf;
-               htmlFile = EmailUtils::TMP_DIR_PREFIX+htmlFile;
-               LoggerD("htmlFile : " << htmlFile);
+               htmlFile = getWidgetPath()+EmailUtils::TMP_DIR_SEPERATOR+htmlFile;
 
                FILE* f = fopen(htmlFile.c_str(), "w");
                if (NULL != f) {
@@ -975,7 +971,7 @@ void Email::createSendMessage()
                EmailAccountInfo account = getEmailAccount();
                m_accountId = account.getIntId();       //set account ID
                LoggerD("account ID : " << m_accountId);
-               m_mail.Reset(EmailService::createMailData(account));
+               m_mail.Reset(EmailService::createMailData(account, getWidgetPath()));
 
                updateSubject();
                updateBody();
@@ -1072,7 +1068,7 @@ void Email::addMessageToDraft()
                EmailAccountInfo account = getEmailAccount();
                m_accountId = account.getIntId();       //set account ID
                LoggerD("account ID : " << m_accountId);
-               m_mail.Reset(EmailService::createMailData(account));
+               m_mail.Reset(EmailService::createMailData(account, getWidgetPath()));
 
                updateSubject();
                updateBody();
@@ -1336,19 +1332,22 @@ void Email::updateAttachments()
 
                                //copy attachment file
                                std::stringstream cp_cmd;
-                               char buf[] = "/tmp/XXXXXX";
+                               char buf[] = "XXXXXX";
                                mode_t mask = umask(S_IWGRP | S_IWOTH);
                                error = mkstemp(buf);
                                umask(mask);
 
+                               std::string attachFile = buf;
+                               attachFile = getWidgetPath()+EmailUtils::TMP_DIR_SEPERATOR+attachFile;
+
                                cp_cmd << COMMAND_NAME;
                                cp_cmd << " " << COMMAND_SWITCH_RECURSIVE;
                                cp_cmd << " \"" << att->getFullPath() << "\"";
-                               cp_cmd << " \"" << buf << "\"";
+                               cp_cmd << " \"" << attachFile << "\"";
 
                                attachment_info = EmailService::alloc<email_attachment_data_t>();
                                attachment_info->attachment_name = String::strdup(att->getShortName());
-                               attachment_info->attachment_path = String::strdup( buf );
+                               attachment_info->attachment_path = String::strdup( attachFile );
                                attachment_info->save_status = true;
                                attachment_info->inline_content_status = 0;
                                if(att->getMimeType().size() > 0)
@@ -1356,17 +1355,17 @@ void Email::updateAttachments()
                                        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("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());
+//                             LoggerD("Copy Command=" << cp_cmd.str());
                                if (EINA_TRUE != ecore_file_is_dir(att->getFullPath().c_str())) {
-                                       LoggerD("att->getFullPath().c_str()=" << att->getFullPath().c_str());
-                                       if (EINA_TRUE != ecore_file_cp(att->getFullPath().c_str(), buf)) {
-                                               LoggerD("buf=" << buf);
+//                                     LoggerD("att->getFullPath().c_str()=" << att->getFullPath().c_str());
+                                       if (EINA_TRUE != ecore_file_cp(att->getFullPath().c_str(), attachFile.c_str())) {
+//                                             LoggerD("buf=" << attachFile);
                                                ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to copy file");
                                        }
                                }
@@ -1387,7 +1386,6 @@ void Email::updateAttachments()
                                }
 */
 
-                               LoggerD("add Attachment");
                                int error = email_add_attachment(m_mail->mail_id, attachment_info);
                                if (EMAIL_ERROR_NONE != error) {
                                        LoggerD("error :" << error);
@@ -1423,19 +1421,21 @@ void Email::updateAttachments()
 
                                //copy attachment file
                                std::stringstream cp_cmd;
-                               char buf[] = "/tmp/XXXXXX";
+                               char buf[] = "XXXXXX";
                                mode_t mask = umask(S_IWGRP | S_IWOTH);
                                error = mkstemp(buf);
                                umask(mask);
+                               std::string attachFile = buf;
+                               attachFile = getWidgetPath()+EmailUtils::TMP_DIR_SEPERATOR+attachFile;
 
                                cp_cmd << COMMAND_NAME;
                                cp_cmd << " " << COMMAND_SWITCH_RECURSIVE;
                                cp_cmd << " \"" << att->getFullPath() << "\"";
-                               cp_cmd << " \"" << buf << "\"";
+                               cp_cmd << " \"" << attachFile << "\"";
 
                                attachment_info = EmailService::alloc<email_attachment_data_t>();
                                attachment_info->attachment_name = String::strdup(att->getShortName());
-                               attachment_info->attachment_path = String::strdup( buf );
+                               attachment_info->attachment_path = String::strdup( attachFile );
                                attachment_info->save_status = true;
                                attachment_info->inline_content_status = 1;
                                LoggerD("attachment_info->inline_content_status=" << attachment_info->inline_content_status);
@@ -1444,34 +1444,14 @@ void Email::updateAttachments()
                                        attachment_info->attachment_mime_type = String::strdup(att->getMimeType());
                                }
 
-                               LoggerD("Copy Command=" << cp_cmd.str());
+//                             LoggerD("Copy Command=" << cp_cmd.str());
                                if (EINA_TRUE != ecore_file_is_dir(att->getFullPath().c_str())) {
-                                       LoggerD("att->getFullPath().c_str()=" << att->getFullPath().c_str());
-                                       if (EINA_TRUE != ecore_file_cp(att->getFullPath().c_str(), buf)) {
-                                               LoggerD("buf=" << buf);
+//                                     LoggerD("att->getFullPath().c_str()=" << att->getFullPath().c_str());
+                                       if (EINA_TRUE != ecore_file_cp(att->getFullPath().c_str(), attachFile.c_str())) {
                                                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());
-                               if (-1 != result) {
-                                       if (0 != WIFEXITED(result)) {
-                                               if (0 != WEXITSTATUS(result)) {
-                                                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Command failed.");
-                                               }
-                                       } else {
-                                               ThrowMsg(WrtDeviceApis::Commons::PlatformException,
-                                               "Command terminated abnormally.");
-                                       }
-                               } else {
-                                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Couldn't launch command.");
-                               }
-*/
-
-
-                               LoggerD("add Attachment");
                                int error = email_add_attachment(m_mail->mail_id, attachment_info);
                                if (EMAIL_ERROR_NONE != error) {
                                ThrowMsg(WrtDeviceApis::Commons::PlatformException,
@@ -1479,14 +1459,13 @@ void Email::updateAttachments()
                                }
                                else
                                {
-                                       LoggerD(" attachment id : " << attachment_info->attachment_id);
-                                       LoggerD(" attachment inline : " << attachment_info->inline_content_status);
-                                       LoggerD(" setNth(i+(int)attachmentSize+1) : " << i+(int)attachmentSize+1);
+//                                     LoggerD(" attachment id : " << attachment_info->attachment_id);
+//                                     LoggerD(" attachment inline : " << attachment_info->inline_content_status);
+//                                     LoggerD(" setNth(i+(int)attachmentSize+1) : " << i+(int)attachmentSize+1);
                                        att->setDownloaded(true);
                                        att->setIsInlineAttachment(TRUE);
                                        att->setAttachmentID(attachment_info->attachment_id);
                                        att->setMessage(SharedFromThis());
-//                                     att->setNth(i+1);
                                        att->setNth(i + (int)attachmentSize + 1);
                                }
 
index 8ded66b..eb98be3 100644 (file)
@@ -27,6 +27,7 @@
 #include "EmailService.h"
 #include "ScopedMail.h"
 #include "ScopedMailbox.h"
+#include "WidgetFilePathMgr.h"
 
 #define LOG_ENTER LoggerD("---> ENTER");
 #define LOG_EXIT LoggerD("---> EXIT");
@@ -35,7 +36,7 @@ namespace DeviceAPI {
 namespace Messaging {
 namespace EmailService {
 
-email_mail_data_t* createMailData(const EmailAccountInfo& account)
+email_mail_data_t* createMailData(const EmailAccountInfo& account, const std::string& filePath)
 {
     LOG_ENTER
     int error = 0;
@@ -53,7 +54,7 @@ email_mail_data_t* createMailData(const EmailAccountInfo& account)
     error = mkstemp(buf);
     umask(mask);
     std::string bodyFile = buf;
-    bodyFile = EmailUtils::TMP_DIR_PREFIX+bodyFile;
+    bodyFile = filePath+EmailUtils::TMP_DIR_SEPERATOR+bodyFile;
     LoggerD("bodyFile : " << bodyFile);
 
     FILE* f = fopen(bodyFile.c_str(), "w");
index 12d1aef..d153a84 100644 (file)
@@ -42,7 +42,7 @@ T* alloc()
 }
 
 #if 1
-email_mail_data_t* createMailData(const EmailAccountInfo& account);
+email_mail_data_t* createMailData(const EmailAccountInfo& account, const std::string& filePath);
 
 email_mail_data_t* readMail(int mailId);
 
index 216d582..3ceac07 100755 (executable)
@@ -39,6 +39,7 @@ IMessage::IMessage(const MessageType msgType,
     m_validisReadChangeStatus(true),
     m_folder(DRAFTBOX),
     m_folderId(-1),
+    m_widgetPath(""),
     m_requestReceiver(NULL),
     m_sendMessageEvent(NULL)
 {
@@ -53,6 +54,7 @@ IMessage::IMessage(const MessageType msgType,
     } else {
         LoggerE("Failed to initialize message dateTime");
     }
+    m_widgetPath = GetWidgetPath("");
 }
 
 IMessage::~IMessage()
@@ -319,5 +321,16 @@ MessageStatus IMessage::getMessageStatus() const
        return m_msgStatus;
 }
 
+void IMessage::setWidgetPath(const std::string& filePath)
+{
+       m_widgetPath = filePath;
+}
+
+std::string IMessage::getWidgetPath() const
+{
+       return m_widgetPath;
+}
+
+
 }
 }
old mode 100755 (executable)
new mode 100644 (file)
index 4c3669e..614355c
@@ -32,6 +32,7 @@
 #include "ValidityPeriodHours.h"
 #include "Subject.h"
 #include "EventOnSendingFailed.h"
+#include "WidgetFilePathMgr.h"
 
 namespace DeviceAPI {
 namespace Messaging {
@@ -127,6 +128,11 @@ class IMessage :
      */
     int m_folderId;
 
+    /**
+     * widget path
+     */
+    std::string m_widgetPath;
+
 
     /**
      * User folder name
@@ -243,6 +249,17 @@ class IMessage :
     /**
      *  method used to set current user folder name
      */
+    void setWidgetPath(const std::string& arg);
+
+
+    /**
+     *  method used to get current user folder name
+     */
+    std::string getWidgetPath() const;
+
+    /**
+     *  method used to set current user folder name
+     */
     void setCurrentUserFolder(const std::string& arg);
 
     /**
index 6077bfd..61cdb03 100755 (executable)
@@ -114,9 +114,8 @@ JSClassRef JSConversation::m_jsClassRef = JSClassCreate(JSConversation::getClass
 
 void JSConversation::initialize(JSContextRef context, JSObjectRef object)
 {
-       LoggerD("JSConversation::initialize ");
        JSConversationPriv* priv = static_cast<JSConversationPriv*>(JSObjectGetPrivate(object));
-;
+
        if (priv == NULL)
        {
                LoggerD("Private data is null ");
@@ -138,8 +137,6 @@ JSObjectRef JSConversation::createJSObject(JSContextRef context, IConversationPt
 void JSConversation::finalize(JSObjectRef object) {
        JSConversationPriv* priv = static_cast<JSConversationPriv*>(JSObjectGetPrivate(object));
 
-       LoggerD("JSConversation::Finalize");
-
        if (priv != NULL)
        {
                JSObjectSetPrivate(object, NULL);
@@ -157,7 +154,6 @@ JSValueRef JSConversation::getProperty(JSContextRef context,
                                                                                JSStringRef propertyName,
                                                                                JSValueRef* exception)
 {
-       LoggerD("OK");
 
        ConverterMessageFactory::ConverterType converter =  ConverterMessageFactory::getConverter(context);
 //     WrtDeviceApis::CommonsJavaScript::Converter converter(context);
@@ -243,7 +239,6 @@ bool JSConversation::setProperty(JSContextRef context,
         JSValueRef value,
         JSValueRef* exception)
 {
-    LoggerD("entered");
 
     if (JSStringIsEqualToUTF8CString(propertyName, CONVID)) {
         return true;
@@ -279,7 +274,6 @@ void JSConversation::getPropertyNames(JSContextRef context,
         JSObjectRef object,
         JSPropertyNameAccumulatorRef propertyNames)
 {
-    LoggerD("Entered");
     JSStringRef propertyName = NULL;
 
     propertyName = JSStringCreateWithUTF8CString(CONVID);
index aa4aeed..a64a316 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <ArgumentValidator.h>
 #include <Export.h>
+#include <WidgetDB/WidgetDBMgr.h>
 
 #include "JSMessagingServiceManager.h"
 #include "MessagingController.h"
@@ -37,6 +38,7 @@
 #include "plugin_config.h"
 #include "MessageAsyncCallbackManager.h"
 #include "MessagingErrorMsg.h"
+#include "WidgetFilePathMgr.h"
 
 using namespace std;
 
@@ -90,6 +92,7 @@ namespace Messaging {
 
     void JSMessagingServiceManager::initialize(JSContextRef context, JSObjectRef object) {
         LoggerD("creation messaging instance");
+        int widgetId = -1;
 
         JSMessagingServiceManagerPriv *priv = static_cast<JSMessagingServiceManagerPriv*>(JSObjectGetPrivate(object));
         if (priv == NULL)
@@ -97,6 +100,10 @@ namespace Messaging {
             IMessagingServiceManagerPtr MessagingServiceManager(MessagingFactory::getInstance().getMessagingServiceManager());
             priv = new JSMessagingServiceManagerPriv( context, MessagingServiceManager);
 
+            widgetId = WrtAccessSingleton::Instance().getWidgetId();
+            WrtDeviceApis::WidgetDB::Api::IWidgetDBPtr widgetDB = WrtDeviceApis::WidgetDB::Api::getWidgetDB(widgetId);
+            GetWidgetPath(widgetDB->getWidgetPersistentStoragePath());
+
             if(!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
                 LoggerE("Object can't store private data.");
                 delete priv;
index 02552b2..8949a91 100644 (file)
@@ -50,6 +50,7 @@ extern "C" {
 #include <Logger.h>
 
 IMPLEMENT_SAFE_SINGLETON(DeviceAPI::Messaging::MsgServiceHandle)
+IMPLEMENT_SAFE_SINGLETON(DeviceAPI::Messaging::WidgetFilePath)
 
 
 #define LOG_ENTER LoggerD("---> ENTER");
index 1c840b6..f203691 100644 (file)
@@ -34,6 +34,7 @@ extern "C" {
 #include "DBus/Connection.h"
 #include "DBus/MessageEvent.h"
 #include "MsgServiceHandleMgr.h"
+#include "WidgetFilePathMgr.h"
 
 #include <IFilter.h>
 #include "IConversation.h"
index 1567f8c..4fcffeb 100644 (file)
@@ -23,6 +23,7 @@
 #include "Messaging.h"
 #include "CallbackMgr.h"
 #include "MsgServiceHandleMgr.h"
+#include "WidgetFilePathMgr.h"
 #include <Logger.h>
 #include <vconf.h>
 
@@ -35,7 +36,7 @@ extern "C" {
 namespace {
 const char* TEXT_AREA = "Text";
 const char* TEXT_FILE_EXTENSION = ".txt";
-const char* TEXT_DIR_PREFIX = "/tmp/";
+const char* TEXT_DIR_SEPERATOR = "/";
 const int WHITE_COLOR = 0xffffff;
 const int BLACK_COLOR = 0x000000;
 const int ROOT_LAYOUT_WIDTH = 100;
@@ -50,11 +51,9 @@ namespace Messaging {
 
 Mms::Mms(const string& id) :
     IMessage(MMS, id),
-//    m_bodyFilePath(string(tmpnam(NULL)) + TEXT_FILE_EXTENSION),
     m_messageData(NULL)
 {
        LoggerD("m_id=" << getIdRef());
-       LoggerD("m_msgType=" << getMessageType());
 
        char buf[] = "XXXXXX";
        mode_t mask = umask(S_IWGRP | S_IWOTH);
@@ -62,15 +61,11 @@ Mms::Mms(const string& id) :
        LoggerD("buf : " << buf << " i : " << i);
        umask(mask);
        m_bodyFilePath = buf;
-       m_bodyFilePath = TEXT_DIR_PREFIX+m_bodyFilePath+TEXT_FILE_EXTENSION;
-
-       LoggerD("m_bodyFilePath : " << m_bodyFilePath);
+       m_bodyFilePath = getWidgetPath()+TEXT_DIR_SEPERATOR+m_bodyFilePath+TEXT_FILE_EXTENSION;
 
        if (getIdRef().empty()) {
-               LoggerD("create new message");
                createNewMessage();
        } else {
-               LoggerD("read existing message");
                readExistingMessage();
        }
 }
@@ -80,11 +75,8 @@ Mms::Mms(const string& id, const msg_struct_t msg_data) :
        m_messageData(NULL)
 {
        LoggerD("m_id=" << getIdRef());
-       LoggerD("m_msgType=" << getMessageType());
 
-       LoggerD("created msg_data : " << msg_data);
        m_messageData = createNewCopyOfPLatformMsgWithAddressList(msg_data);
-       LoggerD("created m_messageData : " << m_messageData);
 
        char buf[] = "XXXXXX";
        mode_t mask = umask(S_IWGRP | S_IWOTH);
@@ -92,10 +84,8 @@ Mms::Mms(const string& id, const msg_struct_t msg_data) :
        LoggerD("buf : " << buf << " i : " << i);
        umask(mask);
        m_bodyFilePath = buf;
-       m_bodyFilePath = TEXT_DIR_PREFIX+m_bodyFilePath+TEXT_FILE_EXTENSION;
-       
-       LoggerD("m_bodyFilePath : " << m_bodyFilePath);
-       
+       m_bodyFilePath = getWidgetPath()+TEXT_DIR_SEPERATOR+m_bodyFilePath+TEXT_FILE_EXTENSION;
+
        readConversationId(m_messageData);
        readRecipientList(m_messageData);
        readPriority(m_messageData);
@@ -105,7 +95,6 @@ Mms::Mms(const string& id, const msg_struct_t msg_data) :
        readDateTime(m_messageData);
        readReadStatus(m_messageData);
        readMessageStatus(m_messageData);
-//     setMessageStatus(MESSAGE_STATUS_LOADED);
 
 }
 
diff --git a/src/Messaging/WidgetFilePathMgr.h b/src/Messaging/WidgetFilePathMgr.h
new file mode 100644 (file)
index 0000000..9dba66f
--- /dev/null
@@ -0,0 +1,96 @@
+//
+// 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 WIDGETFILEPATHMGR_H
+#define WIDGETFILEPATHMGR_H
+
+#include <dpl/singleton.h>
+#include <dpl/shared_ptr.h>
+#include <dpl/thread.h>
+#include <Commons/Exception.h>
+#include <Logger.h>
+
+extern "C" {
+#include <msg.h>
+}
+
+namespace DeviceAPI {
+namespace Messaging {
+
+/*
+ * Class used for msg service handle manager
+ */
+class MsgWidgetPathMgr
+{
+  public:
+    MsgWidgetPathMgr(std::string path) : m_widgetPath("")
+    {
+               m_widgetPath = path;
+    }
+
+  public:
+    ~MsgWidgetPathMgr()
+    {
+    }
+
+  std::string getPath() const
+  {
+         return m_widgetPath;
+  }
+
+
+  private:
+    std::string m_widgetPath;
+};
+
+typedef DPL::SharedPtr<MsgWidgetPathMgr> MsgWidgetPathMgrPtr;
+typedef DPL::ThreadLocalVariable<MsgWidgetPathMgrPtr> TlvWidgetPathMgr;
+
+class WidgetFilePath
+{
+  protected:
+    WidgetFilePath()
+    {
+    }
+
+  public:
+    ~WidgetFilePath()
+    {
+    }
+
+  std::string getPath(std::string path)
+  {
+         if (m_tlvWidgetPath.IsNull()) {
+                 m_tlvWidgetPath = MsgWidgetPathMgrPtr(new MsgWidgetPathMgr(path));
+         }
+         return (*m_tlvWidgetPath)->getPath();
+  }
+
+
+  private:
+    TlvWidgetPathMgr m_tlvWidgetPath;
+};
+
+typedef DPL::Singleton<WidgetFilePath> WidgetPathSingleton;
+
+#define GetWidgetPath(PATH) WidgetPathSingleton::Instance().getPath(PATH)
+
+
+}
+}
+#endif /* WIDGETFILEPATHMGR_H */
+
index 1ea152e..cccb790 100755 (executable)
@@ -3,9 +3,6 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-messaging.so</library-name>
     <feature-install-uri>messaging.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
         
     <api-feature>
index 100de03..4ef78ab 100755 (executable)
@@ -48,6 +48,8 @@ NFCAdapter::~NFCAdapter() {
 
 int NFCAdapter::setTagListener(const EventNFCChangedEmitterPtr& emitter, const TagFilterPtr& filter) {
        LoggerD(" NFCAdapter::setTagListener Entered");
+       if (!getPowerState())
+               ThrowMsg(PlatformException, "NFC is OFF.");
        if (m_NFCTagEmitterPtr.Get() != NULL)
                ThrowMsg(PlatformException, "It has already set Tag Listener");
 
@@ -59,7 +61,8 @@ int NFCAdapter::setTagListener(const EventNFCChangedEmitterPtr& emitter, const T
 
 int NFCAdapter::setPeerListener(const EventNFCChangedEmitterPtr& emitter) {
        LoggerD(" NFCAdapter::setPeerListener Entered");
-
+       if (!getPowerState())
+               ThrowMsg(PlatformException, "NFC is OFF.");
        if (m_NFCTargetEmitterPtr.Get() != NULL)
                ThrowMsg(PlatformException, "It has already set Peer Listener");
 
@@ -68,6 +71,8 @@ int NFCAdapter::setPeerListener(const EventNFCChangedEmitterPtr& emitter) {
 }
 void NFCAdapter::unsetTagListener() {
        LoggerD(" NFCAdapter::unsetTagListener Entered");
+       if (!getPowerState())
+               ThrowMsg(PlatformException, "NFC is OFF.");
        m_NFCTagEmitterPtr.Reset();
        m_tagFilter.Reset();
        NFCDefaultAdapterSingleton::Instance().unsetTagListener(this);
@@ -75,6 +80,8 @@ void NFCAdapter::unsetTagListener() {
 
 void NFCAdapter::unsetPeerListener() {
        LoggerD(" NFCAdapter::unsetPeerListener Entered");
+       if (!getPowerState())
+               ThrowMsg(PlatformException, "NFC is OFF.");
        m_NFCTargetEmitterPtr.Reset();
        NFCDefaultAdapterSingleton::Instance().unsetPeerListener(this);
 }
index ebde1dc..a06d606 100755 (executable)
@@ -3,9 +3,6 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-nfc.so</library-name>
     <feature-install-uri>nfc.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/nfc.common</name>
index 28e194f..190d206 100755 (executable)
@@ -3,9 +3,6 @@
 <plugin-properties>
        <library-name>libwrt-plugins-tizen-networkbearerselection.so</library-name>
        <feature-install-uri>networkbearerselection.install.uri</feature-install-uri>
-       <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-       <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-       <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
        <api-feature>
         <name>http://tizen.org/privilege/networkbearerselection</name>
index a63a880..7ceb0bb 100644 (file)
@@ -3,9 +3,6 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-notification.so</library-name>
     <feature-install-uri>notification.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/notification</name>
index 64b9735..170e884 100755 (executable)
@@ -3,9 +3,6 @@
 <plugin-properties>
        <library-name>libwrt-plugins-tizen-package.so</library-name>
        <feature-install-uri>package.install.uri</feature-install-uri>
-       <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-       <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-       <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/packagemanager.install</name>
index 2784c10..6c703e7 100755 (executable)
@@ -203,6 +203,9 @@ void PowerManager::setScreenBrightness(double brightness){
     }
     int nativeBrightness = (int)(brightness*maxBrightness);
 
+    if (nativeBrightness == 0)
+        nativeBrightness = 1;
+
     setPlatformBrightness(nativeBrightness);
     LOGI("Set the brightness value: %d", nativeBrightness);
 }
index 2b28639..92b3f63 100755 (executable)
@@ -3,9 +3,6 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-power.so</library-name>
     <feature-install-uri>power.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/power</name>
index 7b1e921..f50c830 100644 (file)
@@ -3,13 +3,10 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-push.so</library-name>
     <feature-install-uri>push.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/push</name>
         <device-capability>push</device-capability>
     </api-feature>
 
-</plugin-properties>
\ No newline at end of file
+</plugin-properties>
index 74306aa..0c4b9dd 100755 (executable)
@@ -3,9 +3,6 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-secureelement.so</library-name>
     <feature-install-uri>secureelement.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/secureelement</name>
index e8685ea..aa2690c 100644 (file)
@@ -3,9 +3,6 @@
 <plugin-properties>
        <library-name>libwrt-plugins-tizen-systemsetting.so</library-name>
        <feature-install-uri>systemsetting.install.uri</feature-install-uri>
-       <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-       <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-       <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
        <api-feature>
         <name>http://tizen.org/privilege/setting</name>
index 217cb47..2956c4e 100755 (executable)
@@ -3,9 +3,6 @@
 <plugin-properties>
        <library-name>libwrt-plugins-tizen-systeminfo.so</library-name>
        <feature-install-uri>systeminfo.install.uri</feature-install-uri>
-       <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-       <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-       <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
        <api-feature>
         <name>http://tizen.org/privilege/systeminfo</name>
index f7a3cf8..38b00bf 100644 (file)
@@ -23,7 +23,7 @@
 #include <Commons/Exception.h>
 #include <JSWebAPIErrorFactory.h>
 #include <ArgumentValidator.h>
-
+#include <JSUtil.h>
 #include "DurationProperties.h"
 #include "JSTZDate.h"
 #include "TimeUtilConverter.h"
@@ -212,43 +212,50 @@ void JSTZDate::finalize(JSObjectRef object)
 JSObjectRef JSTZDate::constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
        LoggerD("entered");
-       TZDateProperties prop;
        JSObjectRef tzDate = NULL;
+       ArgumentValidator validator(ctx, argumentCount, arguments);
        Try {
                if (argumentCount == 0)
                        tzDate = createJSObject(ctx);
                else if (argumentCount <= 2) {
-                       TimeUtilConverter converter(ctx);
                        std::string timezone = "";
                        try {
-                               if ((argumentCount == 2) && !JSValueIsNull(ctx, arguments[1]) && !JSValueIsUndefined(ctx, arguments[1]))
-                                       timezone = converter.toString(arguments[1]);
+                               timezone = validator.toString(1, true);
 
-                               JSStringRef toStringName = JSStringCreateWithUTF8CString("toString");
-                               JSValueRef toStringFuction = JSObjectGetProperty(ctx, converter.toJSObjectRef(arguments[0]), toStringName, exception);
-                               JSStringRelease(toStringName);
+                               JSObjectRef dateObj = validator.toObject(0, true);
+                               if (dateObj) {
+                                       JSValueRef dateException = NULL;
 
-                               if (!toStringFuction)
-                                       ThrowMsg(ConversionException, "Couldn't get date string.");
-               
-                               JSObjectRef function = JSValueToObject(ctx, toStringFuction, exception);
-                               JSValueRef result = JSObjectCallAsFunction(ctx, function, converter.toJSObjectRef(arguments[0]), 0, NULL, exception);
-
-                               LoggerD(converter.toDateString(arguments[0]));
-                               std::string stringDate = converter.toString(result);
-                               stringDate.erase(stringDate.find(" GMT"));
-
-                           JSStringRef getMillisecondsName = JSStringCreateWithUTF8CString("getMilliseconds");
-                               JSValueRef getMiliSecFuction = JSObjectGetProperty(ctx, converter.toJSObjectRef(arguments[0]), getMillisecondsName, exception);
-                               JSStringRelease(getMillisecondsName);
-                               long millisec = 0;
-                               if (getMiliSecFuction) {
-                                       function = JSValueToObject(ctx, getMiliSecFuction, exception);
-                                       result = JSObjectCallAsFunction(ctx, function, converter.toJSObjectRef(arguments[0]), 0, NULL, exception);
-                                       millisec = converter.toLong(result);
+                                       JSValueRef toStringFuction = JSUtil::getProperty(ctx, dateObj, "toString", NULL);
+                                       JSObjectRef function = JSUtil::JSValueToObject(ctx, toStringFuction);
+
+                                       JSValueRef result = JSObjectCallAsFunction(ctx, function, dateObj, 0, NULL, &dateException);
+                                       if (dateException)
+                                               ThrowMsg(ConversionException, "Couldn't get date string");
+
+                                       std::string stringDate = JSUtil::JSValueToString(ctx, result);
+                                       LoggerD(stringDate);
+                                       stringDate.erase(stringDate.find(" GMT"));
+
+                                       JSValueRef getMiliSecFuction = JSUtil::getProperty(ctx, dateObj, "getMilliseconds", NULL);
+                                       function = JSUtil::JSValueToObject(ctx, getMiliSecFuction);
+
+                                       result = JSObjectCallAsFunction(ctx, function, dateObj, 0, NULL, &dateException);
+                                       if (dateException)
+                                               ThrowMsg(ConversionException, "Couldn't get milliseconds");
+       
+                                       long millisec = JSUtil::JSValueToLong(ctx, result);
                                        LoggerD("getMilliseconds = " << millisec);
+                                       tzDate = createJSObject(ctx, stringDate, millisec, timezone);
                                }
-                               tzDate = createJSObject(ctx, stringDate, millisec, timezone);
+                       } catch (const BasePlatformException& err) {
+                               LoggerE(err.getName() << ":"<<err.getMessage());
+                               if (tzDate) {
+                                       TZDatePrivObject *priv = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(tzDate));
+                                       if (priv)
+                                       delete priv;
+                               }
+                               tzDate = NULL;
                        } catch (const WrtDeviceApis::Commons::Exception& err) {
                                LoggerE(err.GetClassName() << ":"<<err.GetMessage());
                                if (tzDate) {
@@ -256,13 +263,12 @@ JSObjectRef JSTZDate::constructor(JSContextRef ctx, JSObjectRef constructor, siz
                                        if (priv)
                                        delete priv;
                                }
-                                       
-                               tzDate = createJSObject(ctx, timezone);
+                               tzDate = NULL;
                        }
-                       if (tzDate == NULL)
-                               tzDate = createJSObject(ctx, prop);
+                       if (!tzDate)
+                               tzDate = createJSObject(ctx, timezone);
                } else {
-                       ArgumentValidator validator(ctx, argumentCount, arguments);
+                       TZDateProperties prop;
                        prop.year = validator.toLong(0);
                        if ((prop.year >= 0) && (prop.year <= 99))
                                prop.year += 1900;
index 4e27469..a0205c6 100755 (executable)
@@ -3,9 +3,6 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-timeutil.so</library-name>
     <feature-install-uri>time.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/time</name>
index e1ccdfa..6bf9d83 100644 (file)
@@ -3,9 +3,6 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-tizen.so</library-name>
     <feature-install-uri>tizen.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/tizen</name>
index 3584a6d..7afa65a 100755 (executable)
@@ -9,7 +9,7 @@ PKG_CHECK_MODULES(platform_pkgs_websetting REQUIRED
 
 INCLUDE_DIRECTORIES(
        ${INCLUDE_COMMON}
-       ${websetting_INCLUDE_DIRS}
+       ${platform_pkgs_websetting_INCLUDE_DIRS}
 )
 
 SET(CMAKE_INSTALL_RPATH
@@ -28,7 +28,7 @@ ADD_LIBRARY(${TARGET_IMPL_NAME} SHARED ${SRCS_IMPL})
 TARGET_LINK_LIBRARIES(${TARGET_IMPL_NAME}
        ${LIBS_COMMON}
        ${tizen_impl}
-       ${websetting_LIBRARIES}
+       ${platform_pkgs_websetting_LIBRARIES}
 )
 
 SET(SRCS
index 377b37f..6ec8526 100644 (file)
@@ -3,13 +3,10 @@
 <plugin-properties>
     <library-name>libwrt-plugins-tizen-websetting.so</library-name>
     <feature-install-uri>websetting.install.uri</feature-install-uri>
-    <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
-    <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
-    <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
 
     <api-feature>
         <name>http://tizen.org/privilege/websetting</name>
         <device-capability>websetting</device-capability>
     </api-feature>
 
-</plugin-properties>
\ No newline at end of file
+</plugin-properties>