From a6266735d66b5843d8b3001f6c7203df1c817726 Mon Sep 17 00:00:00 2001 From: Dongjin Choi Date: Wed, 22 May 2013 20:06:22 +0900 Subject: [PATCH] Update change log and spec for wrt-plugins-tizen_0.4.33 [model] REDWOOD [binary_type] PDA [customer] OPEN [Issue#] N/A [Problem] Error with gcc 4.7 [Cause] isnan func is ambiguous [Solution] specified the namespace [Issue#] N/A [Problem] plugin loading time [Cause] Symbol visibility [Solution] Rearranged symbol visibility [Issue] TDIS-5524 [Problem] add attachment with sounds path fail [Cause] sounds path is changed [Solution] change sounds path corectly [Issue#] N/A [Problem] package id has been exposed. [Cause] package id has been exposed. [Solution] Don't print. [Issue#] DCM1667 [Problem] request protocl change. [Cause] N/A [Solution] modification [Issue] N/A [Problem] email from address invalid [Cause] get email from address from email data directly [Solution] convert email from address [Issue] N/A [Problem] JSMessage folderId attribute bug [Cause] Convert folderType to string for email [Solution] set email folderId than folderType on email [Issue] N/A [Problem] addDraftMessage then updateMessage attachment bug fix on email [Cause] addDraftMessage then updateMessage attachment bug fix on email [Solution] addDraftMessage then updateMessage attachment bug fix on email [Issue#] N/A [Problem] notificationi TC occur error in the jigtop UnitTC [Cause] accessable notification in the other package. [Solution] inserted package check module. [team] WebAPI [request] N/A [horizontal_expansion] N/A --- packaging/wrt-plugins-tizen.spec | 4 +- src/Common/JSUtil.cpp | 2 +- src/DataControl/DataControlAsyncCallbackManager.h | 10 ++- src/DataControl/JSMappedDataControlConsumer.cpp | 2 + src/DataControl/JSSQLDataControlConsumer.cpp | 4 +- src/DataControl/MappedDataControlConsumer.cpp | 31 +++++++++ src/DataControl/SelectDataObject.cpp | 10 +-- src/DataControl/SqlDataControlConsumer.cpp | 29 +++++++++ src/Messaging/AttachmentFactory.cpp | 4 +- src/Messaging/Email.cpp | 77 ++++++++++++++++++++--- src/Messaging/IMessage.cpp | 12 ++++ src/Messaging/IMessage.h | 11 ++++ src/Messaging/JSMessage.cpp | 27 ++++++-- src/Notification/NotificationManager.cpp | 21 +++++-- src/Push/PushManager.cpp | 2 +- src/SystemSetting/CMakeLists.txt | 2 + src/SystemSetting/plugin_config.cpp | 4 -- src/Systeminfo/CMakeLists.txt | 2 + src/Systeminfo/JSSysteminfo.cpp | 3 +- src/Systeminfo/SysteminfoAsyncCallbackManager.cpp | 9 ++- src/Systeminfo/SysteminfoAsyncCallbackManager.h | 8 +-- src/Systeminfo/SysteminfoListenerManager.cpp | 9 ++- src/Systeminfo/SysteminfoListenerManager.h | 8 ++- src/Systeminfo/plugin_config.cpp | 4 +- 24 files changed, 246 insertions(+), 49 deletions(-) diff --git a/packaging/wrt-plugins-tizen.spec b/packaging/wrt-plugins-tizen.spec index d9810b6..72f2d45 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.32 -Release: 1 +Version: 0.4.33 +Release: 0 Group: Development/Libraries License: Apache License, Version 2.0 Source0: %{name}-%{version}.tar.gz diff --git a/src/Common/JSUtil.cpp b/src/Common/JSUtil.cpp index 1297795..9a637c6 100644 --- a/src/Common/JSUtil.cpp +++ b/src/Common/JSUtil.cpp @@ -119,7 +119,7 @@ double JSUtil::JSValueToDouble(JSContextRef ctx, JSValueRef value){ throw TypeMismatchException("Value is POSITIVE_INFINITY"); if( doublevalue == -std::numeric_limits::infinity() ) throw TypeMismatchException("Value is NEGATIVE_INFINITY"); - if( isnan(doublevalue)){ + if( std::isnan(doublevalue)){ throw TypeMismatchException("Value is not number"); } return doublevalue; diff --git a/src/DataControl/DataControlAsyncCallbackManager.h b/src/DataControl/DataControlAsyncCallbackManager.h index 0ea9e9d..bc81f12 100755 --- a/src/DataControl/DataControlAsyncCallbackManager.h +++ b/src/DataControl/DataControlAsyncCallbackManager.h @@ -29,13 +29,21 @@ class DataControlAsyncCallbackManager : public DeviceAPI::Common::AsyncCallbackM public: DataControlAsyncCallbackManager() { + m_sqlDataControlGC = false; + m_mappedDataControlGC = false; } virtual ~DataControlAsyncCallbackManager() { } - + bool isSQLDataControlGC() { return m_sqlDataControlGC;} + bool isMappedDataControlGC() { return m_mappedDataControlGC;} + void setSQLDataControlGC(bool gc) { m_sqlDataControlGC = gc;} + void setMappedDataControlGC(bool gc) { m_mappedDataControlGC = gc;} friend class DPL::Singleton; +private: + bool m_sqlDataControlGC; + bool m_mappedDataControlGC; }; typedef DPL::Singleton DataControlAsyncCallbackManagerSingleton; diff --git a/src/DataControl/JSMappedDataControlConsumer.cpp b/src/DataControl/JSMappedDataControlConsumer.cpp index b1c72b6..db00b12 100644 --- a/src/DataControl/JSMappedDataControlConsumer.cpp +++ b/src/DataControl/JSMappedDataControlConsumer.cpp @@ -103,10 +103,12 @@ void JSMappedDataControlConsumer::initialize(JSContextRef context, JSObjectRef o void JSMappedDataControlConsumer::finalize(JSObjectRef object) { JSMappedDataControlConsumerPriv *priv = static_cast(JSObjectGetPrivate(object)); + LoggerD("finalize"); if (!priv) { LoggerE("Private object is null"); } delete priv; + priv = NULL; } diff --git a/src/DataControl/JSSQLDataControlConsumer.cpp b/src/DataControl/JSSQLDataControlConsumer.cpp index e7e0cc3..025f911 100644 --- a/src/DataControl/JSSQLDataControlConsumer.cpp +++ b/src/DataControl/JSSQLDataControlConsumer.cpp @@ -103,11 +103,13 @@ void JSSQLDataControlConsumer::initialize(JSContextRef context, JSObjectRef obje void JSSQLDataControlConsumer::finalize(JSObjectRef object) { JSSQLDataControlConsumerPriv *priv = static_cast(JSObjectGetPrivate(object)); + LoggerD("finalize"); + if (!priv) { LoggerE("Private object is null"); } delete priv; - + priv = NULL; } bool JSSQLDataControlConsumer::hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception) diff --git a/src/DataControl/MappedDataControlConsumer.cpp b/src/DataControl/MappedDataControlConsumer.cpp index 935e5eb..233fb9b 100644 --- a/src/DataControl/MappedDataControlConsumer.cpp +++ b/src/DataControl/MappedDataControlConsumer.cpp @@ -26,6 +26,7 @@ #include #include #include +#include "DataControlAsyncCallbackManager.h" namespace DeviceAPI { @@ -112,6 +113,12 @@ static void MappedDataControlGetValueCallback(bundle* b, int request_code, appsv LoggerD("data null, can not send result to JS Layer"); return; } + + if (DataControlAsyncCallbackManagerSingleton::Instance().isMappedDataControlGC()) + { + LoggerD("private object is garbage collected"); + return; + } pendingEvent = (EventGetValuePendingEvent *)data; consumer = (MappedDataControlConsumer*)pendingEvent->getThisObject(); @@ -250,6 +257,13 @@ static void MappedDataControlAddValueCallback(bundle* b, int request_code, appsv return; } + if (DataControlAsyncCallbackManagerSingleton::Instance().isMappedDataControlGC()) + { + LoggerD("private object is garbage collected"); + return; + } + + pendingEvent = (EventAddValuePendingEvent *)data; consumer = (MappedDataControlConsumer*)pendingEvent->getThisObject(); event = pendingEvent->getEvent(); @@ -317,6 +331,13 @@ static void MappedDataControlRemoveValueCallback(bundle* b, int request_code, ap return; } + + if (DataControlAsyncCallbackManagerSingleton::Instance().isMappedDataControlGC()) + { + LoggerD("private object is garbage collected"); + return; + } + pendingEvent = (EventRemoveValuePendingEvent *)data; consumer = (MappedDataControlConsumer*)pendingEvent->getThisObject(); event = pendingEvent->getEvent(); @@ -384,6 +405,12 @@ static void MappedDataControlUpdateValueCallback(bundle* b, int request_code, ap LoggerD("data null, can not send result to JS Layer"); return; } + + if (DataControlAsyncCallbackManagerSingleton::Instance().isMappedDataControlGC()) + { + LoggerD("private object is garbage collected"); + return; + } pendingEvent = (EventUpdateValuePendingEvent *)data; consumer = (MappedDataControlConsumer*)pendingEvent->getThisObject(); @@ -445,17 +472,21 @@ MappedDataControlConsumer::MappedDataControlConsumer(std::string& provId, std::s m_type = type;; m_dataId = dataId; m_providerId = provId; + DataControlAsyncCallbackManagerSingleton::Instance().setMappedDataControlGC(false); } MappedDataControlConsumer::~MappedDataControlConsumer() { LoggerD("Enter"); + DataControlAsyncCallbackManagerSingleton::Instance().setMappedDataControlGC(true); + } DPL::Mutex MappedDataControlConsumer::m_mutex; + std::string MappedDataControlConsumer::getDataId() { return m_dataId; diff --git a/src/DataControl/SelectDataObject.cpp b/src/DataControl/SelectDataObject.cpp index dd10c35..f7e711b 100644 --- a/src/DataControl/SelectDataObject.cpp +++ b/src/DataControl/SelectDataObject.cpp @@ -60,10 +60,10 @@ void SelectDataObject::openResultPath(const std::string& filepath) if (m_istream.is_open()) { - LoggerD("load header"); + //LoggerD("load header"); loadHeader(); - LoggerD("print header"); // debug - printHeader(); +// LoggerD("print header"); // debug +// printHeader(); } else { @@ -133,7 +133,7 @@ void SelectDataObject::OnRequestReceived(const EventGetIndexedRowPtr& event) m_istream.read((char*)&type, sizeof(type)); // skip type m_istream.read((char*)&size, sizeof(int)); // read size - LoggerD(type << " - " << size << " "); +// LoggerD(type << " - " << size << " "); if (memorizedSize < size) { @@ -284,7 +284,7 @@ void SelectDataObject::moveOneRow() size = 0; m_istream.seekg(sizeof(int), std::ios::cur); // skip type m_istream.read((char*)&size, sizeof(int)); // read size - LoggerD(size << " "); +// LoggerD(size << " "); m_istream.seekg(size, std::ios::cur); // skip data } diff --git a/src/DataControl/SqlDataControlConsumer.cpp b/src/DataControl/SqlDataControlConsumer.cpp index e5e9783..6ed1e69 100644 --- a/src/DataControl/SqlDataControlConsumer.cpp +++ b/src/DataControl/SqlDataControlConsumer.cpp @@ -32,6 +32,7 @@ // To get ppid #include #include +#include "DataControlAsyncCallbackManager.h" namespace DeviceAPI { namespace DataControl { @@ -119,6 +120,12 @@ static void sqldataControlSelectCallback(bundle* b, int request_code, appsvc_res return; } + if (DataControlAsyncCallbackManagerSingleton::Instance().isSQLDataControlGC()) + { + LoggerD("private object is garbage collected"); + return; + } + pendingEvent = (EventSelectPendingEvent *)data; consumer = (SQLDataControlConsumer*)pendingEvent->getThisObject(); event = pendingEvent->getEvent(); @@ -183,6 +190,13 @@ static void sqldataControlInsertCallback(bundle* b, int request_code, appsvc_res return; } + if (DataControlAsyncCallbackManagerSingleton::Instance().isSQLDataControlGC()) + { + LoggerD("private object is garbage collected"); + return; + } + + pendingEvent = (EventInsertPendingEvent *)data; consumer = (SQLDataControlConsumer*)pendingEvent->getThisObject(); event = pendingEvent->getEvent(); @@ -244,6 +258,12 @@ static void sqldataControlDeleteCallback(bundle* b, int request_code, appsvc_res return; } + if (DataControlAsyncCallbackManagerSingleton::Instance().isSQLDataControlGC()) + { + LoggerD("private object is garbage collected"); + return; + } + EventDeletePendingEvent* pendingEvent = NULL; SQLDataControlConsumer *consumer = NULL; EventDeletePtr event; @@ -317,6 +337,13 @@ static void sqldataControlUpdateCallback(bundle* b, int request_code, appsvc_res return; } + if (DataControlAsyncCallbackManagerSingleton::Instance().isSQLDataControlGC()) + { + LoggerD("private object is garbage collected"); + return; + } + + pendingEvent = (EventUpdatePendingEvent *)data; consumer = (SQLDataControlConsumer*)pendingEvent->getThisObject(); event = pendingEvent->getEvent(); @@ -376,11 +403,13 @@ SQLDataControlConsumer::SQLDataControlConsumer(std::string& provId, std::string& m_currentAppId = getCurrentApplicationId(); createResultDir(); + DataControlAsyncCallbackManagerSingleton::Instance().setSQLDataControlGC(false); } SQLDataControlConsumer::~SQLDataControlConsumer() { LoggerD("Enter"); + DataControlAsyncCallbackManagerSingleton::Instance().setSQLDataControlGC(true); } DPL::Mutex SQLDataControlConsumer::m_mutex; diff --git a/src/Messaging/AttachmentFactory.cpp b/src/Messaging/AttachmentFactory.cpp index a258062..6a6662e 100755 --- a/src/Messaging/AttachmentFactory.cpp +++ b/src/Messaging/AttachmentFactory.cpp @@ -31,13 +31,13 @@ using namespace DeviceAPI::Messaging; namespace { const char* PATH_DOWNLOADS = "/opt/usr/media/Downloads"; const char* PATH_DOCUMENTS = "/opt/usr/media/Documents"; -const char* PATH_SOUNDS = "/opt/usr/media/Music"; +const char* PATH_SOUNDS = "/opt/usr/media/Sounds"; const char* PATH_IMAGES = "/opt/usr/media/Images"; const char* PATH_VIDEOS = "/opt/usr/media/Videos"; const char* VPATH_DOWNLOADS = "download"; const char* VPATH_DOCUMENTS = "documents"; -const char* VPATH_SOUNDS = "music"; +const char* VPATH_SOUNDS = "sounds"; const char* VPATH_IMAGES = "images"; const char* VPATH_VIDEOS = "videos"; const char* VPATH_WGT_PACKAGE = "wgt-package"; diff --git a/src/Messaging/Email.cpp b/src/Messaging/Email.cpp index aafa367..fde5680 100644 --- a/src/Messaging/Email.cpp +++ b/src/Messaging/Email.cpp @@ -517,7 +517,7 @@ void Email::readHeader() if (m_mail->full_address_from) { Recipients from; - from.setRecipients(m_mail->full_address_from); + from.setRecipients(EmailUtils::stripAddress(m_mail->full_address_from)); setSourceAddress(from); setSourceAddressValidity(true); //not needed to update in platform } @@ -660,6 +660,7 @@ void Email::readInfo() setConvId(m_mail->thread_id); setPriority( EmailConverter::toMessagePriority( m_mail->priority ) ); setSize(m_mail->mail_size); + setCurrentFolderId(m_mail->mailbox_id); LOG_EXIT } @@ -835,8 +836,8 @@ void Email::updateMessage() updateBody(); updateSubject(); updateRecipients(); - updateFrom(); - updateAttachments(); +// updateFrom(); +// updateAttachments(); updatePriority(); } updateReadStatus(); @@ -859,6 +860,47 @@ void Email::updateMessage() LoggerW("Nothing to update or error. [" << error << "]"); } + if(getCurrentFolder() == DRAFTBOX) + { + + updateAttachments(); + + email_mail_data_t* result = NULL; + + error = email_get_mail_data(m_mail->mail_id, &result); + if (EMAIL_ERROR_NONE != error) { + LoggerW("email_get_mail_data error. [" << error << "]"); + } + else + { + if(result->body_download_status != 1) + { + LoggerD("result->body_download_status " << result->body_download_status); + int mail_id_count = 1; + int mail_id_array[1]; + email_mail_attribute_type attribute_type; + email_mail_attribute_value_t attribute_value; + + mail_id_array[0] = result->mail_id; + LoggerD("result->mail_id " << result->mail_id); + attribute_type = EMAIL_MAIL_ATTRIBUTE_BODY_DOWNLOAD_STATUS; + attribute_value.integer_type_value = 1; + + error = email_update_mail_attribute(m_accountId, mail_id_array, 1, EMAIL_MAIL_ATTRIBUTE_BODY_DOWNLOAD_STATUS, attribute_value); + if (EMAIL_ERROR_NONE != error) { + LoggerW("email_update_mail_attribute error. [" << error << "]"); + } + } + } + if(result != NULL) + { + error = email_free_mail_data(&result, 1); + if (EMAIL_ERROR_NONE != error) { + LoggerW("email_free_mail_data error. [" << error << "]"); + } + } + } + if(meeting_req) { email_free_meeting_request(&meeting_req, 1); } @@ -952,6 +994,14 @@ void Email::createSendMessage() m_mail->file_path_html = strdup(result->file_path_html); } + if (result->full_address_from) { + Recipients from; + from.setRecipients(EmailUtils::stripAddress(result->full_address_from)); + setSourceAddress(from); + setSourceAddressValidity(true); //not needed to update in platform + } + setCurrentFolderId(result->mailbox_id); + error = email_free_mail_data(&result, 1); if (EMAIL_ERROR_NONE != error) { ThrowMsg(WrtDeviceApis::Commons::PlatformException, @@ -1002,6 +1052,7 @@ void Email::addMessageToDraft() error = email_add_mail(m_mail.Get(), NULL, 0, NULL, 0); if (EMAIL_ERROR_NONE != error) { + LoggerE("Couldn't add message to mailbox"); ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Couldn't add message to mailbox. [" << error << "]"); } @@ -1030,7 +1081,6 @@ void Email::loadDraftMessage() LOG_ENTER email_mail_data_t* result = NULL; - std::string from; int error = email_get_mail_data(m_mail->mail_id, &result); if (EMAIL_ERROR_NONE != error) { @@ -1067,10 +1117,16 @@ void Email::loadDraftMessage() setConvId(result->thread_id); setPriority( EmailConverter::toMessagePriority( result->priority ) ); setSize(result->mail_size); + setCurrentFolderId(result->mailbox_id); if (m_mail->file_path_plain) + { free(m_mail->file_path_plain); - m_mail->file_path_plain = strdup(result->file_path_plain); + } + if(result->file_path_plain) + { + m_mail->file_path_plain = strdup(result->file_path_plain); + } if ( m_mail->file_path_html) { @@ -1081,8 +1137,15 @@ void Email::loadDraftMessage() { m_mail->file_path_html = strdup(result->file_path_html); } - from = EmailUtils::stripAddress(result->full_address_from); - setFrom(from); + + if (result->full_address_from) { + Recipients from; + from.setRecipients(EmailUtils::stripAddress(result->full_address_from)); + setSourceAddress(from); + setSourceAddressValidity(true); //not needed to update in platform + setFrom(result->full_address_from); + } + m_mail->save_status = result->save_status; error = email_free_mail_data(&result, 1); if (EMAIL_ERROR_NONE != error) { diff --git a/src/Messaging/IMessage.cpp b/src/Messaging/IMessage.cpp index 3d7a495..d989c56 100755 --- a/src/Messaging/IMessage.cpp +++ b/src/Messaging/IMessage.cpp @@ -37,6 +37,7 @@ IMessage::IMessage(const MessageType msgType, m_isReadChangeStatus(false), m_validisReadChangeStatus(true), m_folder(DRAFTBOX), + m_folderId(-1), m_requestReceiver(NULL), m_sendMessageEvent(NULL) { @@ -188,6 +189,17 @@ void IMessage::setCurrentUserFolder(const std::string& arg) m_userFolderName = arg; } +int IMessage::getCurrentFolderId() const +{ + return m_folderId; +} + +void IMessage::setCurrentFolderId(int folderId) +{ + m_folderId = folderId; +} + + bool IMessage::validatePhoneNumber(std::string& number) { LoggerD("testing number=" << number); diff --git a/src/Messaging/IMessage.h b/src/Messaging/IMessage.h index 98bd8ad..d9eb267 100755 --- a/src/Messaging/IMessage.h +++ b/src/Messaging/IMessage.h @@ -121,6 +121,12 @@ class IMessage : FolderType m_folder; /** + * Message current folder id for email + */ + int m_folderId; + + + /** * User folder name */ std::string m_userFolderName; @@ -322,6 +328,11 @@ class IMessage : MessageStatus getMessageStatus() const; + void setCurrentFolderId(int folderId); + + int getCurrentFolderId() const; + + /** * Remove message * @throw PlatformException Thrown when remove message fail diff --git a/src/Messaging/JSMessage.cpp b/src/Messaging/JSMessage.cpp index 45f442d..0b4f9f1 100644 --- a/src/Messaging/JSMessage.cpp +++ b/src/Messaging/JSMessage.cpp @@ -1119,19 +1119,36 @@ JSValueRef JSMessage::getFolder(JSContextRef context, try { ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context); IMessagePtr msg = converter->toIMessage(object); - FolderType folder = msg->getCurrentFolder(); + MessageType msgType = msg->getMessageType(); int tmpInt = msg->getMessageStatus(); - LoggerE("folder : " << folder); - LoggerE("msg->getMessageStatus() : " << tmpInt); - if(tmpInt == MESSAGE_STATUS_CREATED) { return JSValueMakeNull(context); } - tmpInt = (int)folder; + + switch (msgType) { + case SMS: + case MMS: + { + FolderType folder = msg->getCurrentFolder(); + tmpInt = (int)folder; + break; + } + case EMAIL: + { + tmpInt = msg->getCurrentFolderId(); + break; + } + default: + LoggerE("message not support subject"); + /* unsupported type -> type is integral message attribute + * so error at this place means internal api error*/ + throw DeviceAPI::Common::NotSupportedException("Unsupported message type"); + break; + } return converter->toJSValueRef(converter->convertIntToString(tmpInt)); } catch(BasePlatformException &bex) { diff --git a/src/Notification/NotificationManager.cpp b/src/Notification/NotificationManager.cpp index 2b77c1a..c822a2b 100755 --- a/src/Notification/NotificationManager.cpp +++ b/src/Notification/NotificationManager.cpp @@ -399,7 +399,7 @@ void NotificationManager::remove(std::string id) while ( noti_list_iter != NULL) { noti = notification_list_get_data(noti_list_iter); - if (noti != NULL /* && notification_package_equal(noti)*/) + if (noti != NULL && notification_package_equal(noti)) { int noti_priv = -1; notification_get_id(noti, NULL, ¬i_priv); @@ -455,8 +455,22 @@ StatusNotification* NotificationManager::get(std::string id) } stream >> privID; - StatusNotification* notification = new StatusNotification(privID); - return notification; + LoggerI("priv ID : " << privID); + + notification_h notification = notification_load( NULL, privID); //load notification. + LoggerI(" notification " << notification); + + if (notification != NULL && notification_package_equal(notification)) + { + StatusNotification* noti = new StatusNotification(notification); + return noti; + } + else + { + throw NotFoundException("It is not notification ID or removed notification"); + } + + return NULL; } std::vector NotificationManager::getAll() { @@ -490,7 +504,6 @@ std::vector NotificationManager::getAll() LoggerD("loaded notification id = " << noti_priv); data.push_back(notification); - } noti_list_iter = notification_list_get_next(noti_list_iter); diff --git a/src/Push/PushManager.cpp b/src/Push/PushManager.cpp index 92e4bbf..344cf8b 100644 --- a/src/Push/PushManager.cpp +++ b/src/Push/PushManager.cpp @@ -330,7 +330,7 @@ void PushManager::setAppId(std::string appId) { ret = app_info_get_package(handle, &_pkg_id); if ((ret != APP_MANAGER_ERROR_NONE) || (_pkg_id == NULL)) { - LOGW("Fail to get pkg_id by %s", appId.c_str()); + LOGW("Fail to get pkg id"); } ret = app_info_destroy(handle); diff --git a/src/SystemSetting/CMakeLists.txt b/src/SystemSetting/CMakeLists.txt index cc8ed19..fad59ee 100644 --- a/src/SystemSetting/CMakeLists.txt +++ b/src/SystemSetting/CMakeLists.txt @@ -3,6 +3,8 @@ SET(DESTINATION_NAME ${systemsetting_dest}) PKG_CHECK_MODULES(platform_pkgs_systemsetting REQUIRED capi-system-system-settings) +ADD_DEFINITIONS("-fvisibility=hidden") + INCLUDE_DIRECTORIES( ${INCLUDE_COMMON} ${TOP}/Filesystem diff --git a/src/SystemSetting/plugin_config.cpp b/src/SystemSetting/plugin_config.cpp index d2e3b62..b84fd6a 100755 --- a/src/SystemSetting/plugin_config.cpp +++ b/src/SystemSetting/plugin_config.cpp @@ -42,12 +42,8 @@ static WrtDeviceApis::Commons::FunctionMapping createSystemSettingFunctions(); static WrtDeviceApis::Commons::FunctionMapping SystemSettingFunctions = createSystemSettingFunctions(); -#pragma GCC visibility push(default) - DEFINE_FUNCTION_GETTER(SystemSetting, SystemSettingFunctions); -#pragma GCC visibility pop - static WrtDeviceApis::Commons::FunctionMapping createSystemSettingFunctions() { using namespace WrtDeviceApis::Commons; diff --git a/src/Systeminfo/CMakeLists.txt b/src/Systeminfo/CMakeLists.txt index fdf043e..838913e 100755 --- a/src/Systeminfo/CMakeLists.txt +++ b/src/Systeminfo/CMakeLists.txt @@ -11,6 +11,8 @@ PKG_CHECK_MODULES(platform_pkgs_systeminfo REQUIRED sensor ) +ADD_DEFINITIONS("-fvisibility=hidden") + INCLUDE_DIRECTORIES( ${INCLUDE_COMMON} ${platform_pkgs_systeminfo_INCLUDE_DIRS} diff --git a/src/Systeminfo/JSSysteminfo.cpp b/src/Systeminfo/JSSysteminfo.cpp index ca70e74..ecada1d 100755 --- a/src/Systeminfo/JSSysteminfo.cpp +++ b/src/Systeminfo/JSSysteminfo.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "SysteminfoListener.h" #include "SysteminfoAsyncCallbackManager.h" #include "SysteminfoListenerManager.h" @@ -69,7 +70,7 @@ JSStaticFunction JSSysteminfo::m_function[] = { { 0, 0, 0 } }; -const JSClassRef JSSysteminfo::getClassRef() +const JSClassRef DLL_EXPORT JSSysteminfo::getClassRef() { if (!m_jsClassRef) { m_jsClassRef = JSClassCreate(&m_classInfo); diff --git a/src/Systeminfo/SysteminfoAsyncCallbackManager.cpp b/src/Systeminfo/SysteminfoAsyncCallbackManager.cpp index 593259f..6fa6b26 100755 --- a/src/Systeminfo/SysteminfoAsyncCallbackManager.cpp +++ b/src/Systeminfo/SysteminfoAsyncCallbackManager.cpp @@ -16,8 +16,11 @@ // #include "SysteminfoAsyncCallbackManager.h" -#include -using namespace DPL; +namespace DeviceAPI { +namespace Systeminfo { -IMPLEMENT_SINGLETON(DeviceAPI::Systeminfo::SysteminfoAsyncCallbackManager) +SINGLETON_IMPLEMENTATION(SysteminfoAsyncCallbackManager) + +} // Systeminfo +} // DeviceAPI diff --git a/src/Systeminfo/SysteminfoAsyncCallbackManager.h b/src/Systeminfo/SysteminfoAsyncCallbackManager.h index 9a3b75c..2393cc7 100755 --- a/src/Systeminfo/SysteminfoAsyncCallbackManager.h +++ b/src/Systeminfo/SysteminfoAsyncCallbackManager.h @@ -18,7 +18,6 @@ #ifndef _TIZEN_SYSTEMINFO_ASYNC_CALLBACK_MANAGER_H_ #define _TIZEN_SYSTEMINFO_ASYNC_CALLBACK_MANAGER_H_ -#include #include namespace DeviceAPI { @@ -26,19 +25,20 @@ namespace Systeminfo { class SysteminfoAsyncCallbackManager : public DeviceAPI::Common::AsyncCallbackManager { -public: +private: SysteminfoAsyncCallbackManager() { } +public: virtual ~SysteminfoAsyncCallbackManager() { } - friend class DPL::Singleton; + friend class SysteminfoAsyncCallbackManagerSingleton; }; -typedef DPL::Singleton SysteminfoAsyncCallbackManagerSingleton; +SINGLETON_DEFINITION(SysteminfoAsyncCallbackManager) } } diff --git a/src/Systeminfo/SysteminfoListenerManager.cpp b/src/Systeminfo/SysteminfoListenerManager.cpp index d8489bd..54cac75 100755 --- a/src/Systeminfo/SysteminfoListenerManager.cpp +++ b/src/Systeminfo/SysteminfoListenerManager.cpp @@ -16,8 +16,11 @@ // #include "SysteminfoListenerManager.h" -#include -using namespace DPL; +namespace DeviceAPI { +namespace Systeminfo { -IMPLEMENT_SINGLETON(DeviceAPI::Systeminfo::SysteminfoListenerManager) +SINGLETON_IMPLEMENTATION(SysteminfoListenerManager) + +} // Systeminfo +} // DeviceAPI diff --git a/src/Systeminfo/SysteminfoListenerManager.h b/src/Systeminfo/SysteminfoListenerManager.h index 1051f70..7807ba2 100644 --- a/src/Systeminfo/SysteminfoListenerManager.h +++ b/src/Systeminfo/SysteminfoListenerManager.h @@ -21,7 +21,6 @@ #include #include #include -#include #include #include "JSSysteminfo.h" #include @@ -31,16 +30,19 @@ namespace Systeminfo { class SysteminfoListenerManager : public DeviceAPI::Common::IListenerController { -public: +private: SysteminfoListenerManager() { } +public: virtual ~SysteminfoListenerManager() { } + + friend class SysteminfoListenerManagerSingleton; }; -typedef DPL::Singleton SysteminfoListenerManagerSingleton; +SINGLETON_DEFINITION(SysteminfoListenerManager) class SysteminfoListenerCanceller : public DeviceAPI::Common::IListenerItem { diff --git a/src/Systeminfo/plugin_config.cpp b/src/Systeminfo/plugin_config.cpp index a705d8b..a444bf8 100755 --- a/src/Systeminfo/plugin_config.cpp +++ b/src/Systeminfo/plugin_config.cpp @@ -32,6 +32,8 @@ namespace DeviceAPI { namespace Systeminfo { +#pragma GCC visibility push(default) + const char* SYSTEMINFO_FUNCTION_API_GET_CAPABILITIES = "getCapabilities"; const char* SYSTEMINFO_FUNCTION_API_GET_PROPERTY_PARTNER_VALUE = "getPropertyPartnerValue"; const char* SYSTEMINFO_FUNCTION_API_GET_PROPERTY_SIM_VALUE = "getPropertySimValue"; @@ -41,8 +43,6 @@ static WrtDeviceApis::Commons::FunctionMapping createSysteminfoFunctions(); static WrtDeviceApis::Commons::FunctionMapping SysteminfoFunctions = createSysteminfoFunctions(); -#pragma GCC visibility push(default) - DEFINE_FUNCTION_GETTER(Systeminfo, SysteminfoFunctions); #pragma GCC visibility pop -- 2.7.4