Update change log and spec for wrt-plugins-tizen_0.4.35
authorDongjin Choi <milkelf.choi@samsung.com>
Mon, 27 May 2013 06:13:36 +0000 (15:13 +0900)
committerDongjin Choi <milkelf.choi@samsung.com>
Mon, 27 May 2013 06:13:36 +0000 (15:13 +0900)
[model] REDWOOD
[binary_type] PDA
[customer] OPEN

[Issue#] DCM-1710
[Problem] Callback is not occured when roaming status is changed.
[Cause] Internal bug.
[Solution] Modification.

[Issue#] DCM-1574
[Problem] Calendar rrule array not updated as desired.
[Cause] Did't parse the whole attribute for rule.
[Solution] Parse all attribute for rrule when adding/updating events..

[Issue#] TDIS-5784
[Problem] Calendar duration with greater than 80 years caused an error in update routine.
[Cause] 4 byte long variable used for duration length in one place.
[Solution] Use 8 bytes long long variable.

[Issue] DCM-1696
[Problem] id does not math with operation result.
[Cause] platform api bug.
[Solution] add queue to manager id & result.

[Issue#] N/A
[Problem] Leaks of Tizen 2.1 Feature
[Cause] N/A
[Solution] Add testcases for Download

[Issue] N/A
[Problem] Sms and Mms conversation listener update bug fix
[Cause] Sms and Mms conversation listener update bug fix
[Solution] Sms and Mms conversation listener update bug fix

[team] WebAPI
[request] N/A
[horizontal_expansion] N/A

UnitTest Done.

16 files changed:
packaging/wrt-plugins-tizen.spec
src/Calendar/CalendarConverter.cpp
src/Calendar/CalendarConverter.h
src/Calendar/EventWrapper.cpp
src/Calendar/JSCalendar.cpp
src/Calendar/JSCalendarEvent.cpp
src/Calendar/JSCalendarItemProperties.cpp
src/Calendar/JSCalendarTask.cpp
src/DataControl/DataControlAsyncCallbackManager.h
src/DataControl/SqlDataControlConsumer.cpp
src/DataControl/SqlDataControlConsumer.h
src/Messaging/Conversation.cpp
src/Messaging/Conversation.h
src/Messaging/IConversation.h
src/Messaging/Messaging.cpp
src/Systeminfo/Systeminfo.cpp

index 91dbdc4..141e6ef 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       wrt-plugins-tizen
 Summary:    JavaScript plugins for WebRuntime
-Version:    0.4.34
+Version:    0.4.35
 Release:    0
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index d53c23b..c13b5a7 100755 (executable)
@@ -770,21 +770,12 @@ EventAlarmListPtr CalendarConverter::toVectorOfEventAlarmsFromReference(JSValueR
 
 CalendarEventPtr CalendarConverter::toItem(const JSValueRef value, bool updateMode)
 {
-       CalendarEventPtr result;
+       CalendarEventPtr result(NULL);
        JSObjectRef arg = toJSObjectRef(value);
 
        if(updateMode) {
                LoggerD("Update mode.");
-           CalendarEventPtr resultPtr(new CalendarEvent());
-               result = resultPtr;
-
-               // Set the unparsed attributes.
-        CalendarEventPtr oldItem = JSCalendarEvent::getPrivateObject(arg);
-               result->setId(oldItem->getId());
-               result->setParentId(oldItem->getParentId());
-               result->setCalendarId(oldItem->getCalendarId());
-               result->setRecurrenceId(oldItem->getRecurrenceId());
-               result->setCalendarType(oldItem->getCalendarType());
+        result = JSCalendarEvent::getPrivateObject(arg);
        } else {
                LoggerD("Constructor mode.");
            CalendarEventPtr resultPtr(new CalendarEvent());
@@ -838,7 +829,6 @@ CalendarEventPtr CalendarConverter::toItem(const JSValueRef value, bool updateMo
     if (!JSValueIsUndefined(m_context, descriptionData)) {
         result->setDescription(toString(descriptionData));
     }
-
     if (!JSValueIsUndefined(m_context, summaryData)) {
         result->setSubject(toString(summaryData));
     }
@@ -873,7 +863,6 @@ CalendarEventPtr CalendarConverter::toItem(const JSValueRef value, bool updateMo
                result->getDuration()->length = length;
                result->getDuration()->unit = unit;
     }
-
     if (!JSValueIsUndefined(m_context, locationData)) {
         result->setLocation(toString(locationData));
     }
@@ -902,7 +891,6 @@ CalendarEventPtr CalendarConverter::toItem(const JSValueRef value, bool updateMo
         EventAttendeeListPtr attendees = toVectorOfAttendeesFromReference(attendeesData);
         result->setAttendees(attendees);
     }
-
     if (!JSValueIsUndefined(m_context, geolocationData) && !JSValueIsNull(m_context, geolocationData)) {
            Try {
                DeviceAPI::Tizen::SimpleCoordinatesPtr geoLocation = DeviceAPI::Tizen::JSSimpleCoordinates::getSimpleCoordinates(m_context, geolocationData);
@@ -919,7 +907,7 @@ CalendarEventPtr CalendarConverter::toItem(const JSValueRef value, bool updateMo
         result->setAvailability(toEventAvailability(toString(availabilityData)));
     }
     if (!JSValueIsUndefined(m_context, recurrenceRuleData) && !JSValueIsNull(m_context, recurrenceRuleData)) {
-        result->setRecurrenceRule(JSCalendarRecurrenceRule::getPrivateObject(JSValueToObject(m_context, recurrenceRuleData, NULL)));
+               result->setRecurrenceRule(toEventRecurrenceRule(recurrenceRuleData));
     }
     if (!JSValueIsUndefined(m_context, priorityData)) {
         result->setPriority(toTaskPriority(toString(priorityData)));
@@ -978,7 +966,7 @@ CalendarEventListPtr CalendarConverter::toVectorOfItems(JSValueRef items)
     return result;
 }
 
-CalendarEventListPtr CalendarConverter::toVectorOfItemsFromDictionary(JSValueRef items)
+CalendarEventListPtr CalendarConverter::toVectorOfItemsFromDictionary(JSValueRef items, bool updateMode)
 {
        if(!JSIsArrayValue(m_context, items)) {
                LoggerW("JSValue is not an array.");
@@ -990,7 +978,7 @@ CalendarEventListPtr CalendarConverter::toVectorOfItemsFromDictionary(JSValueRef
     JSObjectRef objArg = toJSObjectRef(items);
     LoggerD("array length "<<JSGetArrayLength(m_context, objArg));
     for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); i++) {
-        result->push_back(toItem(JSGetArrayElement(m_context, objArg, i), true));
+        result->push_back(toItem(JSGetArrayElement(m_context, objArg, i), updateMode));
     }
 
     return result;
index b8f0660..2092edb 100755 (executable)
@@ -38,9 +38,9 @@ class CalendarConverter : public WrtDeviceApis::CommonsJavaScript::Converter
     explicit CalendarConverter(JSContextRef context, CalendarEvent::CalendarType calendarType=CalendarEvent::EVENT_TYPE);
     virtual ~CalendarConverter();
 
-    CalendarEventPtr toItem(const JSValueRef value, bool updateMode=false);
+    CalendarEventPtr toItem(const JSValueRef value, bool updateMode);
     CalendarEventListPtr toVectorOfItems(JSValueRef items);
-    CalendarEventListPtr toVectorOfItemsFromDictionary(JSValueRef items);
+    CalendarEventListPtr toVectorOfItemsFromDictionary(JSValueRef items, bool updateMode);
     StringArrayPtr toCategories(JSValueRef categories);
     EventAttendeePtr toAttendee(JSValueRef attendee);
     EventAttendeeListPtr toVectorOfAttendeesFromDictionary(JSValueRef attendees);
index 7cb4131..cab98f0 100755 (executable)
@@ -486,8 +486,8 @@ void EventWrapper::setEndTimeToPlatformEvent()
         cal.type = CALENDAR_TIME_LOCALTIME;
                cal.time.date = CalendarUtility::LLIToCalTime(m_abstractEvent->getTimeZone().c_str(), time).time.date;
     } else {
-    cal.type = CALENDAR_TIME_UTIME;
-    cal.time.utime = time;
+           cal.type = CALENDAR_TIME_UTIME;
+           cal.time.utime = time;
     }
 
     if(CalendarEvent::TASK_TYPE==getType()) {
index 4c68611..b0f9e20 100755 (executable)
@@ -179,14 +179,15 @@ JSValueRef JSCalendar::add(JSContextRef context,
             ThrowMsg(ConversionException, "Wrong calendar type.");
         }
 
-        JSObjectRef arg = JSValueToObject(context, arguments[0], exception);
-        CalendarEventPtr event = JSCalendarEvent::getPrivateObject(arg);
-        if (!event) {
+        CalendarConverter converter(context);
+
+        CalendarEventPtr item = converter.toItem(arguments[0], true);
+        if (!item) {
             ThrowMsg(ConversionException, "Parameter conversion failed.");
         }
 
         IEventAddEventPtr dplEvent(new IEventAddEvent());
-        dplEvent->setEvent(event);
+        dplEvent->setEvent(item);
         dplEvent->setForSynchronousCall();
         calendar->addEvent(dplEvent);
 
@@ -254,7 +255,7 @@ JSValueRef JSCalendar::addBatch(JSContextRef context,
         if (!JSIsArrayValue(context, arguments[0])) {
             ThrowMsg(ConversionException, "Wrong first parameter type.");
         }
-        events = converter.toVectorOfItems(arguments[0]);
+        events = converter.toVectorOfItemsFromDictionary(arguments[0], true);
         if (!events) {
             ThrowMsg(ConversionException, "First parameter conversion failed.");
         }
@@ -426,7 +427,7 @@ JSValueRef JSCalendar::updateBatch(JSContextRef context,
             ThrowMsg(ConversionException, "Wrong parameter type.");
         }
         CalendarEventListPtr items;
-        items = converter.toVectorOfItemsFromDictionary(arguments[0]);
+        items = converter.toVectorOfItemsFromDictionary(arguments[0], true);
         if (!items) {
             ThrowMsg(ConversionException, "Third parameter conversion failed.");
         }
index d0987f7..263c007 100755 (executable)
@@ -139,7 +139,7 @@ JSObjectRef DLL_EXPORT JSCalendarEvent::constructor(JSContextRef context,
                 CalendarEventPtr result(new CalendarEvent());
                 event = result;
             } else if (JSValueIsObject(context, arguments[0])) {
-                event = converter.toItem(arguments[0]);
+                event = converter.toItem(arguments[0], false);
                 if (!event) {
                     ThrowMsg(ConversionException, "Parameter conversion failed.");
                 }
index 23c110c..31fbaf9 100755 (executable)
@@ -848,7 +848,7 @@ bool JSCalendarItemProperties::setPropertyDuration(JSContextRef context,
     {
         CalendarEventPtr event = getPrivateObject(object);
         TimeUtilConverter converter(context);
-        long length = converter.getDurationLength(value);
+        long long length = converter.getDurationLength(value);
         int unit = converter.getDurationUnit(value);
         if (length < 0) {
             DeviceAPI::Common::JSWebAPIErrorFactory::postException(context, exception, DeviceAPI::Common::JSWebAPIErrorFactory::INVALID_VALUES_ERROR);
index 89ad514..b71e361 100755 (executable)
@@ -124,7 +124,7 @@ JSObjectRef DLL_EXPORT JSCalendarTask::constructor(JSContextRef context,
                 CalendarEventPtr result(new CalendarEvent());
                 task = result;
             } else if (JSValueIsObject(context, arguments[0])) {
-                task = converter.toItem(arguments[0]);
+                task = converter.toItem(arguments[0], false);
                 if (!task) {
                     ThrowMsg(ConversionException, "Parameter conversion failed.");
                 }
index bc81f12..b2308ba 100755 (executable)
@@ -20,6 +20,8 @@
 
 #include <dpl/singleton.h>
 #include <AsyncCallbackManager.h>
+#include <dpl/mutex.h>
+#include "SqlDataControlConsumer.h"
 
 namespace DeviceAPI {
 namespace DataControl {
@@ -35,15 +37,104 @@ public:
 
        virtual ~DataControlAsyncCallbackManager()
        {
+               cleanupSQLUserData();
        }
+       
        bool isSQLDataControlGC() { return m_sqlDataControlGC;}
        bool isMappedDataControlGC() { return m_mappedDataControlGC;}
        void setSQLDataControlGC(bool gc) { m_sqlDataControlGC = gc;}
        void setMappedDataControlGC(bool gc) { m_mappedDataControlGC = gc;}
+       bool checkReqIdUnique(std::string key) 
+       {
+               if (m_callbackSQLUserDataMap.find(key) == m_callbackSQLUserDataMap.end())
+               {
+                       return true;
+               }
+               return false;
+       }
+       
+       void addSQLUserData(std::string key, void* data) 
+       { 
+               if (m_callbackSQLUserDataMap.find(key) != m_callbackSQLUserDataMap.end())
+               {
+                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "same id exist");
+               }
+
+//             LoggerD(key << " : " << std::hex << data);
+
+               DPL::Mutex::ScopedLock lock(&m_mutex);          
+               m_callbackSQLUserDataMap[key] = data;
+       }
+       
+       void* removeSQLUserData(std::string key) 
+       {
+               if (m_callbackSQLUserDataMap.find(key) == m_callbackSQLUserDataMap.end())
+               {
+                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "there is no key");
+               }
+               
+
+               DPL::Mutex::ScopedLock lock(&m_mutex);                  
+               void* data = m_callbackSQLUserDataMap[key];
+               
+       //      LoggerD(key << " : " << std::hex << data);
+
+               m_callbackSQLUserDataMap.erase(key);
+               return data;
+       }
+
        friend class DPL::Singleton<DataControlAsyncCallbackManager>;
+       
 private:
+       void cleanupSQLUserData() 
+       {       
+               for (std::map<std::string, void*>::iterator it = m_callbackSQLUserDataMap.begin();
+                       it != m_callbackSQLUserDataMap.end(); ++it)
+               {
+                       CommonPendingEvent *event = (CommonPendingEvent*)it->second;
+                       
+                       EventInsertPendingEvent *insertEvent = dynamic_cast<EventInsertPendingEvent*>(event);
+               
+                       if (insertEvent)
+                       {
+                               LoggerD("free insert");
+                               delete insertEvent;
+                               continue;
+                       }
+               
+                       
+                       EventSelectPendingEvent *selectEvent = dynamic_cast<EventSelectPendingEvent*>(event);
+               
+                       if (selectEvent) 
+                       {
+                               LoggerD("free select");
+                               delete selectEvent;
+                               continue;
+                       }
+               
+                       EventUpdatePendingEvent *updateEvent = dynamic_cast<EventUpdatePendingEvent*>(event);
+               
+                       if (updateEvent) 
+                       {
+                               LoggerD("free update");
+                               delete updateEvent;
+                               continue;
+                       }
+               
+                       EventDeletePendingEvent *deleteEvent = dynamic_cast<EventDeletePendingEvent*>(event);
+                       
+                       if (deleteEvent) 
+                       {
+                               LoggerD("free delete");
+                               delete deleteEvent;
+                       }
+               }
+       }
+       DPL::Mutex m_mutex;
        bool m_sqlDataControlGC;
        bool m_mappedDataControlGC;
+       std::map<std::string, void*> m_callbackSQLUserDataMap;
+       
 };
 
 typedef DPL::Singleton<DataControlAsyncCallbackManager> DataControlAsyncCallbackManagerSingleton;
index c5dee10..a2cbeb5 100644 (file)
@@ -77,9 +77,6 @@ static const char BUNDLE_KEY_WINDOW[] = "__APP_SVC_K_WIN_ID__";
 #define DATACONTROL_PROTOCOL_DIR_TOP  "/tmp/osp"
 #define DATACONTROL_PROTOCOL_DIR_MIDDLE  "/tmp/osp/data-control"
 #define DATACONTROL_PROTOCOL_DIR  "/tmp/osp/data-control/request"
-//#define DATACONTROL_PROTOCOL_DIR  "/tmp/osp/DataControlRequest"
-
-
 
 static std::vector<std::string> getDataArrayFromBundle(bundle *b, std::string key)
 {
@@ -111,17 +108,24 @@ static void sqldataControlSelectCallback(bundle* b, int request_code, appsvc_res
        EventSelectPendingEvent *pendingEvent = NULL;
        SQLDataControlConsumer *consumer = NULL;
        EventSelectPtr event;
-
+       const char *bundleKey = NULL;
+       
        try 
        {
-               if (data == NULL)
+               if (b == NULL)
                {
-                       LoggerD("data null, can not send result to JS Layer");
-                       return;
+                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Get result fail from datacontrol provider");
                }
-
-               pendingEvent = (EventSelectPendingEvent *)data;
                
+        bundleKey = appsvc_get_data(b, OSP_K_REQUEST_ID);
+
+               if (bundleKey == NULL)
+               {
+                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Get key fail from datacontrol provider");
+               }
+
+               pendingEvent = (EventSelectPendingEvent *)DataControlAsyncCallbackManagerSingleton::Instance().removeSQLUserData(bundleKey);
+       
                if (DataControlAsyncCallbackManagerSingleton::Instance().isSQLDataControlGC())
                {
                        LoggerD("private object is garbage collected");
@@ -131,11 +135,7 @@ static void sqldataControlSelectCallback(bundle* b, int request_code, appsvc_res
                
                consumer = (SQLDataControlConsumer*)pendingEvent->getThisObject();
                event = pendingEvent->getEvent();
-
-               if (b == NULL)
-               {
-                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Get result fail from datacontrol provider");
-               }
+               
                std::vector<std::string> result = getDataArrayFromBundle(b, OSP_K_ARG);
 
                for (size_t index = 0; index < result.size(); index++)
@@ -183,16 +183,23 @@ static void sqldataControlInsertCallback(bundle* b, int request_code, appsvc_res
        EventInsertPendingEvent *pendingEvent = NULL;
        SQLDataControlConsumer *consumer = NULL;
        EventInsertPtr event;
+       const char *bundleKey = NULL;
 
        try 
        {
-               if (data == NULL)
+               if (b == NULL)
                {
-                       LoggerD("data null, can not send result to JS Layer");
-                       return;
+                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Get result fail from datacontrol provider");
+               }
+
+        bundleKey = appsvc_get_data(b, OSP_K_REQUEST_ID);
+
+               if (bundleKey == NULL)
+               {
+                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Get key fail from datacontrol provider");
                }
 
-               pendingEvent = (EventInsertPendingEvent *)data;
+               pendingEvent = (EventInsertPendingEvent *)DataControlAsyncCallbackManagerSingleton::Instance().removeSQLUserData(bundleKey);
 
                if (DataControlAsyncCallbackManagerSingleton::Instance().isSQLDataControlGC())
                {
@@ -204,10 +211,6 @@ static void sqldataControlInsertCallback(bundle* b, int request_code, appsvc_res
                consumer = (SQLDataControlConsumer*)pendingEvent->getThisObject();
                event = pendingEvent->getEvent();
 
-               if (b == NULL)
-               {
-                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Get result fail from datacontrol provider");
-               }
                std::vector<std::string> result = getDataArrayFromBundle(b, OSP_K_ARG);
 
                for (size_t index = 0; index < result.size(); index++)
@@ -255,25 +258,32 @@ static void sqldataControlDeleteCallback(bundle* b, int request_code, appsvc_res
 {
        LoggerD("Enter");
 
-       if (data == NULL)
+       if (DataControlAsyncCallbackManagerSingleton::Instance().isSQLDataControlGC())
        {
-               LoggerD("Data or Bundle error");
+               LoggerD("private object is garbage collected");
                return;
        }
 
        EventDeletePendingEvent* pendingEvent = NULL;
        SQLDataControlConsumer *consumer = NULL;
        EventDeletePtr event;
+       const char* bundleKey = NULL;
        
        try 
        {
-               if (data == NULL)
+               if (b == NULL)
                {
-                       LoggerD("data null, can not send result to JS Layer");
-                       return;
+                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Get result fail from datacontrol provider");
+               }
+
+        bundleKey = appsvc_get_data(b, OSP_K_REQUEST_ID);
+
+               if (bundleKey == NULL)
+               {
+                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Get key fail from datacontrol provider");
                }
 
-               pendingEvent = (EventDeletePendingEvent *)data;
+               pendingEvent = (EventDeletePendingEvent *)DataControlAsyncCallbackManagerSingleton::Instance().removeSQLUserData(bundleKey);
 
                if (DataControlAsyncCallbackManagerSingleton::Instance().isSQLDataControlGC())
                {
@@ -285,10 +295,6 @@ static void sqldataControlDeleteCallback(bundle* b, int request_code, appsvc_res
                consumer = (SQLDataControlConsumer*)pendingEvent->getThisObject();
                event = pendingEvent->getEvent();
 
-               if (b == NULL)
-               {
-                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Get result fail from datacontrol provider");
-               }
                std::vector<std::string> result = getDataArrayFromBundle(b, OSP_K_ARG);
 
                for (size_t index = 0; index < result.size(); index++)
@@ -333,17 +339,23 @@ static void sqldataControlUpdateCallback(bundle* b, int request_code, appsvc_res
        EventUpdatePendingEvent* pendingEvent = NULL;
        SQLDataControlConsumer *consumer = NULL;
        EventUpdatePtr event;
+       const char *bundleKey = NULL;
        
        try 
        {
-               if (data == NULL)
+               if (b == NULL)
                {
-                       LoggerD("data null, can not send result to JS Layer");
-                       return;
+                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Get result fail from datacontrol provider");
                }
 
+        bundleKey = appsvc_get_data(b, OSP_K_REQUEST_ID);
 
-               pendingEvent = (EventUpdatePendingEvent *)data;
+               if (bundleKey == NULL)
+               {
+                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Get key fail from datacontrol provider");
+               }
+
+               pendingEvent = (EventUpdatePendingEvent *)DataControlAsyncCallbackManagerSingleton::Instance().removeSQLUserData(bundleKey);    
                
                if (DataControlAsyncCallbackManagerSingleton::Instance().isSQLDataControlGC())
                {
@@ -354,10 +366,6 @@ static void sqldataControlUpdateCallback(bundle* b, int request_code, appsvc_res
                consumer = (SQLDataControlConsumer*)pendingEvent->getThisObject();
                event = pendingEvent->getEvent();
 
-               if (b == NULL)
-               {
-                       ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Get result fail from datacontrol provider");
-               }
                std::vector<std::string> result = getDataArrayFromBundle(b, OSP_K_ARG);
 
                for (size_t index = 0; index < result.size(); index++)
@@ -419,6 +427,7 @@ SQLDataControlConsumer::~SQLDataControlConsumer()
 }
 
 DPL::Mutex SQLDataControlConsumer::m_mutex;
+std::vector<unsigned int> SQLDataControlConsumer::m_currentReqIds;
 
 std::string SQLDataControlConsumer::getCurrentApplicationId()
 {
@@ -758,8 +767,7 @@ void SQLDataControlConsumer::OnRequestReceived(const EventInsertPtr& event)
                        ThrowMsg(WrtDeviceApis::Commons::PlatformException, "ipc memory allocation fail");
                }
 
-               appsvc_set_operation(passData, APPSVC_OPERATION_DEFAULT);
-
+               appsvc_set_operation(passData, APPSVC_OPERATION_DEFAULT);               
                appsvc_set_appid(passData, m_appId.c_str());
 
                bundle_add(passData, OSP_K_REQUEST_ID, reqIdStr.c_str());
@@ -777,11 +785,8 @@ void SQLDataControlConsumer::OnRequestReceived(const EventInsertPtr& event)
                addArrayToBundle(passData, queryItem);
                saveArrayToFile(ipcFilename, rowData);
 
-
-               // FIXEME
-               // reqid sholud be known
                EventInsertPendingEvent* pendingEvent = new EventInsertPendingEvent((void*)this, event);
-               int pid = appsvc_run_service(passData, reqId, sqldataControlInsertCallback, (void*)pendingEvent);
+               int pid = appsvc_run_service(passData, reqId, sqldataControlInsertCallback, (void*)NULL);
 
                if (pid < 0) 
                {
@@ -792,7 +797,8 @@ void SQLDataControlConsumer::OnRequestReceived(const EventInsertPtr& event)
 
                DPL::Mutex::ScopedLock lock(&m_mutex);          
                m_currentReqIds.push_back(reqId);
-               
+               DataControlAsyncCallbackManagerSingleton::Instance().addSQLUserData(reqIdStr, (void*)pendingEvent);
+
        }       
        catch (const WrtDeviceApis::Commons::Exception& ex) 
        {
@@ -873,7 +879,7 @@ void SQLDataControlConsumer::OnRequestReceived(const EventDeletePtr& event)
                addArrayToBundle(passData, queryItem);
                EventDeletePendingEvent* pendingEvent = new EventDeletePendingEvent(this, event);
 
-               int pid = appsvc_run_service(passData, reqId, sqldataControlDeleteCallback, (void*)pendingEvent);
+               int pid = appsvc_run_service(passData, reqId, sqldataControlDeleteCallback, (void*)NULL);
 
                if (pid < 0) 
                {
@@ -884,7 +890,9 @@ void SQLDataControlConsumer::OnRequestReceived(const EventDeletePtr& event)
 
                DPL::Mutex::ScopedLock lock(&m_mutex);          
                m_currentReqIds.push_back(reqId);
+               DataControlAsyncCallbackManagerSingleton::Instance().addSQLUserData(reqIdStr, (void*)pendingEvent);
        }       
+       
        catch (const WrtDeviceApis::Commons::Exception& ex) 
        {
                LoggerE("Exception: " << ex.GetMessage());
@@ -1015,7 +1023,7 @@ void SQLDataControlConsumer::OnRequestReceived(const EventSelectPtr& event)
                addArrayToBundle(passData, queryItem);
                EventSelectPendingEvent* pendingEvent = new EventSelectPendingEvent(this, event);
                
-               int pid = appsvc_run_service(passData, reqId, sqldataControlSelectCallback, (void*)pendingEvent);
+               int pid = appsvc_run_service(passData, reqId, sqldataControlSelectCallback, (void*)NULL);
 
                if (pid < 0) 
                {
@@ -1026,6 +1034,7 @@ void SQLDataControlConsumer::OnRequestReceived(const EventSelectPtr& event)
                
                DPL::Mutex::ScopedLock lock(&m_mutex);          
                m_currentReqIds.push_back(reqId);
+               DataControlAsyncCallbackManagerSingleton::Instance().addSQLUserData(reqIdStr, (void*)pendingEvent);
        }       
        catch (const WrtDeviceApis::Commons::Exception& ex) 
        {
@@ -1108,15 +1117,7 @@ void SQLDataControlConsumer::OnRequestReceived(const EventUpdatePtr& event)
                        queryItem.push_back(countStr); // count
                        queryItem.push_back(ipcFilename); // filepath
 
-/*                     for (std::map<std::string, std::string>::iterator it= rowData->m_Data.begin();
-                               it != rowData->m_Data.end(); ++it)
-                       {
-                               queryItem.push_back((*it).first); // key - column
-                               queryItem.push_back((*it).second); // value
-                       }*/
                        saveArrayToFile(ipcFilename, rowData);
-                       
-
                }
 
                if (where.size() == 0)  // where
@@ -1131,7 +1132,7 @@ void SQLDataControlConsumer::OnRequestReceived(const EventUpdatePtr& event)
                addArrayToBundle(passData, queryItem);
                EventUpdatePendingEvent* pendingEvent = new EventUpdatePendingEvent(this, event);
 
-               int pid = appsvc_run_service(passData, reqId, sqldataControlUpdateCallback, (void*)pendingEvent);
+               int pid = appsvc_run_service(passData, reqId, sqldataControlUpdateCallback, (void*)NULL);
 
                if (pid < 0) 
                {
@@ -1142,6 +1143,8 @@ void SQLDataControlConsumer::OnRequestReceived(const EventUpdatePtr& event)
 
                DPL::Mutex::ScopedLock lock(&m_mutex);          
                m_currentReqIds.push_back(reqId);
+               DataControlAsyncCallbackManagerSingleton::Instance().addSQLUserData(reqIdStr, (void*)pendingEvent);
+
        }       
        catch (const WrtDeviceApis::Commons::Exception& ex) 
        {
@@ -1157,9 +1160,6 @@ void SQLDataControlConsumer::OnRequestReceived(const EventUpdatePtr& event)
        }
 
 }
-
-
-
 }
 }
 
index 989c058..fcb499b 100755 (executable)
@@ -65,7 +65,7 @@ private:
                
        std::string getCurrentApplicationId();
        void addArrayToBundle(bundle* passData, std::vector<std::string>& array);
-       std::vector<unsigned int> m_currentReqIds;
+       static std::vector<unsigned int> m_currentReqIds;
        bool checkReqIdUniqueness(unsigned int reqId);
        void removeReqId(unsigned int reqId);           
        std::string generateFileName(unsigned int reqId);
@@ -87,10 +87,19 @@ private:
 
 };
 
+class CommonPendingEvent
+{
+public:        
+       CommonPendingEvent() {}
+       ~CommonPendingEvent() {}
+
+       virtual void* getThisObject() const = 0;
+};
 
-class EventInsertPendingEvent
+class EventInsertPendingEvent : public CommonPendingEvent
 {
 public:
+       EventInsertPendingEvent() {}
        EventInsertPendingEvent(void *thisObject, const  EventInsertPtr &event) :
                m_thisObject(thisObject),
                m_event(event)
@@ -100,16 +109,17 @@ public:
        virtual ~EventInsertPendingEvent()
        {
        }
-       void* getThisObject() const { return m_thisObject; }
+       virtual void* getThisObject() const { return m_thisObject; }
        EventInsertPtr getEvent() const { return m_event; }
 private:
        void *m_thisObject;
        EventInsertPtr m_event;
 };
 
-class EventDeletePendingEvent
+class EventDeletePendingEvent : public  CommonPendingEvent
 {
 public:
+       EventDeletePendingEvent() {}
        EventDeletePendingEvent(void *thisObject, const  EventDeletePtr &event) :
                m_thisObject(thisObject),
                m_event(event)
@@ -119,16 +129,17 @@ public:
        virtual ~EventDeletePendingEvent()
        {
        }
-       void* getThisObject() const { return m_thisObject; }
+       virtual void* getThisObject() const { return m_thisObject; }
        EventDeletePtr getEvent() const { return m_event; }
 private:
        void *m_thisObject;
        EventDeletePtr m_event;
 };
 
-class EventUpdatePendingEvent
+class EventUpdatePendingEvent : public CommonPendingEvent
 {
 public:
+       EventUpdatePendingEvent() {}
        EventUpdatePendingEvent(void *thisObject, const  EventUpdatePtr &event) :
                m_thisObject(thisObject),
                m_event(event)
@@ -138,16 +149,17 @@ public:
        virtual ~EventUpdatePendingEvent()
        {
        }
-       void* getThisObject() const { return m_thisObject; }
+       virtual void* getThisObject() const { return m_thisObject; }
        EventUpdatePtr getEvent() const { return m_event; }
 private:
        void *m_thisObject;
        EventUpdatePtr m_event;
 };
 
-class EventSelectPendingEvent
+class EventSelectPendingEvent : public CommonPendingEvent
 {
 public:
+       EventSelectPendingEvent() {}
        EventSelectPendingEvent(void *thisObject, const  EventSelectPtr &event) :
                m_thisObject(thisObject),
                m_event(event)
@@ -157,7 +169,7 @@ public:
        virtual ~EventSelectPendingEvent()
        {
        }
-       void* getThisObject() const { return m_thisObject; }
+       virtual void* getThisObject() const { return m_thisObject; }
        EventSelectPtr getEvent() const { return m_event; }
 private:
        void *m_thisObject;
index f9f965c..e400bbf 100644 (file)
@@ -545,6 +545,7 @@ bool Conversation::makeConversationFromMsgId(unsigned int msgId, MessageType msg
                msg_get_int_value(convViewList.msg_struct_info[lastMsgIndex], MSG_CONV_MSG_DIRECTION_INT, &tempInt);
                int type = tempInt;
                LoggerD("direction : " << type);
+               m_direction = type;
 
                msg_get_list_handle(msgInfo, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
                nToCnt = addr_list->nCount;
@@ -872,6 +873,12 @@ bool Conversation::getResult()
        return m_result;
 }
 
+int Conversation::getDirection()
+{
+       return m_direction;
+}
+
+
 }
 }
 
index 6a69fa5..ce4eda2 100644 (file)
@@ -62,6 +62,7 @@ public:
        std::vector<std::string> getBCC();
        int getLastMessageId();
        bool getResult();
+       int getDirection();
        bool makeConversationFromMsgId(unsigned int msgId, MessageType msgType);
        void makeConversationFromThreadIndex(unsigned int threadIndex);
 //     void makeConversationFromThread(msg_thread_view_t msg_thread);
@@ -99,6 +100,7 @@ private:
        std::vector<std::string> m_cc;
        std::vector<std::string> m_bcc;
        int m_lastMessageId;
+       int m_direction;
        bool m_result;
 
 };
index 078c922..1e387e7 100755 (executable)
@@ -52,6 +52,7 @@ public:
        virtual std::vector<std::string> getBCC() = 0;
        virtual int getLastMessageId() = 0;
        virtual bool getResult() = 0;
+       virtual int getDirection() = 0;
 
        virtual void setConvId(const int id) = 0;
 
index abe0907..44cd54b 100644 (file)
@@ -1345,30 +1345,21 @@ void Messaging::OnEventReceived(const DBus::MessageEvent& event)
                                }
                                
                                if(m_onConversationReceived.size() > 0){
-                               m_onConversationReceived.emit(jsEvent);
-                               }
-/*
-                               if (OUTBOX != folder && SENTBOX != folder && DRAFTBOX != folder)
-                               {
-                                       jsEvent->setMessage(msg);
-                                       jsEvent->setConversation(conversation);
-
-                                       if(m_onMessageReceived.size() > 0){
-                                               m_onMessageReceived.emit(jsEvent);
-                                       }
-
-                                       if(m_onConversationReceived.size() > 0){
                                        m_onConversationReceived.emit(jsEvent);
-                                       }
-
-                               } else {
-                                       LoggerW("New email message in ignored folder: " << folder);
                                }
-*/
                        }
-                       else if ((mail_id > 0) && (NOTI_MAIL_DELETE == status))
+                       else if ((name.size() > 0) && (NOTI_MAIL_DELETE == status))
                        { // TODO also RECEIVE_THREAD_ITEM?
-                               LoggerI("Email received. delete type: " << mail_id);
+                               LoggerI("name.size(): " << name.size());
+
+                               unsigned foundLocation = name.rfind(0x01);
+                               LoggerI("foundLocation: " << foundLocation);
+                               if(foundLocation != std::string::npos)
+                               {
+                                       LoggerI("name: " << name);
+                                       name = name.substr(foundLocation+1);
+                                       LoggerI("name: " << name);
+                               }
 
                                std::vector<std::string> strIds = String::split(name, ',');
 
@@ -1586,7 +1577,7 @@ void Messaging::onMessageStorageChanged(msg_handle_t handle,
                     msg_struct_t sendOpt = NULL;
                     msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
                     sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
-                       
+
                     err = msg_get_message(handle, pMsgIdList->msgIdList[index], msg, sendOpt);
 
                     if (err != MSG_SUCCESS)
@@ -1601,7 +1592,7 @@ void Messaging::onMessageStorageChanged(msg_handle_t handle,
                     }
                     int msgType = 0;
                     msg_get_int_value(msg, MSG_MESSAGE_TYPE_INT, &msgType);
-                  LoggerD("msgType : " << msgType); 
+                    LoggerD("msgType : " << msgType);
                     if((msgType > MSG_TYPE_INVALID) && ( msgType <= MSG_TYPE_SMS_REJECT))
                     {
                         if(msgType  != MSG_TYPE_MMS_NOTI)
@@ -1619,21 +1610,30 @@ void Messaging::onMessageStorageChanged(msg_handle_t handle,
                             event->setMessage(message);
                             event->setConversation(conversation);
 
-                            if(storageChangeType == MSG_STORAGE_CHANGE_INSERT)
-                            {
-                                LoggerD("MSG_STORAGE_CHANGE_INSERT");
-                                event->setMsg_Event_Type(EventMessageReceived::MSG_ADDED);
-                            }
-                            else if(storageChangeType == MSG_STORAGE_CHANGE_UPDATE)
-                            {
-                                LoggerD("MSG_STORAGE_CHANGE_UPDATE");
-                                event->setMsg_Event_Type(EventMessageReceived::MSG_UPDATED);
-                            }
-
                             if(this_->m_onMessageReceived.size() > 0){
+                                if(storageChangeType == MSG_STORAGE_CHANGE_INSERT)
+                                {
+                                    LoggerD("MSG_STORAGE_CHANGE_INSERT");
+                                    event->setMsg_Event_Type(EventMessageReceived::MSG_ADDED);
+                                }
+                                else if(storageChangeType == MSG_STORAGE_CHANGE_UPDATE)
+                                {
+                                    LoggerD("MSG_STORAGE_CHANGE_UPDATE");
+                                   event->setMsg_Event_Type(EventMessageReceived::MSG_UPDATED);
+                                }
                                 this_->m_onMessageReceived.emit(event);
                             }
-                            if(this_->m_onConversationReceived.size() > 0){
+                            if((this_->m_onConversationReceived.size() > 0) && (storageChangeType == MSG_STORAGE_CHANGE_INSERT)){
+                                if(conversation->getMessageCount() == 1)
+                                {
+                                    LoggerD("MSG_STORAGE_CHANGE_INSERT");
+                                    event->setMsg_Event_Type(EventMessageReceived::MSG_ADDED);
+                                }
+                                if(conversation->getMessageCount() > 1)
+                                {
+                                    LoggerD("MSG_STORAGE_CHANGE_INSERT but Conversation Count > 1");
+                                    event->setMsg_Event_Type(EventMessageReceived::MSG_UPDATED);
+                                }
                                 this_->m_onConversationReceived.emit(event);
                             }
                         }
@@ -1650,7 +1650,6 @@ void Messaging::onMessageStorageChanged(msg_handle_t handle,
                             msg_get_int_value(msg, MSG_MESSAGE_ID_INT, &msgId);
                             IMessagePtr message = MessageFactory::createMessage(
                                                                                 MMS,
-//                                                                                msg_get_message_id(
                                                                                 msgId,
                                                                                 msg
                                                                                 );
@@ -1660,23 +1659,30 @@ void Messaging::onMessageStorageChanged(msg_handle_t handle,
                             event->setMessage(message);
                             event->setConversation(conversation);
 
-                            if(storageChangeType == MSG_STORAGE_CHANGE_INSERT)
-                            {
-                                event->setMsg_Event_Type(EventMessageReceived::MSG_ADDED);
-                            }
-                            else if(storageChangeType == MSG_STORAGE_CHANGE_UPDATE)
-                            {
-                                event->setMsg_Event_Type(EventMessageReceived::MSG_UPDATED);
-                            }
-//                             else if(storageChangeType == MSG_STORAGE_CHANGE_DELETE)
-//                             {
-//                                 event->setMsg_Event_Type(EventMessageReceived::MSG_DELETED);
-//                             }
-
                             if(this_->m_onMessageReceived.size() > 0){
+                                if(storageChangeType == MSG_STORAGE_CHANGE_INSERT)
+                                {
+                                    LoggerD("MSG_STORAGE_CHANGE_INSERT");
+                                    event->setMsg_Event_Type(EventMessageReceived::MSG_ADDED);
+                                }
+                                else if(storageChangeType == MSG_STORAGE_CHANGE_UPDATE)
+                                {
+                                    LoggerD("MSG_STORAGE_CHANGE_UPDATE");
+                                   event->setMsg_Event_Type(EventMessageReceived::MSG_UPDATED);
+                                }
                                 this_->m_onMessageReceived.emit(event);
                             }
-                            if(this_->m_onConversationReceived.size() > 0){
+                            if((this_->m_onConversationReceived.size() > 0) && (storageChangeType == MSG_STORAGE_CHANGE_INSERT)){
+                                if(conversation->getMessageCount() == 1)
+                                {
+                                    LoggerD("MSG_STORAGE_CHANGE_INSERT");
+                                    event->setMsg_Event_Type(EventMessageReceived::MSG_ADDED);
+                                }
+                                if(conversation->getMessageCount() > 1)
+                                {
+                                    LoggerD("MSG_STORAGE_CHANGE_INSERT but Conversation Count > 1");
+                                    event->setMsg_Event_Type(EventMessageReceived::MSG_UPDATED);
+                                }
                                 this_->m_onConversationReceived.emit(event);
                             }
                         }
index f40bb37..cf0d7a1 100755 (executable)
@@ -267,6 +267,7 @@ void Systeminfo::clearWatch(const long id)
                     vconf_ignore_key_changed(VCONFKEY_TELEPHONY_FLIGHT_MODE, CellularNetworkValueCallback);
                     vconf_ignore_key_changed(VCONFKEY_TELEPHONY_CELLID, CellularNetworkValueCallback);
                     vconf_ignore_key_changed(VCONFKEY_TELEPHONY_LAC, CellularNetworkValueCallback);
+                    vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SVC_ROAM, CellularNetworkValueCallback);
                     if (m_networkRegist == REGIST_CELLULAR) {
                         connection_unset_ip_address_changed_cb(m_connectionHandle);
                         m_networkRegist = REGIST_NOT;
@@ -504,6 +505,7 @@ void Systeminfo::OnRequestReceived(const EventWatchSysteminfoPtr& event)
                 vconf_notify_key_changed(VCONFKEY_TELEPHONY_FLIGHT_MODE, CellularNetworkValueCallback, (void *)this);
                 vconf_notify_key_changed(VCONFKEY_TELEPHONY_CELLID, CellularNetworkValueCallback, (void *)this);
                 vconf_notify_key_changed(VCONFKEY_TELEPHONY_LAC, CellularNetworkValueCallback, (void *)this);
+                vconf_notify_key_changed(VCONFKEY_TELEPHONY_SVC_ROAM, CellularNetworkValueCallback, (void *)this);                
                 if (m_networkRegist == REGIST_NOT) {
                     connection_set_ip_address_changed_cb(m_connectionHandle, NetworkValueCallback, (void *)this);
                     m_networkRegist = REGIST_CELLULAR;