Name: wrt-plugins-tizen
Summary: JavaScript plugins for WebRuntime
-Version: 0.4.74
+Version: 0.4.75
Release: 0
Group: Development/Libraries
License: Apache License, Version 2.0
{
char *app_id = NULL;
std::string appId = "";
- int parent_pid = getppid();
- LoggerD("parent pid : " << parent_pid);
+ int parent_pid = getpid();
+
int ret = app_manager_get_app_id(parent_pid, &app_id);
if((ret != APP_ERROR_NONE) || (app_id == NULL))
LoggerE("Can not get app id from current pid (" << ret << ")");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "could not get information about application");
}
+
appId = app_id;
free(app_id);
return appId;
email-service
dbus-1
capi-system-info
- capi-network-connection
+ capi-network-connection
tapi
)
int MailRemover::removeCheck(int accountId, const IEmailPtr& mail)
{
- LoggerD("enter");
- email_mail_data_t* result = NULL;
+ email_mail_data_t* result = NULL;
int mailId = mail->convertId(mail->getIdRef());
- LoggerD("mailId " << mailId);
+ int error = email_get_mail_data(mailId, &result);
- int error = email_get_mail_data(mailId, &result);
- LoggerD("error " << error);
+ email_free_mail_data(&result,1);
- email_free_mail_data(&result,1);
-
- if (error == EMAIL_ERROR_MAIL_NOT_FOUND) {
- LoggerD("email already removed : " << mailId);
- return 1;
+ if (error == EMAIL_ERROR_MAIL_NOT_FOUND) {
+ return 1;
}
else
{
- LoggerD("Insert remove request");
RemoveRequestData data = RemoveRequestData(accountId, mail);
m_requests.insert(std::make_pair(mailId, data));
}
- return 0;
+ return 0;
}
// TODO Copied from former solution, refactor it.
void MailRemover::OnEventReceived(const DBus::MessageEvent& event)
{
- LoggerD("enter");
DBus::MessagePtr message = event.GetArg0();
int account_id = 0, mail_id = 0, thread_id = 0, status = 0, mailId;
}
}
- LoggerD("m_requests.erase(): " << mailId);
m_requests.erase(mailId);
break;
}
LoggerW("Can't find mail_id " << mail_id);
}
}
- LoggerI("m_requests.size(): " << m_requests.size());
-
}
MailRemover::MailRemover() :
m_dbusThread(new DPL::Thread()),
m_dbus(new DBus::Connection())
{
- LoggerD("enter");
m_dbusThread->Run();
m_dbus->setWorkerThread(m_dbusThread.Get());
{
m_dbus->RemoveListener(this);
m_dbus->close();
-
m_dbusThread->Quit();
-
//close email service
- if (EMAIL_ERROR_NONE == email_close_db()) {
- LoggerD("Email Close DB Success\n");
- if (EMAIL_ERROR_NONE == email_service_end()){
- LoggerD("Email service close Success\n");
- }
- else{
- LoggerD("Email service end failed\n");
- }
- }
- else{
- LoggerD("Email Close DB failed\n");
- }
-
+ if (EMAIL_ERROR_NONE == email_close_db()) {
+ if (EMAIL_ERROR_NONE == email_service_end()){
+ }
+ else{
+ LoggerD("Email service end failed\n");
+ }
+ }
+ else{
+ LoggerD("Email Close DB failed\n");
+ }
}
}
/**
* @file MessageFilterConverter.cpp
- * @author Kisub Song (kisubs.song@samsung.com)
* @version 0.1
* @description Reference from CalendarConverter.cpp
*/
int vecSize = msg.size();
for(int i=0; i < vecSize; i++){
- int type = msg[i]->getMessageType();
std::string id = msg[i]->getId();
msg[i]->remove();
}//for
if ( msg->getMessageType() == EMAIL )
{
IEmailPtr email = MessageFactory::convertToEmail(msg);
- event->switchToManualAnswer(); //switch to manual answer;
- int handle = email->downloadBody();
- LoggerD("Load Message Body handle : " << handle);
- if (event->opId && event->m_messagingService)
+ if (email && email->isBodyDownloaded() > 0)
{
- event->m_messagingService->setHandleToOpId(event->opId, handle);
- }
- if (handle > 0)
+ LoggerD("isBodyDownloaded : " << email->isBodyDownloaded());
+ }else
{
- event->setHandle(handle); //set handle
- }
+ event->switchToManualAnswer(); //switch to manual answer;
+ int handle = email->downloadBody();
+ LoggerD("Load Message Body handle : " << handle);
+ if (event->opId && event->m_messagingService)
+ {
+ event->m_messagingService->setHandleToOpId(event->opId, handle);
+ }
+ if (handle > 0)
+ {
+ event->setHandle(handle); //set handle
+ }
+ }
}
}
else {
// release old data
if (m_messageData) {
// release platform message if it was created previously
- msg_release_struct(&m_messageData);
- m_messageData = NULL;
+ msg_release_struct(&m_messageData);
+ m_messageData = NULL;
}
msg_struct_t sendOpt = NULL;
msg_error_t err = MSG_SUCCESS;
Try
- {
+ {
//prepare for sending sms/mms
- update();
+ update();
LoggerD("trying to send sms");
if (!getCellularOn())
else
{
err = CallbackMgrSingleton::Instance().registerAndSend(msg_sms_send_message, m_messageData, this);
- }
+ }
if (err != MSG_SUCCESS)
- {
+ {
LoggerE("Sending Message (submit request) failed!!! err=" << err);
setMessageStatus(MESSAGE_STATUS_FAILED);
- Throw(WrtDeviceApis::Commons::PlatformException);
- }
+ Throw(WrtDeviceApis::Commons::PlatformException);
+ }
setMessageStatus(MESSAGE_STATUS_SENDING);
LoggerE("send Error");
EventMessagingServicePtr event = getMessagingServiceEvent();
if(err == MSG_ERR_TRANSPORT_ERROR)
- {
+ {
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::PlatformWrongStateException);
}
else
- {
+ {
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
}
requestReceiver->WrtDeviceApis::Commons::EventRequestReceiver< EventMessagingService>::ManualAnswer(event);
void Sms::sendingCallback(msg_struct_t sent_status)
{
- int status = MSG_NETWORK_SEND_FAIL;
- msg_get_int_value(sent_status, MSG_SENT_STATUS_NETWORK_STATUS_INT, &status);
-
+ int status = MSG_NETWORK_SEND_FAIL;
+ msg_get_int_value(sent_status, MSG_SENT_STATUS_NETWORK_STATUS_INT, &status);
+
LoggerD("status : " << status);
if (MSG_NETWORK_SEND_SUCCESS == status) {
} else {
LoggerE("sending failed: " << static_cast<unsigned int>(status));
setSendingStatusFailed();
- setMessageStatus(MESSAGE_STATUS_FAILED);
- }
+ setMessageStatus(MESSAGE_STATUS_FAILED);
+ }
}
void Sms::OnEventReceived(const int&)
*
*
* @file VirtualMessage.cpp
- * @author Pawel Misiak (p.misiak@samsung.com)
* @version 0.1
* @brief
*/
LoggerD("Callback TagInformationCallback.");
if (user_data) {
NFCUtil util;
- std::vector<unsigned char> tagInfo = util.toVector(value, value_size);
+ std::vector<unsigned char> tagInfo = util.toVector(value, (unsigned int)value_size);
(static_cast<NFCTag*>(user_data))->makeTagProperties(key, tagInfo);
return TRUE;
}
LoggerD("message handler :" << message);
unsigned char *rawdata = NULL;
- int size;
+ unsigned int size;
if (nfc_ndef_message_get_rawdata(message, &rawdata, &size) != NFC_ERROR_NONE) {
LoggerE("Can't get record's rawdata");
if (rawdata)
LoggerD("Callback TagTransceiveCallback.");
if (data) {
NFCUtil util;
- std::vector<unsigned char> responseData = util.toVector(buffer, buffer_size) ;
+ std::vector<unsigned char> responseData = util.toVector(buffer, (unsigned int)buffer_size) ;
((NFCTag *)data)->transceiveManualAnswer((int)result, responseData);
} else {
LoggerD("Error! TagTransceiveCallback is Null.");
LoggerD("Callback TargetReceivedCallback.");
if (user_data) {
unsigned char *rawdata = NULL;
- int size;
+ unsigned int size;
if (nfc_ndef_message_get_rawdata(message, &rawdata, &size) != NFC_ERROR_NONE) {
LoggerE("Can't get rawdata of message");
if (rawdata)
namespace DeviceAPI {
namespace NFC {
-std::vector<unsigned char> NFCUtil::toVector(const unsigned char *ch, const int size) {
+std::vector<unsigned char> NFCUtil::toVector(const unsigned char *ch, const unsigned int size) {
std::vector<unsigned char> vec;
if (ch && (size > 0)) {
- int i;
+ unsigned int i;
for (i = 0; i < size; i++)
vec.push_back(ch[i]);
NdefRecordData recordData;
nfc_record_tnf_e tnf;
- unsigned char *typeName, *id, *payload;
- int typeSize, idSize, payloadSize;
+ unsigned char *typeName = NULL, *id = NULL, *payload = NULL;
+ int typeSize = 0, idSize = 0;
+ unsigned int payloadSize = 0;
int result = nfc_ndef_record_get_tnf(recordHandle, &tnf);
throwNFCException(result, "Can't get record's tnf");
LoggerD("payload : " << byteToString(payload, payloadSize));
recordData.properties.tnf = static_cast<short>(tnf);
- recordData.properties.typeName = toVector(typeName, typeSize);
- recordData.properties.id = toVector(id, idSize);
+ recordData.properties.typeName = toVector(typeName, (unsigned int)typeSize);
+ recordData.properties.id = toVector(id, (unsigned int)idSize);
recordData.payload = toVector(payload, payloadSize);
return recordData;
public:
NFCUtil() {}
virtual ~NFCUtil() {}
- std::vector<unsigned char> toVector(const unsigned char *ch, const int size);
+ std::vector<unsigned char> toVector(const unsigned char *ch, const unsigned int size);
unsigned char *toCharPtr(std::vector<unsigned char> vec) ;
char *byteToString(const unsigned char* buffer, const int size);
char *byteToString(std::vector<unsigned char> *buffer);
if (message == NULL)
ThrowMsg(ConversionException, "Invalid NDEF Message");
unsigned char *rawdata = NULL;
- int size = 0;
+ unsigned int size = 0;
int result = nfc_ndef_message_get_rawdata(message, &rawdata, &size);
std::vector<unsigned char> byteData = util.toVector(rawdata, size);
else
{
JSUtil::setProperty(context, object, NOTIFICATION_POSTED_TIME,
- JSValueMakeNull(context), kJSPropertyAttributeReadOnly);
+ JSValueMakeUndefined(context), kJSPropertyAttributeReadOnly);
}
//title
{
LoggerI("Notification Launch Flag True");
notification_set_property(handle, 0);
- if (notification_set_execute_option(handle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data) != SERVICE_ERROR_NONE)
+ if (notification_set_execute_option(handle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data) != NOTIFICATION_ERROR_NONE)
{
LoggerD("can't set notification option");
}
{
LoggerI("Notification Launch Flag True");
notification_set_property(handle, 0);
- if (notification_set_execute_option(handle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data)!= SERVICE_ERROR_NONE)
+ if (notification_set_execute_option(handle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data)!= NOTIFICATION_ERROR_NONE)
{
LoggerI("Can't set Service option");
}