Update change log and spec for wrt-plugins-tizen_0.2.72
authorKisub Song <kisubs.song@samsung.com>
Mon, 27 Aug 2012 10:49:49 +0000 (19:49 +0900)
committerKisub Song <kisubs.song@samsung.com>
Mon, 27 Aug 2012 10:53:24 +0000 (19:53 +0900)
Changed Modules : Messaging, Notification, Alarm,
                  LBS and Contact

[Version] 0.2.72
[Project] GT-I8800, Public
[Title] SEL Verification
[Team] WebAPI
[BinType] PDA
[Customer] Open

[Issue#] WEB-1644
[Problem] Message is deleted but does not popup window occurs
[Cause] Message delete is not checked for email conversation
[Solution] check email conversation delete

[Issue#] N_SE-7298
[Problem] remove, removeAll functions are undefined.
[Cause] wrong names are used.
[Solution] function names are modified.

[Issue#] WEB-1714
[Problem] Alarm with service not running.
[Cause] Wrong app id.
[Solution] Use aysnc callback handler in TC.

[Issue#] N_SE-7702
[Problem] Geocoder converting fail
[Cause] security error,
[Solution] Add security param, change API name, add flag

[Issue#] N/A
[Problem] Showed wrong date value from DB
[Cause] Conversion rule was wrong
[Solution] Fix conversion rule

[SCMRequest] N/A

Change-Id: I9842827affe9b7348429d768dd0d5834af086e00

23 files changed:
debian/changelog
packaging/wrt-plugins-tizen.spec
src/platform/API/Call/CallDefine.h
src/platform/API/Messaging/IConversation.h
src/platform/Tizen/Call/CallHistoryFilter.cpp
src/platform/Tizen/Contact/ContactDownloadManager.cpp
src/platform/Tizen/Contact/ContactObjectA2PConverter.cpp
src/platform/Tizen/Contact/ContactObjectP2AConverter.cpp
src/platform/Tizen/Contact/ContactUtility.cpp
src/platform/Tizen/Contact/ContactUtility.h
src/platform/Tizen/Messaging/Conversation.cpp
src/platform/Tizen/Messaging/Conversation.h
src/platform/Tizen/Messaging/Messaging.cpp
src/platform/Tizen/Messaging/messageDB/MessageStorageReader.cpp
src/standards/Tizen/Alarm/JSAlarmManager.cpp
src/standards/Tizen/Geocoder/DefaultGeocoderProvider.cpp
src/standards/Tizen/Geocoder/JSGeocoderServiceManager.cpp
src/standards/Tizen/LBS/JSLBS.cpp
src/standards/Tizen/LBS/LBSAce.cpp
src/standards/Tizen/Notification/JSNotificationManager.cpp
src/standards/Tizen/POI/DefaultPOIProvider.cpp
src/standards/Tizen/POI/JSPOIServiceManager.cpp
src/standards/Tizen/Route/JSRouteServiceManager.cpp

index b7b0447..dc9c4cc 100644 (file)
@@ -1,3 +1,11 @@
+wrt-plugins-tizen (0.2.72) unstable; urgency=low
+
+  * Bug fix on Messaging, Notification, Alarm, LBS and Contact
+  * Git : slp/pkgs/w/wrt-plugins-tizen
+  * Tag : wrt-plugins-tizen_0.2.72
+
+ -- Kisub Song <kisubs.song@samsung.com>  Mon, 27 Aug 2012 19:36:19 +0900
+
 wrt-plugins-tizen (0.2.71) unstable; urgency=low
 
   * Bug fix on Messaging, Calendar, Notification, Download, Contact, Filesystem and Application
index a1ec4ae..e0f832d 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       wrt-plugins-tizen
 Summary:    JavaScript plugins for WebRuntime
-Version:    0.2.71
+Version:    0.2.72
 Release:    0
 Group:      TO_BE_FILLED
 License:    TO_BE_FILLED
index 1e84d1c..bd73cb6 100755 (executable)
@@ -36,7 +36,7 @@ namespace {
 #define STR_REJECTED                   "rejected"
 #define STR_BLOCKED                    "blocked"
 
-#define STR_BASE_QUERY                 "SELECT id, log_type, person_id, number, log_time, data1 FROM phonelogs"
+#define STR_BASE_QUERY                 "SELECT id, log_type, related_id, number, log_time, data1 FROM phonelogs"
 
 #define STR_ENTRY_ID                   "uid"
 #define STR_SERVICE_ID                 "serviceId"
@@ -64,7 +64,7 @@ namespace {
 #define STR_LOG_TIME                   "log_time"
 #define STR_LOG_TYPE                   "log_type"
 #define STR_DATA1                      "data1"
-#define STR_PERSON_ID                  "person_id"
+#define STR_RELATED_ID                 "related_id"
 
 #define STR_TEL_URI                    "tel://"
 #define STR_TIZEN_DIALER               "org.tizen.phone"
index c520e3c..5167311 100755 (executable)
@@ -53,6 +53,8 @@ public:
        virtual unsigned int getLastMessageId() = 0;
        virtual bool getResult() = 0;
 
+       virtual void setId(const unsigned int id) = 0;
+
 #if 0
 private:
        
index 7015c6d..0667b82 100755 (executable)
@@ -29,7 +29,7 @@ using namespace TizenApis::Api::Call;
 namespace {
 const std::string F_LOG_ID (STR_LOG_ID);
 const std::string F_LOG_TYPE (STR_LOG_TYPE);
-const std::string F_PERSON_ID (STR_PERSON_ID);
+const std::string F_RELATED_ID (STR_RELATED_ID);
 const std::string F_NUMBER (STR_NUMBER);
 const std::string F_LOG_TIME (STR_LOG_TIME);
 const std::string F_DURATION (STR_DATA1);
@@ -111,7 +111,7 @@ void CallHistoryFilter::visitAttributeRange(std::string& attrName, AnyPtr& initi
        if (attrName.compare(STR_RP_REMOTEPARTY) == 0) {
                name = F_NUMBER;
        } else if (attrName.compare(STR_RP_CONTACTREF) == 0) {
-               name = F_PERSON_ID;
+               name = F_RELATED_ID;
        } else if (attrName.compare(STR_START_TIME) == 0) {
                name = F_LOG_TIME;      
        } else if (attrName.compare(STR_DURATION) == 0) {
@@ -228,7 +228,7 @@ std::string CallHistoryFilter::convertAttribute(std::string &name, AnyPtr& value
        } else if (name.compare(STR_RP_REMOTEPARTY) == 0) {
                query = F_LEFT_BRACKET + F_NUMBER + F_EQUAL + F_S_QUOTATION + value->toString() + F_S_QUOTATION + F_RIGHT_BRACKET;
        } else if (name.compare(STR_RP_CONTACTREF) == 0) {
-               query = F_LEFT_BRACKET + F_PERSON_ID + F_EQUAL + F_S_QUOTATION + value->toString() + F_S_QUOTATION + F_RIGHT_BRACKET;
+               query = F_LEFT_BRACKET + F_RELATED_ID + F_EQUAL + F_S_QUOTATION + value->toString() + F_S_QUOTATION + F_RIGHT_BRACKET;
        } else if (name.compare(STR_START_TIME) == 0) {
                std::string dateStr ("");
                if(value->getType() == PrimitiveType_Time) {
index 3f1b57c..1c8d36e 100755 (executable)
@@ -33,6 +33,8 @@
 #include <Commons/Exception.h>
 #include <Commons/Regex.h>
 
+#define TMP_DOWNLOAD_PATH "/opt/media/Downloads/Others/"
+
 namespace TizenApis {
 namespace Platform {
 namespace Contact {
@@ -74,6 +76,12 @@ string ContactDownloadManager::downloadImage(const string &imgUrl) const
                        ThrowMsg(PlatformException, "Error during url_download_set_url() ret: " << ud_ret);
                }
 
+               ud_ret = url_download_set_destination(urlDownload, TMP_DOWNLOAD_PATH);
+               if (ud_ret != URL_DOWNLOAD_ERROR_NONE) {
+                       url_download_destroy(urlDownload);
+                       ThrowMsg(PlatformException, "Error during url_download_set_destination() ret: " << ud_ret);
+               }
+
                ud_ret = url_download_set_stopped_cb(urlDownload, urlDownloadStoppedCB, static_cast<void*>(&downImageInfo));
                if (ud_ret != URL_DOWNLOAD_ERROR_NONE)
                {
@@ -98,11 +106,13 @@ string ContactDownloadManager::downloadImage(const string &imgUrl) const
                DPL::WaitForSingleHandle(waitableEvent.GetHandle());
                waitableEvent.Reset();
                if ((downImageInfo.getDownloadedImagePath()).empty()) {
+                       url_download_destroy(urlDownload);
                        ThrowMsg(PlatformException, "Download failed");
                }
 
                url_download_destroy(urlDownload);
-               result = "file://" + downImageInfo.getDownloadedImagePath();
+
+               result = "file://" TMP_DOWNLOAD_PATH + downImageInfo.getDownloadedImagePath();
 
        } Catch (Exception) {
                LogError("Probably invalid URL(" << imgUrl << ") " << _rethrown_exception.GetMessage());
@@ -138,6 +148,8 @@ string ContactDownloadManager::getRealPath(const string &path) const
                LogError("invalid path(" << path << ")");
        }
 
+       LogDebug("RealPath : " << result);
+
        return result;
 }
 
@@ -164,7 +176,6 @@ void ContactDownloadManager::urlDownloadCompletedCB(url_download_h download, con
        if(download == NULL)
        {
                LogDebug("download_info is NULL!!");
-               return;
        }
 
        if (user_data == NULL)
@@ -173,15 +184,20 @@ void ContactDownloadManager::urlDownloadCompletedCB(url_download_h download, con
                return;
        }
 
-       if (installed_path)
+       string savedPath;
+       if(installed_path)
        {
                LogDebug("installed_path : " << installed_path);
-
-               DownImageInfo *downImageInfo = static_cast<DownImageInfo*>(user_data);
-               string savedPath = installed_path;
-               downImageInfo->setDownloadedImagePath(savedPath);
-               (downImageInfo->getWaitableEvent())->Signal();
+               savedPath = installed_path;
        }
+       else
+       {
+               LogWarning("installed path is NULL");
+       }
+
+       DownImageInfo *downImageInfo = static_cast<DownImageInfo*>(user_data);
+       downImageInfo->setDownloadedImagePath(savedPath);
+       (downImageInfo->getWaitableEvent())->Signal();
 }
 
 ContactDownloadManagerPtr ContactDownloadManager::getInstance()
index b7b187a..e9f1dbc 100644 (file)
@@ -1345,9 +1345,7 @@ GSList * ContactObjectA2PConverter::importEventListBirthday(GSList *gsList)
        if (birthdayTm.tm_year == 0 && birthdayTm.tm_mon == 0 && birthdayTm.tm_mday == 0)
                return gsList;
 
-       int birthday = ( ( birthdayTm.tm_year + 1900) * 10000 ) +
-                       ( ( birthdayTm.tm_mon + 1 ) * 100 ) +
-                       birthdayTm.tm_mday;
+       int birthday = ContactUtility::toDateDbInt(birthdayTm);
 
        CTSvalue *ctsValue = NULL;
        ctsValue = contacts_svc_value_new(CTS_VALUE_EVENT);
@@ -1400,9 +1398,7 @@ GSList * ContactObjectA2PConverter::importEventListAnniversary(GSList *gsList)
                if (dateTm.tm_year == 0 && dateTm.tm_mon == 0 && dateTm.tm_mday == 0)
                        continue;
 
-               int date = ( ( dateTm.tm_year + 1900) * 10000 ) +
-                               ( ( dateTm.tm_mon + 1 ) * 100 ) +
-                               dateTm.tm_mday;
+               int date = ContactUtility::toDateDbInt(dateTm);
 
                CTSvalue *ctsValue = NULL;
                ctsValue = contacts_svc_value_new(CTS_VALUE_EVENT);
index f43d19a..cd94914 100644 (file)
@@ -617,11 +617,13 @@ void ContactObjectP2AConverter::exportEventList()
 
                intValueDate = contacts_svc_value_get_int(static_cast<CTSvalue*>(eventList->data), CTS_EVENT_VAL_DATE_INT);
 
-               struct tm tmDate = {0, };
+               tm tmDate = {0, };
 
-               tmDate.tm_year = (intValueDate / 10000) - 1900;
-               tmDate.tm_mon = ((intValueDate - ((tmDate.tm_year + 1900) * 10000)) / 100) - 1;
-               tmDate.tm_mday = (intValueDate - ((tmDate.tm_year + 1900) * 10000) - tmDate.tm_mon * 100);
+               Try {
+                       tmDate = ContactUtility::toDateTmFromDateDbInt(intValueDate);
+               } Catch(Exception) {
+                       LogError("date has wrong value");
+               }
 
                intValueType = contacts_svc_value_get_int(static_cast<CTSvalue*>(eventList->data), CTS_EVENT_VAL_TYPE_INT);
                if (intValueType == CTS_EVENT_TYPE_BIRTH)
index 7c76f55..185d2fb 100644 (file)
@@ -87,6 +87,11 @@ string ContactUtility::intToStr(const int value)
        return oss.str();
 }
 
+int ContactUtility::toDateDbInt(const tm &date)
+{
+       return strToInt(toDateDbStr(date));
+}
+
 string ContactUtility::toDateDbStr(const tm &date)
 {
        stringstream ss;
@@ -97,11 +102,28 @@ string ContactUtility::toDateDbStr(const tm &date)
        return ss.str();
 }
 
-tm ContactUtility::toDateTmFromDateDbStr(const char* arg)
+tm ContactUtility::toDateTmFromDateDbInt(int arg)
 {
        tm date;
        memset(&date, 0, sizeof(tm));
 
+       if(arg < 0) {
+               ThrowMsg(InvalidArgumentException, "Invalid Date type");
+       }
+
+       int section0to3 = arg / 10000;
+       int section4to5 = (arg / 100) % 100;
+       int section6to7 = arg % 100;
+
+       date.tm_year = section0to3 - 1900;
+       date.tm_mon = section4to5 - 1;
+       date.tm_mday = section6to7;
+
+       return date;
+}
+
+tm ContactUtility::toDateTmFromDateDbStr(const char* arg)
+{
        if(arg == NULL) {
                ThrowMsg(InvalidArgumentException, "Invalid Date type");
        }
@@ -110,11 +132,7 @@ tm ContactUtility::toDateTmFromDateDbStr(const char* arg)
        stringstream ss(arg);
        ss >> dateDb;
 
-       date.tm_year = (dateDb / 10000) - 1900;
-       date.tm_mon = ((dateDb - ((date.tm_year + 1900) * 10000)) / 100) - 1;
-       date.tm_mday = (dateDb - ((date.tm_year + 1900) * 10000) - ((date.tm_mon+1) * 100));
-
-       return date;
+       return toDateTmFromDateDbInt(dateDb);
 }
 
 string ContactUtility::convertUriToPath(const string str)
index 417b38b..ce7bd86 100644 (file)
@@ -41,7 +41,9 @@ public:
        static int strToInt(const std::string &str);
        static std::string intToStr(const int value);
 
+       static int toDateDbInt(const tm &date);
        static std::string toDateDbStr(const tm &date);
+       static tm toDateTmFromDateDbInt(int arg);
        static tm toDateTmFromDateDbStr(const char* arg);
 
        static std::string convertUriToPath(const std::string str);
index e7d0fff..4de99b6 100644 (file)
@@ -855,6 +855,12 @@ void Conversation::setLastMessageId(unsigned int id)
        m_lastMessageId = id;
 }
 #endif
+
+void Conversation::setId(const unsigned int id)
+{
+       m_Id = id;
+}
+
 // getter
 unsigned int Conversation::getId()
 {
index b7f2f39..0b94084 100644 (file)
@@ -67,7 +67,8 @@ public:
 //     void makeConversationFromThread(msg_thread_view_t msg_thread);
        void makeConversationFromThread(msg_struct_t msg_thread);
        bool makeConversationFromEmailThreadId(unsigned int emailTreadId);
-#if 0  
+       void setId(const unsigned int id);
+#if 0
        // setter
        void setId(unsigned int id);
        void setType(unsigned short type);
index ca16667..9edf411 100644 (file)
@@ -374,7 +374,7 @@ std::string Messaging::generateFilterSql(const Api::Tizen::FilterPtr& filter){
                vector<IMessagePtr> retVal;
                std::string tempString = "";
 //             MSG_LIST_S message_list = {0, NULL};
-               msg_struct_list_s message_list = {0, NULL};
+               msg_struct_list_s message_list = {0,};
 
                Try{
                        msg_error_t res = MSG_ERR_UNKNOWN;
@@ -409,7 +409,7 @@ std::string Messaging::generateFilterSql(const Api::Tizen::FilterPtr& filter){
 
                vector<IMessagePtr> retVal;
 //             MSG_LIST_S message_list = {0, NULL};
-               msg_struct_list_s message_list = {0, NULL};
+               msg_struct_list_s message_list = {0,};
 
                Try{
                        msg_error_t res = MSG_ERR_UNKNOWN;
@@ -1265,242 +1265,249 @@ void Messaging::removeOnMessageFolderReceived(Api::Messaging::EmitterFolderRecei
 
 void Messaging::OnEventReceived(const DBus::MessageEvent& event)
 {
-    LogDebug("ENTER");
-    EventMessageReceivedPtr jsEvent(new EventMessageReceived());
-    DBus::MessagePtr message = event.GetArg0();
+       LogDebug("ENTER");
+       EventMessageReceivedPtr jsEvent(new EventMessageReceived());
+       DBus::MessagePtr message = event.GetArg0();
 
-    if (!message) 
-    {
-        jsEvent->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::PlatformException);
-        m_onMessageReceived.emit(jsEvent);
-    } 
-    else 
-    {
-        if (message->getInterface() == DBUS_INTERFACE_EMAIL_RECEIVED) 
-        {
-            int account_id = 0, mail_id = 0, thread_id = 0, status = 0;
-            std::string name;
-            email_mailbox_t m_mailboxes;               
-            email_mailbox_t* mailboxes = NULL;
-                       
-            DBus::Message::ReadIterator it = message->getReadIterator();
-            for (int i = 0; it->isValid(); it->next(), ++i) 
-            {
-                if ((i == 0) && (it->getArgType() == DBUS_TYPE_INT32)) 
-                {
-                    status = it->getInt();
-                    LogInfo("status: " << status);                                     
-                } 
-                else if ((i == 1) && (it->getArgType() == DBUS_TYPE_INT32)) 
-                {
-                    account_id = it->getInt();
-                    LogInfo("account_id: " << account_id);                                     
-                } 
-                else if ((i == 2) && (it->getArgType() == DBUS_TYPE_INT32)) 
-                {
-                    mail_id = it->getInt();
-                    LogInfo("mail_id: " << mail_id);                                                                           
-                } 
-                else if ((i == 3) && (it->getArgType() == DBUS_TYPE_STRING)) 
-                {
-                    name = it->getString();
-                    LogInfo("name: " << name);                                                                         
-                } 
-                else if ((i == 4) && (it->getArgType() == DBUS_TYPE_INT32)) 
-                {
-                    thread_id = it->getInt();
-                    LogInfo("thread_id: " << thread_id);                                                                               
-                }
-            }
-                                       
-            if ((mail_id > 0) && (NOTI_MAIL_ADD == status)) 
-            { // TODO also RECEIVE_THREAD_ITEM?
-                LogInfo("Email received. mail_id: " << mail_id);
+       if (!message) 
+       {
+               jsEvent->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::PlatformException);
+               m_onMessageReceived.emit(jsEvent);
+       } 
+       else 
+       {
+               if (message->getInterface() == DBUS_INTERFACE_EMAIL_RECEIVED) 
+               {
+                       int account_id = 0, mail_id = 0, thread_id = 0, status = 0;
+                       std::string name;
+                       email_mailbox_t m_mailboxes;            
+                       email_mailbox_t* mailboxes = NULL;
 
-                IMessagePtr msg = MessageFactory::createMessage(EMAIL, mail_id);
-                IConversationPtr conversation(new Conversation(thread_id, EMAIL));
-                               
-                // TODO Temporary fix: ignore messages from OUTBOX, SENTBOX & DRAFTBOX -> most probably we added them
-                Api::Messaging::FolderType folder = msg->getCurrentFolder();
-                jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_ADDED);
-                               
-                if (OUTBOX != folder && SENTBOX != folder && DRAFTBOX != folder) 
-                {
-                    IEmailPtr email = MessageFactory::convertToEmail(msg);
-                    jsEvent->setMessage(msg);
-                    jsEvent->setConversation(conversation);                                    
+                       DBus::Message::ReadIterator it = message->getReadIterator();
+                       for (int i = 0; it->isValid(); it->next(), ++i) 
+                       {
+                               if ((i == 0) && (it->getArgType() == DBUS_TYPE_INT32)) 
+                               {
+                                       status = it->getInt();
+                                       LogInfo("status: " << status);                                  
+                               } 
+                               else if ((i == 1) && (it->getArgType() == DBUS_TYPE_INT32)) 
+                               {
+                                       account_id = it->getInt();
+                                       LogInfo("account_id: " << account_id);                                  
+                               } 
+                               else if ((i == 2) && (it->getArgType() == DBUS_TYPE_INT32)) 
+                               {
+                                       mail_id = it->getInt();
+                                       LogInfo("mail_id: " << mail_id);                                                                                
+                               } 
+                               else if ((i == 3) && (it->getArgType() == DBUS_TYPE_STRING)) 
+                               {
+                                       name = it->getString();
+                                       LogInfo("name: " << name);                                                                              
+                               } 
+                               else if ((i == 4) && (it->getArgType() == DBUS_TYPE_INT32)) 
+                               {
+                                       thread_id = it->getInt();
+                                       LogInfo("thread_id: " << thread_id);                                                                            
+                               }
+                       }
 
-                    if(m_onMessageReceived.size() > 0){
-                        m_onMessageReceived.emit(jsEvent);
-                    }
+                       if ((mail_id > 0) && (NOTI_MAIL_ADD == status)) 
+                       { // TODO also RECEIVE_THREAD_ITEM?
+                               LogInfo("Email received. mail_id: " << mail_id);
 
-                    if(m_onConversationReceived.size() > 0){
-                        m_onConversationReceived.emit(jsEvent);
-                    }
+                               IMessagePtr msg = MessageFactory::createMessage(EMAIL, mail_id);
+                               IConversationPtr conversation(new Conversation(thread_id, EMAIL));
 
-                } else {
-                    LogWarning("New email message in ignored folder: " << folder);
-                }
-            }
-            else if ((mail_id > 0) && (NOTI_MAIL_DELETE == status)) 
-            { // TODO also RECEIVE_THREAD_ITEM?
-                LogInfo("Email received. delete type: " << mail_id);                   
+                               // TODO Temporary fix: ignore messages from OUTBOX, SENTBOX & DRAFTBOX -> most probably we added them
+                               Api::Messaging::FolderType folder = msg->getCurrentFolder();
+                               jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_ADDED);
 
-                std::vector<std::string> strIds = String::split(name, ',');
+                               if (OUTBOX != folder && SENTBOX != folder && DRAFTBOX != folder)
+                               {
+                                       jsEvent->setMessage(msg);
+                                       jsEvent->setConversation(conversation);
 
-                std::stringstream stream;                                              
-                for (std::vector<std::string>::iterator it = strIds.begin(); it != strIds.end(); ++it) 
-                {
-                    LogDebug("ID is :" << *it);
+                                       if(m_onMessageReceived.size() > 0){
+                                               m_onMessageReceived.emit(jsEvent);
+                                       }
 
-                    if ( (*it).length() > 0 ) //vaild id
-                    {
-                        stream<< *it;
-                        int id;
-                        stream >> id;
-                                       
-                        IMessagePtr msg = MessageFactory::createMessage(EMAIL, id);
-                        IConversationPtr conversation(new Conversation(thread_id, EMAIL));                                     
-
-                        Api::Messaging::FolderType folder = msg->getCurrentFolder();
-                        jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_DELETED);
-                                               
-                        if (true) { // if (OUTBOX != folder && SENTBOX != folder && DRAFTBOX != folder)
-                            IEmailPtr email = MessageFactory::convertToEmail(msg);
-                            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 {
-                            LogWarning("New email message in ignored folder: " << folder);
-                        }
-                    }
-                               
-                    stream.clear();
-                } //for
-                                       
-            }
-            else if ((mail_id > 0) && (NOTI_MAIL_UPDATE == status)) 
-            { // TODO also RECEIVE_THREAD_ITEM?
-                LogInfo("Email received. mail_id: " << mail_id);
+                                       if(m_onConversationReceived.size() > 0){
+                                       m_onConversationReceived.emit(jsEvent);
+                                       }
 
-                IMessagePtr msg = MessageFactory::createMessage(EMAIL, mail_id);
-                IConversationPtr conversation(new Conversation(thread_id, EMAIL));
+                               } else {
+                                       LogWarning("New email message in ignored folder: " << folder);
+                               }
+                       }
+                       else if ((mail_id > 0) && (NOTI_MAIL_DELETE == status))
+                       { // TODO also RECEIVE_THREAD_ITEM?
+                               LogInfo("Email received. delete type: " << mail_id);
 
-                Api::Messaging::FolderType folder = msg->getCurrentFolder();
-                jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_UPDATED);
-                               
-                if (true) { // if (OUTBOX != folder && SENTBOX != folder && DRAFTBOX != folder)
-                    IEmailPtr email = MessageFactory::convertToEmail(msg);
-                    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 {
-                    LogWarning("New email message in ignored folder: " << folder);
-                }
-            }
-            else if (NOTI_MAILBOX_ADD == status) 
-            {
-                LogInfo("Emailbox received. account Id: " << account_id);
-                LogInfo("name Id: " << name);
+                               std::vector<std::string> strIds = String::split(name, ',');
 
-                email_mail_data_t* mail_data = NULL;
-                email_mailbox_t* mail_box = NULL;
-                               
-                if (EMAIL_ERROR_NONE != email_get_mail_data(mail_id, &mail_data)) {
-                    LogError("Couldn't retrieve message or it has been malformed.");
-                }
-                if (EMAIL_ERROR_NONE != email_get_mailbox_by_mailbox_id(mail_data->mailbox_id, &mail_box)) {
-                    LogError("Couldn't retrieve message or it has been malformed.");
-                }
-                       
-//                email_get_mailbox_by_name(account_id, name.c_str(), &mail_box);
+                               std::stringstream stream;
+                               for (std::vector<std::string>::iterator it = strIds.begin(); it != strIds.end(); ++it)
+                               {
+                                       LogDebug("ID is :" << *it);
 
-                m_mailboxes = *mail_box;
+                                       if ( (*it).length() > 0 ) //vaild id
+                                       {
+                                               stream<< *it;
+                                               int id;
+                                               stream >> id;
+
+                                               IMessagePtr msg = MessageFactory::createMessage(EMPTY_MESSAGE, id);
+                                               IConversationPtr conversation(new Conversation());
+
+                                               Api::Messaging::FolderType folder = msg->getCurrentFolder();
+                                               jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_DELETED);
+
+                                               if (true) { // if (OUTBOX != folder && SENTBOX != folder && DRAFTBOX != folder)
+                                                       jsEvent->setMessage(msg);
+                                                       jsEvent->setConversation(conversation);
+                                                       if(m_onMessageReceived.size() > 0){
+                                                               m_onMessageReceived.emit(jsEvent);
+                                                       }
+                                               }
+                                               else {
+                                                       LogWarning("New email message in ignored folder: " << folder);
+                                               }
+                                       }
 
-                Api::Messaging::IMessageFolderPtr folderPtr(new MessageFolder(m_mailboxes));
-                jsEvent->setMessageFolder(folderPtr);
-                jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_ADDED);
-                if(m_onFolderReceived.size() > 0)
-                {
-                    m_onFolderReceived.emit(jsEvent);
-                }
+                                       stream.clear();
+                               } //for
 
-            }
-            else if (NOTI_MAILBOX_UPDATE == status) 
-            {
-                LogInfo("Emailbox received. account Id: " << account_id);
-                LogInfo("name Id: " << name);
+                       }
+                       else if ((mail_id > 0) && (NOTI_MAIL_UPDATE == status)) 
+                       { // TODO also RECEIVE_THREAD_ITEM?
+                               LogInfo("Email received. mail_id: " << mail_id);
+
+                               IMessagePtr msg = MessageFactory::createMessage(EMAIL, mail_id);
+                               IConversationPtr conversation(new Conversation(thread_id, EMAIL));
+
+                               Api::Messaging::FolderType folder = msg->getCurrentFolder();
+                               jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_UPDATED);
+
+                               if (true) { // 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 {
+                                       LogWarning("New email message in ignored folder: " << folder);
+                               }
+                       }
+                       else if ((mail_id > 0) && (NOTI_THREAD_DELETE == status))
+                       { // TODO also RECEIVE_THREAD_ITEM?
+                               LogInfo("Email received. delete thread Id : " << mail_id);
 
-                email_mail_data_t* mail_data = NULL;
-                email_mailbox_t* mail_box = NULL;
-               
-                if (EMAIL_ERROR_NONE != email_get_mail_data(mail_id, &mail_data)) {
-                    LogError("Couldn't retrieve message or it has been malformed.");
-                }
-                if (EMAIL_ERROR_NONE != email_get_mailbox_by_mailbox_id(mail_data->mailbox_id, &mail_box)) {
-                    LogError("Couldn't retrieve message or it has been malformed.");
-                }
-       
-//            email_get_mailbox_by_name(account_id, name.c_str(), &mailboxes);
+                               IConversationPtr conversation(new Conversation());
+                               conversation->setId((unsigned int)mail_id);
+                               jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_DELETED);
+                               jsEvent->setConversation(conversation);
 
-                m_mailboxes = *mail_box;
+                               if(m_onConversationReceived.size() > 0){
+                                       m_onConversationReceived.emit(jsEvent);
+                               }
+                       }
+                       else if (NOTI_MAILBOX_ADD == status)
+                       {
+                               LogInfo("Emailbox received. account Id: " << account_id);
+                               LogInfo("name Id: " << name);
 
-                Api::Messaging::IMessageFolderPtr folderPtr(new MessageFolder(m_mailboxes));
-                jsEvent->setMessageFolder(folderPtr);
-                jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_UPDATED);
-                               
-                if(m_onFolderReceived.size() > 0)
-                {
-                    m_onFolderReceived.emit(jsEvent);
-                }
-            }
-            else if (NOTI_MAILBOX_DELETE == status) 
-            {
-                LogInfo("Emailbox received. account Id: " << account_id);
-                LogInfo("name Id: " << name);
+                               email_mail_data_t* mail_data = NULL;
+                               email_mailbox_t* mail_box = NULL;
 
-                email_mail_data_t* mail_data = NULL;
-                email_mailbox_t* mail_box = NULL;
+                               if (EMAIL_ERROR_NONE != email_get_mail_data(mail_id, &mail_data)) {
+                                       LogError("Couldn't retrieve message or it has been malformed.");
+                               }
+                               if (EMAIL_ERROR_NONE != email_get_mailbox_by_mailbox_id(mail_data->mailbox_id, &mail_box)) {
+                                       LogError("Couldn't retrieve message or it has been malformed.");
+                               }
 
-                if (EMAIL_ERROR_NONE != email_get_mail_data(mail_id, &mail_data)) {
-                    LogError("Couldn't retrieve message or it has been malformed.");
-                }
-                if (EMAIL_ERROR_NONE != email_get_mailbox_by_mailbox_id(mail_data->mailbox_id, &mail_box)) {
-                    LogError("Couldn't retrieve message or it has been malformed.");
-                }
-                                       
-//                email_get_mailbox_by_name(account_id, name.c_str(), &mail_box);
+                               //                email_get_mailbox_by_name(account_id, name.c_str(), &mail_box);
 
-                m_mailboxes = *mail_box;
+                               m_mailboxes = *mail_box;
 
-                Api::Messaging::IMessageFolderPtr folderPtr(new MessageFolder(m_mailboxes));
-                jsEvent->setMessageFolder(folderPtr);
-                jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_DELETED);
-                               
-                if(m_onFolderReceived.size() > 0)
-                {
-                    m_onFolderReceived.emit(jsEvent);
-                }
-            }
-            else 
-            {
-                LogError("Couldn't retrieve message or it has been malformed.");
-            }
-        } 
-        else // DBUS_INTERFACE_EMAIL_RECEIVED
-        {
-            LogDebug("Wrong DBus interface, skipping it.");
-        }
-    }
+                               Api::Messaging::IMessageFolderPtr folderPtr(new MessageFolder(m_mailboxes));
+                               jsEvent->setMessageFolder(folderPtr);
+                               jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_ADDED);
+                               if(m_onFolderReceived.size() > 0)
+                               {
+                                       m_onFolderReceived.emit(jsEvent);
+                               }
+
+                       }
+                       else if (NOTI_MAILBOX_UPDATE == status) 
+                       {
+                               LogInfo("Emailbox received. account Id: " << account_id);
+                               LogInfo("name Id: " << name);
+
+                               email_mail_data_t* mail_data = NULL;
+                               email_mailbox_t* mail_box = NULL;
+
+                               if (EMAIL_ERROR_NONE != email_get_mail_data(mail_id, &mail_data)) {
+                                       LogError("Couldn't retrieve message or it has been malformed.");
+                               }
+                               if (EMAIL_ERROR_NONE != email_get_mailbox_by_mailbox_id(mail_data->mailbox_id, &mail_box)) {
+                                       LogError("Couldn't retrieve message or it has been malformed.");
+                               }
+
+                               //            email_get_mailbox_by_name(account_id, name.c_str(), &mailboxes);
+
+                               m_mailboxes = *mail_box;
+
+                               Api::Messaging::IMessageFolderPtr folderPtr(new MessageFolder(m_mailboxes));
+                               jsEvent->setMessageFolder(folderPtr);
+                               jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_UPDATED);
+
+                               if(m_onFolderReceived.size() > 0)
+                               {
+                                       m_onFolderReceived.emit(jsEvent);
+                               }
+                       }
+                       else if (NOTI_MAILBOX_DELETE == status) 
+                       {
+                               LogInfo("Emailbox received. account Id: " << account_id);
+                               LogInfo("name Id: " << name);
+
+                               email_mail_data_t* mail_data = NULL;
+                               email_mailbox_t* mail_box = NULL;
+
+                               if (EMAIL_ERROR_NONE != email_get_mail_data(mail_id, &mail_data)) {
+                                       LogError("Couldn't retrieve message or it has been malformed.");
+                               }
+                               if (EMAIL_ERROR_NONE != email_get_mailbox_by_mailbox_id(mail_data->mailbox_id, &mail_box)) {
+                                       LogError("Couldn't retrieve message or it has been malformed.");
+                               }
+
+                               //                email_get_mailbox_by_name(account_id, name.c_str(), &mail_box);
+
+                               m_mailboxes = *mail_box;
+
+                               Api::Messaging::IMessageFolderPtr folderPtr(new MessageFolder(m_mailboxes));
+                               jsEvent->setMessageFolder(folderPtr);
+                               jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_DELETED);
+
+                               if(m_onFolderReceived.size() > 0)
+                               {
+                                       m_onFolderReceived.emit(jsEvent);
+                               }
+                       }
+                       else 
+                       {
+                               LogError("Couldn't retrieve message or it has been malformed.");
+                       }
+               } 
+               else // DBUS_INTERFACE_EMAIL_RECEIVED
+               {
+                       LogDebug("Wrong DBus interface, skipping it.");
+               }
+       }
 }
 
 void Messaging::onMessageStorageChanged(msg_handle_t handle,
index 5c7e728..c2352c4 100644 (file)
@@ -62,7 +62,6 @@ namespace{
                char                                    replyAddress[MAX_PHONE_NUMBER_LEN+1];   /**< Indicates the reply address. */
                char                                    subject[MAX_SUBJECT_LEN+1];                                     /**< Indicates the message subject. */
                time_t                                  displayTime;                                                                                                    /**< Indicates the display time related to the specific operation. */
-               time_t                                  scheduledTime;                                                                                          /**< Indicates the time to send scheduled message. */
                msg_network_status_t    networkStatus;                                                  /**< Indicates the network status of the message. */
                msg_encode_type_t               encodeType;                                                     /**< Indicates the string encoding type. */
                bool                                    bRead;                                                                                                                          /**< Indicates whether the message is read or not. */
@@ -131,7 +130,6 @@ enum _MSG_SUB_TYPE_E
        MSG_STATUS_REPORT_SMS,          /**< SMS-STATUS-REPORT */
        MSG_SYNCML_CP,                          /**< SyncML Message CP */
        MSG_LBS_SMS,                                    /**< LBS Message */
-       MSG_SOS_SMS,                                    /**< SOS Message */
        MSG_REJECT_SMS,                         /**< Reject Message */
        MSG_CONCAT_SIM_SMS,                     /**< Concatenated Message in SIM */
 
@@ -288,7 +286,7 @@ FROM " << MSGFW_MESSAGE_TABLE_NAME << " A, " << MSGFW_ADDRESS_TABLE_NAME << " B
                pTmp->bBackup = dbHandle.getColumnToInt(index++);
                pTmp->priority = dbHandle.getColumnToInt(index++);
                pTmp->direction= dbHandle.getColumnToInt(index++);
-               pTmp->scheduledTime = (time_t)dbHandle.getColumnToInt(index++);
+               index++; // This field is reserved.
 
                dbHandle.getColumnToString(index++, MAX_SUBJECT_LEN, pTmp->subject);
 
index 047e461..1cfa637 100755 (executable)
@@ -149,7 +149,9 @@ JSValueRef JSAlarmManager::add(JSContextRef ctx, JSObjectRef object, JSObjectRef
                }
 
                if(argumentCount >= 2) {
-                       // Think it is application id
+            if( JSValueIsNull(ctx, arguments[1]) || JSValueIsUndefined(ctx, arguments[1]) ) {
+                ThrowMsg(InvalidArgumentException, "Wrong application id.");
+            }
                        applicationId = converter.toString(arguments[1]);
                        LogDebug("package:[" << applicationId << "]");
                }
index 0a0a3c7..5b558e4 100755 (executable)
@@ -92,7 +92,7 @@ DefaultGeocoderProvider::DefaultGeocoderProvider():GeocoderProvider("default"),
        }
 
        char *provider_name = NULL;
-       ret = location_preference_get_provider_name (GET_LOCATION_SERVICE(nativeHandle) , &provider_name);
+       ret = location_preference_get_provider (GET_LOCATION_SERVICE(nativeHandle) , &provider_name);
        if( ret == LOCATION_PREFERENCE_ERROR_NONE && provider_name != NULL)
        {
                string providerName(provider_name);
index c77f8e6..a823c9f 100755 (executable)
@@ -35,6 +35,8 @@ using namespace std;
 using namespace WrtDeviceApis::CommonsJavaScript;
 using namespace WrtDeviceApis::Commons;
 
+extern bool initGeocoder;
+
 namespace TizenApis {
 namespace Tizen1_0 {
 namespace LBS {
@@ -87,6 +89,7 @@ const JSClassDefinition* JSGeocoderServiceManager::getClassInfo()
 void JSGeocoderServiceManager::initialize(JSContextRef ctx, JSObjectRef object) 
 {
        LOGD("%s - JSGeocoderServiceManager", __func__);
+       initGeocoder = true;
        if( JSGeocoderServiceManager::m_globalContextRef == NULL )
        {
                JSGeocoderServiceManager::m_globalContextRef = ctx;
index c12bde6..abc56a6 100755 (executable)
@@ -39,6 +39,10 @@ using namespace WrtDeviceApis;
 using namespace WrtDeviceApis::Commons;
 using namespace WrtDeviceApis::PluginManager::Api;
 
+bool initGeocoder = false;
+bool initRoute = false;
+bool initPOI = false;
+
 namespace TizenApis {
 namespace Tizen1_0 {
 namespace LBS {
@@ -133,7 +137,19 @@ bool JSLBS::setProperty(JSContextRef context, JSObjectRef object, JSStringRef pr
 {
     LOGE("%s", __func__);
        LBS *priv = (LBS*)JSObjectGetPrivate(object);
-       return priv->getPluginManager()->setProperty(CommonsJavaScript::Converter(context).toString(propertyName),value);
+
+       std::string name = CommonsJavaScript::Converter(context).toString(propertyName);
+
+       if((name == "geocoder" && initGeocoder) || (name == "route" && initRoute) || (name == "poi" && initPOI))
+       {
+               LOGD("PluginManager::setProperty is done !! ");
+               initGeocoder = false;
+               initRoute = false;
+               initPOI = false;
+               return priv->getPluginManager()->setProperty(CommonsJavaScript::Converter(context).toString(propertyName),value);
+       }
+
+       return true;
 }
 
 void JSLBS::getPropertyNames(JSContextRef context, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames)
index f58d350..4a85917 100755 (executable)
@@ -20,6 +20,7 @@
 #include <vector>
 #include "LBSAce.h"
 
+#define FEATURE_LBS "http://tizen.org/api/lbs"
 #define FEATURE_POI_ALL "http://tizen.org/api/lbs.poi"
 #define FEATURE_POI_READ "http://tizen.org/api/lbs.poi.read"
 #define FEATURE_POI_WRITE "http://tizen.org/api/lbs.poi.write"
@@ -38,6 +39,7 @@ static AceFunction __create_lbs_service_provider_function();
 static AceFunction lbs_service_provider_function = __create_lbs_service_provider_function();
 
 static AceFunction __create_lbs_service_provider_function(){
+       AceFeature lbs_feature_lbs(FEATURE_LBS);
        AceFeature lbs_feature_poi_all(FEATURE_POI_ALL);
        AceFeature lbs_feature_poi_read(FEATURE_POI_READ);
        AceFeature lbs_feature_poi_write(FEATURE_POI_WRITE);
@@ -46,6 +48,7 @@ static AceFunction __create_lbs_service_provider_function(){
        AceFeature lbs_feature_geocoder(FEATURE_GEOCODER);
        AceDeviceCaps empty_device_caps;
        AceFeatures executable_feature_list;
+       executable_feature_list.push_back(lbs_feature_lbs);
        executable_feature_list.push_back(lbs_feature_poi_all);
        executable_feature_list.push_back(lbs_feature_poi_read);
        executable_feature_list.push_back(lbs_feature_poi_write);
index 3a078fc..0f71ee5 100644 (file)
@@ -65,8 +65,8 @@ JSStaticFunction JSNotificationManager::m_function[] =
        { "update", JSNotificationManager::update, kJSPropertyAttributeNone },
        { "get", JSNotificationManager::get, kJSPropertyAttributeNone },        
        { "getAll", JSNotificationManager::getAll, kJSPropertyAttributeNone },          
-       { "cancel", JSNotificationManager::cancel, kJSPropertyAttributeNone },          
-       { "cancelAll", JSNotificationManager::cancelAll, kJSPropertyAttributeNone },            
+       { "remove", JSNotificationManager::cancel, kJSPropertyAttributeNone },          
+       { "removeAll", JSNotificationManager::cancelAll, kJSPropertyAttributeNone },            
        { 0, 0, 0 }
 };
 
index cfa38c8..1f02ea9 100755 (executable)
@@ -69,7 +69,7 @@ DefaultPOIProvider::DefaultPOIProvider():POIProvider("default"), nativeHandle(NU
        }
 
        char *provider_name = NULL;
-       ret = location_preference_get_provider_name(GET_LOCATION_SERVICE(nativeHandle) , &provider_name);
+       ret = location_preference_get_provider(GET_LOCATION_SERVICE(nativeHandle) , &provider_name);
        if( ret == 0 && provider_name != NULL){
                string providerName(provider_name);
                setName(providerName);  
index 1d54742..8b2b22c 100755 (executable)
@@ -37,6 +37,8 @@ using namespace std;
 using namespace WrtDeviceApis::CommonsJavaScript;
 using namespace WrtDeviceApis::Commons;
 
+extern bool initPOI;
+
 namespace TizenApis {
 namespace Tizen1_0 {
 namespace LBS {
@@ -90,6 +92,9 @@ const JSClassDefinition* JSPOIServiceManager::getClassInfo()
 
 void JSPOIServiceManager::initialize(JSContextRef ctx, JSObjectRef object) 
 {
+       initPOI = true;
+       LOGD("initialize !!!");
+
        if( JSPOIServiceManager::m_globalContextRef == NULL ){
                JSPOIServiceManager::m_globalContextRef = ctx;
        }
index bad71c4..a153920 100755 (executable)
@@ -35,6 +35,8 @@ using namespace std;
 using namespace WrtDeviceApis::CommonsJavaScript;
 using namespace WrtDeviceApis::Commons;
 
+extern bool initRoute;
+
 namespace TizenApis {
 namespace Tizen1_0 {
 namespace LBS {
@@ -88,6 +90,8 @@ const JSClassDefinition* JSRouteServiceManager::getClassInfo()
 
 void JSRouteServiceManager::initialize(JSContextRef ctx, JSObjectRef object) 
 {
+       LOGD("initialize !!!");
+       initRoute = true;
     if( JSRouteServiceManager::m_globalContextRef == NULL )
     {
         JSRouteServiceManager::m_globalContextRef = ctx;
@@ -96,6 +100,7 @@ void JSRouteServiceManager::initialize(JSContextRef ctx, JSObjectRef object)
 
 void JSRouteServiceManager::finalize(JSObjectRef object) 
 {
+       LOGD("finalize !!!");
     if( JSRouteServiceManager::m_defaultObj != NULL ){
         JSValueUnprotect(JSRouteServiceManager::m_globalContextRef, JSRouteServiceManager::m_defaultObj);
         JSRouteServiceManager::m_defaultObj = NULL;