Update change log and spec for wrt-plugins-tizen_0.4.50
authorDongjin Choi <milkelf.choi@samsung.com>
Thu, 4 Jul 2013 08:21:51 +0000 (17:21 +0900)
committerDongjin Choi <milkelf.choi@samsung.com>
Thu, 4 Jul 2013 10:29:34 +0000 (19:29 +0900)
[model] REDWOOD
[binary_type] PDA
[customer] OPEN

[Issue#] N/A
[Problem] There are including of unused files.
[Solution] Removed including of unused files.
[SCMRequest] N/A

[Issue] N/A
[Problem] updateMessages for email service bug fix
[Cause] updateMessages for email service bug fix
[Solution] updateMessages for email service bug fix

[Issue] N/A
[Problem] Dereferencing pointer "soundPath"
[Cause] Null-checking "soundPath" suggests that it may be null, but it has already been dereferenced on all paths leading to the check
[Solution] inserted Null check.

[Issue] prevent CID : 63078
[Problem] memory leak.
[Cause] free omission.
[Solution] memory free.

[Systeminfo] Fix bug when get duid value

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

15 files changed:
packaging/wrt-plugins-tizen.spec
src/Callhistory/CallHistory.cpp
src/Callhistory/JSCallHistoryEntry.cpp
src/Callhistory/JSRemoteParty.cpp
src/Contact/ContactSearchEngine.cpp
src/Contact/ContactSearchEngine.h
src/Contact/JSAddressBook.cpp
src/Contact/JSContactManager.cpp
src/Contact/PersonSearchEngine.cpp
src/DataControl/SqlDataControlConsumer.cpp
src/Messaging/Email.cpp
src/Notification/StatusNotification.cpp
src/Systeminfo/JSDeviceCapabilitiesInfo.cpp
src/Systeminfo/Systeminfo.cpp
src/Systeminfo/SysteminfoPropertyInfo.h

index 531a664..91f473b 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       wrt-plugins-tizen
 Summary:    JavaScript plugins for WebRuntime
-Version:    0.4.49
+Version:    0.4.50
 Release:    0
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index 9b4350b..2af0ccf 100755 (executable)
@@ -21,7 +21,6 @@
 #include <vector>
 #include <string>
 #include <sstream>
-#include <cassert>
 #include <Commons/Exception.h>
 #include <CommonsJavaScript/JSCallbackManager.h>
 #include <dpl/shared_ptr.h>
index d12e56c..535f107 100755 (executable)
@@ -15,7 +15,6 @@
 // limitations under the License.
 //
 
-#include <cassert>
 #include <memory>
 #include <dpl/shared_ptr.h>
 #include <CommonsJavaScript/JSUtils.h>
index 7932144..c7bf5de 100755 (executable)
@@ -15,7 +15,6 @@
 // limitations under the License.
 //
 
-#include <cassert>
 #include <memory>
 #include <dpl/shared_ptr.h>
 #include <CommonsJavaScript/JSUtils.h>
index 73d520a..0ff9fa1 100755 (executable)
@@ -285,19 +285,24 @@ void ContactSearchEngine::visitPostComposite(FilterType& type, int depth)
 
 void ContactSearchEngine::visitAttribute(string& attrName, MatchFlag& matchFlag, AnyPtr& matchValue, int depth)
 {
+       if(matchValue == NULL || matchValue->isNullOrUndefined())
+               matchFlag = MATCH_EXISTS;
+
        ContactIdSetPtr idSet = ContactIdSetPtr(new ContactIdSet());
 
        if(attrName == "id")
        {
-               string value = matchValue->getString();
-               idSet->insert(ContactUtility::strToInt(value));
+               if(matchFlag != MATCH_EXISTS){
+                       string value = matchValue->getString();
+                       idSet->insert(ContactUtility::strToInt(value));
 
-               if(depth == 0)
-                       m_filteredContactIds = idSet;
-               else
-               {
-                       ContactIdSetArrayPtr parentIdSets = m_contactIdSetArrayStack.top();
-                       parentIdSets->push_back(idSet);
+                       if(depth == 0)
+                               m_filteredContactIds = idSet;
+                       else
+                       {
+                               ContactIdSetArrayPtr parentIdSets = m_contactIdSetArrayStack.top();
+                               parentIdSets->push_back(idSet);
+                       }
                }
 
                return;
@@ -321,16 +326,24 @@ void ContactSearchEngine::visitAttribute(string& attrName, MatchFlag& matchFlag,
 
        if(properties.type == ContactSvcPrimitiveType_Boolean)
        {
-               bool value = matchValue->getBool();
+               bool value = true;
+               if(matchFlag != MATCH_EXISTS)
+                       value = matchValue->getBool();
+
                queryAttributeBool(properties, idSet, value);
        }
        else if(properties.type == ContactSvcPrimitiveType_String)
        {
                string value;
-               if(attrName == "photoURI" || attrName == "ringtoneURI" || attrName == "organizations.logoURI")
-                       value = ContactUtility::convertUriToPath(matchValue->getString());
-               else
-                       value = matchValue->getString();
+
+               if(matchFlag != MATCH_EXISTS)
+               {
+                       if(attrName == "photoURI" || attrName == "ringtoneURI" || attrName == "organizations.logoURI")
+                               value = ContactUtility::convertUriToPath(matchValue->getString());
+                       else
+                               value = matchValue->getString();
+               }else
+                       value = "";
 
                contacts_match_str_flag_e flag = CONTACTS_MATCH_EXISTS;
 
@@ -353,15 +366,18 @@ void ContactSearchEngine::visitAttribute(string& attrName, MatchFlag& matchFlag,
        {
                int value;
 
-               if(attrName == "id" || attrName == "personId"){
-                       value = ContactUtility::strToInt(matchValue->getString());
-               }else if(attrName == "lastUpdated"){
-                       time_t tmpTime = mktime(matchValue->getDateTm());
-                       value = (int)tmpTime;
-               }else if(attrName == "birthday" || attrName == "anniversaries.date"){
-                       value = ContactUtility::toDateDbInt(*matchValue->getDateTm());
-               }else{
-                       value = matchValue->getLong();
+               if(matchFlag != MATCH_EXISTS)
+               {
+                       if(attrName == "id" || attrName == "personId"){
+                               value = ContactUtility::strToInt(matchValue->getString());
+                       }else if(attrName == "lastUpdated"){
+                               time_t tmpTime = mktime(matchValue->getDateTm());
+                               value = (int)tmpTime;
+                       }else if(attrName == "birthday" || attrName == "anniversaries.date"){
+                               value = ContactUtility::toDateDbInt(*matchValue->getDateTm());
+                       }else{
+                               value = matchValue->getLong();
+                       }
                }
 
                contacts_match_int_flag_e flag;
@@ -377,7 +393,12 @@ void ContactSearchEngine::visitAttribute(string& attrName, MatchFlag& matchFlag,
                        flag = CONTACTS_MATCH_EQUAL;
                }
 
-               queryAttributeInt(properties, idSet, flag, value);
+               if(attrName == "birthday" || attrName == "anniversaries.date"){
+                       queryAttributeDate(attrName, properties, idSet, flag, value);
+               }else{
+                       queryAttributeInt(properties, idSet, flag, value);
+               }
+
        }
 
        if(depth == 0)
@@ -780,6 +801,48 @@ void ContactSearchEngine::queryAttributeInt(AttributeProperties& attributeProper
        _CONTACTS_SVC_QUERY_FUNC_SUFFIX(query, filter, list, property_contact_id, result);
 }
 
+void ContactSearchEngine::queryAttributeDate(string& attrName, AttributeProperties& attributeProperties, ContactIdSetPtr& result,
+               contacts_match_int_flag_e match, int match_value)
+{
+       const char* view_uri = attributeProperties.viewUri;
+       unsigned int property_contact_id = attributeProperties.propertyContactId;
+       unsigned int property_id = attributeProperties.propertyId;
+
+       int errorCode = 0;
+       contacts_query_h query = NULL;
+       contacts_filter_h filter = NULL;
+       contacts_list_h list = NULL;
+
+       _CONTACTS_SVC_QUERY_FUNC_PREFIX(view_uri, query, filter);
+
+       errorCode = contacts_filter_add_int(filter, property_id, match, match_value);
+       if(errorCode != CONTACTS_ERROR_NONE)
+               ThrowMsg(PlatformException, "contacts_filter_add_int error : " << errorCode << " (" << __FUNCTION__ << ")");
+
+       LoggerD("attrName" << attrName);
+
+       if(attrName == "birthday"){
+               errorCode = contacts_filter_add_operator( filter, CONTACTS_FILTER_OPERATOR_AND);
+               if(errorCode != CONTACTS_ERROR_NONE)
+                       ThrowMsg(PlatformException, "contacts_filter_add_int error : " << errorCode << " (" << __FUNCTION__ << ")");
+
+               errorCode = contacts_filter_add_int(filter, _contacts_event.type, CONTACTS_MATCH_EQUAL, CONTACTS_EVENT_TYPE_BIRTH);
+               if(errorCode != CONTACTS_ERROR_NONE)
+                       ThrowMsg(PlatformException, "contacts_filter_add_int error : " << errorCode << " (" << __FUNCTION__ << ")");
+
+       }else if(attrName == "anniversaries.date"){
+               errorCode = contacts_filter_add_operator( filter, CONTACTS_FILTER_OPERATOR_AND);
+               if(errorCode != CONTACTS_ERROR_NONE)
+                       ThrowMsg(PlatformException, "contacts_filter_add_int error : " << errorCode << " (" << __FUNCTION__ << ")");
+
+               errorCode = contacts_filter_add_int(filter, _contacts_event.type, CONTACTS_MATCH_EQUAL, CONTACTS_EVENT_TYPE_ANNIVERSARY);
+               if(errorCode != CONTACTS_ERROR_NONE)
+                       ThrowMsg(PlatformException, "contacts_filter_add_int error : " << errorCode << " (" << __FUNCTION__ << ")");
+       }
+
+       _CONTACTS_SVC_QUERY_FUNC_SUFFIX(query, filter, list, property_contact_id, result);
+}
+
 void ContactSearchEngine::queryAttributeString(AttributeProperties& attributeProperties, ContactIdSetPtr& result,
                contacts_match_str_flag_e match, const char* match_value)
 {
index 29f9387..f504aeb 100755 (executable)
@@ -121,6 +121,8 @@ private:
        ContactArrayPtr getContacts(ContactIdSetPtr& ids);
        ContactPtr getContact(int id);
 
+       void queryAttributeDate(std::string& attrName, AttributeProperties& attributeProperties, ContactIdSetPtr& result,
+               contacts_match_int_flag_e match, int match_value);
        void queryAttributeBool(AttributeProperties& attributeProperties, ContactIdSetPtr& result,
                        bool match_value);
        void queryAttributeInt(AttributeProperties& attributeProperties, ContactIdSetPtr& result,
index 33eac7d..139bfbe 100755 (executable)
@@ -956,16 +956,23 @@ JSValueRef JSAddressBook::find(JSContextRef context,
 
        EventAddressBookFindPtr dplEvent(new EventAddressBookFind());
        Try {
-               if (js3rdParamIsObject)
-                       dplEvent->setFilter(filterConverter->toFilter(arguments[2]));
+               if (js3rdParamIsObject){
+                       FilterPtr filter = filterConverter->toFilter(arguments[2]);
+                       if(filter)
+                               dplEvent->setFilter(filter);
+                       else
+                               return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "3rd argument must be an Correct 'Filter object' or 'null'");
+               }
        } Catch(Exception) {
                LoggerE("Error on 3rd parameter conversion : " << _rethrown_exception.GetMessage());
                return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "3rd argument must be an 'Filter object' or 'null'");
        }
 
        Try {
-               if (js4thParamIsObject)
-                       dplEvent->setSortMode(filterConverter->toSortMode(arguments[3]));
+               if (js4thParamIsObject){
+                       SortModePtr sortMode = filterConverter->toSortMode(arguments[3]);
+                       dplEvent->setSortMode(sortMode);
+               }
        } Catch(Exception) {
                LoggerE("Error on 4th parameter conversion : " << _rethrown_exception.GetMessage());
                return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "4th argument must be an 'SortMode object' or 'null'");
index 4ea72c6..e33fce5 100755 (executable)
@@ -972,16 +972,23 @@ JSValueRef JSContactManager::find(JSContextRef context,
 
        EventContactManagerFindPtr dplEvent(new EventContactManagerFind());
        Try {
-               if (js3rdParamIsObject)
-                       dplEvent->setFilter(filterConverter->toFilter(arguments[2]));
+               if (js3rdParamIsObject){
+                       FilterPtr filter = filterConverter->toFilter(arguments[2]);
+                       if(filter)
+                               dplEvent->setFilter(filter);
+                       else
+                               return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "3rd argument must be an Correct 'Filter object' or 'null'");
+               }
        } Catch(Exception) {
                LoggerE("Error on 3rd parameter conversion : " << _rethrown_exception.GetMessage());
                return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "3rd argument must be an 'Filter object' or 'null'");
        }
 
        Try {
-               if (js4thParamIsObject)
-                       dplEvent->setSortMode(filterConverter->toSortMode(arguments[3]));
+               if (js4thParamIsObject){
+                       SortModePtr sortMode = filterConverter->toSortMode(arguments[3]);
+                       dplEvent->setSortMode(sortMode);
+               }
        } Catch(Exception) {
                LoggerE("Error on 4th parameter conversion : " << _rethrown_exception.GetMessage());
                return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "4th argument must be an 'SortMode object' or 'null'");
index 3d2bc3a..47a641f 100755 (executable)
@@ -196,6 +196,9 @@ void PersonSearchEngine::visitAttribute(string& attrName, MatchFlag& matchFlag,
        int errorCode = 0;
        contacts_filter_h filter = NULL;
 
+       if(matchValue == NULL || matchValue->isNullOrUndefined())
+               matchFlag = MATCH_EXISTS;
+
        if(depth != 0)
        {
                filter = m_filterStack.top();
@@ -214,11 +217,15 @@ void PersonSearchEngine::visitAttribute(string& attrName, MatchFlag& matchFlag,
                int value = 0;
                if(attrName == "id" || attrName == "displayContactId")
                {
-                       string valueStr = matchValue->getString();
-                       value = ContactUtility::strToInt(valueStr);
+                       if(matchFlag != MATCH_EXISTS){
+                               string valueStr = matchValue->getString();
+                               value = ContactUtility::strToInt(valueStr);
+                       }
+               }
+               else{
+                       if(matchFlag != MATCH_EXISTS)
+                               value = matchValue->getLong();
                }
-               else
-                       value = matchValue->getLong();
 
                contacts_match_int_flag_e flag;
                if(matchFlag == MATCH_EXISTS)
@@ -238,10 +245,13 @@ void PersonSearchEngine::visitAttribute(string& attrName, MatchFlag& matchFlag,
        else if(property.type == PrimitiveType_String)
        {
                string value;
-               if(attrName == "photoURI" || attrName == "ringtoneURI")
-                       value = ContactUtility::convertUriToPath(matchValue->getString());
-               else
-                       value = matchValue->getString();
+               if(matchFlag != MATCH_EXISTS){
+                       if(attrName == "photoURI" || attrName == "ringtoneURI")
+                               value = ContactUtility::convertUriToPath(matchValue->getString());
+                       else
+                               value = matchValue->getString();
+               }else
+                       value = "";
 
                contacts_match_str_flag_e flag = CONTACTS_MATCH_EXISTS;
                if(matchFlag == MATCH_EXACTLY)
@@ -261,12 +271,9 @@ void PersonSearchEngine::visitAttribute(string& attrName, MatchFlag& matchFlag,
        }
        else if(property.type == PrimitiveType_Boolean)
        {
-               bool value = false;
-               value = matchValue->getBool();
-
-               // TODO MATCH_EXISTS
-//             if(matchFlag == MATCH_EXISTS)
-//             else
+               bool value = true;
+               if(matchFlag != MATCH_EXISTS)
+                       value = matchValue->getBool();
 
                errorCode = contacts_filter_add_bool(filter, property.propertyId, value);
        }
index 597ff90..0f719d8 100644 (file)
@@ -1169,6 +1169,12 @@ void SQLDataControlConsumer::SendAppControlLaunchToProvider(void* event)
                ThrowMsg(WrtDeviceApis::Commons::PlatformException, ex.GetMessage());
 
        }
+
+       if (passData)
+       {
+               bundle_free(passData);
+               passData = NULL;
+       }
        
 }
 
index a0ae848..667b864 100644 (file)
@@ -603,15 +603,22 @@ void Email::readBody() {
                for ( i = 0; i < attachmentCount; i++)
                {
                        Try {
-                               LoggerD("attachment ID :" << attachment[i].attachment_id << " name :" << attachment[i].attachment_name << " download :" << attachment[i].save_status << "savefile :" << attachment[i].attachment_path);
-                               LoggerD("attachment inline status :" << attachment[i].inline_content_status);
+                               LoggerD("attachment ID : [" << attachment[i].attachment_id
+                        << "] name : [" << attachment[i].attachment_name
+                        << "] download : [" << attachment[i].save_status
+                        << "] savefile : [" << attachment[i].attachment_path
+                        << "] mimetype : [" << attachment[i].attachment_mime_type
+                        << "]");
+                               LoggerD("attachment inline status : ["
+                        << attachment[i].inline_content_status << "]");
                                IAttachmentPtr tmpAtt(new Attachment());
                                if (attachment[i].attachment_path)
                                        tmpAtt->init(attachment[i].attachment_path, false);
 
                                if (tmpAtt)
                                {
-                                       LoggerD("attachment[i].inline_content_status : " << attachment[i].inline_content_status);
+                                       LoggerD("attachment[i].inline_content_status : ["
+                            << attachment[i].inline_content_status << "]");
                                        tmpAtt->rename(std::string(attachment[i].attachment_name));
                                        tmpAtt->setAttachmentID(attachment[i].attachment_id);
                                        tmpAtt->setDownloaded(attachment[i].save_status);
@@ -849,9 +856,9 @@ void Email::updateMessage()
 
        if(getCurrentFolder() == DRAFTBOX)
        {
-               updateBody();
-               updateSubject();
-               updateRecipients();
+//             updateBody();
+//             updateSubject();
+//             updateRecipients();
 //             updateFrom();
 //             updateAttachments();
                updatePriority();
@@ -885,9 +892,9 @@ void Email::updateMessage()
        if(getCurrentFolder() == DRAFTBOX)
        {
        
-               updateAttachments();
+//             updateAttachments();
 
-/*             
+               
                email_mail_data_t* result = NULL;
                
                error = email_get_mail_data(m_mail->mail_id, &result);
@@ -913,6 +920,12 @@ void Email::updateMessage()
                                        LoggerW("email_update_mail_attribute error. [" << error << "]");
                                }
                        }
+                   tm* time = localtime(&result->date_time);
+                   if (!time) {
+                       LoggerE("localtime failed");
+                       Throw(WrtDeviceApis::Commons::PlatformException);
+                   }
+                   setDateTime(*time);
                }
                if(result != NULL)
                {
@@ -921,7 +934,7 @@ void Email::updateMessage()
                                LoggerW("email_free_mail_data error. [" << error << "]");
                        }
                }
-*/
+
        }
 
        if(meeting_req) {
index ecd5b2c..777f32c 100755 (executable)
@@ -638,17 +638,21 @@ std::string StatusNotification::getSoundPath()
                {
                        throw UnknownException("get notification sound error");
                }
-
-               LoggerI(" sound type = " << type << " path = " << soundPath);
-               if ( type == NOTIFICATION_SOUND_TYPE_USER_DATA  && soundPath)
-               {
-                       LoggerI("soundPath = " << soundPath);
-                       return std::string(soundPath); 
-               }
-               else
+               
+               std::string strSoundPath;
+               if (soundPath)
                {
-                       return std::string("");
+                       LoggerI(" soudn type=" << type);
+                       if ( type == NOTIFICATION_SOUND_TYPE_USER_DATA)
+                       {
+                               LoggerI("soundPath = " << soundPath);
+                               strSoundPath = soundPath;
+                       }
                }
+               
+               LoggerI("soundPath :" << strSoundPath);
+               return strSoundPath;
+
        }
        else
        {
index 565de6f..d15508b 100755 (executable)
@@ -695,8 +695,8 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR
 
             while(fgets(duid, DUID_BUFFER_SIZE-1, fp)) {
                 if (strncmp(duid, "http://tizen.org/system/duid", DUID_KEY_STRING) == 0) {
-                    LoggerD("duid : " << duid);
-                    deviceCapabilitiesInfo->duid = duid;                    
+                    deviceCapabilitiesInfo->duid = duid + (DUID_KEY_STRING+1);
+                    LoggerD("deviceCapabilitiesInfo->duid : " << deviceCapabilitiesInfo->duid);
                     break;
                 }
             }
index 8f49a1c..f9f4f2d 100755 (executable)
@@ -657,6 +657,8 @@ void Systeminfo::OnRequestReceived(const EventGetSysteminfoPtr& event)
             }
         } else {
             LoggerE("get fail sim state");
+            event->makeSimObject();
+            EventRequestReceiver<EventGetSysteminfo>::ManualAnswer(event);
         }
     } else {
         event->processGetValue((void *)m_connectionHandle);
index 781ac8b..960868c 100755 (executable)
@@ -323,7 +323,7 @@ struct SIMProperties
        std::string     spn;
 
        SIMProperties() :
-        state(""),
+               state("UNKNOWN"),
                operatorName(""),
                msisdn(""),
                iccid(""),