From c9cfe03fff7a6858f5abdb5e896087e0e37591fa Mon Sep 17 00:00:00 2001 From: Dongjin Choi Date: Tue, 4 Jun 2013 18:48:59 +0900 Subject: [PATCH] Update change log and spec for wrt-plugins-tizen_0.4.39 [model] REDWOOD [binary_type] PDA [customer] OPEN [Issue#] N/A [Problem] tizen log is deprecated. [Cause] N/A [Solution] removed tizen.log code from Notification.js [Systeminfo] Change code about get 'imei' attribute value [Issue] N/A [Problem] queryGenerator bug fix [Cause] check MAIN TYPE for conversation type search [Solution] check conversation count check for type [Issue] N/A [Problem] Mms service support check [Cause] Mms service support check [Solution] Mms service support check [Issue] N/A [Problem] Goto replaced with Throw in MMS [Cause] Goto is not used in C++ because exceptions were introduced to handle errors. [Solution] Goto replaced with Throw in MMS [Issue] N/A [Problem] Can't print privacy information. [Cause] Platfrom policy [Solution] Provides Secure Log [Systeminfo] Update devicecapabitiles getter code [Issue#] N/A [Problem] Not necessary DPL using declarations. [Cause] N/A [Solution] Refactoring applied. [Issue] N/A [Problem] email conversation listener bug fix [Cause] email conversation listener bug fix [Solution] email conversation listener bug fix [team] WebAPI [request] N/A [horizontal_expansion] N/A UnitTest passwd in 2.1.1 RC2 R8 --- packaging/wrt-plugins-tizen.spec | 2 +- src/Application/ApplicationManager.cpp | 2 +- src/Callhistory/CallHistory.cpp | 2 +- .../CallHistoryAsyncCallbackManager.cpp | 2 +- src/Callhistory/CallHistoryEntry.cpp | 2 +- src/Callhistory/CallHistoryListenerManager.cpp | 2 +- src/Callhistory/JSCallHistory.cpp | 8 +- src/Common/Logger.h | 20 ++- src/Common/TimeTracer/TimeTracer.c | 6 +- src/Contact/ContactQueue.cpp | 2 +- src/Content/AudioLyricsUtil.cpp | 2 +- src/Content/ContentAsyncCallbackManager.cpp | 2 +- .../DataControlAsyncCallbackManager.cpp | 2 +- src/MessagePort/MessagePortListenerManager.cpp | 2 +- src/Messaging/CMakeLists.txt | 2 +- src/Messaging/ConversationQueryGenerator.cpp | 20 ++- src/Messaging/Messaging.cpp | 12 +- src/Messaging/MessagingServiceManager.cpp | 19 ++ src/Messaging/Mms.cpp | 20 +-- src/NFC/JSNFCAdapter.cpp | 16 +- src/NFC/JSNFCManager.cpp | 2 +- src/NFC/JSNFCTag.cpp | 8 +- src/NFC/JSNFCTarget.cpp | 10 +- src/NFC/NFCAdapter.cpp | 2 +- src/NFC/NFCAsyncCallbackManager.cpp | 2 +- src/NFC/NFCDefaultAdapter.cpp | 2 +- src/NFC/NFCListenerManager.cpp | 2 +- .../JSNetworkBearerSelection.cpp | 4 +- .../NetworkBearerSelection.cpp | 2 +- src/Notification/StatusNotification.h | 8 +- src/SecureElement/JSSEChannel.cpp | 4 +- src/SecureElement/JSSEReader.cpp | 4 +- src/SecureElement/JSSEService.cpp | 10 +- src/SecureElement/JSSESession.cpp | 6 +- src/SecureElement/SEAsyncCallbackManager.cpp | 2 +- src/SecureElement/SEListenerManager.cpp | 2 +- src/SystemSetting/JSSystemSetting.cpp | 6 +- src/SystemSetting/SystemSetting.cpp | 2 +- .../SystemSettingAsyncCallbackManager.cpp | 2 +- src/Systeminfo/CMakeLists.txt | 2 + src/Systeminfo/JSCellularNetworkInfo.cpp | 25 ++- src/Systeminfo/JSDeviceCapabilitiesInfo.cpp | 193 ++++++++++++++++++++- src/Systeminfo/JSDeviceCapabilitiesInfo.h | 3 + src/Systeminfo/JSSysteminfo.cpp | 6 +- src/Systeminfo/Systeminfo.cpp | 2 +- src/TimeUtil/JSTimeDuration.cpp | 2 +- src/TimeUtil/JSTimeUtil.cpp | 2 +- 47 files changed, 352 insertions(+), 108 deletions(-) diff --git a/packaging/wrt-plugins-tizen.spec b/packaging/wrt-plugins-tizen.spec index 968efa0..be71937 100755 --- a/packaging/wrt-plugins-tizen.spec +++ b/packaging/wrt-plugins-tizen.spec @@ -1,6 +1,6 @@ Name: wrt-plugins-tizen Summary: JavaScript plugins for WebRuntime -Version: 0.4.38 +Version: 0.4.39 Release: 0 Group: Development/Libraries License: Apache License, Version 2.0 diff --git a/src/Application/ApplicationManager.cpp b/src/Application/ApplicationManager.cpp index cd62762..3c06851 100644 --- a/src/Application/ApplicationManager.cpp +++ b/src/Application/ApplicationManager.cpp @@ -57,7 +57,7 @@ namespace DeviceAPI { namespace Application { -using namespace DPL; + using namespace WrtDeviceApis; using namespace WrtDeviceApis::Commons; diff --git a/src/Callhistory/CallHistory.cpp b/src/Callhistory/CallHistory.cpp index cc6e8ce..1f7a309 100755 --- a/src/Callhistory/CallHistory.cpp +++ b/src/Callhistory/CallHistory.cpp @@ -37,7 +37,7 @@ using namespace DeviceAPI::Tizen; using namespace WrtDeviceApis; using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; -using namespace DPL; + namespace DeviceAPI { namespace CallHistory { diff --git a/src/Callhistory/CallHistoryAsyncCallbackManager.cpp b/src/Callhistory/CallHistoryAsyncCallbackManager.cpp index 244c58d..01cb59b 100755 --- a/src/Callhistory/CallHistoryAsyncCallbackManager.cpp +++ b/src/Callhistory/CallHistoryAsyncCallbackManager.cpp @@ -18,7 +18,7 @@ #include "CallHistoryAsyncCallbackManager.h" #include -using namespace DPL; + IMPLEMENT_SINGLETON(DeviceAPI::CallHistory::CallHistoryAsyncCallbackManager) diff --git a/src/Callhistory/CallHistoryEntry.cpp b/src/Callhistory/CallHistoryEntry.cpp index 7af2e12..6988806 100644 --- a/src/Callhistory/CallHistoryEntry.cpp +++ b/src/Callhistory/CallHistoryEntry.cpp @@ -24,7 +24,7 @@ using namespace DeviceAPI::Tizen; using namespace WrtDeviceApis; using namespace WrtDeviceApis::Commons; -using namespace DPL; + namespace DeviceAPI { namespace CallHistory { diff --git a/src/Callhistory/CallHistoryListenerManager.cpp b/src/Callhistory/CallHistoryListenerManager.cpp index 0922c13..437fbde 100755 --- a/src/Callhistory/CallHistoryListenerManager.cpp +++ b/src/Callhistory/CallHistoryListenerManager.cpp @@ -18,7 +18,7 @@ #include "CallHistoryListenerManager.h" #include -using namespace DPL; + IMPLEMENT_SINGLETON(DeviceAPI::CallHistory::CallHistoryListenerManager) diff --git a/src/Callhistory/JSCallHistory.cpp b/src/Callhistory/JSCallHistory.cpp index 11e4240..ee4a63c 100755 --- a/src/Callhistory/JSCallHistory.cpp +++ b/src/Callhistory/JSCallHistory.cpp @@ -47,7 +47,7 @@ using namespace std; -using namespace DPL; + using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; using namespace DeviceAPI::Tizen; @@ -196,7 +196,7 @@ JSValueRef JSCallHistory::find(JSContextRef context, JSObjectRef object, JSObjec EventFindCallHistoryPtr event(new EventFindCallHistory()); ICallHistoryPtr callHistory(priv->getObject()); - event->setPrivateData(StaticPointerCast (cbm)); + event->setPrivateData(DPL::StaticPointerCast (cbm)); event->setForAsynchronousCall(&ResponseDispatcher::getInstance()); if (argumentCount >= 3) { @@ -345,7 +345,7 @@ JSValueRef JSCallHistory::removeBatch(JSContextRef context, JSObjectRef object, EventRemoveBatchPtr event(new EventRemoveBatch()); ICallHistoryPtr callHistory(priv->getObject()); - event->setPrivateData(StaticPointerCast (cbm)); + event->setPrivateData(DPL::StaticPointerCast (cbm)); event->setForAsynchronousCall(&ResponseDispatcher::getInstance()); CallHistoryEntryList entryList; @@ -415,7 +415,7 @@ JSValueRef JSCallHistory::removeAll(JSContextRef context, JSObjectRef object, JS EventRemoveAllPtr event(new EventRemoveAll()); ICallHistoryPtr callHistory(priv->getObject()); - event->setPrivateData(StaticPointerCast (cbm)); + event->setPrivateData(DPL::StaticPointerCast (cbm)); event->setForAsynchronousCall(&ResponseDispatcher::getInstance()); callHistory->removeAll(event); CallHistoryAsyncCallbackManagerSingleton::Instance().registerCallbackManager(cbm, gContext); diff --git a/src/Common/Logger.h b/src/Common/Logger.h index c3a3268..38eb99e 100644 --- a/src/Common/Logger.h +++ b/src/Common/Logger.h @@ -27,8 +27,9 @@ #define _LOGGER(prio, fmt, args...) \ do { \ std::ostringstream platformLog; \ + platformLog << "%s: %s(%d) > "; \ platformLog << fmt; \ - print_log(prio, LOG_TAG, "%s: %s(%d) > %s", __MODULE__, __func__, __LINE__, platformLog.str().c_str(), ##args); \ + print_log(prio, LOG_TAG, platformLog.str().c_str(), __MODULE__, __func__, __LINE__, ##args); \ } while(0) #define LoggerD(fmt, args...) _LOGGER(DLOG_DEBUG, fmt, ##args) @@ -36,4 +37,21 @@ #define LoggerW(fmt, args...) _LOGGER(DLOG_WARN, fmt, ##args) #define LoggerE(fmt, args...) _LOGGER(DLOG_ERROR, fmt, ##args) +#ifdef _SECURE_LOG +#define _SLOGGER(prio, fmt, args...) \ + do { \ + std::ostringstream platformLog; \ + platformLog << "%s: %s(%d) > [SECURE_LOG] "; \ + platformLog << fmt; \ + print_log(prio, LOG_TAG, platformLog.str().c_str(), __MODULE__, __func__, __LINE__, ##args); \ + } while(0) +#else +#define _SLOGGER(prio,fmt,args....) (0) +#endif + + +#define SLoggerD(fmt, args...) _SLOGGER(DLOG_DEBUG, fmt, ##args) +#define SLoggerI(fmt, args...) _SLOGGER(DLOG_INFO, fmt, ##args) +#define SLoggerE(fmt, args...) _SLOGGER(DLOG_ERROR, fmt, ##args) + #endif // __TIZEN_COMMON_LOGGER_H__ diff --git a/src/Common/TimeTracer/TimeTracer.c b/src/Common/TimeTracer/TimeTracer.c index 5d1d0d7..62432d7 100644 --- a/src/Common/TimeTracer/TimeTracer.c +++ b/src/Common/TimeTracer/TimeTracer.c @@ -363,10 +363,8 @@ void time_tracer_export_report(int direction, char* name) g_items[i]->last_timestamp - g_first_time, //end timestamp g_items[i]->mismatch_count ); // # of mismatch (begin - end mismatch) -#if 0 - LOGE("[%%3d] %%-%ds |\tTotal:%%ld,\tCnt:%%ld,\tAvg:%%ld,\tMin:%%ld,\tMax:%%ld,\tStart:%%lu,\tEnd:%%lu,\tMismatch:%%ld", - i,g_items[i]->name, g_items[i]->total_elapsed_time, g_items[i]->invoke_count, (g_items[i]->total_elapsed_time == 0)?0:(int)(g_items[i]->total_elapsed_time / g_items[i]->invoke_count), g_items[i]->min_elapsed_time, g_items[i]->max_elapsed_time, g_items[i]->first_timestamp - g_first_time, g_items[i]->last_timestamp - g_first_time, g_items[i]->mismatch_count ); -#endif + print_log(DLOG_ERROR, LOG_TAG, format,i,g_items[i]->name, g_items[i]->total_elapsed_time, g_items[i]->invoke_count, (g_items[i]->total_elapsed_time == 0)?0:(int)(g_items[i]->total_elapsed_time / g_items[i]->invoke_count), g_items[i]->min_elapsed_time, g_items[i]->max_elapsed_time, g_items[i]->first_timestamp - g_first_time, g_items[i]->last_timestamp - g_first_time, g_items[i]->mismatch_count ); + } fprintf(fp, "TIME TRACER REPORT [END] ============================\n"); LOGE("TIME TRACER REPORT [END] ============================"); diff --git a/src/Contact/ContactQueue.cpp b/src/Contact/ContactQueue.cpp index d274546..04f00a9 100755 --- a/src/Contact/ContactQueue.cpp +++ b/src/Contact/ContactQueue.cpp @@ -19,7 +19,7 @@ #include #include -using namespace DPL; + IMPLEMENT_SINGLETON(DeviceAPI::Contact::ContactQueueManager) diff --git a/src/Content/AudioLyricsUtil.cpp b/src/Content/AudioLyricsUtil.cpp index d6292ca..f46df7b 100755 --- a/src/Content/AudioLyricsUtil.cpp +++ b/src/Content/AudioLyricsUtil.cpp @@ -20,7 +20,7 @@ #include #include -using namespace DPL; + IMPLEMENT_SINGLETON(DeviceAPI::Content::MediaLyricsUtil) diff --git a/src/Content/ContentAsyncCallbackManager.cpp b/src/Content/ContentAsyncCallbackManager.cpp index f7124d6..fcb37eb 100755 --- a/src/Content/ContentAsyncCallbackManager.cpp +++ b/src/Content/ContentAsyncCallbackManager.cpp @@ -18,7 +18,7 @@ #include "ContentAsyncCallbackManager.h" #include -using namespace DPL; + IMPLEMENT_SINGLETON(DeviceAPI::Content::MediaContentAsyncCallbackManager) diff --git a/src/DataControl/DataControlAsyncCallbackManager.cpp b/src/DataControl/DataControlAsyncCallbackManager.cpp index 8a56187..f31172c 100755 --- a/src/DataControl/DataControlAsyncCallbackManager.cpp +++ b/src/DataControl/DataControlAsyncCallbackManager.cpp @@ -19,6 +19,6 @@ #include "DataControlAsyncCallbackManager.h" #include -using namespace DPL; + IMPLEMENT_SINGLETON(DeviceAPI::DataControl::DataControlAsyncCallbackManager) diff --git a/src/MessagePort/MessagePortListenerManager.cpp b/src/MessagePort/MessagePortListenerManager.cpp index 3df78f1..9e58529 100644 --- a/src/MessagePort/MessagePortListenerManager.cpp +++ b/src/MessagePort/MessagePortListenerManager.cpp @@ -25,7 +25,7 @@ #include "MessagePortListenerManager.h" #include -using namespace DPL; + IMPLEMENT_SINGLETON(DeviceAPI::MessagePort::MessagePortListenerManager) diff --git a/src/Messaging/CMakeLists.txt b/src/Messaging/CMakeLists.txt index b33f480..d3b95a5 100755 --- a/src/Messaging/CMakeLists.txt +++ b/src/Messaging/CMakeLists.txt @@ -2,7 +2,7 @@ SET(TARGET_NAME ${messaging_target}) SET(DESTINATION_NAME ${messaging_dest}) SET(TARGET_IMPL_NAME ${messaging_impl}) -PKG_CHECK_MODULES(platform_pkgs_messaging REQUIRED msg-service email-service dbus-1) +PKG_CHECK_MODULES(platform_pkgs_messaging REQUIRED msg-service email-service dbus-1 capi-system-info) ADD_DEFINITIONS("-fvisibility=hidden") diff --git a/src/Messaging/ConversationQueryGenerator.cpp b/src/Messaging/ConversationQueryGenerator.cpp index 0d11793..a4a1176 100755 --- a/src/Messaging/ConversationQueryGenerator.cpp +++ b/src/Messaging/ConversationQueryGenerator.cpp @@ -25,8 +25,8 @@ namespace DeviceAPI { namespace Messaging { - const std::string ConversationQueryGenerator::QUERY_PREFIX_SMS = "WHERE (B.SMS_CNT > 0 OR B.MMS_CNT > 0) AND A.CONV_ID = B.CONV_ID AND (B.MAIN_TYPE=1) AND ("; - const std::string ConversationQueryGenerator::QUERY_PREFIX_MMS = "WHERE (B.SMS_CNT > 0 OR B.MMS_CNT > 0 ) AND A.CONV_ID = B.CONV_ID AND (B.MAIN_TYPE=2) AND ("; + const std::string ConversationQueryGenerator::QUERY_PREFIX_SMS = "WHERE B.SMS_CNT > 0 AND A.CONV_ID = B.CONV_ID AND ("; + const std::string ConversationQueryGenerator::QUERY_PREFIX_MMS = "WHERE B.MMS_CNT > 0 AND A.CONV_ID = B.CONV_ID AND ("; const std::string ConversationQueryGenerator::QUERY_PREFIX_EMAIL = "WHERE "; const std::string ConversationQueryGenerator::QUERY_SUFFIX_SMS_MMS = ") "; const std::string ConversationQueryGenerator::QUERY_SUFFIX_EMAIL = ""; @@ -57,9 +57,17 @@ namespace DeviceAPI { attributeMap.insert( std::pair( ConversationFilterValidatorFactory::ATTRIBUTE_ID, "A.ADDRESS_ID")); - attributeMap.insert( + if(getMode() == MODE_SMS) + { + attributeMap.insert( + std::pair( + ConversationFilterValidatorFactory::ATTRIBUTE_TYPE, "B.SMS_CNT")); + } + else{ + attributeMap.insert( std::pair( - ConversationFilterValidatorFactory::ATTRIBUTE_TYPE, "B.MAIN_TYPE")); + ConversationFilterValidatorFactory::ATTRIBUTE_TYPE, "B.MMS_CNT")); + } attributeMap.insert( std::pair( ConversationFilterValidatorFactory::ATTRIBUTE_TIMESTAMP, "B.DISPLAY_TIME")); @@ -90,6 +98,10 @@ namespace DeviceAPI { if(attrName.compare(ConversationFilterValidatorFactory::ATTRIBUTE_MESSAGE_COUNT)==0){ retClause = emfAttributeName + "=" + value->toString(); return retClause; + }else if(attrName.compare(ConversationFilterValidatorFactory::ATTRIBUTE_TYPE)==0){ + retClause = emfAttributeName + " > 0"; + LoggerD(">retClause>> " << retClause); + return retClause; }else if(attrName.compare(ConversationFilterValidatorFactory::ATTRIBUTE_PREVIEW)==0){ retClause = emfAttributeName + " LIKE '" + value->toString() + "'"; return retClause; diff --git a/src/Messaging/Messaging.cpp b/src/Messaging/Messaging.cpp index 6478111..6647c6f 100644 --- a/src/Messaging/Messaging.cpp +++ b/src/Messaging/Messaging.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -291,7 +292,7 @@ std::string Messaging::generateFilterSql(const DeviceAPI::Tizen::FilterPtr& filt vector retVal; int tempInt; - int tempPreviousId = -1; + set alreadyCreated; // int l_msgId = 0; MessageType webApiMsgType; @@ -326,11 +327,11 @@ std::string Messaging::generateFilterSql(const DeviceAPI::Tizen::FilterPtr& filt { ThrowMsg(WrtDeviceApis::Commons::UnknownException, "get message id fail"); } - if( tempPreviousId != tempInt) + if(alreadyCreated.find(tempInt) == alreadyCreated.end()) { IMessagePtr msg; msg = MessageFactory::createMessage(webApiMsgType, tempInt); - tempPreviousId = tempInt; + alreadyCreated.insert(tempInt); retVal.push_back(msg); } } //for @@ -390,7 +391,6 @@ std::string Messaging::generateFilterSql(const DeviceAPI::Tizen::FilterPtr& filt LoggerD(">>>"); return retVal; } - vector Messaging::querySmsMmsMessages(const std::string& queryString, const std::string& orderLimitString){ // LOGD("<<< queryString:[%s]", queryString.c_str()); // LOGD("<<< orderLimitString:[%s]", orderLimitString.c_str()); @@ -470,11 +470,11 @@ vector Messaging::queryEmailConversation(const std::string& sq printErrorMessage(errCode); }else{ LoggerD("message found mailListCount:" << mailListCount); - std::map checkUnique; + std::set checkUnique; for(int i=0; i #include +//for mms support +#include +#include + using namespace std; using namespace DPL; +using namespace DeviceAPI::Common; namespace DeviceAPI { namespace Messaging { @@ -88,6 +93,20 @@ void MessagingServiceManager::getMessagingServiceManager(const EventGetMessaging initialize(); } + if( event->getMessagingServiceType() == MMS) + { + bool isSupported = false; + if(system_info_get_value_bool(SYSTEM_INFO_KEY_MMS_SUPPORTED, &isSupported) != SYSTEM_INFO_ERROR_NONE) { + LoggerE("Can't know whether mms is supported or not"); + } + LoggerD("isSupported " << isSupported); + if(isSupported == false) + { + LoggerE("mms is not supported"); + throw DeviceAPI::Common::NotSupportedException("Unsupported message type"); + } + } + EventRequestReceiver::PostRequest(event); LoggerD(">>>"); diff --git a/src/Messaging/Mms.cpp b/src/Messaging/Mms.cpp index 41a3d44..5bc0838 100644 --- a/src/Messaging/Mms.cpp +++ b/src/Messaging/Mms.cpp @@ -1525,7 +1525,7 @@ int Mms::send() { LoggerE("Sending Message (submit request) failed!!! err=" << err); setMessageStatus(MESSAGE_STATUS_FAILED); - goto ERROR; + Throw(WrtDeviceApis::Commons::PlatformException); } setMessageStatus(MESSAGE_STATUS_SENDING); @@ -1534,20 +1534,16 @@ int Mms::send() } Catch(WrtDeviceApis::Commons::PlatformException) { LoggerE("message is not send, manually run callback"); - goto ERROR; + ReqReceiverMessage *requestReceiver = getRequestReceiver(); + if (requestReceiver) { + LoggerE("send Error"); + EventMessagingServicePtr event = getMessagingServiceEvent(); + event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException); + requestReceiver->WrtDeviceApis::Commons::EventRequestReceiver< EventMessagingService>::ManualAnswer(event); + } } return 0; - - ERROR: - ReqReceiverMessage *requestReceiver = getRequestReceiver(); - if (requestReceiver) { - LoggerE("send Error"); - EventMessagingServicePtr event = getMessagingServiceEvent(); - event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException); - requestReceiver->WrtDeviceApis::Commons::EventRequestReceiver< EventMessagingService>::ManualAnswer(event); - } - return 0; } void Mms::sendingCallback(msg_struct_t sent_status) diff --git a/src/NFC/JSNFCAdapter.cpp b/src/NFC/JSNFCAdapter.cpp index e48b746..9e4dd96 100644 --- a/src/NFC/JSNFCAdapter.cpp +++ b/src/NFC/JSNFCAdapter.cpp @@ -44,7 +44,7 @@ #include using namespace std; -using namespace DPL; + using namespace DeviceAPI::Common; using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; @@ -209,13 +209,13 @@ JSValueRef JSNFCAdapter::setTagListener (JSContextRef context, JSObjectRef objec ); EventNFCChangedEmitterPtr emitter(new EventNFCChangedEmitter); emitter->setListener(&NFCStaticController::getInstance()); - emitter->setEventPrivateData(StaticPointerCast(privateData)); + emitter->setEventPrivateData(DPL::StaticPointerCast(privateData)); if (nfcAdapter->setTagListener(emitter, tagFilter) != 0) Throw(WrtDeviceApis::Commons::UnknownException); NFCListenerCancellerPtr canceller = NFCListenerCancellerPtr(new NFCListenerCanceller(global_context, thisObject, static_cast(ID_NFCADAPTER_TAG_LISTENER))); - IListenerItemPtr listenerItem = StaticPointerCast(canceller); + IListenerItemPtr listenerItem = DPL::StaticPointerCast(canceller); NFCListenerManagerSingleton::Instance().registerListener(listenerItem, global_context); return JSValueMakeUndefined(context); @@ -273,13 +273,13 @@ JSValueRef JSNFCAdapter::setPeerListener (JSContextRef context, JSObjectRef obje EventNFCChangedEmitterPtr emitter(new EventNFCChangedEmitter); emitter->setListener(&NFCStaticController::getInstance()); - emitter->setEventPrivateData(StaticPointerCast(privateData)); + emitter->setEventPrivateData(DPL::StaticPointerCast(privateData)); if (nfcAdapter->setPeerListener(emitter) != 0) Throw(WrtDeviceApis::Commons::UnknownException); NFCListenerCancellerPtr canceller = NFCListenerCancellerPtr(new NFCListenerCanceller(global_context, thisObject, static_cast(ID_NFCADAPTER_PEER_LISTENER))); - IListenerItemPtr listenerItem = StaticPointerCast(canceller); + IListenerItemPtr listenerItem = DPL::StaticPointerCast(canceller); NFCListenerManagerSingleton::Instance().registerListener(listenerItem, global_context); return JSValueMakeUndefined(context); @@ -318,7 +318,7 @@ JSValueRef JSNFCAdapter::unsetTagListener(JSContextRef context, JSObjectRef obje nfcAdapter->unsetTagListener(); NFCListenerCancellerPtr canceller = NFCListenerCancellerPtr(new NFCListenerCanceller(privateObject->getContext(), thisObject, static_cast(ID_NFCADAPTER_TAG_LISTENER))); - IListenerItemPtr listenerItem = StaticPointerCast(canceller); + IListenerItemPtr listenerItem = DPL::StaticPointerCast(canceller); NFCListenerManagerSingleton::Instance().unregisterListener(listenerItem); return JSValueMakeUndefined(context); @@ -352,7 +352,7 @@ JSValueRef JSNFCAdapter::unsetPeerListener(JSContextRef context, JSObjectRef obj nfcAdapter->unsetPeerListener(); NFCListenerCancellerPtr canceller = NFCListenerCancellerPtr(new NFCListenerCanceller(privateObject->getContext(), thisObject, static_cast(ID_NFCADAPTER_PEER_LISTENER))); - IListenerItemPtr listenerItem = StaticPointerCast(canceller); + IListenerItemPtr listenerItem = DPL::StaticPointerCast(canceller); NFCListenerManagerSingleton::Instance().unregisterListener(listenerItem); return JSValueMakeUndefined(context); @@ -436,7 +436,7 @@ JSValueRef JSNFCAdapter::setPowered (JSContextRef context, JSObjectRef object, NFCConverter nfcConverter(context); EventNFCChangedSetPoweredPtr event(new EventNFCChangedSetPowered(state)); - event->setPrivateData( StaticPointerCast(callbackManager) ); + event->setPrivateData( DPL::StaticPointerCast(callbackManager) ); event->setForAsynchronousCall(&NFCStaticController::getInstance()); nfcAdapter->setPowered(event); NFCAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, global_context); diff --git a/src/NFC/JSNFCManager.cpp b/src/NFC/JSNFCManager.cpp index 49e3c0e..7869f67 100755 --- a/src/NFC/JSNFCManager.cpp +++ b/src/NFC/JSNFCManager.cpp @@ -32,7 +32,7 @@ #include using namespace std; -using namespace DPL; + using namespace DeviceAPI::Common; using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; diff --git a/src/NFC/JSNFCTag.cpp b/src/NFC/JSNFCTag.cpp index 7580d7c..571361c 100644 --- a/src/NFC/JSNFCTag.cpp +++ b/src/NFC/JSNFCTag.cpp @@ -40,7 +40,7 @@ using namespace DeviceAPI::Common; using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; -using namespace DPL; + #define TIZEN_NFCTAG_ATTRIBUTENAME "NFCTag" @@ -224,7 +224,7 @@ JSValueRef JSNFCTag::readNDEF(JSContextRef context, callbackManager->setOnError(arguments[1]); EventTagActionReadPtr event(new EventTagActionRead()); - event->setPrivateData( StaticPointerCast(callbackManager) ); + event->setPrivateData( DPL::StaticPointerCast(callbackManager) ); event->setForAsynchronousCall(&NFCResponseDispatcher::getInstance()); nfcTag->readNdef(event); @@ -295,7 +295,7 @@ JSValueRef JSNFCTag::writeNDEF(JSContextRef context, NFCConverter convert(context); void *messageHandle = convert.copiedMessage(ndefMessageObj); event->writeNdef(messageHandle); - event->setPrivateData( StaticPointerCast(callbackManager)); + event->setPrivateData( DPL::StaticPointerCast(callbackManager)); event->setForAsynchronousCall(&NFCResponseDispatcher::getInstance()); nfcTag->writeNdef(event); NFCAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, global_context); @@ -368,7 +368,7 @@ JSValueRef JSNFCTag::transceive(JSContextRef context, if (dataObj) data= convert.toVectorOfUChars(arguments[0]); event->transceive(data); - event->setPrivateData( StaticPointerCast(callbackManager) ); + event->setPrivateData( DPL::StaticPointerCast(callbackManager) ); event->setForAsynchronousCall(&NFCResponseDispatcher::getInstance()); nfcTag->transceive(event); NFCAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, global_context); diff --git a/src/NFC/JSNFCTarget.cpp b/src/NFC/JSNFCTarget.cpp index ac9f58f..0cdb586 100644 --- a/src/NFC/JSNFCTarget.cpp +++ b/src/NFC/JSNFCTarget.cpp @@ -43,7 +43,7 @@ using namespace DeviceAPI::Common; using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; -using namespace DPL; + #define TIZEN_NFCTARGET_ATTRIBUTENAME "NFCTarget" @@ -203,11 +203,11 @@ JSValueRef JSNFCTarget::setReceiveNDEFListener(JSContextRef context, EventTargetActionReceiveEmitterPtr emitter(new EventTargetActionReceiveEmitter); emitter->setListener(&NFCResponseDispatcher::getInstance()); - emitter->setEventPrivateData(StaticPointerCast(callbackManager)); + emitter->setEventPrivateData(DPL::StaticPointerCast(callbackManager)); nfcTarget->setReceiveNDEFListener(emitter); NFCListenerCancellerPtr canceller = NFCListenerCancellerPtr(new NFCListenerCanceller(global_context, thisObject, static_cast(ID_NFCPEER_RECEIVENDEF_LISTENER))); - IListenerItemPtr listenerItem = StaticPointerCast(canceller); + IListenerItemPtr listenerItem = DPL::StaticPointerCast(canceller); NFCListenerManagerSingleton::Instance().registerListener(listenerItem, global_context); return JSValueMakeUndefined(context); @@ -253,7 +253,7 @@ JSValueRef JSNFCTarget::unsetReceiveNDEFListener(JSContextRef context, nfcTarget->unsetReceiveNDEFListener(); NFCListenerCancellerPtr canceller = NFCListenerCancellerPtr(new NFCListenerCanceller(global_context, thisObject, static_cast(ID_NFCPEER_RECEIVENDEF_LISTENER))); - IListenerItemPtr listenerItem = StaticPointerCast(canceller); + IListenerItemPtr listenerItem = DPL::StaticPointerCast(canceller); NFCListenerManagerSingleton::Instance().unregisterListener(listenerItem); return JSValueMakeUndefined(context); @@ -310,7 +310,7 @@ JSValueRef JSNFCTarget::sendNDEF(JSContextRef context, void *messageHandle = convert.copiedMessage(ndefMessageObj); EventTargetActionSendPtr event(new EventTargetActionSend(messageHandle)); - event->setPrivateData( StaticPointerCast(callbackManager)); + event->setPrivateData( DPL::StaticPointerCast(callbackManager)); event->setForAsynchronousCall(&NFCResponseDispatcher::getInstance()); nfcTarget->sendNDEF(event); NFCAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, global_context); diff --git a/src/NFC/NFCAdapter.cpp b/src/NFC/NFCAdapter.cpp index 6ad697d..f0d2d8a 100644 --- a/src/NFC/NFCAdapter.cpp +++ b/src/NFC/NFCAdapter.cpp @@ -24,7 +24,7 @@ #include "NFCUtil.h" #include -using namespace DPL; + namespace DeviceAPI { namespace NFC { diff --git a/src/NFC/NFCAsyncCallbackManager.cpp b/src/NFC/NFCAsyncCallbackManager.cpp index c53f6f5..4508c50 100755 --- a/src/NFC/NFCAsyncCallbackManager.cpp +++ b/src/NFC/NFCAsyncCallbackManager.cpp @@ -19,7 +19,7 @@ #include "NFCAsyncCallbackManager.h" #include -using namespace DPL; + IMPLEMENT_SINGLETON(DeviceAPI::NFC::NFCAsyncCallbackManager) diff --git a/src/NFC/NFCDefaultAdapter.cpp b/src/NFC/NFCDefaultAdapter.cpp index e944e6d..25ce8c0 100755 --- a/src/NFC/NFCDefaultAdapter.cpp +++ b/src/NFC/NFCDefaultAdapter.cpp @@ -24,7 +24,7 @@ #include "NFCUtil.h" #include -using namespace DPL; + IMPLEMENT_SINGLETON(DeviceAPI::NFC::NFCDefaultAdapter) namespace DeviceAPI { diff --git a/src/NFC/NFCListenerManager.cpp b/src/NFC/NFCListenerManager.cpp index 6b75e7e..45dc0a9 100755 --- a/src/NFC/NFCListenerManager.cpp +++ b/src/NFC/NFCListenerManager.cpp @@ -19,7 +19,7 @@ #include "NFCListenerManager.h" #include -using namespace DPL; + IMPLEMENT_SINGLETON(DeviceAPI::NFC::NFCListenerManager) namespace DeviceAPI { diff --git a/src/NetworkBearerSelection/JSNetworkBearerSelection.cpp b/src/NetworkBearerSelection/JSNetworkBearerSelection.cpp index d66e8f9..605b48b 100755 --- a/src/NetworkBearerSelection/JSNetworkBearerSelection.cpp +++ b/src/NetworkBearerSelection/JSNetworkBearerSelection.cpp @@ -38,7 +38,7 @@ namespace DeviceAPI { namespace NetworkBearerSelection { using namespace std; -using namespace DPL; + using namespace WrtDeviceApis::CommonsJavaScript; using namespace WrtDeviceApis::Commons; using namespace DeviceAPI::Common; @@ -267,7 +267,7 @@ JSValueRef JSNetworkBearerSelection::releaseRouteToHost(JSContextRef context, JS EventNetworkBearerReleasePtr dplEvent(new EventNetworkBearerRelease()); dplEvent->setNetworkType(networkType); dplEvent->setDomainName(domainName); - dplEvent->setPrivateData(StaticPointerCast(callbackManager)); + dplEvent->setPrivateData(DPL::StaticPointerCast(callbackManager)); dplEvent->setForAsynchronousCall(&NetworkBearerSelectionResponseDispatcher::getInstance()); NetworkBearerSelections->releaseRouteToHost(dplEvent); diff --git a/src/NetworkBearerSelection/NetworkBearerSelection.cpp b/src/NetworkBearerSelection/NetworkBearerSelection.cpp index 3abbe05..39cdf2a 100644 --- a/src/NetworkBearerSelection/NetworkBearerSelection.cpp +++ b/src/NetworkBearerSelection/NetworkBearerSelection.cpp @@ -26,7 +26,7 @@ using namespace WrtDeviceApis::CommonsJavaScript; using namespace WrtDeviceApis::Commons; -using namespace DPL; + namespace DeviceAPI { namespace NetworkBearerSelection { diff --git a/src/Notification/StatusNotification.h b/src/Notification/StatusNotification.h index f99d077..96c8e79 100755 --- a/src/Notification/StatusNotification.h +++ b/src/Notification/StatusNotification.h @@ -36,9 +36,9 @@ class StatusNotification { public: - StatusNotification(NotificationType type); //type. - StatusNotification(void* noti); // notification - StatusNotification(int privID); //private ID of Notification. + explicit StatusNotification(NotificationType type); //type. + explicit StatusNotification(void* noti); // notification + explicit StatusNotification(int privID); //private ID of Notification. ~StatusNotification(); @@ -189,4 +189,4 @@ protected: } // Notification } // DeviceAPI -#endif // __TIZEN_STATUS_NOTIFICATION_H__ \ No newline at end of file +#endif // __TIZEN_STATUS_NOTIFICATION_H__ diff --git a/src/SecureElement/JSSEChannel.cpp b/src/SecureElement/JSSEChannel.cpp index 984e292..7de6c27 100644 --- a/src/SecureElement/JSSEChannel.cpp +++ b/src/SecureElement/JSSEChannel.cpp @@ -35,7 +35,7 @@ using namespace DeviceAPI::Common; using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; -using namespace DPL; + #define TIZEN_SECHANNEL_ATTRIBUTENAME "Channel" #define TIZEN_SECHANNEL_ISBASICCHANNEL "isBasicChannel" @@ -237,7 +237,7 @@ JSValueRef JSSEChannel::transmit(JSContextRef context, Try { EventSEChannelTransmitPtr event(new EventSEChannelTransmit(convert.toVectorOfUChars(arguments[0]))); - event->setPrivateData( StaticPointerCast(callbackManager) ); + event->setPrivateData( DPL::StaticPointerCast(callbackManager) ); event->setForAsynchronousCall(&SEResponseDispatcher::getInstance()); seChannel->transmit(event); diff --git a/src/SecureElement/JSSEReader.cpp b/src/SecureElement/JSSEReader.cpp index 1e3732f..0241dc5 100644 --- a/src/SecureElement/JSSEReader.cpp +++ b/src/SecureElement/JSSEReader.cpp @@ -35,7 +35,7 @@ using namespace DeviceAPI::Common; using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; -using namespace DPL; + #define TIZEN_SEREADER_ATTRIBUTENAME "Reader" #define TIZEN_SEREADER_ISPRESENT "isPresent" @@ -225,7 +225,7 @@ JSValueRef JSSEReader::openSession(JSContextRef context, JSCallbackManagerPtr callbackManager = JSCallbackManager::createObject(privateObject->getContext(), onSuccessForCbm, onErrorForCbm, true, true); Try { EventSEOpenSessionPtr event(new EventSEOpenSession()); - event->setPrivateData( StaticPointerCast(callbackManager) ); + event->setPrivateData( DPL::StaticPointerCast(callbackManager) ); event->setForAsynchronousCall(&SEResponseDispatcher::getInstance()); seReader->openSession(event); diff --git a/src/SecureElement/JSSEService.cpp b/src/SecureElement/JSSEService.cpp index 00c1980..ec90166 100755 --- a/src/SecureElement/JSSEService.cpp +++ b/src/SecureElement/JSSEService.cpp @@ -37,7 +37,7 @@ using namespace DeviceAPI::Common; using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; -using namespace DPL; + #define TIZEN_SESERVICE_ATTRIBUTENAME "SEService" @@ -169,7 +169,7 @@ JSValueRef JSSEService::getReaders(JSContextRef context, JSCallbackManagerPtr callbackManager = JSCallbackManager::createObject(privateObject->getContext(), onSuccessForCbm, onErrorForCbm, true, true); Try { EventListSEsPtr event(new EventListSEs()); - event->setPrivateData( StaticPointerCast(callbackManager) ); + event->setPrivateData( DPL::StaticPointerCast(callbackManager) ); event->setForAsynchronousCall(&SEResponseDispatcher::getInstance()); seService->getReaders(event); @@ -233,11 +233,11 @@ JSValueRef JSSEService::registerSEListener(JSContextRef context, Try { EventSEStateChangedEmitterPtr emitter(new EventSEStateChangedEmitter); emitter->setListener(&SEResponseDispatcher::getInstance()); - emitter->setEventPrivateData(StaticPointerCast(callbackManager)); + emitter->setEventPrivateData(DPL::StaticPointerCast(callbackManager)); seService->registerSEListener(emitter); SEListenerCancellerPtr canceller = SEListenerCancellerPtr(new SEListenerCanceller(privateObject->getContext(), thisObject, static_cast(emitter->getId()))); - IListenerItemPtr listenerItem = StaticPointerCast(canceller); + IListenerItemPtr listenerItem = DPL::StaticPointerCast(canceller); SEListenerManagerSingleton::Instance().registerListener(listenerItem, privateObject->getContext()); return convert.toJSValueRef(static_cast(emitter->getId())); @@ -281,7 +281,7 @@ JSValueRef JSSEService::unregisterSEListener(JSContextRef context, JSObjectRef o seService->unregisterSEListener(value); SEListenerCancellerPtr canceller = SEListenerCancellerPtr(new SEListenerCanceller(privateObject->getContext(), thisObject, value)); - IListenerItemPtr listenerItem = StaticPointerCast(canceller); + IListenerItemPtr listenerItem = DPL::StaticPointerCast(canceller); SEListenerManagerSingleton::Instance().unregisterListener(listenerItem); return JSValueMakeUndefined(context); diff --git a/src/SecureElement/JSSESession.cpp b/src/SecureElement/JSSESession.cpp index 409dca4..a063acf 100644 --- a/src/SecureElement/JSSESession.cpp +++ b/src/SecureElement/JSSESession.cpp @@ -36,7 +36,7 @@ using namespace DeviceAPI::Common; using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; -using namespace DPL; + #define TIZEN_SESESSION_ATTRIBUTENAME "Session" #define TIZEN_SESESSION_ISCLOSED "isClosed" @@ -292,7 +292,7 @@ JSValueRef JSSESession::openBasicChannel(JSContextRef context, return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::INVALID_VALUES_ERROR, "Wrong AID length"); } EventSEOpenChannelPtr event(new EventSEOpenChannel(aid, true)); - event->setPrivateData( StaticPointerCast(callbackManager) ); + event->setPrivateData( DPL::StaticPointerCast(callbackManager) ); event->setForAsynchronousCall(&SEResponseDispatcher::getInstance()); seSession->openChannel(event); @@ -365,7 +365,7 @@ JSValueRef JSSESession::openLogicalChannel(JSContextRef context, return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::INVALID_VALUES_ERROR, "Wrong AID length"); } EventSEOpenChannelPtr event(new EventSEOpenChannel(aid, false)); - event->setPrivateData( StaticPointerCast(callbackManager) ); + event->setPrivateData( DPL::StaticPointerCast(callbackManager) ); event->setForAsynchronousCall(&SEResponseDispatcher::getInstance()); seSession->openChannel(event); diff --git a/src/SecureElement/SEAsyncCallbackManager.cpp b/src/SecureElement/SEAsyncCallbackManager.cpp index 5001f11..31ec9c6 100755 --- a/src/SecureElement/SEAsyncCallbackManager.cpp +++ b/src/SecureElement/SEAsyncCallbackManager.cpp @@ -19,7 +19,7 @@ #include "SEAsyncCallbackManager.h" #include -using namespace DPL; + IMPLEMENT_SINGLETON(DeviceAPI::SecureElement::SEAsyncCallbackManager) diff --git a/src/SecureElement/SEListenerManager.cpp b/src/SecureElement/SEListenerManager.cpp index 78f4800..6197be6 100755 --- a/src/SecureElement/SEListenerManager.cpp +++ b/src/SecureElement/SEListenerManager.cpp @@ -19,7 +19,7 @@ #include "SEListenerManager.h" #include -using namespace DPL; + IMPLEMENT_SINGLETON(DeviceAPI::SecureElement::SEListenerManager) diff --git a/src/SystemSetting/JSSystemSetting.cpp b/src/SystemSetting/JSSystemSetting.cpp index a780b30..09930df 100755 --- a/src/SystemSetting/JSSystemSetting.cpp +++ b/src/SystemSetting/JSSystemSetting.cpp @@ -45,7 +45,7 @@ #include using namespace std; -using namespace DPL; + using namespace WrtDeviceApis::CommonsJavaScript; using namespace WrtDeviceApis::Commons; using namespace DeviceAPI::Common; @@ -191,7 +191,7 @@ JSValueRef JSSystemSetting::setProperty(JSContextRef context, JSObjectRef object EventSetSettingPtr dplEvent(new EventSetSetting()); dplEvent->setSettingType(settingType); dplEvent->setSettingValue(settingValue); - dplEvent->setPrivateData(StaticPointerCast(callbackManager)); + dplEvent->setPrivateData(DPL::StaticPointerCast(callbackManager)); dplEvent->setForAsynchronousCall(&SystemSettingResponseDispatcher::getInstance()); SystemSettings->setProperty(dplEvent); @@ -273,7 +273,7 @@ JSValueRef JSSystemSetting::getProperty(JSContextRef context, JSObjectRef object ISystemSettingPtr SystemSettings(priv->getObject()); EventGetSettingPtr dplEvent(new EventGetSetting()); dplEvent->setSettingType(settingType); - dplEvent->setPrivateData(StaticPointerCast(callbackManager)); + dplEvent->setPrivateData(DPL::StaticPointerCast(callbackManager)); dplEvent->setForAsynchronousCall(&SystemSettingResponseDispatcher::getInstance()); SystemSettings->getProperty(dplEvent); diff --git a/src/SystemSetting/SystemSetting.cpp b/src/SystemSetting/SystemSetting.cpp index 21ad6ed..774f75c 100644 --- a/src/SystemSetting/SystemSetting.cpp +++ b/src/SystemSetting/SystemSetting.cpp @@ -27,7 +27,7 @@ using namespace WrtDeviceApis::CommonsJavaScript; using namespace WrtDeviceApis::Commons; -using namespace DPL; + namespace DeviceAPI { namespace SystemSetting { diff --git a/src/SystemSetting/SystemSettingAsyncCallbackManager.cpp b/src/SystemSetting/SystemSettingAsyncCallbackManager.cpp index 532a1a3..6013585 100755 --- a/src/SystemSetting/SystemSettingAsyncCallbackManager.cpp +++ b/src/SystemSetting/SystemSettingAsyncCallbackManager.cpp @@ -24,7 +24,7 @@ #include "SystemSettingAsyncCallbackManager.h" #include -using namespace DPL; + IMPLEMENT_SINGLETON(DeviceAPI::SystemSetting::SystemSettingAsyncCallbackManager) diff --git a/src/Systeminfo/CMakeLists.txt b/src/Systeminfo/CMakeLists.txt index 838913e..e33d773 100755 --- a/src/Systeminfo/CMakeLists.txt +++ b/src/Systeminfo/CMakeLists.txt @@ -9,6 +9,8 @@ PKG_CHECK_MODULES(platform_pkgs_systeminfo REQUIRED capi-system-runtime-info capi-system-sensor sensor + pkgmgr-info + tapi ) ADD_DEFINITIONS("-fvisibility=hidden") diff --git a/src/Systeminfo/JSCellularNetworkInfo.cpp b/src/Systeminfo/JSCellularNetworkInfo.cpp index db1dc54..3423737 100755 --- a/src/Systeminfo/JSCellularNetworkInfo.cpp +++ b/src/Systeminfo/JSCellularNetworkInfo.cpp @@ -18,7 +18,8 @@ #include #include #include -#include +#include +#include #include "JSCellularNetworkInfo.h" #include "plugin_config.h" #include @@ -156,16 +157,26 @@ JSValueRef JSCellularNetworkInfo::getProperty(JSContextRef context, JSObjectRef AceSecurityStatus status = SYSTEMINFO_CHECK_ACCESS(SYSTEMINFO_FUNCTION_API_GET_PROPERTY_PARTNER_VALUE); TIZEN_SYNC_ACCESS_HANDLER(status, context, exception); + TapiHandle *handle = NULL; char* imei = NULL; - if (system_info_get_value_string(SYSTEM_INFO_KEY_MOBILE_DEVICE_ID, &imei) == SYSTEM_INFO_ERROR_NONE) { - if (imei) { - LoggerD("imei : " << imei); - cellularNetworkInfo->imei = imei; - free(imei); - } + handle = tel_init(0); + + if (handle == NULL) { + return convert.toJSValueRef(cellularNetworkInfo->imei); } + imei = tel_get_misc_me_imei_sync(handle); + + if (imei == NULL) { + tel_deinit(handle); + return convert.toJSValueRef(cellularNetworkInfo->imei); + } + + cellularNetworkInfo->imei = imei; + free(imei); + tel_deinit(handle); + return convert.toJSValueRef(cellularNetworkInfo->imei); } } diff --git a/src/Systeminfo/JSDeviceCapabilitiesInfo.cpp b/src/Systeminfo/JSDeviceCapabilitiesInfo.cpp index c850b31..53c02f4 100755 --- a/src/Systeminfo/JSDeviceCapabilitiesInfo.cpp +++ b/src/Systeminfo/JSDeviceCapabilitiesInfo.cpp @@ -18,11 +18,13 @@ #include #include #include +#include +#include #include #include -#include #include #include +#include #include "JSDeviceCapabilitiesInfo.h" #include "plugin_config.h" #include @@ -263,6 +265,11 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR } return convert.toJSValueRef(deviceCapabilitiesInfo->nfc); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_NFC_RESERVED_PUSH)) { + bool nfcReservedPush = false; + if (system_info_get_value_bool(SYSTEM_INFO_KEY_NFC_RESERVED_PUSH_SUPPORTED, &nfcReservedPush) == SYSTEM_INFO_ERROR_NONE) { + LoggerD("nfcReservedPush : " << nfcReservedPush); + deviceCapabilitiesInfo->nfcReservedPush = nfcReservedPush; + } return convert.toJSValueRef(deviceCapabilitiesInfo->nfcReservedPush); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MULTITOUCHCOUNT)) { int multiTouchCount = 0; @@ -286,6 +293,18 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR } return convert.toJSValueRef(deviceCapabilitiesInfo->inputKeyboard); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_INPUTKEYBOARD_LAYOUT)) { + char* inputKeyboard = NULL; + if (system_info_get_value_string(SYSTEM_INFO_KEY_KEYBOARD_TYPE, &inputKeyboard) == SYSTEM_INFO_ERROR_NONE) { + if (inputKeyboard != NULL) { + LoggerD("inputKeyboard : " << inputKeyboard); + if (strcmp(inputKeyboard, "NULL") == 0) { + deviceCapabilitiesInfo->inputKeyboard = false; + } else { + deviceCapabilitiesInfo->inputKeyboard = true; + } + free(inputKeyboard); + } + } return convert.toJSValueRef(deviceCapabilitiesInfo->inputKeyboardLayout); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_WIFI)) { bool wifi = false; @@ -302,17 +321,33 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR } return convert.toJSValueRef(deviceCapabilitiesInfo->wifiDirect); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_OPENGLES)) { + char* openglesVersion = NULL; + if (system_info_get_value_string(SYSTEM_INFO_KEY_OPENGLES_VERSION, &openglesVersion) == SYSTEM_INFO_ERROR_NONE) { + if (openglesVersion!= NULL) { + LoggerD("openglesVersion : " << openglesVersion); + deviceCapabilitiesInfo->opengles = true; + free(openglesVersion); + } + } return convert.toJSValueRef(deviceCapabilitiesInfo->opengles); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_OPENGLES_TEXTURE_FORMAT)) { + char* textureFormat = NULL; + if (system_info_get_value_string(SYSTEM_INFO_KEY_OPENGLES_TEXTURE_FORMAT, &textureFormat) == SYSTEM_INFO_ERROR_NONE) { + if (textureFormat!= NULL) { + LoggerD("textureFormat : " << textureFormat); + deviceCapabilitiesInfo->openglestextureFormat = textureFormat; + free(textureFormat); + } + } return convert.toJSValueRef(deviceCapabilitiesInfo->openglestextureFormat); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_OPENGLESVERSION1_1)) { char* openglesVersion = NULL; if (system_info_get_value_string(SYSTEM_INFO_KEY_OPENGLES_VERSION, &openglesVersion) == SYSTEM_INFO_ERROR_NONE) { if (openglesVersion!= NULL) { LoggerD("openglesVersion : " << openglesVersion); - if (strcmp(openglesVersion, "1.0") == 0) { + if (strcmp(openglesVersion, "1.1") == 0) { deviceCapabilitiesInfo->openglesVersion1_1 = true; - } else if (strcmp(openglesVersion, "1.0/2.0") == 0) { + } else if (strcmp(openglesVersion, "1.1/2.0") == 0) { deviceCapabilitiesInfo->openglesVersion1_1 = true; } free(openglesVersion); @@ -326,7 +361,7 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR LoggerD("openglesVersion : " << openglesVersion); if (strcmp(openglesVersion, "2.0") == 0) { deviceCapabilitiesInfo->openglesVersion2_0 = true; - } else if (strcmp(openglesVersion, "1.0/2.0") == 0) { + } else if (strcmp(openglesVersion, "1.1/2.0") == 0) { deviceCapabilitiesInfo->openglesVersion2_0 = true; } free(openglesVersion); @@ -420,6 +455,15 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR } return convert.toJSValueRef(deviceCapabilitiesInfo->cameraFront); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERA)) { + int cameraCount = 0; + if (system_info_get_value_int(SYSTEM_INFO_KEY_CAMERA_COUNT, &cameraCount) == SYSTEM_INFO_ERROR_NONE) { + LoggerD("cameraCount : " << cameraCount); + if (cameraCount > 0) { + deviceCapabilitiesInfo->camera = true; + } else { + deviceCapabilitiesInfo->camera = false; + } + } return convert.toJSValueRef(deviceCapabilitiesInfo->camera); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERAFRONTFLASH)) { bool cameraFrontFlash = false; @@ -551,6 +595,13 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR } return convert.toJSValueRef(deviceCapabilitiesInfo->speechRecognition); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SPEECH_SYNTHESIS)) { + void* handle = dlopen("/usr/lib/libtts.so",RTLD_NOW); + if(handle!=NULL) { + deviceCapabilitiesInfo->speechSynthesis = true; + } else { + deviceCapabilitiesInfo->speechSynthesis = false; + } + LoggerD("speechSynthesis : " << deviceCapabilitiesInfo->speechSynthesis); return convert.toJSValueRef(deviceCapabilitiesInfo->speechSynthesis); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_ACCELEROMETER)) { bool isAccelerometer = false; @@ -560,6 +611,11 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR } return convert.toJSValueRef(deviceCapabilitiesInfo->accelerometer); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_ACCELEROMETER_WAKEUP)) { + bool isAccelerometerWakeup = false; + if (sensor_awake_is_supported(SENSOR_ACCELEROMETER, &isAccelerometerWakeup) == SENSOR_ERROR_NONE) { + LoggerD("isAccelerometerWakeup : " << isAccelerometerWakeup); + deviceCapabilitiesInfo->accelerometerWakeup = isAccelerometerWakeup; + } return convert.toJSValueRef(deviceCapabilitiesInfo->accelerometerWakeup); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_BAROMETER)) { bool isBarometer = false; @@ -578,6 +634,11 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR } return convert.toJSValueRef(deviceCapabilitiesInfo->gyroscope); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_GYROSCOPE_WAKEUP)) { + bool isGyroscopeWakeup = false; + if (sensor_awake_is_supported(SENSOR_GYROSCOPE, &isGyroscopeWakeup) == SENSOR_ERROR_NONE) { + LoggerD("isGyroscopeWakeup : " << isGyroscopeWakeup); + deviceCapabilitiesInfo->gyroscopeWakeup = isGyroscopeWakeup; + } return convert.toJSValueRef(deviceCapabilitiesInfo->gyroscopeWakeup); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MAGNETOMETER)) { bool isMagnetometer = false; @@ -587,10 +648,25 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR } return convert.toJSValueRef(deviceCapabilitiesInfo->magnetometer); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MAGNETOMETER_WAKEUP)) { + bool isMagnetometerWakeup = false; + if (sensor_awake_is_supported(SENSOR_MAGNETIC, &isMagnetometerWakeup) == SENSOR_ERROR_NONE) { + LoggerD("isMagnetometerWakeup : " << isMagnetometerWakeup); + deviceCapabilitiesInfo->magnetometerWakeup = isMagnetometerWakeup; + } return convert.toJSValueRef(deviceCapabilitiesInfo->magnetometerWakeup); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PHOTOMETER)) { + bool isPhotometer = false; + if (sensor_is_supported(SENSOR_LIGHT, &isPhotometer) == SENSOR_ERROR_NONE) { + LoggerD("isPhotometer : " << isPhotometer); + deviceCapabilitiesInfo->photometer = isPhotometer; + } return convert.toJSValueRef(deviceCapabilitiesInfo->photometer); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PHOTOMETER_WAKEUP)) { + bool isphotometerWakeup = false; + if (sensor_awake_is_supported(SENSOR_LIGHT, &isphotometerWakeup) == SENSOR_ERROR_NONE) { + LoggerD("isphotometerWakeup : " << isphotometerWakeup); + deviceCapabilitiesInfo->photometerWakeup = isphotometerWakeup; + } return convert.toJSValueRef(deviceCapabilitiesInfo->photometerWakeup); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PROXIMITY)) { bool isProximity = false; @@ -600,44 +676,116 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR } return convert.toJSValueRef(deviceCapabilitiesInfo->proximity); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PROXIMITY_WAKEUP)) { + bool isProximityWakeup = false; + if (sensor_awake_is_supported(SENSOR_PROXIMITY, &isProximityWakeup) == SENSOR_ERROR_NONE) { + LoggerD("isProximityWakeup : " << isProximityWakeup); + deviceCapabilitiesInfo->proximityWakeup = isProximityWakeup; + } return convert.toJSValueRef(deviceCapabilitiesInfo->proximityWakeup); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TILTMETER)) { + bool isTiltmeter = false; + if (sensor_is_supported(SENSOR_MOTION_TILT, &isTiltmeter) == SENSOR_ERROR_NONE) { + LoggerD("isTiltmeter : " << isTiltmeter); + deviceCapabilitiesInfo->tiltmeter = isTiltmeter; + } return convert.toJSValueRef(deviceCapabilitiesInfo->tiltmeter); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TILTMETER_WAKEUP)) { + bool isTiltmeterWakeup = false; + if (sensor_awake_is_supported(SENSOR_MOTION_TILT, &isTiltmeterWakeup) == SENSOR_ERROR_NONE) { + LoggerD("isTiltmeterWakeup : " << isTiltmeterWakeup); + deviceCapabilitiesInfo->tiltmeterWakeup = isTiltmeterWakeup; + } return convert.toJSValueRef(deviceCapabilitiesInfo->tiltmeterWakeup); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_DATA_ENCRYPTION)) { + void* handle = dlopen("/usr/lib/libsqlite3.so.0",RTLD_NOW); + if(handle != NULL) { + deviceCapabilitiesInfo->dataEncryption = true; + } else { + deviceCapabilitiesInfo->dataEncryption = false; + } + LoggerD("dataEncryption : " << deviceCapabilitiesInfo->dataEncryption); return convert.toJSValueRef(deviceCapabilitiesInfo->dataEncryption); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_GRAPHICS_ACCELERATION)) { + bool isGraphicsAccelerationSupported = false; + if (system_info_get_value_bool(SYSTEM_INFO_KEY_GRAPHICS_HWACCEL_SUPPORTED , &isGraphicsAccelerationSupported) == SYSTEM_INFO_ERROR_NONE) { + LoggerD("graphicsAcceleration : " << isGraphicsAccelerationSupported); + deviceCapabilitiesInfo->graphicsAcceleration = isGraphicsAccelerationSupported; + } return convert.toJSValueRef(deviceCapabilitiesInfo->graphicsAcceleration); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PUSH)) { + deviceCapabilitiesInfo->push = isExist("/usr/bin/pushd"); + LoggerD("push : " << deviceCapabilitiesInfo->push); return convert.toJSValueRef(deviceCapabilitiesInfo->push); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TELEPHONY)) { + deviceCapabilitiesInfo->telephony = isExist("/usr/bin/telephony-daemon"); + LoggerD("telephony : " << deviceCapabilitiesInfo->telephony); return convert.toJSValueRef(deviceCapabilitiesInfo->telephony); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TELEPHONY_MMS)) { + bool telephonyMms = false; + if (system_info_get_value_bool(SYSTEM_INFO_KEY_MMS_SUPPORTED, &telephonyMms) == SYSTEM_INFO_ERROR_NONE) { + LoggerD("telephonyMms : " << telephonyMms); + deviceCapabilitiesInfo->telephonyMms = telephonyMms; + } return convert.toJSValueRef(deviceCapabilitiesInfo->telephonyMms); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TELEPHONY_SMS)) { + bool telephonySms = false; + if (system_info_get_value_bool(SYSTEM_INFO_KEY_SMS_SUPPORTED, &telephonySms) == SYSTEM_INFO_ERROR_NONE) { + LoggerD("telephonySms : " << telephonySms); + deviceCapabilitiesInfo->telephonySms = telephonySms; + } return convert.toJSValueRef(deviceCapabilitiesInfo->telephonySms); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENSIZE_NORMAL)) { + deviceCapabilitiesInfo->screenSizeNormal = getRegistry("screen.coordinate_system.size.normal"); + LoggerD("screenSizeNormal : " << deviceCapabilitiesInfo->screenSizeNormal); return convert.toJSValueRef(deviceCapabilitiesInfo->screenSizeNormal); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENSIZE_480_800)) { + deviceCapabilitiesInfo->screenSize480_800 = getRegistry("screen.coordinate_system.physical.normal_480x800"); + LoggerD("screenSize480_800 : " << deviceCapabilitiesInfo->screenSize480_800); return convert.toJSValueRef(deviceCapabilitiesInfo->screenSize480_800); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENSIZE_720_1280)) { + deviceCapabilitiesInfo->screenSize720_1280 = getRegistry("screen.coordinate_system.physical.normal_720x1280"); + LoggerD("screenSize720_1280 : " << deviceCapabilitiesInfo->screenSize720_1280); return convert.toJSValueRef(deviceCapabilitiesInfo->screenSize720_1280); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_AUTO_ROTATION)) { + bool isAutoRotation = false; + if (system_info_get_value_bool(SYSTEM_INFO_KEY_FEATURE_AUTO_ROTATION_SUPPORTED, &isAutoRotation) == SYSTEM_INFO_ERROR_NONE) { + LoggerD("auto rotation : " << isAutoRotation); + deviceCapabilitiesInfo->autoRotation = isAutoRotation; + } return convert.toJSValueRef(deviceCapabilitiesInfo->autoRotation); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SHELL_APP_WIDGET)) { + bool isShellAppWidgetSupported = false; + pkgmgrinfo_pkginfo_h handle; + if (pkgmgrinfo_pkginfo_get_pkginfo("gi2qxenosh",&handle) == PMINFO_R_OK) { + isShellAppWidgetSupported = true; + pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + LoggerD("shellAppWidget : " << isShellAppWidgetSupported); + } + deviceCapabilitiesInfo->shellAppWidget = isShellAppWidgetSupported; return convert.toJSValueRef(deviceCapabilitiesInfo->shellAppWidget); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_VISION_IMAGE_RECOGNITION)) { + deviceCapabilitiesInfo->visionImageRecognition = isExist("/usr/lib/osp/libarengine.so"); + LoggerD("visionImageRecognition : " << deviceCapabilitiesInfo->visionImageRecognition); return convert.toJSValueRef(deviceCapabilitiesInfo->visionImageRecognition); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_VISION_QRCODE_GENERATION)) { + deviceCapabilitiesInfo->visionQrcodeGeneration = isExist("/usr/lib/osp/libarengine.so"); + LoggerD("visionQrcodeGeneration : " << deviceCapabilitiesInfo->visionQrcodeGeneration); return convert.toJSValueRef(deviceCapabilitiesInfo->visionQrcodeGeneration); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_VISION_QRCODE_RECOGNITION)) { + deviceCapabilitiesInfo->visionQrcodeRecognition = isExist("/usr/lib/osp/libarengine.so"); + LoggerD("visionQrcodeRecognition : " << deviceCapabilitiesInfo->visionQrcodeRecognition); return convert.toJSValueRef(deviceCapabilitiesInfo->visionQrcodeRecognition); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_VISION_FACE_RECOGNITION)) { + deviceCapabilitiesInfo->visionFaceRecognition = isExist("/usr/lib/osp/libarengine.so"); + LoggerD("visionFaceRecognition : " << deviceCapabilitiesInfo->visionFaceRecognition); return convert.toJSValueRef(deviceCapabilitiesInfo->visionFaceRecognition); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SECURE_ELEMENT)) { + deviceCapabilitiesInfo->secureElement = isExist("/usr/bin/smartcard-daemon"); + LoggerD("secureElement : " << deviceCapabilitiesInfo->secureElement); return convert.toJSValueRef(deviceCapabilitiesInfo->secureElement); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_NATIVE_OSP_COMPATIBLE)) { + deviceCapabilitiesInfo->nativeOspCompatible = getRegistry("platform.native.osp_compatible"); + LoggerD("nativeOspCompatible : " << deviceCapabilitiesInfo->nativeOspCompatible); return convert.toJSValueRef(deviceCapabilitiesInfo->nativeOspCompatible); } } @@ -647,5 +795,42 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR } return JSValueMakeUndefined(context); } + +bool JSDeviceCapabilitiesInfo::isExist(const char* path) +{ + if (0 == access(path ,F_OK)) + return true; + return false; +} + +bool JSDeviceCapabilitiesInfo::getRegistry(std::string key) +{ + std::ifstream file("/usr/etc/system-info.ini"); + std::string line; + std::string _key; + _key.append(key); + _key.append("=(\\w+)"); + std::string value = ""; + bool ret = false; + + if(!file) { + LoggerD("Registry file not found"); + } else { + while ((std::getline(file, line).rdstate() & (std::ifstream::failbit | std::ifstream::eofbit)) == 0) { + if (pcrecpp::RE(_key).PartialMatch(line, &value)) { + LoggerD("Key[" << key << "] : " << value; ); + if(0==value.compare("true")) { + ret = true; + } else { + ret = false; + } + break; + } + } + file.close(); + } + return ret; +} + } } diff --git a/src/Systeminfo/JSDeviceCapabilitiesInfo.h b/src/Systeminfo/JSDeviceCapabilitiesInfo.h index 89053ab..b36584c 100755 --- a/src/Systeminfo/JSDeviceCapabilitiesInfo.h +++ b/src/Systeminfo/JSDeviceCapabilitiesInfo.h @@ -37,6 +37,9 @@ class JSDeviceCapabilitiesInfo static void Finalize(JSObjectRef object); static bool hasProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName); static JSValueRef getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); + static bool isExist(const char* path); + static bool getRegistry(std::string key); + static JSStaticValue m_properties[]; static JSClassRef m_classRef; diff --git a/src/Systeminfo/JSSysteminfo.cpp b/src/Systeminfo/JSSysteminfo.cpp index ecada1d..1c90d90 100755 --- a/src/Systeminfo/JSSysteminfo.cpp +++ b/src/Systeminfo/JSSysteminfo.cpp @@ -37,7 +37,7 @@ namespace DeviceAPI { namespace Systeminfo { using namespace std; -using namespace DPL; + using namespace WrtDeviceApis::CommonsJavaScript; using namespace WrtDeviceApis::Commons; using namespace DeviceAPI::Common; @@ -183,7 +183,7 @@ JSValueRef JSSysteminfo::getPropertyValue(JSContextRef context, JSObjectRef obje EventGetSysteminfoPtr event(new EventGetSysteminfo()); event->setBasePropertyPtr(baseProperty); TIME_TRACER_ITEM_BEGIN(event->getProperty(), 0); - event->setPrivateData(StaticPointerCast(cbm)); + event->setPrivateData(DPL::StaticPointerCast(cbm)); SysteminfoListener& listener = SysteminfoListener::getInstance(); event->setForAsynchronousCall(&listener); @@ -244,7 +244,7 @@ JSValueRef JSSysteminfo::addPropertyValueChangeListener(JSContextRef context, JS EventWatchSysteminfoPtr event(new EventWatchSysteminfo); event->setWatchOption(option); event->setBasePropertyPtr(baseProperty); - event->setPrivateData(StaticPointerCast(cbm)); + event->setPrivateData(DPL::StaticPointerCast(cbm)); SysteminfoListener& listener = SysteminfoListener::getInstance(); event->setForAsynchronousCall(&listener); diff --git a/src/Systeminfo/Systeminfo.cpp b/src/Systeminfo/Systeminfo.cpp index cf0d7a1..f3657b8 100755 --- a/src/Systeminfo/Systeminfo.cpp +++ b/src/Systeminfo/Systeminfo.cpp @@ -27,7 +27,7 @@ using namespace WrtDeviceApis::CommonsJavaScript; using namespace WrtDeviceApis::Commons; -using namespace DPL; + namespace DeviceAPI { namespace Systeminfo { diff --git a/src/TimeUtil/JSTimeDuration.cpp b/src/TimeUtil/JSTimeDuration.cpp index cd36745..26adf36 100755 --- a/src/TimeUtil/JSTimeDuration.cpp +++ b/src/TimeUtil/JSTimeDuration.cpp @@ -29,7 +29,7 @@ namespace DeviceAPI { namespace Time { -using namespace DPL; + using namespace DeviceAPI::Common; using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; diff --git a/src/TimeUtil/JSTimeUtil.cpp b/src/TimeUtil/JSTimeUtil.cpp index 2c8d50f..a43dfff 100644 --- a/src/TimeUtil/JSTimeUtil.cpp +++ b/src/TimeUtil/JSTimeUtil.cpp @@ -32,7 +32,7 @@ namespace DeviceAPI { namespace Time { -using namespace DPL; + using namespace DeviceAPI::Common; using namespace WrtDeviceApis::Commons; using namespace WrtDeviceApis::CommonsJavaScript; -- 2.7.4