Update change log and spec for wrt-plugins-tizen_0.4.55 submit/tizen_2.2/20130716.180446 submit/tizen_2.2/20130717.014920 submit/tizen_2.2/20130717.053417
authorDongjin Choi <milkelf.choi@samsung.com>
Tue, 16 Jul 2013 07:40:30 +0000 (16:40 +0900)
committerDongjin Choi <milkelf.choi@samsung.com>
Tue, 16 Jul 2013 07:40:30 +0000 (16:40 +0900)
[model] REDWOOD
[binary_type] PDA
[customer] OPEN

[Bluetooth] visibility changed cb will be not invoked when bt is turned off

[Issue#] CID-63423, CID-63164
[Problem] N/A
[Solution] modify code

[Issue#] N/A
[Problem] Calendar alarm before attribute returned non-null value always.
[Cause] Calendar alarm before attribute not initialized as null.
[Solution] Check the value is undefined before returning JS value.

[Issue#] WEB-3475
[Problem] rangeFilter is not working properly at birthday
[Cause] internal error
[Solution] fix code

[Issue] Prevent 64294/64334
[Problem] Resource leak, Unchecked return value
[Cause] Resource leak, Unchecked return value
[Solution] Resource leak, Unchecked return value

[Issue] Prevent 64294/64334
[Problem] Resource leak, Unchecked return value
[Cause] Resource leak, Unchecked return value
[Solution] Resource leak, Unchecked return value

[Issue] N/A
[Problem] remove build warning
[Cause] remove build warning
[Solution] remove build warning

[Issue] N/A
[Problem] 1. matchFlag operation is wrong.
          2. App crashes when update the geolocation after it set null.
[Cause] 1. No condition for some matchFlags.
        2. It doesn't check null value.
[Solution] 1. Add the condition for matchFlags.
           2. Check the null value when geolocation update.

[Issue#] N/A
[Problem] BluetoothServiceHandler.unregister() and BluetoothHealthChannel.close() have wrong privilege
[Cause] Some functions have same name
[Solution] Register the different name in FunctionMapping

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

UnitTC passed.

27 files changed:
packaging/wrt-plugins-tizen.spec
src/Bluetooth/BluetoothAdapter.cpp
src/Bluetooth/JSBluetoothHealthApplication.cpp
src/Bluetooth/JSBluetoothHealthChannel.cpp
src/Bluetooth/plugin_config.h
src/Calendar/EventAlarm.cpp
src/Calendar/JSCalendarAlarm.cpp
src/Contact/ContactSearchEngine.cpp
src/Contact/ContactSearchEngine.h
src/Content/ContentConverter.cpp
src/Content/ContentImage.cpp
src/Content/ContentManager.cpp
src/Content/ContentMedia.h
src/Content/ContentSearchVisitor.cpp
src/Content/ContentSearchVisitor.h
src/Content/ContentUtility.cpp
src/Content/ContentUtility.h
src/Content/ContentVideo.cpp
src/Content/ContentVideo.h
src/Content/JSContent.cpp
src/Content/JSContentManager.cpp
src/Content/JSImage.cpp
src/Content/JSVideo.cpp
src/Messaging/Conversation.cpp
src/Messaging/Messaging.cpp
src/Messaging/Mms.cpp
src/Systeminfo/Systeminfo.cpp

index bb524f3..8042a33 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       wrt-plugins-tizen
 Summary:    JavaScript plugins for WebRuntime
-Version:    0.4.54
+Version:    0.4.55
 Release:    0
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index a62d9e3..0203a4e 100644 (file)
@@ -46,6 +46,9 @@ void BluetoothAdapter::onStateChangedCB(int result, bt_adapter_state_e adapterSt
     
     bool previousState = object->mEnabled;
     object->mEnabled = (adapterState == BT_ADAPTER_ENABLED) ? true : false;
+    if(object->mEnabled == true) {
+        object->mVisible = object->getVisible();
+    }
 
     // call onstatechanged in ChangeListener
     if(previousState != object->mEnabled && result == BT_ERROR_NONE && object->mChangeListener != NULL) {
@@ -1007,7 +1010,6 @@ void BluetoothAdapter::setPowered(bool powered, MultiCallbackUserDataPtr userDat
 
 bool BluetoothAdapter::getVisible() const
 {
-/*
     bt_adapter_visibility_mode_e mode;
 
     if (bt_adapter_get_visibility(&mode, NULL) == BT_ERROR_NONE) {
@@ -1017,8 +1019,6 @@ bool BluetoothAdapter::getVisible() const
     }
     
     return false;
-*/
-    return mVisible;
 }
 
 void BluetoothAdapter::setVisible(bool visible, unsigned int timeout, MultiCallbackUserDataPtr userData)
index 14ced18..21d6987 100644 (file)
@@ -64,7 +64,7 @@ JSStaticValue JSBluetoothHealthApplication::m_property[] = {
 };
 
 JSStaticFunction JSBluetoothHealthApplication::m_function[] = {
-    { BLUETOOTH_HEALTH_APPLICATION_API_UNREGISTER, unregister, kJSPropertyAttributeNone },
+    { "unregister", unregister, kJSPropertyAttributeNone },
     { 0, 0, 0 }
 };
 
index 6b6ad23..e1a683c 100644 (file)
@@ -67,7 +67,7 @@ JSStaticValue JSBluetoothHealthChannel::m_property[] = {
 
 JSStaticFunction JSBluetoothHealthChannel::m_function[] = {
     { BLUETOOTH_HEALTH_CHANNEL_API_SEND_DATA, sendData, kJSPropertyAttributeNone },
-    { BLUETOOTH_HEALTH_CHANNEL_API_CLOSE, close, kJSPropertyAttributeNone },
+    { "close", close, kJSPropertyAttributeNone },
     { BLUETOOTH_HEALTH_CHANNEL_API_SET_LISTENER, setListener, kJSPropertyAttributeNone },
     { BLUETOOTH_HEALTH_CHANNEL_API_UNSET_LISTENER, unsetListener, kJSPropertyAttributeNone },    
     { 0, 0, 0 }
index 13b4cbc..5f346a8 100644 (file)
@@ -84,12 +84,12 @@ namespace Bluetooth {
 #define BLUETOOTH_CLASS_API_HAS_SERVICE "hasService"
 #define BLUETOOTH_SERVICE_HANDLER_API_UNREGISTER "unregister"
 #define BLUETOOTH_HEALTH_PROFILE_HANDLER_API_REGISTER_SINK_APPLICATION "registerSinkApplication"
-#define BLUETOOTH_HEALTH_APPLICATION_API_UNREGISTER "unregister"
+#define BLUETOOTH_HEALTH_APPLICATION_API_UNREGISTER "healthUnregister"
 #define BLUETOOTH_HEALTH_PROFILE_HANDLER_API_CONNECT_TO_SOURCE "connectToSource"
 #define BLUETOOTH_HEALTH_CHANNEL_API_SEND_DATA "sendData"
 #define BLUETOOTH_HEALTH_CHANNEL_API_SET_LISTENER "setListener"
 #define BLUETOOTH_HEALTH_CHANNEL_API_UNSET_LISTENER "unsetListener"
-#define BLUETOOTH_HEALTH_CHANNEL_API_CLOSE "close"
+#define BLUETOOTH_HEALTH_CHANNEL_API_CLOSE "healthClose"
 
 
 DECLARE_FUNCTION_GETTER(Bluetooth);
index b5e9632..fa097e7 100755 (executable)
@@ -25,8 +25,9 @@ namespace Calendar {
 
 EventAlarm::EventAlarm()
 {
-    m_absoluteDate = UNDEFINED_TIME;
-    m_timeZone = DEFAULT_TIMEZONE;
+       m_absoluteDate = UNDEFINED_TIME;
+       m_duration.length = UNDEFINED_TIME;
+       m_timeZone = DEFAULT_TIMEZONE;
        m_method = SOUND_ALARM;
 }
 EventAlarm::~EventAlarm()
index 973aaab..67d209d 100755 (executable)
@@ -238,7 +238,11 @@ JSValueRef JSCalendarAlarm::getProperty(JSContextRef context,
                 return timeConverter.toJSValueRefTZDate((double)(alarm->getAbsoluteDate()*1000.0), alarm->getTimeZone());
             }
         } else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_CALENDAR_ALARM_BEFORE)) {
-            return JSTimeDuration::createJSObject(context, alarm->getDuration());
+                       if (UNDEFINED_TIME==alarm->getDuration().length) {
+                               return JSValueMakeNull(context);
+                       } else {
+                               return JSTimeDuration::createJSObject(context, alarm->getDuration());
+                       }
         } else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_CALENDAR_ALARM_DESCRIPTION)) {
             return converter.toJSValueRef(alarm->getDescription());
         } else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_CALENDAR_ALARM_METHOD)) {
index 0ff9fa1..9c55ee2 100755 (executable)
@@ -159,7 +159,7 @@ void ContactSearchEngine::setCondition(FilterPtr filter)
 
        if(m_filteredContactIds != NULL)
                m_isFilterSet = true;
-}
+       }
 
 void ContactSearchEngine::setSortMode(SortModePtr attr)
 {
@@ -419,13 +419,13 @@ void ContactSearchEngine::visitAttributeRange(string& attrName, AnyPtr& initialV
 {
        ContactIdSetPtr idSet = ContactIdSetPtr(new ContactIdSet());
 
-       bool initialValueIsSet = false;
-       bool endValueIsSet = false;
+       bool initialValueIsSet = true;
+       bool endValueIsSet = true;
 
-       if(initialValue != NULL || initialValue->isNullOrUndefined())
+       if(initialValue == NULL || initialValue->isNullOrUndefined())
                initialValueIsSet = false;
 
-       if(endValue != NULL || endValue->isNullOrUndefined())
+       if(endValue == NULL || endValue->isNullOrUndefined())
                endValueIsSet = false;
 
        if(!initialValueIsSet && !endValueIsSet)
@@ -524,7 +524,7 @@ void ContactSearchEngine::visitAttributeRange(string& attrName, AnyPtr& initialV
                                initialValueInt = ContactUtility::toDateDbInt(*initialValue->getDateTm());
                        }
                        if(endValueIsSet){
-                               endValueInt = ContactUtility::toDateDbInt(*initialValue->getDateTm());
+                               endValueInt = ContactUtility::toDateDbInt(*endValue->getDateTm());
                        }
                }
                else
@@ -535,7 +535,11 @@ void ContactSearchEngine::visitAttributeRange(string& attrName, AnyPtr& initialV
                                endValueInt = endValue->getLong();
                }
 
-               queryAttributeRangeInt(properties, idSet, initialValueIsSet, initialValueInt, endValueIsSet, endValueInt);
+               if(attrName == "birthday" || attrName == "anniversaries.date"){
+                       queryAttributeRangeDate(attrName, properties, idSet, initialValueIsSet, initialValueInt, endValueIsSet, endValueInt);
+               }else{
+                       queryAttributeRangeInt(properties, idSet, initialValueIsSet, initialValueInt, endValueIsSet, endValueInt);
+               }
        }
 
        if(depth == 0)
@@ -819,8 +823,6 @@ void ContactSearchEngine::queryAttributeDate(string& attrName, AttributeProperti
        if(errorCode != CONTACTS_ERROR_NONE)
                ThrowMsg(PlatformException, "contacts_filter_add_int error : " << errorCode << " (" << __FUNCTION__ << ")");
 
-       LoggerD("attrName" << attrName);
-
        if(attrName == "birthday"){
                errorCode = contacts_filter_add_operator( filter, CONTACTS_FILTER_OPERATOR_AND);
                if(errorCode != CONTACTS_ERROR_NONE)
@@ -904,6 +906,56 @@ void ContactSearchEngine::queryAttributeRangeBool(AttributeProperties& attribute
        _CONTACTS_SVC_QUERY_FUNC_SUFFIX(query, filter, list, property_contact_id, result);
 }
 
+void ContactSearchEngine::queryAttributeRangeDate(string& attrName, AttributeProperties& attributeProperties, ContactIdSetPtr& result,
+               bool initial_value_is_set, int initial_value, bool end_value_is_set, int end_value)
+{
+       const char* view_uri = attributeProperties.viewUri;
+       unsigned int property_contact_id = attributeProperties.propertyContactId;
+       unsigned int property_id = attributeProperties.propertyId;
+
+       int errorCode = 0;
+       contacts_query_h query = NULL;
+       contacts_filter_h filter = NULL;
+       contacts_list_h list = NULL;
+
+       _CONTACTS_SVC_QUERY_FUNC_PREFIX(view_uri, query, filter);
+
+       if(initial_value_is_set && end_value_is_set)
+       {
+               errorCode = contacts_filter_add_int(filter, property_id, CONTACTS_MATCH_GREATER_THAN_OR_EQUAL, initial_value);
+               contacts_filter_add_operator(filter, CONTACTS_FILTER_OPERATOR_AND);
+               errorCode = contacts_filter_add_int(filter, property_id, CONTACTS_MATCH_LESS_THAN_OR_EQUAL, end_value);
+       }
+       else if(initial_value_is_set)
+       {
+               errorCode = contacts_filter_add_int(filter, property_id, CONTACTS_MATCH_GREATER_THAN_OR_EQUAL, initial_value);
+       }
+       else if(end_value_is_set)
+       {
+               errorCode = contacts_filter_add_int(filter, property_id, CONTACTS_MATCH_LESS_THAN_OR_EQUAL, end_value);
+       }
+
+       if(attrName == "birthday"){
+               errorCode = contacts_filter_add_operator( filter, CONTACTS_FILTER_OPERATOR_AND);
+               if(errorCode != CONTACTS_ERROR_NONE)
+                       ThrowMsg(PlatformException, "contacts_filter_add_int error : " << errorCode << " (" << __FUNCTION__ << ")");
+
+               errorCode = contacts_filter_add_int(filter, _contacts_event.type, CONTACTS_MATCH_EQUAL, CONTACTS_EVENT_TYPE_BIRTH);
+               if(errorCode != CONTACTS_ERROR_NONE)
+                       ThrowMsg(PlatformException, "contacts_filter_add_int error : " << errorCode << " (" << __FUNCTION__ << ")");
+       }else if(attrName == "anniversaries.date"){
+               errorCode = contacts_filter_add_operator( filter, CONTACTS_FILTER_OPERATOR_AND);
+               if(errorCode != CONTACTS_ERROR_NONE)
+                       ThrowMsg(PlatformException, "contacts_filter_add_int error : " << errorCode << " (" << __FUNCTION__ << ")");
+
+               errorCode = contacts_filter_add_int(filter, _contacts_event.type, CONTACTS_MATCH_EQUAL, CONTACTS_EVENT_TYPE_ANNIVERSARY);
+               if(errorCode != CONTACTS_ERROR_NONE)
+                       ThrowMsg(PlatformException, "contacts_filter_add_int error : " << errorCode << " (" << __FUNCTION__ << ")");
+       }
+
+       _CONTACTS_SVC_QUERY_FUNC_SUFFIX(query, filter, list, property_contact_id, result);
+}
+
 void ContactSearchEngine::queryAttributeRangeInt(AttributeProperties& attributeProperties, ContactIdSetPtr& result,
                bool initial_value_is_set, int initial_value, bool end_value_is_set, int end_value)
 {
index f504aeb..a9bdc41 100755 (executable)
@@ -131,6 +131,8 @@ private:
                        contacts_match_str_flag_e match, const char* match_value);
        void queryAttributeRangeBool(AttributeProperties& attributeProperties, ContactIdSetPtr& result,
                        bool initial_value_is_set, bool initial_value, bool end_value_is_set, bool end_value);
+       void queryAttributeRangeDate(std::string& attrName, AttributeProperties& attributeProperties, ContactIdSetPtr& result,
+                       bool initial_value_is_set, int initial_value, bool end_value_is_set, int end_value);
        void queryAttributeRangeInt(AttributeProperties& attributeProperties, ContactIdSetPtr& result,
                        bool initial_value_is_set, int initial_value, bool end_value_is_set, int end_value);
        void queryAttributeRangeString(AttributeProperties& attributeProperties, ContactIdSetPtr& result,
index 2c080b7..3bf4c1c 100755 (executable)
@@ -27,6 +27,7 @@
 #include "JSAudio.h"
 #include "JSFolder.h"
 #include "JSAudioLyrics.h"
+#include "ContentUtility.h"
 #include <Logger.h>
 
 using namespace DeviceAPI::Common;
@@ -128,22 +129,46 @@ MediacontentMediaListPtr MediaConverter::toVectorOfMediaItem(JSValueRef events)
         }
 
         if(JSValueIsObjectOfClass(m_context, element, JSImage::getClassRef())){
-            JSValueRef geoValRef = JSUtil::getProperty(m_context , JSUtil::JSValueToObject(m_context, element), "geolocation");
-            JSObjectRef geoObjRef = JSUtil::JSValueToObject(m_context, geoValRef);
-            double latitude = JSUtil::JSValueToDouble(m_context, JSUtil::getProperty(m_context, geoObjRef, "latitude"));
-            double longitude = JSUtil::JSValueToDouble(m_context,JSUtil::getProperty(m_context, geoObjRef, "longitude"));
             MediacontentImagePtr imgPtr = JSImage::getImageObject(arg);
-            imgPtr->setImageLatitude(latitude);
-            imgPtr->setImageLongitude(longitude);
+            JSValueRef geoValRef = JSUtil::getProperty(m_context , JSUtil::JSValueToObject(m_context, element), "geolocation");
+            if(!(JSValueIsNull(m_context, geoValRef) || JSValueIsUndefined(m_context, geoValRef))){
+                JSObjectRef geoObjRef = JSUtil::JSValueToObject(m_context, geoValRef);
+                double latitude = JSUtil::JSValueToDouble(m_context, JSUtil::getProperty(m_context, geoObjRef, "latitude"));
+                double longitude = JSUtil::JSValueToDouble(m_context,JSUtil::getProperty(m_context, geoObjRef, "longitude"));
+                if(ContentUtility::checkLocation(latitude, latitude)){
+                    imgPtr->setImageLatitude(latitude);
+                    imgPtr->setImageLongitude(longitude);
+                }
+                else{
+                    ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "geolocation value is not valid.");
+                }
+            }
+            else
+            {
+                imgPtr->setImageLatitude(DEFAULT_GEOLOCATION);
+                imgPtr->setImageLongitude(DEFAULT_GEOLOCATION);
+            }
         }
         if(JSValueIsObjectOfClass(m_context, element, JSVideo::getClassRef())){
-            JSValueRef geoValRef = JSUtil::getProperty(m_context , JSUtil::JSValueToObject(m_context, element), "geolocation");
-            JSObjectRef geoObjRef = JSUtil::JSValueToObject(m_context, geoValRef);
-            double latitude = JSUtil::JSValueToDouble(m_context, JSUtil::getProperty(m_context, geoObjRef, "latitude"));
-            double longitude = JSUtil::JSValueToDouble(m_context,JSUtil::getProperty(m_context, geoObjRef, "longitude"));
             MediacontentVideoPtr vedioPtr = JSVideo::getVideoObject(arg);
-            vedioPtr->setVideoLatitude(latitude);
-            vedioPtr->setVideoLongitude(longitude);
+            JSValueRef geoValRef = JSUtil::getProperty(m_context , JSUtil::JSValueToObject(m_context, element), "geolocation");
+            if(!(JSValueIsNull(m_context, geoValRef) || JSValueIsUndefined(m_context, geoValRef))){
+                JSObjectRef geoObjRef = JSUtil::JSValueToObject(m_context, geoValRef);
+                double latitude = JSUtil::JSValueToDouble(m_context, JSUtil::getProperty(m_context, geoObjRef, "latitude"));
+                double longitude = JSUtil::JSValueToDouble(m_context,JSUtil::getProperty(m_context, geoObjRef, "longitude"));
+                if(ContentUtility::checkLocation(latitude, latitude)){
+                    vedioPtr->setVideoLatitude(latitude);
+                    vedioPtr->setVideoLongitude(longitude);
+                }
+                else{
+                    ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "geolocation value is not valid.");
+                }
+            }
+            else
+            {
+                vedioPtr->setVideoLatitude(DEFAULT_GEOLOCATION);
+                vedioPtr->setVideoLongitude(DEFAULT_GEOLOCATION);
+            }
         }
         resultVector.push_back(JSMedia::getMediaObject(arg));
     }
index f4c1bf3..03f43fe 100755 (executable)
@@ -19,6 +19,7 @@
 #include "ContentImage.h"
 #include <Logger.h>
 
+
 namespace DeviceAPI {
 namespace Content {
 
@@ -26,6 +27,8 @@ MediacontentImage::MediacontentImage()
 {
        m_editableAttrList.push_back("geolocation");
        m_editableAttrList.push_back("orientation");
+       m_imageLongitude = DEFAULT_GEOLOCATION;
+       m_imageLatitude = DEFAULT_GEOLOCATION;
 }
 
 MediacontentImage::~MediacontentImage()
@@ -39,8 +42,7 @@ double MediacontentImage::getImageLatitude() const
 
 double MediacontentImage::getImageLongitude() const
 {
-       return m_imageLongitude;        
-
+       return m_imageLongitude;
 }
 
 void MediacontentImage::setImageLatitude(const double  &value, bool isChanged)
index 43013b8..3e700ac 100755 (executable)
@@ -728,7 +728,7 @@ void MediacontentManager::OnRequestReceived(const IEventFindFolderPtr &eFolder)
     if ( MEDIA_CONTENT_ERROR_NONE == media_filter_create(&filter))
     {
         string condition="(FOLDER_STORAGE_TYPE = 0 OR FOLDER_STORAGE_TYPE = 1)";
-        LoggerI("condition:" + condition);
+
         media_filter_set_condition(filter, condition.c_str(), MEDIA_CONTENT_COLLATE_DEFAULT ); //set condition
         if ( MEDIA_CONTENT_ERROR_NONE != 
             media_folder_foreach_folder_from_db (filter, mediaFolderCallback, eFolder.Get()))
@@ -774,7 +774,8 @@ void MediacontentManager::OnRequestReceived(const IEventBrowseFolderPtr &eBrowse
                 condition += visitor->getResult();
             }
 
-            LoggerI("condition:" + condition);
+            //LoggerI("condition:" << condition);
+
             media_filter_set_condition(filter, condition.c_str(), MEDIA_CONTENT_COLLATE_DEFAULT );  //set condition
 
             if(eBrowse->getSortModesIsSet())
index ca5de01..1902556 100755 (executable)
@@ -30,6 +30,8 @@ using namespace std;
 namespace DeviceAPI {
 namespace Content {
 
+const double DEFAULT_GEOLOCATION = -200;
+
 typedef enum 
 {
        MEDIA_TYPE_IMAGE        = 1,
@@ -38,7 +40,6 @@ typedef enum
        MEDIA_TYPE_UNKOWN       = 4,
 }media_type;
 
-
 typedef vector<std::string> EditableAttributeList;
 typedef DPL::SharedPtr<EditableAttributeList> EditableAttributeListPtr;
 
index 871989a..ed7f38e 100755 (executable)
@@ -34,6 +34,12 @@ const string STR_LESS_THAN ("<");
 const string STR_EQUAL ("=");
 const string STR_S_QUOTATION ("'");
 const string STR_PERCENT ("%");
+const string STR_MIN_LATITUDE("-90");
+const string STR_MAX_LATITUDE("90");
+const string STR_MIN_LONGITUDE("-180");
+const string STR_MAX_LONGITUDE("180");
+
+
 
 typedef enum
 {
@@ -177,7 +183,6 @@ string MediaSearchVisitor::convertAttribute(string &attrName, AnyPtr& matchValue
        string operatorStr;
        string conditionStr;
 
-       condition_e cond;
        string matchValueStr;
 
        if(attrName.compare("MEDIA_TYPE")==0)
@@ -199,6 +204,28 @@ string MediaSearchVisitor::convertAttribute(string &attrName, AnyPtr& matchValue
        {
                matchValueStr = ContentUtility::convertUriToPath(matchValue->getString());
        }
+       else if(attrName.compare("MEDIA_LATITUDE")==0){
+            if(matchValue->getDouble() < MIN_LATITUDE || 
+                matchValue->getDouble() > MAX_LATITUDE)
+            {
+                ThrowMsg(PlatformException, "latitude range is -90 ~ 90");
+            }
+            else
+            {
+                matchValueStr = matchValue->toString();
+            }
+       }
+       else if(attrName.compare("MEDIA_LONGITUDE")==0){
+            if(matchValue->getDouble() < MIN_LONGITUDE|| 
+                matchValue->getDouble() > MAX_LONGITUDE)
+            {
+                ThrowMsg(PlatformException, "longitude range is -180 ~ 180");
+            }
+            else
+            {
+                matchValueStr = matchValue->toString();
+            }
+       }
        else
        {
                matchValueStr = matchValue->toString();
@@ -217,41 +244,61 @@ string MediaSearchVisitor::convertAttribute(string &attrName, AnyPtr& matchValue
             {
                 valueStr = toDateDbStr(date);
             }
-               cond = EQUAL;
+               m_operationKey = EQUAL;
        }
        else
        {
                ostringstream os;
 
-               if(matchFlag == MATCH_STARTSWITH)
-               {
-                       cond = LIKE;
-                       os << STR_S_QUOTATION << matchValueStr << STR_PERCENT << STR_S_QUOTATION;
-               }
-               else if( matchFlag == MATCH_ENDSWITH )
-               {
-                       cond = LIKE;
-                       os << STR_S_QUOTATION <<  STR_PERCENT << matchValueStr << STR_S_QUOTATION;
-               }
-               else if(  matchFlag ==  MATCH_CONTAINS )
-               {
-                       cond = LIKE;
-                       os << STR_S_QUOTATION <<  STR_PERCENT << matchValueStr << STR_PERCENT << STR_S_QUOTATION;
-               }
-               else
-               {
-                       cond = EQUAL;
-                       os << STR_S_QUOTATION << matchValueStr << STR_S_QUOTATION;
-               }
-               
+             switch (matchFlag) {
+
+             case MATCH_CONTAINS:
+                 m_operationKey = LIKE;
+                 os << STR_S_QUOTATION <<  STR_PERCENT << matchValueStr << STR_PERCENT << STR_S_QUOTATION;
+                 break;
+             case MATCH_STARTSWITH:
+                 m_operationKey = LIKE;
+                 os << STR_S_QUOTATION << matchValueStr << STR_PERCENT << STR_S_QUOTATION;
+                 break;
+             case MATCH_ENDSWITH:
+                 m_operationKey = LIKE;
+                 os << STR_S_QUOTATION <<  STR_PERCENT << matchValueStr << STR_S_QUOTATION;
+                 break;
+             case MATCH_FULLSTRING:
+                 m_operationKey = FULLSTRING;
+                 os << STR_S_QUOTATION << matchValueStr << STR_S_QUOTATION << " COLLATE NOCASE ";
+                 break;
+             case MATCH_EXISTS:
+                 m_operationKey = EXISTS;
+                 break;
+             case MATCH_EXACTLY:
+             default:
+                 m_operationKey = EQUAL;
+                 os << STR_S_QUOTATION << matchValueStr << STR_S_QUOTATION;
+             }
+
                valueStr = os.str();
        }
-       operatorStr = operatorKey[cond];
-       conditionStr = STR_LEFT_BRACKET + attrName + operatorStr + valueStr + STR_RIGHT_BRACKET;
+
+      operatorStr = operatorKey[m_operationKey];
+
+       if( m_operationKey != EXISTS)
+       {
+            conditionStr = STR_LEFT_BRACKET + attrName + operatorStr + valueStr + STR_RIGHT_BRACKET;
+       }
+       else
+       {
+            conditionStr = STR_LEFT_BRACKET + attrName + operatorStr + STR_RIGHT_BRACKET;
+       }
 
        return conditionStr;
 }
 
+condition_e MediaSearchVisitor::getOperationKey()
+{
+    return m_operationKey;
+}
+
 
 void MediaSearchVisitor::visitAttributeRange(string& attrName,AnyPtr& initialValue,AnyPtr& endValue,int depth)
 {
@@ -269,7 +316,7 @@ void MediaSearchVisitor::visitAttributeRange(string& attrName,AnyPtr& initialVal
                if(initialValue->isType(PrimitiveType_Time))
                {
                 tm date = *initialValue->getDateTm();
-                if(attrName.compare("MEDIA_DATETAKEN")==0)
+                if(attrPlatform.compare("MEDIA_DATETAKEN")==0)
                 {
                     char buf[512];
                     strftime(buf, sizeof(buf), "'%Y:%m:%d %H:%M:%S'", &date);
@@ -282,7 +329,7 @@ void MediaSearchVisitor::visitAttributeRange(string& attrName,AnyPtr& initialVal
                } 
                else 
                {
-                       initialValueStr = initialValue->toString();
+                    initialValueStr = initialValue->toString();
                }
        }
 
@@ -291,7 +338,7 @@ void MediaSearchVisitor::visitAttributeRange(string& attrName,AnyPtr& initialVal
                if(endValue->isType(PrimitiveType_Time))
                {
                 tm date = *endValue->getDateTm();
-                if(attrName.compare("MEDIA_DATETAKEN")==0)
+                if(attrPlatform.compare("MEDIA_DATETAKEN")==0)
                 {
                     char buf[512];
                     strftime(buf, sizeof(buf), "'%Y:%m:%d %H:%M:%S'", &date);
@@ -310,19 +357,65 @@ void MediaSearchVisitor::visitAttributeRange(string& attrName,AnyPtr& initialVal
 
        if (!initialValue->isNullOrUndefined() && endValue->isNullOrUndefined()) 
        {
+            initialValueStr = initialValue->toString();
+            if(attrPlatform.compare("MEDIA_LATITUDE")==0)
+            {
+                if(initialValue->getDouble() < MIN_LATITUDE)
+                {
+                    initialValueStr = STR_MIN_LATITUDE;
+                }
+            }
+            else if(attrPlatform.compare("MEDIA_LONGITUDE")==0)
+            {
+                if(initialValue->getDouble() < MIN_LONGITUDE)
+                {
+                    initialValueStr = STR_MIN_LONGITUDE;
+                }
+            }
                str = STR_LEFT_BRACKET + attrPlatform + STR_GREATER_THAN + STR_EQUAL + 
                                STR_S_QUOTATION + initialValueStr + STR_S_QUOTATION + STR_RIGHT_BRACKET;
        }
        else if(initialValue->isNullOrUndefined() && !endValue->isNullOrUndefined()) 
        {
-               str = STR_LEFT_BRACKET + attrPlatform + STR_LESS_THAN + STR_S_QUOTATION + 
-                               endValueStr + STR_S_QUOTATION + STR_RIGHT_BRACKET;
+            if(attrPlatform.compare("MEDIA_LATITUDE")==0)
+            {
+                initialValueStr = STR_MIN_LATITUDE;
+                str = STR_LEFT_BRACKET + attrPlatform + STR_GREATER_THAN + STR_EQUAL + STR_S_QUOTATION + 
+                    initialValueStr + STR_S_QUOTATION + STR_AND + attrPlatform + STR_LESS_THAN + STR_S_QUOTATION + 
+                    endValueStr + STR_S_QUOTATION + STR_RIGHT_BRACKET;
+            }
+            else if(attrPlatform.compare("MEDIA_LONGITUDE")==0)
+            {
+                initialValueStr = STR_MIN_LONGITUDE;
+                str = STR_LEFT_BRACKET + attrPlatform + STR_GREATER_THAN + STR_EQUAL + STR_S_QUOTATION + 
+                    initialValueStr + STR_S_QUOTATION + STR_AND + attrPlatform + STR_LESS_THAN + STR_S_QUOTATION + 
+                    endValueStr + STR_S_QUOTATION + STR_RIGHT_BRACKET;
+            }
+            else
+            {
+                str = STR_LEFT_BRACKET + attrPlatform + STR_LESS_THAN + STR_S_QUOTATION + 
+                    endValueStr + STR_S_QUOTATION + STR_RIGHT_BRACKET;
+            }
        } 
        else if (!initialValue->isNullOrUndefined() && !endValue->isNullOrUndefined()) 
        {
-               str = STR_LEFT_BRACKET + attrPlatform + STR_GREATER_THAN + STR_EQUAL + STR_S_QUOTATION + 
-                               initialValueStr + STR_S_QUOTATION + STR_AND + attrPlatform + STR_LESS_THAN + STR_S_QUOTATION + 
-                               endValueStr + STR_S_QUOTATION + STR_RIGHT_BRACKET;
+            if(attrPlatform.compare("MEDIA_LATITUDE")==0)
+            {
+                if(initialValue->getDouble() < MIN_LATITUDE)
+                {
+                    initialValueStr = STR_MIN_LATITUDE;
+                }
+            }
+            else if(attrPlatform.compare("MEDIA_LONGITUDE")==0)
+            {
+                if(initialValue->getDouble() < MIN_LONGITUDE)
+                {
+                    initialValueStr = STR_MIN_LONGITUDE;
+                }
+            }
+            str = STR_LEFT_BRACKET + attrPlatform + STR_GREATER_THAN + STR_EQUAL + STR_S_QUOTATION + 
+                initialValueStr + STR_S_QUOTATION + STR_AND + attrPlatform + STR_LESS_THAN + STR_S_QUOTATION + 
+                endValueStr + STR_S_QUOTATION + STR_RIGHT_BRACKET;
        }
 
        m_query.append(str);
index e0bc867..6c33999 100755 (executable)
@@ -38,59 +38,64 @@ namespace Content {
        
 typedef enum
 {
-       EQUAL,
-       NOT_EQUAL,
-       GREATER_THAN,
-       LESS_THAN,
-       GREATER_THAN_OR_EQUAL,
-       LESS_THAN_OR_EQUAL,
-       LIKE,
-       EXISTS,
-       CONDITION_MAX
+    EQUAL,
+    NOT_EQUAL,
+    GREATER_THAN,
+    LESS_THAN,
+    GREATER_THAN_OR_EQUAL,
+    LESS_THAN_OR_EQUAL,
+    LIKE,
+    FULLSTRING,
+    EXISTS,
+    CONDITION_MAX
 }condition_e;
 
 static string operatorKey[] =
 {
-       " = ",
-       " NOT IN ",             //!=
-       " > ",
-       " < ",
-       " >= ",
-       " <= ",
-       " LIKE "                // like
+    " = ",              //EQUAL
+    " NOT IN ",                //NOT_EQUAL
+    " > ",              //GREATER_THAN
+    " < ",              //LESS_THAN
+    " >= ",             //GREATER_THAN_OR_EQUAL
+    " <= ",             //LESS_THAN_OR_EQUAL
+    " LIKE ",          // like
+    " = ",              //fullstring
+    " is not null "         //EXISTS
 };
 
 class MediaSearchVisitor : public DeviceAPI::Tizen::IFilterVisitor
 {
 public:
-       typedef enum _QueryType { QUERY_FOLDER, QUERY_MEDIA } QueryType;
+    typedef enum _QueryType { QUERY_FOLDER, QUERY_MEDIA } QueryType;
 
-       
-       MediaSearchVisitor();
-       virtual ~MediaSearchVisitor();
 
-       virtual void visitPreComposite(FilterType& type, int depth);
-       virtual void visitInComposite(FilterType& type, int depth);
-       virtual void visitPostComposite(FilterType& type, int depth);
-       virtual void visitAttribute(string& attrName, MatchFlag& matchFlag, AnyPtr& matchValue, int depth);
-       virtual void visitAttributeRange(string& attrName,AnyPtr& initialValue,AnyPtr& endValue,int depth);
+    MediaSearchVisitor();
+    virtual ~MediaSearchVisitor();
+
+    virtual void visitPreComposite(FilterType& type, int depth);
+    virtual void visitInComposite(FilterType& type, int depth);
+    virtual void visitPostComposite(FilterType& type, int depth);
+    virtual void visitAttribute(string& attrName, MatchFlag& matchFlag, AnyPtr& matchValue, int depth);
+    virtual void visitAttributeRange(string& attrName,AnyPtr& initialValue,AnyPtr& endValue,int depth);
 
-       string getPlatformAttr(string attrName);
-       string getResult() const;
+    string getPlatformAttr(string attrName);
+    string getResult() const;
+    condition_e getOperationKey();
 
-       void setQueryType(QueryType value);
+    void setQueryType(QueryType value);
        
 private:
-       string toDateDbStr(tm &date) const;
-       string convertAttribute(string &attrname, AnyPtr& matchValue, MatchFlag& matchFlag);
+    string toDateDbStr(tm &date) const;
+    string convertAttribute(string &attrname, AnyPtr& matchValue, MatchFlag& matchFlag);
                
 private:
-       QueryType queryType;
-       string m_query; 
-       static map<string, string> attrFolderEnumMap;
-       static map<string, string> attrMediaEnumMap;
+    condition_e m_operationKey;
+    QueryType queryType;
+    string m_query;    
+    static map<string, string> attrFolderEnumMap;
+    static map<string, string> attrMediaEnumMap;
 
-       vector<string> m_condition;
+    vector<string> m_condition;
        
 
 };
index bd1552a..d469192 100755 (executable)
@@ -18,6 +18,7 @@
 #include "ContentUtility.h"
 #include <Commons/Regex.h>
 
+
 namespace DeviceAPI {
 namespace Content {
 
@@ -87,6 +88,16 @@ std::string ContentUtility::ltrim(const std::string s)
     return str;
 }
 
+bool ContentUtility::checkLocation(double lati, double longi)
+{
+    bool ret = true;
+    if(lati < MIN_LATITUDE || lati > MAX_LATITUDE || 
+        longi < MIN_LONGITUDE || longi > MAX_LONGITUDE){
+        ret = false;
+    }
+    return ret;
+}
+
 
 } // Content
 } // DeviceAPI
index faf0fdd..3eeb771 100755 (executable)
 
 #include <string>
 
+const double MAX_LATITUDE = 90;
+const double MIN_LATITUDE = -90;
+const double MAX_LONGITUDE = 180;
+const double MIN_LONGITUDE = -180;
+
 namespace DeviceAPI {
 namespace Content {
 
@@ -32,7 +37,7 @@ public:
 
     static std::string convertUriToPath(const std::string str);
     static std::string convertPathToUri(const std::string str);
-
+    static bool checkLocation(double lati, double longi);
 private:
     static std::string ltrim(const std::string s);
 
index 7cb34c7..4b4cbca 100755 (executable)
@@ -26,7 +26,8 @@ namespace Content {
 MediacontentVideo::MediacontentVideo()
 {
        m_editableAttrList.push_back("geolocation");
-
+       m_videoLongitude = DEFAULT_GEOLOCATION;
+       m_videoLatitude = DEFAULT_GEOLOCATION;
 }
 
 MediacontentVideo::~MediacontentVideo()
index e99b4d5..e156c26 100755 (executable)
@@ -61,7 +61,7 @@ class MediacontentVideo : public MediacontentMedia
        virtual vector<std::string> getEditableAttr() const;
 
        private:
-       double  m_videoLongitude;
+       double m_videoLongitude;
        double m_videoLatitude;
        string m_videoAlbum;
        vector<std::string> m_videoArtist;
index bfe69b6..fd8cd3d 100755 (executable)
@@ -470,7 +470,7 @@ bool        JSMedia::setPropertyRating(
 
 }
 
-bool           JSMedia::setPropertyDisplayName(
+bool JSMedia::setPropertyDisplayName(
                                        JSContextRef context,
                                        JSObjectRef object,
                                        JSStringRef propertyName,
@@ -483,7 +483,7 @@ bool                JSMedia::setPropertyDisplayName(
                MediacontentMediaPtr objMedia = getMediaObject(object);
                string displayName = converter.toString(value);
 
-               if ((objMedia->getDescription()).compare(displayName) != 0)
+               if ((objMedia->getDisplayName()).compare(displayName) != 0)
                {
                        objMedia->setDisplayName(displayName, true);
                }
@@ -499,7 +499,7 @@ bool                JSMedia::setPropertyDisplayName(
        return false;
 }
 
-bool           JSMedia::setPropertyDescription(
+bool JSMedia::setPropertyDescription(
                                        JSContextRef context,
                                        JSObjectRef object,
                                        JSStringRef propertyName,
index 17d3ff1..0a99561 100755 (executable)
@@ -484,26 +484,46 @@ JSValueRef JSMediacontentManager::updateItem(
         IEventUpdateMediaPtr dplEvent(new IEventUpdateMedia());
 
         if(JSValueIsObjectOfClass(context, arguments[0], JSImage::getClassRef())){
-            JSValueRef geoValRef = JSUtil::getProperty(context , JSUtil::JSValueToObject(context, arguments[0]), "geolocation");
-            JSObjectRef geoObjRef = JSUtil::JSValueToObject(context, geoValRef);
-            double latitude = JSUtil::JSValueToDouble(context, JSUtil::getProperty(context, geoObjRef, "latitude"));
-            double longitude = JSUtil::JSValueToDouble(context, JSUtil::getProperty(context, geoObjRef, "longitude"));
-
             MediacontentImagePtr imgPtr = JSImage::getImageObject(arg);
-            imgPtr->setImageLatitude(latitude);
-            imgPtr->setImageLongitude(longitude);
+            JSValueRef geoValRef = JSUtil::getProperty(context , JSUtil::JSValueToObject(context, arguments[0]), "geolocation");
+            if(!(JSValueIsNull(context, geoValRef) || JSValueIsUndefined(context, geoValRef))){
+                JSObjectRef geoObjRef = JSUtil::JSValueToObject(context, geoValRef);
+                double latitude = JSUtil::JSValueToDouble(context, JSUtil::getProperty(context, geoObjRef, "latitude"));
+                double longitude = JSUtil::JSValueToDouble(context, JSUtil::getProperty(context, geoObjRef, "longitude"));
+                if(ContentUtility::checkLocation(latitude, latitude)){
+                    imgPtr->setImageLatitude(latitude);
+                    imgPtr->setImageLongitude(longitude);
+                }
+                else{
+                    ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "geolocation value is not valid.");
+                }
+            }
+            else
+            {
+                imgPtr->setImageLatitude(DEFAULT_GEOLOCATION);
+                imgPtr->setImageLongitude(DEFAULT_GEOLOCATION);
+            }
         }
         else if(JSValueIsObjectOfClass(context, arguments[0], JSVideo::getClassRef())){
-            JSValueRef geoValRef = JSUtil::getProperty(context , JSUtil::JSValueToObject(context, arguments[0]), "geolocation");
-            JSObjectRef geoObjRef = JSUtil::JSValueToObject(context, geoValRef);
-
-            double latitude = JSUtil::JSValueToDouble(context, JSUtil::getProperty(context, geoObjRef, "latitude"));
-
-            double longitude = JSUtil::JSValueToDouble(context, JSUtil::getProperty(context, geoObjRef, "longitude"));
-
             MediacontentVideoPtr vedioPtr = JSVideo::getVideoObject(arg);
-            vedioPtr->setVideoLatitude(latitude);
-            vedioPtr->setVideoLongitude(longitude);
+            JSValueRef geoValRef = JSUtil::getProperty(context , JSUtil::JSValueToObject(context, arguments[0]), "geolocation");
+            if(!(JSValueIsNull(context, geoValRef) || JSValueIsUndefined(context, geoValRef))){
+                JSObjectRef geoObjRef = JSUtil::JSValueToObject(context, geoValRef);
+                double latitude = JSUtil::JSValueToDouble(context, JSUtil::getProperty(context, geoObjRef, "latitude"));
+                double longitude = JSUtil::JSValueToDouble(context, JSUtil::getProperty(context, geoObjRef, "longitude"));
+                if(ContentUtility::checkLocation(latitude, latitude)){
+                    vedioPtr->setVideoLatitude(latitude);
+                    vedioPtr->setVideoLongitude(longitude);
+                }
+                else{
+                    ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "geolocation value is not valid.");
+                }
+            }
+            else
+            {
+                vedioPtr->setVideoLatitude(DEFAULT_GEOLOCATION);
+                vedioPtr->setVideoLongitude(DEFAULT_GEOLOCATION);
+            }
         }
 
         event = JSMedia::getMediaObject(arg);
index 5ffd7fd..e4d6479 100755 (executable)
@@ -87,10 +87,18 @@ void JSImage::initialize(JSContextRef context, JSObjectRef object)
     }
     else {
         MediacontentImagePtr image = getImageObject(object);
-        DeviceAPI::Tizen::SimpleCoordinatesPtr geoPtr(new SimpleCoordinates(image->getImageLatitude(),image->getImageLongitude()));
-        JSUtil::setProperty(context, object, TIZEN_CONTENT_IMAGE_GEOLOCATION,
-                               JSSimpleCoordinates::createJSObject(context,geoPtr),
-                               kJSPropertyAttributeNone);
+        if(image->getImageLatitude() != DEFAULT_GEOLOCATION  && 
+            image->getImageLongitude() != DEFAULT_GEOLOCATION){
+            DeviceAPI::Tizen::SimpleCoordinatesPtr geoPtr(new SimpleCoordinates(image->getImageLatitude(),image->getImageLongitude()));
+            JSUtil::setProperty(context, object, TIZEN_CONTENT_IMAGE_GEOLOCATION,
+                    JSSimpleCoordinates::createJSObject(context,geoPtr),
+                    kJSPropertyAttributeNone);
+        }
+        else
+        {
+            JSUtil::setProperty(context, object, TIZEN_CONTENT_IMAGE_GEOLOCATION,
+                       JSValueMakeNull(context),kJSPropertyAttributeNone);
+        }
     }
 }
 
@@ -142,9 +150,11 @@ JSValueRef JSImage::getPropertyGeoLocation(
     {
         Converter converter(context);
         MediacontentImagePtr image = getImageObject(object);
-        DeviceAPI::Tizen::SimpleCoordinatesPtr geoPtr(new SimpleCoordinates(image->getImageLatitude(),image->getImageLongitude()));
-        return JSSimpleCoordinates::createJSObject(context,geoPtr);
-
+        if(image->getImageLatitude() != DEFAULT_GEOLOCATION  && 
+            image->getImageLongitude() != DEFAULT_GEOLOCATION){
+            DeviceAPI::Tizen::SimpleCoordinatesPtr geoPtr(new SimpleCoordinates(image->getImageLatitude(),image->getImageLongitude()));
+            return JSSimpleCoordinates::createJSObject(context,geoPtr);
+        }
     }
     Catch(Exception)
     {
index 46ee810..1a605e5 100755 (executable)
@@ -87,11 +87,19 @@ void JSVideo::initialize(JSContextRef context, JSObjectRef object)
     }
     else {
         LoggerD("private object already exists");
-               MediacontentVideoPtr video = getVideoObject(object);
-               DeviceAPI::Tizen::SimpleCoordinatesPtr geoPtr(new SimpleCoordinates(video->getVideoLatitude(),video->getVideoLongitude()));
-               JSUtil::setProperty(context, object, TIZEN_CONTENT_VIDEO_GEOLOCATION,
-                                       JSSimpleCoordinates::createJSObject(context,geoPtr),
-                                       kJSPropertyAttributeNone);
+        MediacontentVideoPtr video = getVideoObject(object);
+        if(video->getVideoLatitude() != DEFAULT_GEOLOCATION  && 
+            video->getVideoLongitude() != DEFAULT_GEOLOCATION){
+            DeviceAPI::Tizen::SimpleCoordinatesPtr geoPtr(new SimpleCoordinates(video->getVideoLatitude(),video->getVideoLongitude()));
+            JSUtil::setProperty(context, object, TIZEN_CONTENT_VIDEO_GEOLOCATION,
+                    JSSimpleCoordinates::createJSObject(context,geoPtr),
+                    kJSPropertyAttributeNone);
+        }
+        else
+        {
+            JSUtil::setProperty(context, object, TIZEN_CONTENT_VIDEO_GEOLOCATION,
+                       JSValueMakeNull(context),kJSPropertyAttributeNone);
+        }
     }
 }
 
@@ -146,8 +154,11 @@ JSValueRef JSVideo::getPropertyGeoLocation(
     {
         Converter converter(context);
         MediacontentVideoPtr video = getVideoObject(object);
-        SimpleCoordinatesPtr geoPtr(new SimpleCoordinates(video->getVideoLatitude(),video->getVideoLongitude()));
-        return JSSimpleCoordinates::createJSObject(context,geoPtr);
+        if(video->getVideoLatitude() != DEFAULT_GEOLOCATION && 
+            video->getVideoLongitude() != DEFAULT_GEOLOCATION){        
+            SimpleCoordinatesPtr geoPtr(new SimpleCoordinates(video->getVideoLatitude(),video->getVideoLongitude()));
+            return JSSimpleCoordinates::createJSObject(context,geoPtr);
+        }
     }
     Catch(Exception)
     {
index 3e5a33d..19ab7c7 100644 (file)
@@ -166,10 +166,21 @@ void Conversation::makeConversationFromThread(msg_struct_t msg_thread)
 
                        ret = msg_get_message(handle, tempMsgId, msgInfo, sendOpt);
 
+                       if(ret == MSG_ERR_STORAGE_ERROR)
+                       {
+                               int retryCount = 0;
+                               while (retryCount < 2 && ret != MSG_SUCCESS) {
+                                       LoggerD("retry msg_get_message for MSG_ERR_STORAGE_ERROR");
+                                       usleep(300 * 1000);
+                                       ret = msg_get_message(handle, tempMsgId, msgInfo, sendOpt);
+                                       retryCount++;
+                               }
+                       }
+
                        if (ret != MSG_SUCCESS)
                        {
                                LoggerD("ret " << ret);
-                               ThrowMsg(WrtDeviceApis::Commons::UnknownException, "get message fail");
+                               ThrowMsg(WrtDeviceApis::Commons::PlatformException, "get message fail");
                        }
 
                        msg_get_int_value(msgInfo, MSG_MESSAGE_DIRECTION_INT, &tempInt);
@@ -278,6 +289,20 @@ void Conversation::makeConversationFromThread(msg_struct_t msg_thread)
                }
 
        }
+       catch (const WrtDeviceApis::Commons::PlatformException& ex) 
+       {
+               LoggerE("Exception: " << ex.GetMessage());
+               msg_release_list_struct(&convViewList);
+               if(msgInfo != NULL)
+               {
+                       msg_release_struct(&msgInfo);
+               }
+               if(sendOpt != NULL)
+               {
+                       msg_release_struct(&sendOpt);
+               }
+               ThrowMsg(WrtDeviceApis::Commons::PlatformException, "make conversation error");
+       }
        catch (const WrtDeviceApis::Commons::Exception& ex) 
        {
                m_result = false;
index 9838eac..28c9e72 100644 (file)
@@ -343,14 +343,22 @@ std::string Messaging::generateFilterSql(const DeviceAPI::Tizen::FilterPtr& filt
        std::vector<IConversationPtr> Messaging::createVectorFromeThreadViewList(const msg_struct_list_s& threadViewList){
                vector<IConversationPtr> recVec;
 
-               if (threadViewList.nCount <= 0) {
+               if (threadViewList.nCount <= 0) {
                        LoggerD("Empty...");
-               }       else    {
-                       for (int i = 0; i < threadViewList.nCount; i++)         {
-//                             IConversationPtr convPtr(new Conversation(i));
-                               IConversationPtr convPtr(new Conversation(threadViewList.msg_struct_info[i]));
-
-                               recVec.push_back(convPtr);
+               }
+               else {
+                       for (int i = 0; i < threadViewList.nCount; i++)
+                       {
+                               try 
+                               {
+                                       IConversationPtr convPtr(new Conversation(threadViewList.msg_struct_info[i]));
+                                       recVec.push_back(convPtr);
+                               }
+                               catch (const WrtDeviceApis::Commons::Exception& ex) 
+                               {
+                                       LoggerD("make conversation error for element " << i);
+                                       continue;
+                               }
                        }
                }
 
index 8a4969e..e2abd79 100644 (file)
@@ -1689,27 +1689,14 @@ std::string Mms::indexIntToMimeTypeString(MimeType inputIndex)
 
 msg_struct_t Mms::createNewCopyOfPLatformMsgWithAddressList(const msg_struct_t src) const
 {
-       int tempInt, nCount;
+       int tempInt, nCount, ret;
        bool tempBool;
        msg_struct_list_s *addr_list;
        msg_struct_list_s *new_addr_list;
 
-       int pageLen, mediaLen, attachLen, ret;
-
        msg_struct_t mms_struct = NULL;
        msg_struct_t mms_struct_dummy = NULL;   
 
-       msg_list_handle_t page_list = NULL;
-       msg_list_handle_t media_list = NULL;
-       msg_list_handle_t attach_list = NULL;
-       
-       msg_struct_t page = NULL;
-       msg_struct_t media = NULL;
-       msg_struct_t attach = NULL;
-
-       char szFilePath[MSG_FILEPATH_LEN_MAX] = {0,};
-       char szFileName[MSG_FILENAME_LEN_MAX] = {0,};
-       
        msg_struct_t msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
 
        msg_set_int_value(msg, MSG_MESSAGE_TYPE_INT, MSG_TYPE_MMS);
@@ -1736,11 +1723,15 @@ msg_struct_t Mms::createNewCopyOfPLatformMsgWithAddressList(const msg_struct_t s
 //    copy mms body and attachment
        mms_struct = msg_create_struct(MSG_STRUCT_MMS);
        mms_struct_dummy = msg_create_struct(MSG_STRUCT_MMS);
-       msg_get_mms_struct(src, mms_struct);
+       ret = msg_get_mms_struct(src, mms_struct);
+       if (ret != MSG_SUCCESS)
+       {
+               LoggerE("cannot get mms struct");
+               ThrowMsg(WrtDeviceApis::Commons::PlatformException, "cannot get mms struct");
+       }
 
        msg_set_mms_struct(src, mms_struct_dummy);
        msg_set_mms_struct(msg, mms_struct);
-       msg_release_struct(&mms_struct);
 
        msg_get_int_value(src, MSG_MESSAGE_DISPLAY_TIME_INT, &tempInt);
        msg_set_int_value(msg, MSG_MESSAGE_DISPLAY_TIME_INT, tempInt);
@@ -1798,6 +1789,9 @@ msg_struct_t Mms::createNewCopyOfPLatformMsgWithAddressList(const msg_struct_t s
                msg_set_int_value(new_addr_info, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, tempInt);
        }
 
+       msg_release_struct(&mms_struct_dummy);
+       msg_release_struct(&mms_struct);
+
     return msg;
 }
 
index 5306a37..e606390 100755 (executable)
@@ -127,9 +127,9 @@ void SimCphsValueCallback(TapiHandle *handle, int result, void *data, void *user
         EventGetSysteminfoPtr event = pendingEvent->getEvent();
 
         if (access_rt == TAPI_SIM_ACCESS_SUCCESS) {
-            if (cphsInfo->full_name) {
-            systeminfo->setSimValue(SIM_CPHS_VALUE, (char *)cphsInfo->full_name, event);
-            } else if (cphsInfo->short_name) {
+            if(strlen((const char*)cphsInfo->full_name) == 0) {
+                systeminfo->setSimValue(SIM_CPHS_VALUE, (char *)cphsInfo->full_name, event);
+            } else if (strlen((const char*)cphsInfo->short_name) == 0) {
                 systeminfo->setSimValue(SIM_CPHS_VALUE, (char *)cphsInfo->short_name, event);
             } else {
                 systeminfo->setSimValue(SIM_CPHS_VALUE, NULL, event);                    
@@ -632,7 +632,6 @@ void Systeminfo::OnRequestReceived(const EventGetSysteminfoPtr& event)
                     simState = strdup("UNKNOWN");
                     break;
             }
-            LoggerD("simState : " << simState);
             event->setSimState(simState);
             if(strcmp(simState, "READY") == 0) {
                 if (tel_get_sim_imsi(m_tapiHandle, &imsi) == TAPI_API_SUCCESS) {
@@ -653,8 +652,10 @@ void Systeminfo::OnRequestReceived(const EventGetSysteminfoPtr& event)
                 event->makeSimObject();
                 EventRequestReceiver<EventGetSysteminfo>::ManualAnswer(event);
             }
-            if (simState)
+            if (simState) {
+                LoggerD("simState : " << simState);
                 free(simState);
+            }
         } else {
             LoggerE("get fail sim state");
             event->makeSimObject();