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
}
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)) {
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) {
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) {
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) {
theAlarm->setDescription("");
free(description);
} else {
- LoggerD("Alarm description: "<<description);
if(description) {
+ LoggerD("Alarm description: "<<description);
theAlarm->setDescription(description);
}
}
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) {
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));
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);
}
}
- 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()));
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());
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
{
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);
}
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);
}
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{
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);
}
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);
}
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);
}
#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;
{
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
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
{
Try
{
- AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
for (index = 0; index < 5; index++)
{
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
{
Try
{
- AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
for (index = 0; index < 6; index++)
{
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;
Try
{
- AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
- TIZEN_SYNC_ACCESS_HANDLER(status, globalContext, exception);
-
if (priv == NULL)
{
Throw(WrtDeviceApis::Commons::ConversionException);
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
{
Try
{
- AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
for (index = 0; index < 5; index++)
{
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
{
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)
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
{
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)
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
{
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)
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
{
Try
{
- AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
for (index = 0; index < 4; index++)
{
}
DataControlConverter converter(priv->getContext());
- size_t index = converter.toSizeT(propertyName);
+ int index = converter.toSizeT(propertyName);
LoggerD(index);
ISelectDataObjectPtr SelectDataOjbect = priv->getObject();
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;
LoggerD(result[index]);
}
- if (result.size() < 3)
+ if (result.size() < 2)
{
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "invalid result from datacontrol provider");
}
{
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';
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) {
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);
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);
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);
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);
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);
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);
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);
}
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.");
}
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) {
//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)
{
{
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>
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."));
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)
}
}
- 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);
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);
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) {
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);
LoggerD(" NFCDefaultAdapter::unsetPeerListener Entered");
if (!m_initialized) {
- m_NFCTagListeners.clear();
+ m_NFCTargetListeners.clear();
return;
}
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);
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) ;
}
}
+ 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;
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) {
throw UnknownException("get notification Content error");
}
- LoggerI(" get Content : " << content);
-
std::string notiContent;
if(content)
+ {
notiContent = content;
+ LoggerI(" get Content : " << content);
+ }
return notiContent;
namespace {
const char* BUILD_MODEL_PROPERTY = "model";
const char* BUILD_MANUFACTURER_PROPERTY = "manufacturer";
+const char* BUILD_BUILD_PROPERTY = "buildVersion";
}
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 }
};
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)
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) {
}
}
+ 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);
}
}
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);
}
{
std::string model;
std::string manufacturer;
+ std::string buildVersion;
BuildProperties() :
model(""),
- manufacturer("")
+ manufacturer(""),
+ buildVersion("")
{
}
};