From a5c4a5df4786530a4446382e5869b0b2de8496a7 Mon Sep 17 00:00:00 2001 From: Dongjin Choi Date: Thu, 2 May 2013 20:59:26 +0900 Subject: [PATCH] Update change log and spec for wrt-plugins-tizen_0.4.27 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 --- packaging/wrt-plugins-tizen.spec | 4 +- src/Calendar/CalendarConverter.cpp | 8 ++- src/Calendar/EventWrapper.cpp | 8 +-- src/Callhistory/CallHistory.cpp | 45 +++------------- src/Callhistory/JSCallHistory.cpp | 60 ++++++---------------- src/Contact/ContactSearchEngine.cpp | 5 +- src/Content/JSContentManager.cpp | 12 ++--- src/DataControl/JSDataControlManager.cpp | 7 +-- src/DataControl/JSMappedDataControlConsumer.cpp | 23 +++++---- src/DataControl/JSSQLDataControlConsumer.cpp | 25 +++++---- src/DataControl/JSSelectObjectArrayValues.cpp | 2 +- src/DataControl/MappedDataControlConsumer.cpp | 6 +-- src/DataSync/DataSyncListenerManager.h | 2 +- src/DataSync/DataSyncManager.cpp | 30 +++++------ src/DataSync/JSDataSyncManager.cpp | 4 +- src/Download/DownloadManager.cpp | 4 +- src/Filesystem/Manager.cpp | 20 ++++++-- src/Filesystem/Stream.cpp | 12 +++-- src/MessagePort/JSMessagePortManager.cpp | 5 ++ src/MessagePort/MessagePortManagerProxy.cpp | 7 ++- src/Messaging/Messaging.cpp | 2 +- src/Messaging/Mms.cpp | 3 +- src/Messaging/Sms.cpp | 49 ++++++------------ src/NFC/JSNFCManager.cpp | 2 +- src/NFC/NFCDefaultAdapter.cpp | 2 +- src/NFC/NdefMessage.cpp | 2 +- src/NFC/NdefRecord.cpp | 6 +-- .../JSNetworkBearerSelection.cpp | 6 +++ .../JSNetworkBearerSelectionCallbackManager.cpp | 0 src/NetworkBearerSelection/plugin_initializer.cpp | 0 src/Notification/StatusNotification.cpp | 5 +- src/Systeminfo/JSBuildInfo.cpp | 4 ++ src/Systeminfo/Systeminfo.cpp | 35 ++++++++----- src/Systeminfo/SysteminfoPropertyInfo.h | 4 +- 34 files changed, 194 insertions(+), 215 deletions(-) mode change 100644 => 100755 src/Calendar/EventWrapper.cpp mode change 100644 => 100755 src/DataSync/DataSyncListenerManager.h mode change 100644 => 100755 src/DataSync/JSDataSyncManager.cpp mode change 100644 => 100755 src/NFC/JSNFCManager.cpp mode change 100644 => 100755 src/NFC/NFCDefaultAdapter.cpp mode change 100644 => 100755 src/NFC/NdefMessage.cpp mode change 100755 => 100644 src/NetworkBearerSelection/JSNetworkBearerSelectionCallbackManager.cpp mode change 100755 => 100644 src/NetworkBearerSelection/plugin_initializer.cpp mode change 100644 => 100755 src/Systeminfo/JSBuildInfo.cpp diff --git a/packaging/wrt-plugins-tizen.spec b/packaging/wrt-plugins-tizen.spec index 204e6c5..ed2aad9 100755 --- a/packaging/wrt-plugins-tizen.spec +++ b/packaging/wrt-plugins-tizen.spec @@ -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 diff --git a/src/Calendar/CalendarConverter.cpp b/src/Calendar/CalendarConverter.cpp index eb02ba8..d53c23b 100755 --- a/src/Calendar/CalendarConverter.cpp +++ b/src/Calendar/CalendarConverter.cpp @@ -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)) { diff --git a/src/Calendar/EventWrapper.cpp b/src/Calendar/EventWrapper.cpp old mode 100644 new mode 100755 index 02ad327..81b7004 --- a/src/Calendar/EventWrapper.cpp +++ b/src/Calendar/EventWrapper.cpp @@ -1543,8 +1543,8 @@ void EventWrapper::setRecurrenceRuleFromPlatformEvent() if (CALENDAR_ERROR_NONE != ret) { LoggerW("Can't get byday: "<setDescription(""); free(description); } else { - LoggerD("Alarm description: "<setDescription(description); } } diff --git a/src/Callhistory/CallHistory.cpp b/src/Callhistory/CallHistory.cpp index a181cd9..cc6e8ce 100755 --- a/src/Callhistory/CallHistory.cpp +++ b/src/Callhistory/CallHistory.cpp @@ -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); diff --git a/src/Callhistory/JSCallHistory.cpp b/src/Callhistory/JSCallHistory.cpp index d39b071..3357dc0 100755 --- a/src/Callhistory/JSCallHistory.cpp +++ b/src/Callhistory/JSCallHistory.cpp @@ -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 (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 (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(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()); diff --git a/src/Contact/ContactSearchEngine.cpp b/src/Contact/ContactSearchEngine.cpp index 236ea64..37a3aed 100755 --- a/src/Contact/ContactSearchEngine.cpp +++ b/src/Contact/ContactSearchEngine.cpp @@ -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 { diff --git a/src/Content/JSContentManager.cpp b/src/Content/JSContentManager.cpp index fd24299..adb4cd4 100755 --- a/src/Content/JSContentManager.cpp +++ b/src/Content/JSContentManager.cpp @@ -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); } diff --git a/src/DataControl/JSDataControlManager.cpp b/src/DataControl/JSDataControlManager.cpp index 06891ef..9b5e955 100644 --- a/src/DataControl/JSDataControlManager.cpp +++ b/src/DataControl/JSDataControlManager.cpp @@ -32,16 +32,14 @@ #include "JSSQLDataControlConsumer.h" #include "DataControlListener.h" #include "plugin_config.h" - #include #include #include #include -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 diff --git a/src/DataControl/JSMappedDataControlConsumer.cpp b/src/DataControl/JSMappedDataControlConsumer.cpp index 98826f5..54fc85a 100644 --- a/src/DataControl/JSMappedDataControlConsumer.cpp +++ b/src/DataControl/JSMappedDataControlConsumer.cpp @@ -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(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++) { diff --git a/src/DataControl/JSSQLDataControlConsumer.cpp b/src/DataControl/JSSQLDataControlConsumer.cpp index 122b771..1cf4a4a 100644 --- a/src/DataControl/JSSQLDataControlConsumer.cpp +++ b/src/DataControl/JSSQLDataControlConsumer.cpp @@ -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++) { diff --git a/src/DataControl/JSSelectObjectArrayValues.cpp b/src/DataControl/JSSelectObjectArrayValues.cpp index bd48806..c8d3f9f 100644 --- a/src/DataControl/JSSelectObjectArrayValues.cpp +++ b/src/DataControl/JSSelectObjectArrayValues.cpp @@ -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(); diff --git a/src/DataControl/MappedDataControlConsumer.cpp b/src/DataControl/MappedDataControlConsumer.cpp index 82e8599..5609380 100644 --- a/src/DataControl/MappedDataControlConsumer.cpp +++ b/src/DataControl/MappedDataControlConsumer.cpp @@ -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'; diff --git a/src/DataSync/DataSyncListenerManager.h b/src/DataSync/DataSyncListenerManager.h old mode 100644 new mode 100755 index e760b4d..a3f8cfb --- a/src/DataSync/DataSyncListenerManager.h +++ b/src/DataSync/DataSyncListenerManager.h @@ -72,7 +72,7 @@ class DataSyncListenerCanceller : public DeviceAPI::Common::IListenerItem IEventStopSyncPtr dplEvent(new IEventStopSync()); std::stringstream ss; ss<setProfileId(std::string("Sync" + ss.str())); + dplEvent->setProfileId(std::string(ss.str())); dplEvent->setForSynchronousCall(); datasyncManager->stopSync(dplEvent); } Catch(WrtDeviceApis::Commons::Exception) { diff --git a/src/DataSync/DataSyncManager.cpp b/src/DataSync/DataSyncManager.cpp index c1c8c9d..05edc10 100755 --- a/src/DataSync/DataSyncManager.cpp +++ b/src/DataSync/DataSyncManager.cpp @@ -535,13 +535,12 @@ void DataSyncManager::OnRequestReceived(const IEventUpdateProfilePtr &event) ThrowMsg(NullPointerException, "SyncProfileInfo is NULL."); } - LoggerD("id: "<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: "<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: "<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: "<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: "<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: "<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: "<getResult()) { if(dplEvent->getEmitter()) { - LoggerD("watcherId: "<(canceller); DataSyncListenerManagerSingleton::Instance().registerListener(listenerItem, globalContext); } diff --git a/src/Download/DownloadManager.cpp b/src/Download/DownloadManager.cpp index efccf3d..3abdbd9 100644 --- a/src/Download/DownloadManager.cpp +++ b/src/Download/DownloadManager.cpp @@ -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."); } diff --git a/src/Filesystem/Manager.cpp b/src/Filesystem/Manager.cpp index 7dff757..12d60c8 100644 --- a/src/Filesystem/Manager.cpp +++ b/src/Filesystem/Manager.cpp @@ -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) { diff --git a/src/Filesystem/Stream.cpp b/src/Filesystem/Stream.cpp index cb95fa5..6003438 100644 --- a/src/Filesystem/Stream.cpp +++ b/src/Filesystem/Stream.cpp @@ -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 diff --git a/src/MessagePort/JSMessagePortManager.cpp b/src/MessagePort/JSMessagePortManager.cpp index 229a6e7..3301de8 100644 --- a/src/MessagePort/JSMessagePortManager.cpp +++ b/src/MessagePort/JSMessagePortManager.cpp @@ -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.")); diff --git a/src/MessagePort/MessagePortManagerProxy.cpp b/src/MessagePort/MessagePortManagerProxy.cpp index 47909fe..a9a398e 100644 --- a/src/MessagePort/MessagePortManagerProxy.cpp +++ b/src/MessagePort/MessagePortManagerProxy.cpp @@ -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) diff --git a/src/Messaging/Messaging.cpp b/src/Messaging/Messaging.cpp index 3b2bba5..db9d3e4 100644 --- a/src/Messaging/Messaging.cpp +++ b/src/Messaging/Messaging.cpp @@ -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); diff --git a/src/Messaging/Mms.cpp b/src/Messaging/Mms.cpp index e74aa53..de609c8 100644 --- a/src/Messaging/Mms.cpp +++ b/src/Messaging/Mms.cpp @@ -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); diff --git a/src/Messaging/Sms.cpp b/src/Messaging/Sms.cpp index 695b6cb..5aa74d5 100644 --- a/src/Messaging/Sms.cpp +++ b/src/Messaging/Sms.cpp @@ -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) { diff --git a/src/NFC/JSNFCManager.cpp b/src/NFC/JSNFCManager.cpp old mode 100644 new mode 100755 index 3c1ddcc..bc3ee6d --- a/src/NFC/JSNFCManager.cpp +++ b/src/NFC/JSNFCManager.cpp @@ -234,7 +234,7 @@ JSValueRef JSNFCManager::setExclusiveMode (JSContextRef context, JSObjectRef obj NFCManagerPrivObject* privateObject = static_cast(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); diff --git a/src/NFC/NFCDefaultAdapter.cpp b/src/NFC/NFCDefaultAdapter.cpp old mode 100644 new mode 100755 index 2180c32..23f7511 --- a/src/NFC/NFCDefaultAdapter.cpp +++ b/src/NFC/NFCDefaultAdapter.cpp @@ -239,7 +239,7 @@ void NFCDefaultAdapter::unsetPeerListener(NFCAdapter * adapter) { LoggerD(" NFCDefaultAdapter::unsetPeerListener Entered"); if (!m_initialized) { - m_NFCTagListeners.clear(); + m_NFCTargetListeners.clear(); return; } diff --git a/src/NFC/NdefMessage.cpp b/src/NFC/NdefMessage.cpp old mode 100644 new mode 100755 index 97c42e7..4e006d5 --- a/src/NFC/NdefMessage.cpp +++ b/src/NFC/NdefMessage.cpp @@ -156,7 +156,7 @@ std::vector NdefMessage::toByte() { free(rawdata); util.throwNFCException(result, "Can't get serial bytes of NDEF message"); } - LoggerD(rawdata); + std::vector byteData = util.toVector(rawdata, size); if (rawdata) free(rawdata); diff --git a/src/NFC/NdefRecord.cpp b/src/NFC/NdefRecord.cpp index 3aaaeec..23a6fc6 100755 --- a/src/NFC/NdefRecord.cpp +++ b/src/NFC/NdefRecord.cpp @@ -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(ndefRecordProperties.typeName.size()) > 255) ? 255 : static_cast(ndefRecordProperties.typeName.size()); unsigned char * id = util.toCharPtr(ndefRecordProperties.id); - int idSize = (ndefRecordProperties.id.size() > 255) ? 255 : ndefRecordProperties.id.size(); + int idSize = (static_cast(ndefRecordProperties.id.size()) > 255) ? 255 : static_cast(ndefRecordProperties.id.size()); int result = nfc_ndef_record_create(&handle, static_cast(util.convertToTNF(ndefRecordProperties.tnf)), typeName, typeSize, id, idSize, recordPayload, payloadSize) ; diff --git a/src/NetworkBearerSelection/JSNetworkBearerSelection.cpp b/src/NetworkBearerSelection/JSNetworkBearerSelection.cpp index b6a9a2c..ec19246 100755 --- a/src/NetworkBearerSelection/JSNetworkBearerSelection.cpp +++ b/src/NetworkBearerSelection/JSNetworkBearerSelection.cpp @@ -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) { diff --git a/src/NetworkBearerSelection/JSNetworkBearerSelectionCallbackManager.cpp b/src/NetworkBearerSelection/JSNetworkBearerSelectionCallbackManager.cpp old mode 100755 new mode 100644 diff --git a/src/NetworkBearerSelection/plugin_initializer.cpp b/src/NetworkBearerSelection/plugin_initializer.cpp old mode 100755 new mode 100644 diff --git a/src/Notification/StatusNotification.cpp b/src/Notification/StatusNotification.cpp index 7de06eb..8397142 100755 --- a/src/Notification/StatusNotification.cpp +++ b/src/Notification/StatusNotification.cpp @@ -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; diff --git a/src/Systeminfo/JSBuildInfo.cpp b/src/Systeminfo/JSBuildInfo.cpp old mode 100644 new mode 100755 index b1289e4..a0d96ac --- a/src/Systeminfo/JSBuildInfo.cpp +++ b/src/Systeminfo/JSBuildInfo.cpp @@ -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) diff --git a/src/Systeminfo/Systeminfo.cpp b/src/Systeminfo/Systeminfo.cpp index 088de94..984e53d 100755 --- a/src/Systeminfo/Systeminfo.cpp +++ b/src/Systeminfo/Systeminfo.cpp @@ -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); } diff --git a/src/Systeminfo/SysteminfoPropertyInfo.h b/src/Systeminfo/SysteminfoPropertyInfo.h index a29577c..a6c3dc1 100755 --- a/src/Systeminfo/SysteminfoPropertyInfo.h +++ b/src/Systeminfo/SysteminfoPropertyInfo.h @@ -335,10 +335,12 @@ struct BuildProperties { std::string model; std::string manufacturer; + std::string buildVersion; BuildProperties() : model(""), - manufacturer("") + manufacturer(""), + buildVersion("") { } }; -- 2.7.4