Update change log and spec for wrt-plugins-tizen_0.4.27
authorDongjin Choi <milkelf.choi@samsung.com>
Thu, 2 May 2013 11:59:26 +0000 (20:59 +0900)
committerDongjin Choi <milkelf.choi@samsung.com>
Fri, 3 May 2013 06:22:25 +0000 (15:22 +0900)
smack version

[model] REDWOOD
[binary_type] PDA
[customer] OPEN

[Issue#] N/A
[Problem] Throws wrong exception type
[Cause] Function throws wrong exception
[Solution] Fix error

[Issue#] N/A
[Problem] sorting is not working at getting all contacts
[Cause] internal bug
[Solution] fix code

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

[Issue#] fail during privilege check with TCT
[Problem] N/A
[Cause] N/A
[Solution] N/A

[Issue#] N/A
[Problem] [Callhistory] Fixed the wrong codes in cause of build warning
[Cause] N/A
[Solution] N/A

[Issue#] N/A
[Problem] Calendar and datasync TCT fail cases.
[Cause] Wrong type checking and variable uninitialization.
[Solution] Fix type checking routine and varible initialization routine.

[Issue#] prevent CID 52022, 52021, 52020, 52019
[Problem] Dereference before null check.
[Cause] Dereferenced string variables before null check.
[Solution] Dereference string variables after null check.

[Issue#] N/A
[Problem] Dereferencing pointer "content"
[Cause] Null-checking "content" suggests that it may be null, but it has already been dereferenced on all paths leading to the check
[Solution] The "content" Log code was moved down, after null check.

[Issue#] CID 52026
[Problem] deref_ptr_in_call
[Cause] It doesn't check if the pointer is null or not before using LoggerD.
[Solution] Removed the code for logging.

[Issue#] Prevent 52024, 52023
[Problem] Prevent issue detected
[Cause] Printed pointer to log before NULL checking
[Solution] Insert NULL check code

[Issue] N/A
[Problem] email folder rename bug fix
[Cause] email folder rename bug fix
[Solution] email folder rename bug fix

[Issue] N/A
[Problem] N/A
[Cause] N/A
[Solution]  Fixed the build warning and removed unnecessary codes.

[Issue#] N/A
[Problem] When privilege is not set web api don't throw exception.
[Cause] privilege check code is removed.
[Solution] modification.

[Issue#] N/A
[Problem] Unit TC crash.
[Cause] Wrong profile id access.
[Solution] Revise profile id access routine.

[Issue#] TDIS-5282
[Problem] copy error if destination dir exist.
[Cause] mkdir error when destination dir exist.
[Solution] modification.

[Issue#] ORANGE-265
[Problem] N/A
[Cause] N/A
[Solution] modification.

[Issue#] N/A
[Problem] wrong converting from path
[Cause] N/A
[Solution] change the code to convert URI

[Issue#] N/A
[Problem] start() doesn't work in RSA binary.
[Cause] different DOWNLOAD_NETOWORK_ALL value between RSA and Private
[Solution] Avoid using DOWNLOAD_NETWORK_ALL

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

34 files changed:
packaging/wrt-plugins-tizen.spec
src/Calendar/CalendarConverter.cpp
src/Calendar/EventWrapper.cpp [changed mode: 0644->0755]
src/Callhistory/CallHistory.cpp
src/Callhistory/JSCallHistory.cpp
src/Contact/ContactSearchEngine.cpp
src/Content/JSContentManager.cpp
src/DataControl/JSDataControlManager.cpp
src/DataControl/JSMappedDataControlConsumer.cpp
src/DataControl/JSSQLDataControlConsumer.cpp
src/DataControl/JSSelectObjectArrayValues.cpp
src/DataControl/MappedDataControlConsumer.cpp
src/DataSync/DataSyncListenerManager.h [changed mode: 0644->0755]
src/DataSync/DataSyncManager.cpp
src/DataSync/JSDataSyncManager.cpp [changed mode: 0644->0755]
src/Download/DownloadManager.cpp
src/Filesystem/Manager.cpp
src/Filesystem/Stream.cpp
src/MessagePort/JSMessagePortManager.cpp
src/MessagePort/MessagePortManagerProxy.cpp
src/Messaging/Messaging.cpp
src/Messaging/Mms.cpp
src/Messaging/Sms.cpp
src/NFC/JSNFCManager.cpp [changed mode: 0644->0755]
src/NFC/NFCDefaultAdapter.cpp [changed mode: 0644->0755]
src/NFC/NdefMessage.cpp [changed mode: 0644->0755]
src/NFC/NdefRecord.cpp
src/NetworkBearerSelection/JSNetworkBearerSelection.cpp
src/NetworkBearerSelection/JSNetworkBearerSelectionCallbackManager.cpp [changed mode: 0755->0644]
src/NetworkBearerSelection/plugin_initializer.cpp [changed mode: 0755->0644]
src/Notification/StatusNotification.cpp
src/Systeminfo/JSBuildInfo.cpp [changed mode: 0644->0755]
src/Systeminfo/Systeminfo.cpp
src/Systeminfo/SysteminfoPropertyInfo.h

index 204e6c5..ed2aad9 100755 (executable)
@@ -1,7 +1,7 @@
 Name:       wrt-plugins-tizen
 Summary:    JavaScript plugins for WebRuntime
-Version:    0.4.26
-Release:    1
+Version:    0.4.27
+Release:    0
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
 Source0:    %{name}-%{version}.tar.gz
index eb02ba8..d53c23b 100755 (executable)
@@ -904,8 +904,12 @@ CalendarEventPtr CalendarConverter::toItem(const JSValueRef value, bool updateMo
     }
 
     if (!JSValueIsUndefined(m_context, geolocationData) && !JSValueIsNull(m_context, geolocationData)) {
-        DeviceAPI::Tizen::SimpleCoordinatesPtr geoLocation = DeviceAPI::Tizen::JSSimpleCoordinates::getSimpleCoordinates(m_context, geolocationData);
-        result->setGeolocation(geoLocation);
+           Try {
+               DeviceAPI::Tizen::SimpleCoordinatesPtr geoLocation = DeviceAPI::Tizen::JSSimpleCoordinates::getSimpleCoordinates(m_context, geolocationData);
+               result->setGeolocation(geoLocation);
+       } Catch(InvalidArgumentException) {
+               ThrowMsg(ConversionException, "Wrong geolocation type.");
+               }
     }
 
     if (!JSValueIsUndefined(m_context, visibilityData)) {
old mode 100644 (file)
new mode 100755 (executable)
index 02ad327..81b7004
@@ -1543,8 +1543,8 @@ void EventWrapper::setRecurrenceRuleFromPlatformEvent()
     if (CALENDAR_ERROR_NONE != ret) {
         LoggerW("Can't get byday: "<<ret);
     }
-    LoggerD("Loaded byday: "<<byday);
     if (byday) {
+           LoggerD("Loaded byday: "<<byday);
         char *saveptr = NULL;
         char* pch = strtok_r(byday, ",", &saveptr);
         while (NULL != pch) {
@@ -1596,8 +1596,8 @@ void EventWrapper::setRecurrenceRuleFromPlatformEvent()
     if (CALENDAR_ERROR_NONE != ret) {
         LoggerW("Can't get exdate: "<<ret);
     }
-    LoggerD("Loaded exdate: "<<exdate);
     if (exdate) {
+           LoggerD("Loaded exdate: "<<exdate);
         char *saveptr = NULL;
         char *pch = strtok_r(exdate, ",", &saveptr);
         while (NULL != pch) {
@@ -1619,8 +1619,8 @@ void EventWrapper::setRecurrenceRuleFromPlatformEvent()
     if (CALENDAR_ERROR_NONE != ret) {
         LoggerW("Can't get bysetpos: "<<ret);
     }
-    LoggerD("Loaded bysetpos: "<<bysetpos);
     if (bysetpos) {
+           LoggerD("Loaded bysetpos: "<<bysetpos);
         char *saveptr = NULL;
         char *pch = strtok_r(bysetpos, ",", &saveptr);
         while (NULL != pch) {
@@ -1750,8 +1750,8 @@ void EventWrapper::setAlarmsFromPlatformEvent()
             theAlarm->setDescription("");
             free(description);
         } else {
-            LoggerD("Alarm description: "<<description);
             if(description) {
+                   LoggerD("Alarm description: "<<description);
                 theAlarm->setDescription(description);
             }
         }
index a181cd9..cc6e8ce 100755 (executable)
@@ -313,10 +313,11 @@ bool CallHistory::parseRecord(contacts_list_h *recordList, CallHistoryEntryListP
        callhistory_query_s query_data;
        int logType = 0;
        int time = 0;
+       unsigned int i =0;
 
        contacts_list_get_count(*recordList, &total);
 
-       for (int i = 0; i < total; i++) {
+       for (i = 0; i < total; i++) {
                ret = contacts_list_get_current_record_p(*recordList, &record);
 
                if (record == NULL) {
@@ -340,12 +341,7 @@ bool CallHistory::parseRecord(contacts_list_h *recordList, CallHistoryEntryListP
 
                        validPersonId = 0;
                        validPersonId = updateValidPersonId(query_data.phone_number);
-                       if(validPersonId != -1){
-                               query_data.person_db_id = validPersonId;
-                       }else{
-                               LoggerD("Failed callhistory parser");
-                               return false;
-                       }
+                       query_data.person_db_id = validPersonId;
 
                        contacts_record_get_int(record, _contacts_phone_log.log_time, &time);
                        contacts_record_get_int(record, _contacts_phone_log.extra_data1, &(query_data.duration_sec));
@@ -378,48 +374,21 @@ int CallHistory::updateValidPersonId(char* phoneNum)
 
        contacts_query_set_filter(query, filter);
 
-       ret = contacts_query_set_sort(query, _contacts_person_phone_log.address, false);
-       if (ret != CONTACTS_ERROR_NONE) {
-               LoggerD("Invalid callhistory query [" << ret << "]");
-       }
-
        ret = contacts_db_get_records_with_query(query, 0, 1, &recordList);
        if (ret != CONTACTS_ERROR_NONE) {
                contacts_list_destroy(recordList, true);
                contacts_query_destroy(query);
                contacts_filter_destroy(filter);
                LoggerD("Invalid callhistory query [" << ret << "]");
-               return -1;
+               return 0;
        }
 
-       unsigned int total = 0;
        contacts_record_h record = NULL;
        int validPersonId = 0;
 
-       contacts_list_get_count(recordList, &total);
-
-       for (int i = 0; i < total; i++) {
-               ret = contacts_list_get_current_record_p(recordList, &record);
-
-               if (record == NULL) {
-                       ret = contacts_list_next(recordList);
-                       if (ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NO_DATA) {
-                               LoggerD("Failed contacts");
-                               return -1;
-                       } else {
-                               continue;
-                       }
-               }
-
-               if (ret == CONTACTS_ERROR_NONE) {
-                       contacts_record_get_int(record, _contacts_person_phone_log.person_id, &validPersonId);
-               }
-
-               ret = contacts_list_next(recordList);
-               if (ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NO_DATA) {
-                       LoggerD("Failed contacts");
-                       return -1;
-               }
+       ret = contacts_list_get_current_record_p(recordList, &record);
+       if (ret == CONTACTS_ERROR_NONE) {
+               contacts_record_get_int(record, _contacts_person_phone_log.person_id, &validPersonId);
        }
 
        contacts_list_destroy(recordList, true);
index d39b071..3357dc0 100755 (executable)
@@ -248,24 +248,14 @@ JSValueRef JSCallHistory::find(JSContextRef context, JSObjectRef object, JSObjec
                        }
                }
 
-               if (argumentCount >= 5) {
-                       if (!check.isNullOrUndefined(arguments[4])) {
-                               event->setLimit(converter.toULong(arguments[4]));
-                       }
-               }
+               event->setLimit(limit);
+               event->setOffset(offset);
 
-               if (argumentCount >= 6) {
-                       if (!check.isNullOrUndefined(arguments[5])) {
-                               event->setOffset(converter.toULong(arguments[5]));
-                       }
-               }
                callHistory->find(event);
                CallHistoryAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, gContext);
        } catch(const BasePlatformException& err){
         return JSWebAPIError::throwException(context, exception, err);
-    } catch(const BasePlatformException& err) {
-               return JSWebAPIError::throwException(context, exception, err);
-       } catch(const WrtDeviceApis::Commons::ConversionException& ex) {
+    } catch(const WrtDeviceApis::Commons::ConversionException& ex) {
                return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, ex.GetMessage());
        } catch(const WrtDeviceApis::Commons::InvalidArgumentException& ex) {
                cbm->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::INVALID_VALUES_ERROR, ex.GetMessage()));
@@ -531,52 +521,34 @@ JSValueRef JSCallHistory::removeChangeListener(JSContextRef context, JSObjectRef
                        CALL_HISTORY_FUNCTION_API_REMOVELISTENER);
 
        TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+       long handle = 0;
 
     try{
         ArgumentValidator validator(context, argumentCount, arguments);
 
-        long handle = validator.toLong(0);
-
-    }catch(const BasePlatformException& err){
-        return JSWebAPIError::throwException(context, exception, err);
-    }
-
-       if (argumentCount < 1) {
-               return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
-       }
-
-       JSCallHistoryPriv *priv = static_cast<JSCallHistoryPriv*> (JSObjectGetPrivate(thisObject));
-
-       if (!priv) {
-               return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error : Invalid private pointer");
-       }
+        handle = validator.toLong(0);
 
-       JSContextRef gContext = priv->getContext();
-       Converter converter(context);
-       Validator check(context, exception);
-
-       try {
-               long id = 0;
-
-               if (argumentCount >= 1) {
-                       if (check.isNullOrUndefined(arguments[0])) {
-                               return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid values error : handle");
-                       }
+               JSCallHistoryPriv *priv = static_cast<JSCallHistoryPriv*> (JSObjectGetPrivate(thisObject));
 
-                       id=JSUtil::JSValueToLong(context, arguments[0]);
+               if (!priv) {
+                       return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error : Invalid private pointer");
                }
 
-               if (id != 0) {
+               JSContextRef gContext = priv->getContext();
+
+               if (handle != 0) {
                        ICallHistoryPtr callHistory(priv->getObject());
-                       callHistory->removeListener(id);
+                       callHistory->removeListener(handle);
                } else {
                        return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid values error : handle");
                }
 
-               CallHistoryListenerCancellerPtr canceller = CallHistoryListenerCancellerPtr(new CallHistoryListenerCanceller(gContext, thisObject, id));
+               CallHistoryListenerCancellerPtr canceller = CallHistoryListenerCancellerPtr(new CallHistoryListenerCanceller(gContext, thisObject, handle));
                DeviceAPI::Common::IListenerItemPtr listenerItem = DPL::StaticPointerCast<DeviceAPI::Common::IListenerItem>(canceller);
                CallHistoryListenerManagerSingleton::Instance().unregisterListener(listenerItem);
-       } catch(const WrtDeviceApis::Commons::ConversionException& ex) {
+       } catch(const BasePlatformException& err){
+        return JSWebAPIError::throwException(context, exception, err);
+    } catch(const WrtDeviceApis::Commons::ConversionException& ex) {
                return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, ex.GetMessage());
        } catch(const WrtDeviceApis::Commons::InvalidArgumentException& ex) {
                return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, ex.GetMessage());
index 236ea64..37a3aed 100755 (executable)
@@ -224,7 +224,10 @@ ContactArrayPtr ContactSearchEngine::getContactSearchResult()
                                        attributePropertiesMap.find(m_attributeNameForSort);
                        AttributeProperties &property = iter->second;
 
-                       result = getAllContactsSorted(property, m_sortOrder);
+                       if(m_sortOrder == ASCENDING_SORT_ORDER)
+                               result = getAllContactsSorted(property, true);
+                       else
+                               result = getAllContactsSorted(property, false);
                }
                else
                {
index fd24299..adb4cd4 100755 (executable)
@@ -288,7 +288,7 @@ JSValueRef JSMediacontentManager::findItems(
         return JSWebAPIException::throwException(context,exception,err);
     }
     catch(...){
-        DeviceAPI::Common::UnknownException err("Unknown Error in ContentManager.getDirectories().");
+        DeviceAPI::Common::UnknownException err("Unknown Error in find().");
         return JSWebAPIException::throwException(context, exception, err);
     }
 
@@ -394,7 +394,7 @@ JSValueRef JSMediacontentManager::updateItemsBatch(JSContextRef context,
         return JSWebAPIException::throwException(context,exception,err);
     }
     catch(...){
-        DeviceAPI::Common::UnknownException err("Unknown Error in ContentManager.getDirectories().");
+        DeviceAPI::Common::UnknownException err("Unknown Error in updateBatch().");
         return JSWebAPIException::throwException(context, exception, err);
     }
 
@@ -558,7 +558,7 @@ static void _scanCompletedCallback(std::string err_msg, std::string path, void *
     if(cb != NULL){
             if(err_msg.empty() ){
                         Converter converter(cb->getContext());
-                        JSValueRef jsPath = converter.toJSValueRef(path);
+                        JSValueRef jsPath = converter.toJSValueRef(ContentUtility::convertPathToUri(path));
                         cb->callSuccessCallback(jsPath);
             }
             else{
@@ -617,7 +617,7 @@ JSValueRef JSMediacontentManager::scanFile(
         return JSWebAPIException::throwException(context,exception,err);
     }
     catch(...){
-        DeviceAPI::Common::UnknownException err("Unknown Error in ContentManager.getDirectories().");
+        DeviceAPI::Common::UnknownException err("Unknown Error in scanFile().");
         return JSWebAPIException::throwException(context, exception, err);
     }
 
@@ -691,7 +691,7 @@ JSValueRef JSMediacontentManager::setChangeListener(
         return JSWebAPIException::throwException(context,exception,err);
     }
     catch(...){
-        DeviceAPI::Common::UnknownException err("Unknown Error in ContentManager.getDirectories().");
+        DeviceAPI::Common::UnknownException err("Unknown Error in setChangeListener().");
         return JSWebAPIException::throwException(context, exception, err);
     }
 
@@ -729,7 +729,7 @@ JSValueRef JSMediacontentManager::unsetChangeListener(
         return JSWebAPIException::throwException(context,exception,err);
     }
     catch(...){
-        DeviceAPI::Common::UnknownException err("Unknown Error in ContentManager.getDirectories().");
+        DeviceAPI::Common::UnknownException err("Unknown Error in unsetChangeListener().");
         return JSWebAPIException::throwException(context, exception, err);
     }
 
index 06891ef..9b5e955 100644 (file)
 #include "JSSQLDataControlConsumer.h"
 #include "DataControlListener.h"
 #include "plugin_config.h"
-
 #include <ArgumentValidator.h> 
 #include <JSWebAPIError.h>
 #include <JSWebAPIException.h> 
 #include <JSUtil.h>  
 
 
-using namespace std;
-using namespace DPL;
 using namespace WrtDeviceApis;
+using namespace WrtDeviceApis::Commons;
 using namespace WrtDeviceApis::CommonsJavaScript;
 using namespace DeviceAPI::Common;
 
@@ -143,6 +141,9 @@ JSValueRef JSDataControlManager::getDataControlConsumer (
 {
        LoggerD("Enter");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
+       
+       AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
+       TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
 
 
        // argument validation with new validator  
index 98826f5..54fc85a 100644 (file)
@@ -171,6 +171,9 @@ JSValueRef JSMappedDataControlConsumer::addValue(
        LoggerD("Enter");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
 
+       AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
+       TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+       
        // argument validation with new validator  
        try 
        {
@@ -210,8 +213,7 @@ JSValueRef JSMappedDataControlConsumer::addValue(
 
        Try 
        {
-               AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
-               TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
 
                for (index = 0; index < 5; index++)
                {
@@ -283,6 +285,9 @@ JSValueRef JSMappedDataControlConsumer::updateValue(
        LoggerD("Enter");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
 
+       AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
+       TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
                // argument validation with new validator  
        try 
        {
@@ -323,8 +328,7 @@ JSValueRef JSMappedDataControlConsumer::updateValue(
 
        Try 
        {
-               AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
-               TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
 
                for (index = 0; index < 6; index++)
                {
@@ -399,6 +403,9 @@ JSValueRef JSMappedDataControlConsumer::getValue(
        LoggerD("Enter");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
 
+       AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
+       TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
        JSMappedDataControlConsumerPriv *priv = static_cast<JSMappedDataControlConsumerPriv*>(JSObjectGetPrivate(thisObject));
        JSValueRef successCallback = NULL;
        JSValueRef errorCallBack = NULL;
@@ -437,9 +444,6 @@ JSValueRef JSMappedDataControlConsumer::getValue(
 
        Try 
        {
-               AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
-               TIZEN_SYNC_ACCESS_HANDLER(status, globalContext, exception);
-
                if (priv == NULL)
                {
                        Throw(WrtDeviceApis::Commons::ConversionException);
@@ -510,6 +514,9 @@ JSValueRef JSMappedDataControlConsumer::removeValue(
        LoggerD("Enter");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
 
+       AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
+       TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
        // argument validation with new validator  
        try 
        {
@@ -549,8 +556,6 @@ JSValueRef JSMappedDataControlConsumer::removeValue(
 
        Try 
        {
-               AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
-               TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
 
                for (index = 0; index < 5; index++)
                {
index 122b771..1cf4a4a 100644 (file)
@@ -171,6 +171,10 @@ JSValueRef JSSQLDataControlConsumer::insert(
        LoggerD("Enter");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
 
+       AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
+       TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+       
+
        // argument validation with new validator  
        try 
        {
@@ -209,9 +213,6 @@ JSValueRef JSSQLDataControlConsumer::insert(
 
        Try 
        {
-               AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
-               TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
                for (index = 0; index < 4; index++)
                {
                        if (index < argumentCount)
@@ -280,6 +281,9 @@ JSValueRef JSSQLDataControlConsumer::update(
        LoggerD("Enter");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
 
+       AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
+       TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
        // argument validation with new validator  
        try 
        {
@@ -319,9 +323,6 @@ JSValueRef JSSQLDataControlConsumer::update(
 
        Try 
        {
-               AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
-               TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
                for (index = 0; index < 6; index++)
                {
                        if (index < argumentCount)
@@ -393,6 +394,9 @@ JSValueRef JSSQLDataControlConsumer::select(
        LoggerD("Enter");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
 
+       AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
+       TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
        // argument validation with new validator  
        try 
        {
@@ -435,9 +439,6 @@ JSValueRef JSSQLDataControlConsumer::select(
 
        Try 
        {
-               AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
-               TIZEN_SYNC_ACCESS_HANDLER(status, globalContext, exception);
-
                for (index = 0; index < 7; index++)
                {
                        if (index < argumentCount)
@@ -530,6 +531,9 @@ JSValueRef JSSQLDataControlConsumer::remove(
        LoggerD("Enter");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
 
+       AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
+       TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);  
+
        // argument validation with new validator  
        try 
        {
@@ -567,8 +571,7 @@ JSValueRef JSSQLDataControlConsumer::remove(
 
        Try 
        {
-               AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
-               TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
 
                for (index = 0; index < 4; index++)
                {
index bd48806..c8d3f9f 100644 (file)
@@ -200,7 +200,7 @@ JSValueRef JSSelectObjectArrayValues::getProperty(JSContextRef context,
                }
                
                DataControlConverter converter(priv->getContext());
-               size_t index = converter.toSizeT(propertyName);
+               int index = converter.toSizeT(propertyName);
 
                LoggerD(index);
                ISelectDataObjectPtr SelectDataOjbect = priv->getObject();
index 82e8599..5609380 100644 (file)
@@ -99,7 +99,7 @@ static void MappedDataControlGetValueCallback(bundle* b, int request_code, appsv
        EventGetValuePendingEvent *pendingEvent = NULL;
        MappedDataControlConsumer *consumer = NULL;
        EventGetValuePtr event;
-       int count = 0;
+       size_t count = 0;
        size_t index = 0;
        std::ifstream getValueStream;
        std::string getValueFilePath;
@@ -127,7 +127,7 @@ static void MappedDataControlGetValueCallback(bundle* b, int request_code, appsv
                        LoggerD(result[index]);
                }
 
-               if (result.size() < 3)
+               if (result.size() < 2)
                {
                        ThrowMsg(WrtDeviceApis::Commons::PlatformException, "invalid result from datacontrol provider");
                }
@@ -193,7 +193,7 @@ static void MappedDataControlGetValueCallback(bundle* b, int request_code, appsv
                                {
                                        ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Out of memory");
                                }
-                               memset(buf, memorizedSize + 1, 0);
+                               memset(buf, 0, memorizedSize + 1);
                                getValueStream.read((char*)buf, size);
                                buf[size] = '\0';
                                
old mode 100644 (file)
new mode 100755 (executable)
index e760b4d..a3f8cfb
@@ -72,7 +72,7 @@ class DataSyncListenerCanceller : public DeviceAPI::Common::IListenerItem
                        IEventStopSyncPtr dplEvent(new IEventStopSync());
                        std::stringstream ss;
                        ss<<m_watchId;
-                       dplEvent->setProfileId(std::string("Sync" + ss.str()));
+                       dplEvent->setProfileId(std::string(ss.str()));
                        dplEvent->setForSynchronousCall();
                        datasyncManager->stopSync(dplEvent);
                } Catch(WrtDeviceApis::Commons::Exception) {
index c1c8c9d..05edc10 100755 (executable)
@@ -535,13 +535,12 @@ void DataSyncManager::OnRequestReceived(const IEventUpdateProfilePtr &event)
             ThrowMsg(NullPointerException, "SyncProfileInfo is NULL.");
         }
 
-        LoggerD("id: "<<profile->getProfileId());
-
         sync_agent_ds_error_e ret = SYNC_AGENT_DS_FAIL;
 
-               int profileId;
+               int profileId = -1;
                std::stringstream ss(profile->getProfileId());
                ss>>profileId;
+        LoggerD("profileId: "<<profileId);
                ret = sync_agent_ds_get_profile(profileId, &profile_h);
                if (SYNC_AGENT_DS_SUCCESS!=ret) {
                        ThrowMsg(NotFoundException, "Platform error while getting a profile: "<<ret);
@@ -621,13 +620,12 @@ void DataSyncManager::OnRequestReceived(const IEventRemoveProfilePtr &event)
 
     Try
     {
-        LoggerD("id: "<<event->getProfileId());
-
         sync_agent_ds_error_e ret = SYNC_AGENT_DS_FAIL;
 
-               int profileId;
+               int profileId = -1;
                std::stringstream ss(event->getProfileId());
                ss>>profileId;
+        LoggerD("profileId: "<<profileId);
                ret = sync_agent_ds_get_profile(profileId, &profile_h);
                if (SYNC_AGENT_DS_SUCCESS!=ret) {
                        ThrowMsg(NotFoundException, "Platform error while getting a profile: "<<ret);
@@ -716,13 +714,12 @@ void DataSyncManager::OnRequestReceived(const IEventGetProfilePtr &event)
 
     Try
     {
-        LoggerD("id: "<<event->getProfileId());
-
         sync_agent_ds_error_e ret = SYNC_AGENT_DS_FAIL;
 
-               int profileId;
+               int profileId = -1;
                std::stringstream ss(event->getProfileId());
                ss>>profileId;
+        LoggerD("profileId: "<<profileId);
                ret = sync_agent_ds_get_profile(profileId, &profile_h);
                if (SYNC_AGENT_DS_SUCCESS!=ret) {
                        ThrowMsg(NotFoundException, "Platform error while getting a profile: "<<ret);
@@ -938,14 +935,13 @@ void DataSyncManager::OnRequestReceived(const IEventStartSyncPtr &event)
 
     Try
     {
-        LoggerD("id: "<<event->getProfileId());
-
         sync_agent_ds_error_e ret = SYNC_AGENT_DS_FAIL;
                sync_agent_event_error_e err= SYNC_AGENT_EVENT_FAIL;
 
-               int profileId;
+               int profileId = -1;
                std::stringstream ss(event->getProfileId());
                ss>>profileId;
+        LoggerD("profileId: "<<profileId);
                ret = sync_agent_ds_get_profile(profileId, &profile_h);
                if (SYNC_AGENT_DS_SUCCESS!=ret) {
                        ThrowMsg(NotFoundException, "Platform error while getting a profile: "<<ret);
@@ -997,13 +993,12 @@ void DataSyncManager::OnRequestReceived(const IEventStopSyncPtr &event)
 
     Try
     {
-        LoggerD("id: "<<event->getProfileId());
-
         sync_agent_ds_error_e ret = SYNC_AGENT_DS_FAIL;
 
-               int profileId;
+               int profileId = -1;
                std::stringstream ss(event->getProfileId());
                ss>>profileId;
+        LoggerD("profileId: "<<profileId);
                ret = sync_agent_ds_get_profile(profileId, &profile_h);
                if (SYNC_AGENT_DS_SUCCESS!=ret) {
                        ThrowMsg(NotFoundException, "Platform error while getting a profile: "<<ret);
@@ -1041,13 +1036,12 @@ void DataSyncManager::OnRequestReceived(const IEventGetLastSyncStatisticsPtr &ev
 
     Try
     {
-        LoggerD("id: "<<event->getProfileId());
-
         sync_agent_ds_error_e ret = SYNC_AGENT_DS_FAIL;
 
-               int profileId;
+               int profileId = -1;
                std::stringstream ss(event->getProfileId());
                ss>>profileId;
+        LoggerD("profileId: "<<profileId);
                ret = sync_agent_ds_get_profile(profileId, &profile_h);
                if (SYNC_AGENT_DS_SUCCESS!=ret) {
                        ThrowMsg(NotFoundException, "Platform error while getting a profile: "<<ret);
old mode 100644 (file)
new mode 100755 (executable)
index 0d2f23f..d5f7050
@@ -698,8 +698,8 @@ JSValueRef JSDataSyncManager::startSync(JSContextRef context,
 
         if (dplEvent->getResult()) {
                        if(dplEvent->getEmitter()) {
-                               LoggerD("watcherId: "<<profileId.at(4));
-                   DataSyncListenerCancellerPtr canceller = DataSyncListenerCancellerPtr(new DataSyncListenerCanceller(globalContext, thisObject, profileId.at(4)));
+                               LoggerD("watcherId: "<<profileId.at(0));
+                   DataSyncListenerCancellerPtr canceller = DataSyncListenerCancellerPtr(new DataSyncListenerCanceller(globalContext, thisObject, profileId.at(0)));
                    IListenerItemPtr listenerItem = DPL::StaticPointerCast<IListenerItem>(canceller);
                    DataSyncListenerManagerSingleton::Instance().registerListener(listenerItem, globalContext);
                        }
index efccf3d..3abdbd9 100644 (file)
@@ -383,14 +383,12 @@ long DownloadManager::start(DownloadRequest *request, DownloadCallback *download
                throw UnknownException(("Platform error while setting progress callback. " + _get_download_error(ret)).c_str());
        }
 
-       if (!networkType.empty()) {
+       if (!networkType.empty() && networkType != TIZEN_ENUM_DOWNLOAD_NETWORK_TYPE_ALL) {
                ret = DOWNLOAD_ERROR_NONE;
                if (networkType == TIZEN_ENUM_DOWNLOAD_NETWORK_TYPE_CELLULAR) {
                        ret = download_set_network_type(downloadId, DOWNLOAD_NETWORK_DATA_NETWORK);
                } else if (networkType == TIZEN_ENUM_DOWNLOAD_NETWORK_TYPE_WIFI) {
                        ret = download_set_network_type(downloadId, DOWNLOAD_NETWORK_WIFI);
-               } else if (networkType == TIZEN_ENUM_DOWNLOAD_NETWORK_TYPE_ALL) {
-                       ret = download_set_network_type(downloadId, DOWNLOAD_NETWORK_ALL);
                } else {
                        throw TypeMismatchException("Wrong DownloadNetworkType.");
                }
index 7dff757..12d60c8 100644 (file)
@@ -303,9 +303,11 @@ void Manager::copyElement(
         return;
     }
     //element is a directory -> create it:
-    if (EINA_TRUE != ecore_file_mkdir(dest.c_str())) {
-        LoggerD("Failed to create destination directory");
-        ThrowMsg(Commons::PlatformException, "Failed to copy directory");
+    if (EINA_TRUE != ecore_file_is_dir(dest.c_str())) {
+        if (EINA_TRUE != ecore_file_mkdir(dest.c_str())) {
+            LoggerD("Failed to create destination directory");
+            ThrowMsg(Commons::PlatformException, "Failed to copy directory");
+        }
     }
     //copy all elements of directory:
     if (recursive) {
@@ -575,7 +577,17 @@ void Manager::OnRequestReceived(const EventCopyPtr& event)
             //destination exist. Need to be removed
             Try {
                 INodePtr node = Node::resolve(dest);
-                node->remove(event->getOptions());
+
+                // only remove if dest is file.
+                if (node->getType() == NT_FILE) {
+                    node->remove(event->getOptions());
+                } 
+                else {
+                       // destination exist and src & dest are directory and dest path ends with '/'
+                    if (srcNode->getType() == NT_DIRECTORY && realDest[realDest.length() - 1] == '/') {
+                        realDest += src->getName();
+                    }
+                }
             }
             catch (const Commons::Exception& ex) 
             {
index cb95fa5..6003438 100644 (file)
@@ -237,17 +237,23 @@ unsigned long long Stream::getSize() const
 {
     std::fstream::streampos pos = m_stream.tellg();
     if (pos == -1) {
-        return -1;
+        return 0;
     }
 
     if (!m_stream.seekg(0, std::_S_end)) {
-        return -1;
+        return 0;
     }
 
+       pos = m_stream.tellg();
+
+       if (pos == -1) {
+               return 0;
+       }
+       
     unsigned long long result = m_stream.tellg();
     m_stream.seekg(pos, std::_S_beg);
 
-    return (result == -1 ? result : result + 1);
+    return result + 1;
 }
 
 template<typename T>
index 229a6e7..3301de8 100644 (file)
@@ -531,6 +531,11 @@ JSValueRef JSMessagePortManager::requestTrustedRemoteMessagePort(JSContextRef co
                        return JSWebAPIException::throwException(context, exception,
                                        NotFoundException(oss.str().c_str()));
                        break;
+               case ExceptionCodes::PlatformWrongStateException:
+                       oss << "Have no permission to access app '" << appId << "'";
+                       return JSWebAPIException::throwException(context, exception,
+                                       InvalidAccessException(oss.str().c_str()));
+                       break;
                case ExceptionCodes::PlatformException:
                        return JSWebAPIException::throwException(context, exception,
                                        UnknownException("The method cannot proceed due to a severe system error."));
index 47909fe..a9a398e 100644 (file)
@@ -284,8 +284,11 @@ RemoteMessagePortPtr MessagePortManagerProxy::getCachedRemoteMessagePort(string
 void MessagePortManagerProxy::messagePortMessageCb(int id, const char* remote_app_id,
                const char* remote_port, bool trusted_message, bundle* data)
 {
-       LoggerD("received message : (id:" << id << ", remote_appId : " << remote_app_id <<
-                       ", remote_port:" << remote_port << ", trusted:" << trusted_message << ")");
+       LoggerD("received message : (id:" << id << ", trusted:" << trusted_message << ")");
+       if(remote_app_id != NULL)
+               LoggerD("                   (remote_app_id : " << remote_app_id << ")");
+       if(remote_port != NULL)
+               LoggerD("                   (remote_port : " << remote_port << ")");
 
        LocalMessagePortPtr localMessagePort = getCachedLocalMessagePort(id);
        if(localMessagePort == NULL)
index 3b2bba5..db9d3e4 100644 (file)
@@ -1467,7 +1467,7 @@ void Messaging::OnEventReceived(const DBus::MessageEvent& event)
                                }
 
                        }
-                       else if (NOTI_MAILBOX_UPDATE == status
+                       else if ((NOTI_MAILBOX_UPDATE == status) || (NOTI_MAILBOX_FIELD_UPDATE == status) || (NOTI_MAILBOX_RENAME == status)
                        {
                                LoggerI("Emailbox received. account Id: " << account_id);
                                LoggerI("name Id: " << name);
index e74aa53..de609c8 100644 (file)
@@ -1110,8 +1110,7 @@ void Mms::addMessageToDraft()
                msg_set_int_value(m_messageData, MSG_MESSAGE_ID_INT, msgId);
 
                setId(convertId(msgId));
-               setFolderType(DRAFTBOX);
-               setMessageStatus(MESSAGE_STATUS_DRAFT);
+               readExistingMessage();
 
                msg_release_struct(&sendOpt);
 
index 695b6cb..5aa74d5 100644 (file)
@@ -830,49 +830,34 @@ void Sms::addMessageToDraft()
 
     Try
     {
-       sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
-       msg_set_bool_value(sendOpt, MSG_SEND_OPT_SETTING_BOOL, false);
+        sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
+        msg_set_bool_value(sendOpt, MSG_SEND_OPT_SETTING_BOOL, false);
         int msgId = -1;
-//        MSG_SENDINGOPT_S option = { false, false, false };
-//        option.option.smsSendOpt.bReplyPath = true;
-        // trying to get message from platform
-
-//        const msg_folder_id_t platfromFolderId = Messaging::convertFolderToPlatform(DRAFTBOX);
-
-//        msg_set_message_id(m_messageData, 0);                
-//        msg_set_folder_id(m_messageData, platfromFolderId);
-//        msg_set_network_status(m_messageData, MSG_NETWORK_NOT_SEND);
 
         // trying to add message
         int ret = msg_add_message(MsgGetCommonHandle(), m_messageData, sendOpt);
-        if (ret < MSG_SUCCESS) {
+        if(ret < MSG_SUCCESS) {
             LoggerE("msg_add_message failed, error code=" << ret);
             Throw(WrtDeviceApis::Commons::PlatformException);
         }
-       else
-       {
-               msgId = ret;    
-       }
+        else
+        {
+            msgId = ret;       
+        }
                        
-         LoggerD("Message ID : " << msgId);
-         if (msgId < 0)
-         {
-                LoggerD("Message ID is invailded ");
-                Throw(WrtDeviceApis::Commons::PlatformException);
-         }
+        LoggerD("Message ID : " << msgId);
+        if (msgId < 0)
+        {
+            LoggerD("Message ID is invailded ");
+            Throw(WrtDeviceApis::Commons::PlatformException);
+        }
          
-         msg_set_int_value(m_messageData, MSG_MESSAGE_ID_INT, msgId);
+        msg_set_int_value(m_messageData, MSG_MESSAGE_ID_INT, msgId);
 
-         setId(convertId(msgId));
-        setFolderType(DRAFTBOX);
-        setMessageStatus(MESSAGE_STATUS_DRAFT);
-         LoggerD("Message Status " <<  getMessageStatus());
+        setId(convertId(msgId));
 
-#if 0
-         if ( folder_list_view.nCount )
-               msg_release_list_struct(&folder_list_view);
-#endif   
-       msg_release_struct(&sendOpt);
+        readExistingMessage();
+        msg_release_struct(&sendOpt);
 
     }
     Catch(WrtDeviceApis::Commons::PlatformException) {
old mode 100644 (file)
new mode 100755 (executable)
index 3c1ddcc..bc3ee6d
@@ -234,7 +234,7 @@ JSValueRef JSNFCManager::setExclusiveMode (JSContextRef context, JSObjectRef obj
                NFCManagerPrivObject* privateObject = static_cast<NFCManagerPrivObject*>(JSObjectGetPrivate(thisObject));
                if (!privateObject) {
                        LoggerE("private object is null");
-                       ThrowMsg(UnsupportedException, "private object is null");
+                       throw TypeMismatchException("private object is null");
                }
                NFCDefaultAdapterSingleton::Instance().setExclusiveMode(mode);
                return JSValueMakeUndefined(context);
old mode 100644 (file)
new mode 100755 (executable)
index 2180c32..23f7511
@@ -239,7 +239,7 @@ void NFCDefaultAdapter::unsetPeerListener(NFCAdapter * adapter) {
        LoggerD(" NFCDefaultAdapter::unsetPeerListener Entered");
 
        if (!m_initialized) {
-               m_NFCTagListeners.clear();
+               m_NFCTargetListeners.clear();
                return;
        }
 
old mode 100644 (file)
new mode 100755 (executable)
index 97c42e7..4e006d5
@@ -156,7 +156,7 @@ std::vector<unsigned char> NdefMessage::toByte() {
                        free(rawdata);
                util.throwNFCException(result, "Can't get serial bytes of NDEF message");
        }
-       LoggerD(rawdata);
+
        std::vector<unsigned char> byteData = util.toVector(rawdata, size);
        if (rawdata)
                free(rawdata);
index 3aaaeec..23a6fc6 100755 (executable)
@@ -91,11 +91,11 @@ NdefRecord::NdefRecord(const NdefRecordProperties &ndefRecordProperties, std::ve
        NFCUtil util;
 
        unsigned char * recordPayload = util.toCharPtr(payload);
-       int payloadSize = (payload.size() > (1<<32 -1)) ? (1<<32 -1) : payload.size();
+       unsigned int payloadSize = payload.size();
        unsigned char * typeName = util.toCharPtr(ndefRecordProperties.typeName);
-       int typeSize = (ndefRecordProperties.typeName.size() > 255) ? 255 : ndefRecordProperties.typeName.size();
+       int typeSize = (static_cast<int>(ndefRecordProperties.typeName.size()) > 255) ? 255 : static_cast<int>(ndefRecordProperties.typeName.size());
        unsigned char * id = util.toCharPtr(ndefRecordProperties.id);
-       int idSize = (ndefRecordProperties.id.size() > 255) ? 255 : ndefRecordProperties.id.size();
+       int idSize = (static_cast<int>(ndefRecordProperties.id.size()) > 255) ? 255 : static_cast<int>(ndefRecordProperties.id.size());
 
        int result = nfc_ndef_record_create(&handle, static_cast<nfc_record_tnf_e>(util.convertToTNF(ndefRecordProperties.tnf)), typeName, typeSize,
                id, idSize, recordPayload, payloadSize) ;
index b6a9a2c..ec19246 100755 (executable)
@@ -133,6 +133,9 @@ JSValueRef JSNetworkBearerSelection::requestRouteToHost(JSContextRef context, JS
         }
     }
 
+       AceSecurityStatus status = NETWORKBEARERSELECTION_CHECK_ACCESS(NETWORKBEARERSELECTION_FUNCTION_API_REQUEST_ROUTE_TO_HOST);
+       TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
        JSValueRef onsuccess;
        JSValueRef onpaused;
        JSValueRef onresumed;
@@ -235,6 +238,9 @@ JSValueRef JSNetworkBearerSelection::releaseRouteToHost(JSContextRef context, JS
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
     }
 
+       AceSecurityStatus status = NETWORKBEARERSELECTION_CHECK_ACCESS(NETWORKBEARERSELECTION_FUNCTION_API_RELEASE_ROUTE_TO_HOST);
+       TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
     std::string networkType = converter.toString(arguments[0]);
     std::string domainName = converter.toString(arguments[1]);
     if (strcmp(networkType.c_str(), "CELLULAR") != 0) {
index 7de06eb..8397142 100755 (executable)
@@ -495,12 +495,13 @@ std::string StatusNotification::getContent()
                        throw UnknownException("get notification Content error");
                }
                
-               LoggerI(" get Content : " << content);
-
                std::string notiContent;
                
                if(content)
+               {
                        notiContent = content;
+                       LoggerI(" get Content : " << content);
+               }
 
                return notiContent;
                
old mode 100644 (file)
new mode 100755 (executable)
index b1289e4..a0d96ac
@@ -27,6 +27,7 @@ using namespace WrtDeviceApis::Commons;
 namespace {
 const char* BUILD_MODEL_PROPERTY = "model";
 const char* BUILD_MANUFACTURER_PROPERTY = "manufacturer";
+const char* BUILD_BUILD_PROPERTY = "buildVersion";
 
 }
 
@@ -55,6 +56,7 @@ JSClassDefinition JSBuildInfo::m_classInfo = {
 JSStaticValue JSBuildInfo::m_properties[] = {
     { BUILD_MODEL_PROPERTY, getProperty, NULL, kJSPropertyAttributeReadOnly },
     { BUILD_MANUFACTURER_PROPERTY, getProperty, NULL, kJSPropertyAttributeReadOnly },
+    { BUILD_BUILD_PROPERTY, getProperty, NULL, kJSPropertyAttributeReadOnly },
     { 0, 0, 0, 0 }
 };
 
@@ -113,6 +115,8 @@ JSValueRef JSBuildInfo::getProperty(JSContextRef context, JSObjectRef object, JS
             return convert.toJSValueRef(buildInfo->model);
         } else if (JSStringIsEqualToUTF8CString(propertyName, BUILD_MANUFACTURER_PROPERTY)) {
             return convert.toJSValueRef(buildInfo->manufacturer);
+        } else if (JSStringIsEqualToUTF8CString(propertyName, BUILD_BUILD_PROPERTY)) {
+            return convert.toJSValueRef(buildInfo->buildVersion);
         }
     }
     Catch(Exception)
index 088de94..984e53d 100755 (executable)
@@ -1404,6 +1404,7 @@ PROPERTY_GET_SYSTEMINFO_DEFINITION(Build) {
 
     char* model = NULL;
     char* manufacturer = NULL;
+    char* buildVersion = NULL;
 
     if (system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &model) == SYSTEM_INFO_ERROR_NONE) {
         if (model != NULL) {
@@ -1421,6 +1422,14 @@ PROPERTY_GET_SYSTEMINFO_DEFINITION(Build) {
         }
     }
 
+    if (system_info_get_value_string(SYSTEM_INFO_KEY_BUILD_STRING, &buildVersion) == SYSTEM_INFO_ERROR_NONE) {
+        if (buildVersion != NULL) {
+            LoggerD("buildVersion : " << buildVersion);
+            Build->buildVersion = buildVersion;
+            free(buildVersion);
+        }
+    }
+
     return JSBuildInfo::createJSObject(context, Build);
 }
 
@@ -1441,23 +1450,21 @@ PROPERTY_GET_SYSTEMINFO_DEFINITION(Locale) {
     }
 
     if (runtime_info_get_value_string(RUNTIME_INFO_KEY_REGION, &country) == RUNTIME_INFO_ERROR_NONE) {
-        LoggerD("country : " << country);
-        char* token = NULL;
-        char* countryTemp = NULL;
-        token = strtok(country, ".");
-        if (token != NULL) {
-        countryTemp = strdup(token);
-            if (countryTemp != NULL) {
-        Locale->country = countryTemp;
-            }
-        if (countryTemp != NULL) {
-            free(countryTemp);
-        }
         if (country != NULL) {
-            free(country);
+            LoggerD("country : " << country);
+            char* token = NULL;
+            char* countryTemp = NULL;
+            token = strtok(country, ".");
+            if (token != NULL) {
+                countryTemp = strdup(token);
+                if (countryTemp != NULL) {
+                    Locale->country = countryTemp;
+                    free(countryTemp);
+                }
+            }            
+            free(country);            
         }
     }
-    }
 
     return JSLocaleInfo::createJSObject(context, Locale);
 }
index a29577c..a6c3dc1 100755 (executable)
@@ -335,10 +335,12 @@ struct BuildProperties
 {
     std::string  model;
     std::string  manufacturer;
+    std::string  buildVersion;
 
     BuildProperties() :
         model(""),
-        manufacturer("")
+        manufacturer(""),
+        buildVersion("")
     {
     }
 };