Update change log and spec for wrt-plugins-tizen_0.4.75
authorHyunju Cheon <hyunju.cheon@samsung.com>
Thu, 24 Oct 2013 10:00:12 +0000 (19:00 +0900)
committerHyunju Cheon <hyunju.cheon@samsung.com>
Thu, 24 Oct 2013 10:00:12 +0000 (19:00 +0900)
[model] REDWOOD

[binary_type] PDA

[customer] OPEN

[Notification] Modify the default value of postedTime

[Issue] TTS-2086
[Problem] The spec have no description about default value of attribute postedTime. But it returns null.
[Cause] N/A
[Solution] It will return undefined.
[SCMRequest] N/A

[NFC] Change variable types because of CAPI's change

[Issue] N/A
[Problem] The payload's maximun size has to be 2**32-1. But NFC's CAPI could be set 2**31-1.
[Cause] The paload size's type of NFC CAPI is int.
[Solution] NFC CAPI is fixed. So nfc plugin code is also changed.
[SCMRequest] N/A

Change-Id: Ic6a411af0120dea2da6cdff77c93c3e6fd5de8ba

15 files changed:
packaging/wrt-plugins-tizen.spec
src/DataControl/DataControlCallback.cpp
src/Messaging/CMakeLists.txt
src/Messaging/MailRemover.cpp
src/Messaging/MessageFilterConverter.cpp
src/Messaging/ReqReceiverMessage.cpp
src/Messaging/Sms.cpp
src/Messaging/VirtualMessage.cpp
src/NFC/NFCTag.cpp
src/NFC/NFCTarget.cpp
src/NFC/NFCUtil.cpp
src/NFC/NFCUtil.h
src/NFC/NdefMessage.cpp
src/Notification/JSStatusNotification.cpp
src/Notification/NotificationManager.cpp

index 1caa814..24d493e 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       wrt-plugins-tizen
 Summary:    JavaScript plugins for WebRuntime
-Version:    0.4.74
+Version:    0.4.75
 Release:    0
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index 3a2a0e5..6f3ce02 100644 (file)
@@ -97,8 +97,8 @@ std::string getCurrentApplicationId()
 {
        char *app_id = NULL;
        std::string appId = "";
-       int parent_pid = getppid();
-       LoggerD("parent pid : " << parent_pid); 
+       int parent_pid = getpid();
+               
        int ret = app_manager_get_app_id(parent_pid, &app_id);  
 
        if((ret != APP_ERROR_NONE) || (app_id == NULL))
@@ -106,6 +106,7 @@ std::string getCurrentApplicationId()
                LoggerE("Can not get app id from current pid (" << ret << ")");
                ThrowMsg(WrtDeviceApis::Commons::PlatformException, "could not get information about application");
        }
+       
        appId = app_id;
        free(app_id);
        return appId;           
index 1725dc0..db9b082 100755 (executable)
@@ -7,7 +7,7 @@ PKG_CHECK_MODULES(platform_pkgs_messaging REQUIRED
        email-service
        dbus-1
        capi-system-info
-    capi-network-connection
+       capi-network-connection
        tapi
 )
 
index 2776bfe..42486f4 100644 (file)
@@ -50,35 +50,28 @@ MailRemover& MailRemover::getInstance()
 
 int MailRemover::removeCheck(int accountId, const IEmailPtr& mail)
 {
-       LoggerD("enter");
 
-       email_mail_data_t* result = NULL;
+    email_mail_data_t* result = NULL;
     int mailId = mail->convertId(mail->getIdRef());
 
-       LoggerD("mailId " << mailId);
+    int error = email_get_mail_data(mailId, &result);
 
-       int error = email_get_mail_data(mailId, &result);
-       LoggerD("error " << error);
+    email_free_mail_data(&result,1);
 
-       email_free_mail_data(&result,1);
-
-       if (error == EMAIL_ERROR_MAIL_NOT_FOUND) {
-        LoggerD("email already removed : " << mailId);
-               return 1;
+    if (error == EMAIL_ERROR_MAIL_NOT_FOUND) {
+        return 1;
     }
     else
     {
-        LoggerD("Insert remove request");
         RemoveRequestData data = RemoveRequestData(accountId, mail);
         m_requests.insert(std::make_pair(mailId, data));               
     }
-       return 0;
+    return 0;
 }
 
 // TODO Copied from former solution, refactor it.
 void MailRemover::OnEventReceived(const DBus::MessageEvent& event)
 {
-    LoggerD("enter");
     DBus::MessagePtr message = event.GetArg0();
 
     int account_id = 0, mail_id = 0, thread_id = 0, status = 0, mailId;
@@ -131,7 +124,6 @@ void MailRemover::OnEventReceived(const DBus::MessageEvent& event)
                         }
 
                     }
-                    LoggerD("m_requests.erase(): " << mailId);
                     m_requests.erase(mailId);
                     break;
                 }
@@ -144,15 +136,12 @@ void MailRemover::OnEventReceived(const DBus::MessageEvent& event)
             LoggerW("Can't find mail_id " << mail_id);
         }
        }
-       LoggerI("m_requests.size(): " << m_requests.size());
-
 }
 
 MailRemover::MailRemover() :
     m_dbusThread(new DPL::Thread()),
     m_dbus(new DBus::Connection())
 {
-    LoggerD("enter");
     m_dbusThread->Run();
 
     m_dbus->setWorkerThread(m_dbusThread.Get());
@@ -168,24 +157,19 @@ MailRemover::~MailRemover()
 {
     m_dbus->RemoveListener(this);
     m_dbus->close();
-
     m_dbusThread->Quit();
 
-
     //close email service
-       if (EMAIL_ERROR_NONE == email_close_db()) {
-               LoggerD("Email Close DB Success\n");
-               if (EMAIL_ERROR_NONE == email_service_end()){
-               LoggerD("Email service close Success\n");
-               }
-               else{
-               LoggerD("Email service end failed\n");
-       }
-       }
-       else{
-               LoggerD("Email Close DB failed\n");
-       }
-       
+    if (EMAIL_ERROR_NONE == email_close_db()) {
+        if (EMAIL_ERROR_NONE == email_service_end()){
+        }
+        else{
+            LoggerD("Email service end failed\n");
+        }
+    }
+    else{
+        LoggerD("Email Close DB failed\n");
+    }
 }
 
 }
index 5374cc6..b5413d1 100644 (file)
@@ -17,7 +17,6 @@
 
 /**
  * @file        MessageFilterConverter.cpp
- * @author      Kisub Song (kisubs.song@samsung.com)
  * @version     0.1
  * @description        Reference from CalendarConverter.cpp
  */
index 29047e2..ea1b564 100644 (file)
@@ -308,7 +308,6 @@ void ReqReceiverMessage::OnRequestReceived(const EventDeleteMessagesPtr& event)
 
                int vecSize = msg.size();
                for(int i=0; i < vecSize; i++){
-                       int type = msg[i]->getMessageType();
                        std::string id = msg[i]->getId();
                        msg[i]->remove();
                }//for
@@ -507,17 +506,23 @@ void ReqReceiverMessage::OnRequestReceived(const EventMessagingServicePtr& event
                                        if ( msg->getMessageType() == EMAIL )
                                        {
                                                IEmailPtr email = MessageFactory::convertToEmail(msg);
-                                               event->switchToManualAnswer();          //switch to manual answer;
-                                               int handle = email->downloadBody();
-                                               LoggerD("Load Message Body handle : " << handle);
-                                               if (event->opId && event->m_messagingService)
+                                               if (email && email->isBodyDownloaded() > 0)
                                                {
-                                                       event->m_messagingService->setHandleToOpId(event->opId, handle);
-                                               }
-                                               if (handle > 0)
+                                                       LoggerD("isBodyDownloaded : " << email->isBodyDownloaded());
+                                               }else
                                                {
-                                                       event->setHandle(handle);       //set handle
-                                               }                                               
+                                                       event->switchToManualAnswer();          //switch to manual answer;
+                                                       int handle = email->downloadBody();
+                                                       LoggerD("Load Message Body handle : " << handle);
+                                                       if (event->opId && event->m_messagingService)
+                                                       {
+                                                               event->m_messagingService->setHandleToOpId(event->opId, handle);
+                                                       }
+                                                       if (handle > 0)
+                                                       {
+                                                               event->setHandle(handle);       //set handle
+                                                       }
+                                               }
                                        }
                                }
                                else {
index 42bbdff..8f77a41 100644 (file)
@@ -118,8 +118,8 @@ void Sms::readAllData()
        // release old data
        if (m_messageData) {
                // release platform message if it was created previously
-       msg_release_struct(&m_messageData);
-       m_messageData = NULL;
+               msg_release_struct(&m_messageData);
+               m_messageData = NULL;
        }
        msg_struct_t sendOpt = NULL;
 
@@ -247,10 +247,10 @@ int Sms::send()
        msg_error_t err = MSG_SUCCESS;
 
        Try
-               {
+       {
                //prepare for sending sms/mms
 
-                       update();
+               update();
 
                LoggerD("trying to send sms");
                if (!getCellularOn())
@@ -261,14 +261,14 @@ int Sms::send()
                else
                {
                        err = CallbackMgrSingleton::Instance().registerAndSend(msg_sms_send_message, m_messageData, this);
-       }
+               }
 
                if (err != MSG_SUCCESS) 
-       {
+               {
                        LoggerE("Sending Message (submit request) failed!!! err=" << err);
                        setMessageStatus(MESSAGE_STATUS_FAILED);
-               Throw(WrtDeviceApis::Commons::PlatformException);
-       }
+                       Throw(WrtDeviceApis::Commons::PlatformException);
+               }
 
                setMessageStatus(MESSAGE_STATUS_SENDING);
 
@@ -281,11 +281,11 @@ int Sms::send()
                        LoggerE("send Error");
                        EventMessagingServicePtr event = getMessagingServiceEvent();
                        if(err == MSG_ERR_TRANSPORT_ERROR)
-       {
+                       {
                                event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::PlatformWrongStateException);
                        }
                        else
-               {
+                       {
                                event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
                        }
                        requestReceiver->WrtDeviceApis::Commons::EventRequestReceiver< EventMessagingService>::ManualAnswer(event);
@@ -297,9 +297,9 @@ int Sms::send()
 
 void Sms::sendingCallback(msg_struct_t sent_status)
 {
-    int status = MSG_NETWORK_SEND_FAIL;
-    msg_get_int_value(sent_status, MSG_SENT_STATUS_NETWORK_STATUS_INT, &status);
-
+       int status = MSG_NETWORK_SEND_FAIL;
+       msg_get_int_value(sent_status, MSG_SENT_STATUS_NETWORK_STATUS_INT, &status);
+       
        LoggerD("status : " << status);
 
        if (MSG_NETWORK_SEND_SUCCESS == status) {
@@ -309,8 +309,8 @@ void Sms::sendingCallback(msg_struct_t sent_status)
        } else {
                LoggerE("sending failed: " << static_cast<unsigned int>(status));
                setSendingStatusFailed();
-        setMessageStatus(MESSAGE_STATUS_FAILED);
-    }
+               setMessageStatus(MESSAGE_STATUS_FAILED);
+       }
 }
 
 void Sms::OnEventReceived(const int&)
index 0d9aa84..3373ece 100755 (executable)
@@ -19,7 +19,6 @@
  *
  *
  * @file       VirtualMessage.cpp
- * @author     Pawel Misiak (p.misiak@samsung.com)
  * @version    0.1
  * @brief
  */
index dff56fd..289684c 100755 (executable)
@@ -37,7 +37,7 @@ namespace
                LoggerD("Callback TagInformationCallback.");
                if (user_data) {
                        NFCUtil util;
-                       std::vector<unsigned char> tagInfo = util.toVector(value, value_size);
+                       std::vector<unsigned char> tagInfo = util.toVector(value, (unsigned int)value_size);
                        (static_cast<NFCTag*>(user_data))->makeTagProperties(key, tagInfo);
                        return TRUE;
                }
@@ -54,7 +54,7 @@ namespace
                                LoggerD("message handler :" << message);
 
                                unsigned char *rawdata = NULL;
-                               int size;
+                               unsigned int size;
                                if (nfc_ndef_message_get_rawdata(message, &rawdata, &size) != NFC_ERROR_NONE) {
                                        LoggerE("Can't get record's rawdata");
                                        if (rawdata)
@@ -87,7 +87,7 @@ namespace
                LoggerD("Callback TagTransceiveCallback.");
                if (data) {
                        NFCUtil util;
-                       std::vector<unsigned char> responseData = util.toVector(buffer, buffer_size)    ;
+                       std::vector<unsigned char> responseData = util.toVector(buffer, (unsigned int)buffer_size)      ;
                        ((NFCTag *)data)->transceiveManualAnswer((int)result, responseData);
                } else {
                        LoggerD("Error! TagTransceiveCallback is Null.");
index 79c179f..b449dfd 100755 (executable)
@@ -37,7 +37,7 @@ namespace
                LoggerD("Callback TargetReceivedCallback.");
                if (user_data) {
                        unsigned char *rawdata = NULL;
-                       int size;
+                       unsigned int size;
                        if (nfc_ndef_message_get_rawdata(message, &rawdata, &size) != NFC_ERROR_NONE) {
                                LoggerE("Can't get rawdata of message");
                                if (rawdata)
index b189a60..a92cb0a 100755 (executable)
 namespace DeviceAPI {
 namespace NFC {
 
-std::vector<unsigned char> NFCUtil::toVector(const unsigned char *ch, const int size) {
+std::vector<unsigned char> NFCUtil::toVector(const unsigned char *ch, const unsigned int size) {
        std::vector<unsigned char> vec;
        if (ch && (size > 0)) {
-               int i;
+               unsigned int i;
                
                for (i = 0; i < size; i++)
                        vec.push_back(ch[i]);
@@ -165,8 +165,9 @@ NdefRecordData NFCUtil::getNDEFRecordData(void *handle) {
        NdefRecordData recordData;
 
        nfc_record_tnf_e tnf;
-       unsigned char *typeName, *id, *payload;
-       int typeSize, idSize, payloadSize;
+       unsigned char *typeName = NULL, *id = NULL, *payload = NULL;
+       int typeSize = 0, idSize = 0;
+       unsigned int payloadSize = 0;
 
        int result = nfc_ndef_record_get_tnf(recordHandle, &tnf);
        throwNFCException(result, "Can't get record's tnf");
@@ -185,8 +186,8 @@ NdefRecordData NFCUtil::getNDEFRecordData(void *handle) {
        LoggerD("payload : " << byteToString(payload, payloadSize));
 
        recordData.properties.tnf = static_cast<short>(tnf);
-       recordData.properties.typeName = toVector(typeName, typeSize);
-       recordData.properties.id = toVector(id, idSize);
+       recordData.properties.typeName = toVector(typeName, (unsigned int)typeSize);
+       recordData.properties.id = toVector(id, (unsigned int)idSize);
        recordData.payload = toVector(payload, payloadSize);
 
        return recordData;
index 563bc53..60b2551 100755 (executable)
@@ -35,7 +35,7 @@ class NFCUtil
     public:
                NFCUtil() {}
        virtual  ~NFCUtil() {}
-       std::vector<unsigned char> toVector(const unsigned char *ch, const int size);
+       std::vector<unsigned char> toVector(const unsigned char *ch, const unsigned int size);
        unsigned char *toCharPtr(std::vector<unsigned char> vec) ;
        char *byteToString(const unsigned char* buffer, const int size);
        char *byteToString(std::vector<unsigned char> *buffer);
index 08571af..d7bb0eb 100755 (executable)
@@ -78,7 +78,7 @@ std::vector<unsigned char> NdefMessage::toByte(std::vector<void *> &ndefRcords)
        if (message == NULL)
                ThrowMsg(ConversionException, "Invalid NDEF Message");
        unsigned char *rawdata = NULL;
-       int size = 0;
+       unsigned int size = 0;
        int result = nfc_ndef_message_get_rawdata(message, &rawdata, &size);
 
        std::vector<unsigned char> byteData = util.toVector(rawdata, size);
index eefb695..0651a68 100755 (executable)
@@ -828,7 +828,7 @@ void JSStatusNotification::setPrivateObject(JSContextRef context, JSObjectRef ob
     else
     {
            JSUtil::setProperty(context, object, NOTIFICATION_POSTED_TIME,
-                   JSValueMakeNull(context), kJSPropertyAttributeReadOnly);
+                   JSValueMakeUndefined(context), kJSPropertyAttributeReadOnly);
     }    
 
     //title
index e0a4073..1e5b4af 100755 (executable)
@@ -137,7 +137,7 @@ int NotificationManager::post(StatusNotification *notification)
                                {
                                        LoggerI("Notification Launch Flag True");
                                        notification_set_property(handle, 0);
-                                       if (notification_set_execute_option(handle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data) != SERVICE_ERROR_NONE)
+                                       if (notification_set_execute_option(handle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data) != NOTIFICATION_ERROR_NONE)
                                        {
                                                LoggerD("can't set notification option");
                                        }
@@ -333,7 +333,7 @@ void NotificationManager::update(StatusNotification *notification)
                                                {
                                                        LoggerI("Notification Launch Flag True");
                                                        notification_set_property(handle, 0);
-                                                       if (notification_set_execute_option(handle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data)!= SERVICE_ERROR_NONE)
+                                                       if (notification_set_execute_option(handle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data)!= NOTIFICATION_ERROR_NONE)
                                                        {
                                                                LoggerI("Can't set Service option");
                                                        }