Update change log and spec for wrt-plugins-tizen_0.4.51
authorDongjin Choi <milkelf.choi@samsung.com>
Tue, 9 Jul 2013 08:13:29 +0000 (17:13 +0900)
committerDongjin Choi <milkelf.choi@samsung.com>
Tue, 9 Jul 2013 08:13:29 +0000 (17:13 +0900)
[model] REDWOOD
[binary_type] PDA
[customer] OPEN

[Systeminfo] Change get Sim value code

[Issue] N/A
[Problem] UTC_download_start_P_001 is failed.
[Cause] Using invalid destination virtual path
[Solution] Uses valid path

[WebSetting] Fix websetting privilege TCT issue as well as indentation adjustment.

[Issue] N/A
[Problem] usleep was not decleared
[Cause] unistd.h was missing
[Solution] including unistd.h

[Issue] N/A
[Problem] stopSync fail after sync called quickly
[Cause] stopSync cannot get handle from email service
[Solution] retry to get handle from email service

[Issue#] DCM-2166
[Problem] N/A
[Cause] Internal bug
[Solution] modify code

[Issue#] N/A
[Problem] N/A
[Cause] Internal bug
[Solution] modify code

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

UnitTC passed.

28 files changed:
packaging/wrt-plugins-tizen.spec
src/Alarm/JSAlarmAbsolute.cpp
src/Alarm/JSAlarmAbsolute.h
src/Alarm/JSAlarmManager.cpp
src/Alarm/JSAlarmManager.h
src/Alarm/JSAlarmRelative.cpp
src/Alarm/JSAlarmRelative.h
src/Application/JSApplicationControl.cpp
src/Application/JSApplicationControl.h
src/Application/JSApplicationControlData.cpp
src/Application/JSApplicationManager.cpp
src/Application/JSApplicationManager.h
src/Application/JSRequestedApplicationControl.cpp
src/Application/JSRequestedApplicationControl.h
src/Messaging/Email.cpp
src/Messaging/Messaging.cpp
src/Messaging/MessagingService.cpp
src/Messaging/MessagingService.h
src/Power/PowerManager.cpp
src/Systeminfo/Systeminfo.cpp
src/WebSetting/JSWebSettingManager.cpp
src/WebSetting/JSWebSettingManager.h [changed mode: 0644->0755]
src/WebSetting/WebSettingManager.cpp
src/WebSetting/WebSettingManager.h
src/WebSetting/WebSettingTypes.h [changed mode: 0644->0755]
src/WebSetting/plugin_config.cpp
src/WebSetting/plugin_config.h [changed mode: 0644->0755]
src/WebSetting/plugin_initializer.cpp

index 91f473b..1600340 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       wrt-plugins-tizen
 Summary:    JavaScript plugins for WebRuntime
-Version:    0.4.50
+Version:    0.4.51
 Release:    0
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index 1c78c4f..e18815d 100644 (file)
@@ -107,20 +107,14 @@ void JSAlarmAbsolute::finalize(JSObjectRef object)
 
 }
 
-bool JSAlarmAbsolute::hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception)
-{
-    return JSValueIsObjectOfClass(context, possibleInstance, getClassRef());
-}
 
 JSObjectRef DLL_EXPORT JSAlarmAbsolute::constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
-    try {
-        AlarmAbsolutePtr priv = AlarmAbsolutePtr(new AlarmAbsolute());
-        if (!priv) {
-            throw TypeMismatchException("Private object is null");
-        }
+       ArgumentValidator validator(ctx, argumentCount, arguments);
 
-        ArgumentValidator validator(ctx, argumentCount, arguments); 
+       AlarmAbsolutePtr priv = AlarmAbsolutePtr(new AlarmAbsolute());
+
+    try {
         time_t date = validator.toTimeT(0);
         struct tm *startDate = localtime(&date);
         mktime(startDate);
@@ -152,12 +146,19 @@ JSObjectRef DLL_EXPORT JSAlarmAbsolute::constructor(JSContextRef ctx, JSObjectRe
                 priv->setInterval(interval);
             }
         }
+       } catch (const BasePlatformException& err) {
+               LoggerE("Exception occured while creating constructor : " << err.getMessage());
+       }
 
-        return JSValueToObject(ctx, createJSObject(ctx, priv), exception);
+       JSAlarmAbsolutePriv *jspriv = new JSAlarmAbsolutePriv(ctx, priv);
+       JSObjectRef obj = JSObjectMake(ctx, getClassRef(), jspriv);
 
-    } catch (const BasePlatformException& err) {
-        return JSWebAPIErrorFactory::postException(ctx, exception, err);
-    }
+    JSStringRef ctorName = JSStringCreateWithUTF8CString("constructor");
+    JSObjectSetProperty(ctx, obj, ctorName, constructor,
+        kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete | kJSPropertyAttributeDontEnum, NULL);
+    JSStringRelease(ctorName);
+
+       return obj;
 }
 
 AlarmAbsolutePtr JSAlarmAbsolute::getPrivData(JSObjectRef object)
@@ -173,17 +174,6 @@ AlarmAbsolutePtr JSAlarmAbsolute::getPrivData(JSObjectRef object)
     return result;
 }
 
-JSValueRef JSAlarmAbsolute::createJSObject(JSContextRef context, const int id)
-{
-    AlarmAbsolutePtr privateData = AlarmAbsolutePtr(new AlarmAbsolute());   
-    privateData->setId(id);
-    
-    JSAlarmAbsolutePriv *priv = new JSAlarmAbsolutePriv(context, privateData);
-    if (!priv) {
-        throw TypeMismatchException("Private object is null");
-    }
-    return  JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
-}
 
 JSValueRef JSAlarmAbsolute::createJSObject(JSContextRef context, AlarmAbsolutePtr privateData)
 {
@@ -194,30 +184,6 @@ JSValueRef JSAlarmAbsolute::createJSObject(JSContextRef context, AlarmAbsolutePt
     return JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
 }
 
-JSValueRef JSAlarmAbsolute::createJSObject(JSContextRef context, struct tm date, int interval)
-{
-    AlarmAbsolutePtr privateData = AlarmAbsolutePtr(new AlarmAbsolute());
-    privateData->setDate(date);
-
-    JSAlarmAbsolutePriv *priv = new JSAlarmAbsolutePriv(context, privateData);
-    if (!priv) {
-        throw TypeMismatchException("Private object is null");
-    }
-    return JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
-}
-
-JSValueRef JSAlarmAbsolute::createJSObject(JSContextRef context, struct tm date)
-{
-    AlarmAbsolutePtr privateData = AlarmAbsolutePtr(new AlarmAbsolute());
-    privateData->setDate(date);
-
-    JSAlarmAbsolutePriv *priv = new JSAlarmAbsolutePriv(context, privateData);
-    if (!priv) {
-        throw TypeMismatchException("Private object is null");
-    }
-    return JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
-}
-
 JSValueRef JSAlarmAbsolute::getNextScheduledDate( JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception)
 {   
     TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
index 309b6d6..b9ee64f 100755 (executable)
@@ -40,17 +40,12 @@ class JSAlarmAbsolute {
 public:
     static const JSClassDefinition* getClassInfo();
     static const JSClassRef getClassRef();
-    static JSValueRef createJSObject(JSContextRef context, const int id);
-    static JSValueRef createJSObject(JSContextRef context, AlarmAbsolutePtr privateData);
-    static JSValueRef createJSObject(JSContextRef context, struct tm date, int interval);
-    static JSValueRef createJSObject(JSContextRef context, struct tm date);
     static JSObjectRef constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
-    
+    static JSValueRef createJSObject(JSContextRef context, AlarmAbsolutePtr privateData);
 
 protected:
     static void initialize(JSContextRef context, JSObjectRef object);
     static void finalize(JSObjectRef object);
-    static bool hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);
     static JSValueRef getNextScheduledDate(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
     
 private:
index d59abb0..d491691 100644 (file)
@@ -129,10 +129,6 @@ void JSAlarmManager::finalize(JSObjectRef object)
 {
 }
 
-bool JSAlarmManager::hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception) {
-    return JSValueIsObjectOfClass(context, possibleInstance, getClassRef());
-}
-
 JSValueRef JSAlarmManager::add(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
index a54768f..7100030 100755 (executable)
@@ -41,7 +41,6 @@ public:
 protected:
     static void initialize(JSContextRef context, JSObjectRef object);
     static void finalize(JSObjectRef object);
-    static bool hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);
     static JSValueRef add(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
     static JSValueRef remove(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
     static JSValueRef removeAll(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
index f38bc8d..92c58bd 100644 (file)
@@ -107,34 +107,33 @@ void JSAlarmRelative::finalize(JSObjectRef object)
     delete priv;
 }
 
-bool JSAlarmRelative::hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception)
-{
-    return JSValueIsObjectOfClass(context, possibleInstance, getClassRef());
-}
-
 JSObjectRef DLL_EXPORT JSAlarmRelative::constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
-    try {
-        ArgumentValidator validator(ctx, argumentCount, arguments);
+    ArgumentValidator validator(ctx, argumentCount, arguments);
 
+       AlarmRelativePtr privateData = AlarmRelativePtr(new AlarmRelative());
+
+    try {
         long delay = validator.toLong(0);
-        if (delay < 0) {
-            throw InvalidValuesException("delay cannot be negative value");
-        }
-        long period = validator.toLong(1, true, 0);
-        if (period < 0) {
-            throw InvalidValuesException("period cannot be negative value");
-        }
+        privateData->setDelay(delay);
 
-        if ((argumentCount > 1) && !JSValueIsNull(ctx, arguments[1])) {
-            return JSValueToObject(ctx, createJSObject(ctx, delay, period), exception);
-        } else {
-            return JSValueToObject(ctx, createJSObject(ctx, delay, -1), exception);
-        }
-    } catch (const BasePlatformException& err) {
-        return JSWebAPIErrorFactory::postException(ctx, exception, err);
-    }
+        long period = validator.toLong(1, true, -1);
+        privateData->setPeriod(period);
+
+       } catch (const BasePlatformException& err) {
+               LoggerE("Exception occured while creating constructor : " << err.getMessage());
+       }
+
+       JSAlarmRelativePriv *priv = new JSAlarmRelativePriv(ctx, privateData);
+       JSObjectRef obj = JSObjectMake(ctx, getClassRef(), priv);
+
+    JSStringRef ctorName = JSStringCreateWithUTF8CString("constructor");
+    JSObjectSetProperty(ctx, obj, ctorName, constructor,
+        kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete | kJSPropertyAttributeDontEnum, NULL);
+    JSStringRelease(ctorName);
 
+       return obj;
 }
 
 AlarmRelativePtr JSAlarmRelative::getPrivData(JSObjectRef object)
index f0784a9..fee01ff 100755 (executable)
@@ -46,8 +46,6 @@ public:
 protected:
     static void initialize(JSContextRef context, JSObjectRef object);
     static void finalize(JSObjectRef object);
-    static bool hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);
-    //static JSValueRef getRemainingDuration(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
     static JSValueRef getRemainingSeconds(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception);
 
 private:
index 01d165f..803a5e4 100644 (file)
@@ -116,18 +116,6 @@ ApplicationControlPtr DLL_EXPORT JSApplicationControl::getApplicationControl(JSC
        return priv->getObject();
 }
 
-#if 0
-ApplicationControlPtr JSApplicationControl::getPrivateData(JSContextRef context, JSObjectRef object)
-{
-       JSApplicationControlPriv* priv = static_cast<JSApplicationControlPriv*>(JSObjectGetPrivate(object));
-       if (!priv) {
-               throw TypeMismatchException("Private object is null");
-       }
-       
-       return priv->getObject();
-}
-#endif
-
 void JSApplicationControl::initialize(JSContextRef context,JSObjectRef object)
 {
 }
@@ -162,7 +150,7 @@ JSObjectRef DLL_EXPORT JSApplicationControl::constructor(JSContextRef context,
                        appsvc->setAppControlDataArray(appControlDataArray);
                }
     } catch (const BasePlatformException& err) {
-       return JSWebAPIErrorFactory::postException(context, exception, err);
+        LoggerE("Exception occured while creating constructor : " << err.getMessage());
     }
 
        JSApplicationControlPriv *priv = new JSApplicationControlPriv(context, appsvc);
@@ -279,12 +267,5 @@ bool JSApplicationControl::setProperty(JSContextRef context, JSObjectRef object,
        return false;
 }
 
-
-bool JSApplicationControl::hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception)
-{
-    return JSValueIsObjectOfClass(context, possibleInstance, getClassRef());
-}
-
-
 }
 }
index c047517..2720ad8 100755 (executable)
@@ -96,14 +96,6 @@ private:
                  JSValueRef* exception);
 
   /**
-     * The callback invoked when an object is used as the target of an 'instanceof' expression.
-     */
-    static bool hasInstance(JSContextRef context,
-            JSObjectRef constructor,
-            JSValueRef possibleInstance,
-            JSValueRef* exception);
-
-  /**
      * This structure contains properties and callbacks that define a type of object.
      */
     static JSClassDefinition m_classInfo;
index 29ea6f7..a6eb790 100644 (file)
@@ -88,25 +88,26 @@ JSObjectRef JSApplicationControlData::createJSObject(JSContextRef context, const
 
 JSObjectRef DLL_EXPORT JSApplicationControlData::constructor(JSContextRef context, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
-       try {
-               ArgumentValidator validator(context, argumentCount, arguments);
-               ApplicationControlDataPtr appdata(new ApplicationControlData());
+       ArgumentValidator validator(context, argumentCount, arguments);
+
+       ApplicationControlDataPtr appdata(new ApplicationControlData());
 
+       try {
            appdata->setKey(validator.toString(0));
                appdata->setValue(JSUtil::JSArrayToStringVector(context, validator.toArrayObject(1)));
+       } catch (BasePlatformException &err) {
+               LoggerE("Exception occured while creating constructor : " << err.getMessage());
+       }
 
-               JSApplicationControlDataPriv *priv = new JSApplicationControlDataPriv(context, appdata);
-               JSObjectRef obj = JSObjectMake(context, getClassRef(),priv);
+    JSApplicationControlDataPriv *priv = new JSApplicationControlDataPriv(context, appdata);
+    JSObjectRef obj = JSObjectMake(context, getClassRef(),priv);
 
-           JSStringRef ctorName = JSStringCreateWithUTF8CString("constructor");
-           JSObjectSetProperty(context, obj, ctorName, constructor,
-               kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete | kJSPropertyAttributeDontEnum, NULL);
-           JSStringRelease(ctorName);
+    JSStringRef ctorName = JSStringCreateWithUTF8CString("constructor");
+    JSObjectSetProperty(context, obj, ctorName, constructor,
+        kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete | kJSPropertyAttributeDontEnum, NULL);
+    JSStringRelease(ctorName);
 
-           return obj;
-       } catch (BasePlatformException &err) {
-               return JSWebAPIErrorFactory::postException(context, exception, err);
-    }
+    return obj;
 }
 
 void JSApplicationControlData::initialize(JSContextRef context, JSObjectRef object)
index 96293cc..4de7f85 100644 (file)
@@ -138,15 +138,6 @@ void JSApplicationManager::finalize(JSObjectRef object)
        delete priv;
 }
 
-bool JSApplicationManager::hasInstance(JSContextRef context, 
-       JSObjectRef constructor, 
-       JSValueRef possibleInstance, 
-       JSValueRef* exception) 
-{
-       return JSValueIsObjectOfClass(context, possibleInstance, getClassRef());
-}
-
-
 JSValueRef JSApplicationManager::getCurrentApplication(JSContextRef context, 
        JSObjectRef object, 
        JSObjectRef thisObject, 
index c7826d0..9cb9088 100644 (file)
@@ -50,11 +50,6 @@ private:
        static void finalize(JSObjectRef object);
 
        /**
-        * The callback invoked when an object is used as the target of an 'instanceof' expression.
-        */
-       static bool hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);
-
-       /**
         * Gets a current application
         */
        static JSValueRef getCurrentApplication(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
index 5b59cf7..f0bb9d2 100644 (file)
@@ -179,11 +179,6 @@ JSValueRef JSRequestedApplicationControl::getProperty(JSContextRef context, JSOb
 }
 
 
-bool JSRequestedApplicationControl::hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception)
-{
-    return JSValueIsObjectOfClass(context, possibleInstance, getClassRef());
-}
-
 JSValueRef JSRequestedApplicationControl::replyResult(JSContextRef context, 
        JSObjectRef object, 
        JSObjectRef thisObject, 
index 736aa3b..cc5021a 100644 (file)
@@ -47,11 +47,6 @@ public:
        static JSObjectRef createJSObject(JSContextRef context,
                           const RequestedApplicationControlPtr &appsvc);
 
-       /**
-        * The Constructor of ApplicationControl
-        */
-       static JSObjectRef constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
-
 
        static bool isObjectOfClass(JSContextRef context, JSValueRef value);
 
@@ -102,13 +97,6 @@ private:
                  JSValueRef value,
                  JSValueRef* exception);
 
-  /**
-     * The callback invoked when an object is used as the target of an 'instanceof' expression.
-     */
-    static bool hasInstance(JSContextRef context,
-            JSObjectRef constructor,
-            JSValueRef possibleInstance,
-            JSValueRef* exception);
 
   /**
      * This structure contains properties and callbacks that define a type of object.
index 667b864..fbff139 100644 (file)
@@ -857,7 +857,7 @@ void Email::updateMessage()
        if(getCurrentFolder() == DRAFTBOX)
        {
 //             updateBody();
-//             updateSubject();
+               updateSubject();
 //             updateRecipients();
 //             updateFrom();
 //             updateAttachments();
@@ -887,6 +887,23 @@ void Email::updateMessage()
        error = email_update_mail( m_mail.Get(), attachment, attachmentCount, meeting_req, 0);
        if (EMAIL_ERROR_NONE != error) {
                LoggerW("Nothing to update or error. [" << error << "]");
+/*
+               if(error == EMAIL_ERROR_DB_FAILURE)
+               {
+                       int retry = 0;
+                       while (retry < 2) {
+                               LoggerW("wait 300 ms");
+                               usleep(300 * 1000);
+                               email_update_mail( m_mail.Get(), attachment, attachmentCount, meeting_req, 0);
+                               LoggerW("error. [" << error << "]");
+                               if (EMAIL_ERROR_NONE == error) {
+                                       break;
+                               }
+                               retry++;
+
+                       }
+               }
+*/
        }
 
        if(getCurrentFolder() == DRAFTBOX)
@@ -920,12 +937,14 @@ void Email::updateMessage()
                                        LoggerW("email_update_mail_attribute error. [" << error << "]");
                                }
                        }
-                   tm* time = localtime(&result->date_time);
-                   if (!time) {
-                       LoggerE("localtime failed");
-                       Throw(WrtDeviceApis::Commons::PlatformException);
-                   }
-                   setDateTime(*time);
+
+                       tm* time = localtime(&result->date_time);
+                       if (!time) {
+                               LoggerE("localtime failed");
+                               Throw(WrtDeviceApis::Commons::PlatformException);
+                       }
+                       setDateTime(*time);
+
                }
                if(result != NULL)
                {
index 7625445..5626433 100644 (file)
@@ -473,6 +473,13 @@ vector<IConversationPtr> Messaging::queryEmailConversation(const std::string& sq
                std::set<int> checkUnique;
 
                for(int i=0; i<mailListCount; i++){
+                       if(mailList[i].mail_id != mailList[i].thread_id)
+                       {
+                               LoggerD("skip mail");
+                               LoggerD("mailList[i].mail_id: " << mailList[i].mail_id);
+                               LoggerD("mailList[i].thread_id:" << mailList[i].thread_id);
+                               continue;
+                       }
                        if (checkUnique.find(mailList[i].thread_id) == checkUnique.end()){
                                checkUnique.insert(mailList[i].thread_id);
                                IConversationPtr convPtr(new Conversation(mailList[i].thread_id, EMAIL));
index 8bb5ec1..b408fe6 100644 (file)
@@ -26,7 +26,7 @@
 #include <email-types.h>
 #include <email-api.h>
 #include <Logger.h>
-
+#include <unistd.h>
 
 using namespace std;
 
@@ -153,7 +153,7 @@ int MessagingService::createOpId(int type)
                index = type;
        }
                
-       LoggerD("m_opRequests size : " << cnt );
+       LoggerD("m_opRequests cnt : " << cnt );
        LoggerD("index " << index);
        m_opRequests.insert(std::make_pair(index, MessagingServiceOpData(0,type)));
 
@@ -162,17 +162,29 @@ int MessagingService::createOpId(int type)
 
 int MessagingService::getHandleFromOpId(int opIdx)
 {
-    LoggerD("operation index size : " << opIdx);
-
+    LoggerD("opIdx : " << opIdx);
+    LoggerD("m_opRequests.size() : " << m_opRequests.size() );
     int handle = -1;
        
     OpRequestsIterator it = m_opRequests.find(opIdx);
     if ( m_opRequests.end() != it)
     {
-               handle = it->second.handle;
+        int retryCount = 0;
+        if(it->second.checkSetHandle == false)
+        {
+            while (retryCount < 2) {
+                LoggerW("Wait for handle");
+                usleep(200 * 1000);
+                if (it->second.checkSetHandle) {
+                    break;
+                }
+                retryCount++;
+            }
+            handle = it->second.handle;
+        }
     }
 
-    LoggerD("index " << handle);
+    LoggerD("handle " << handle);
     return handle;
 
 }
@@ -237,6 +249,7 @@ void MessagingService::setHandleToOpId(int opIdx, int handle)
        {
                LoggerD(" find Message ");
                it->second.handle = handle;
+               it->second.checkSetHandle = true;
        }
        
 }
index b518e60..3833eaf 100755 (executable)
@@ -86,12 +86,14 @@ private:
        {
                unsigned int handle;
                unsigned short type;
+               bool checkSetHandle;
                IMessagePtr message;
                EventMessagingServicePtr event;
 
                explicit MessagingServiceOpData(int handle, int type) :
                    handle(handle),
                    type(type),
+                   checkSetHandle(false),
                    message(NULL),
                    event(NULL)
                {
index 568d9a0..af4e39c 100755 (executable)
@@ -25,6 +25,7 @@
 #include <JSUtil.h>
 #include <vconf.h>
 #include <Logger.h>
+#include <unistd.h>
 
 using namespace DeviceAPI::Common;
 using namespace std;
index f9f4f2d..5306a37 100755 (executable)
@@ -634,8 +634,6 @@ void Systeminfo::OnRequestReceived(const EventGetSysteminfoPtr& event)
             }
             LoggerD("simState : " << simState);
             event->setSimState(simState);
-            if (simState)
-                free(simState);
             if(strcmp(simState, "READY") == 0) {
                 if (tel_get_sim_imsi(m_tapiHandle, &imsi) == TAPI_API_SUCCESS) {
                     LoggerD("mcc : " << imsi.szMcc << \r" mnc : " << imsi.szMnc << " msin : " << imsi.szMsin);
@@ -655,6 +653,8 @@ void Systeminfo::OnRequestReceived(const EventGetSysteminfoPtr& event)
                 event->makeSimObject();
                 EventRequestReceiver<EventGetSysteminfo>::ManualAnswer(event);
             }
+            if (simState)
+                free(simState);
         } else {
             LoggerE("get fail sim state");
             event->makeSimObject();
@@ -1283,8 +1283,8 @@ PROPERTY_GET_SYSTEMINFO_DEFINITION(Storage) {
             storagePtr->units[1].type = "MMC";
             storagePtr->units[1].capacity = (unsigned long long)fs.f_bsize * (unsigned long long)fs.f_blocks;
             storagePtr->units[1].availableCapacity = (unsigned long long)fs.f_bsize * (unsigned long long)fs.f_bavail;
-            storagePtr->units[1].isRemoveable = false;
-            storagePtr->units[1].isRemovable = false;
+            storagePtr->units[1].isRemoveable = true;
+            storagePtr->units[1].isRemovable = true;
             storagePtr->cnt = 2;
             LoggerD("type : " << storagePtr->units[1].type);            
         }
index d0b45e6..4ee8a8c 100755 (executable)
 using namespace WrtDeviceApis::Commons;
 using namespace DeviceAPI::Common;
 
-namespace DeviceAPI {
-namespace WebSetting {
+namespace DeviceAPI
+{
+namespace WebSetting
+{
 
-JSClassDefinition JSWebSettingManager::m_classInfo = {
+JSClassDefinition JSWebSettingManager::m_classInfo =
+{
     0,
     kJSClassAttributeNone,
     "WebSettingManager",
@@ -54,7 +57,8 @@ JSClassDefinition JSWebSettingManager::m_classInfo = {
     NULL //ConvertToType
 };
 
-JSStaticFunction JSWebSettingManager::m_function[] = {
+JSStaticFunction JSWebSettingManager::m_function[] =
+{
     { WEB_SETTING_MANAGER_API_SET_USER_AGENT_STRING, setUserAgentString, kJSPropertyAttributeNone },
     { WEB_SETTING_MANAGER_API_REMOVE_ALL_COOKIES, removeAllCookies, kJSPropertyAttributeNone },
     { 0, 0, 0 }
@@ -64,7 +68,8 @@ JSClassRef JSWebSettingManager::m_jsClassRef = JSClassCreate(JSWebSettingManager
 
 const JSClassRef JSWebSettingManager::getClassRef()
 {
-    if (!m_jsClassRef) {
+    if (!m_jsClassRef)
+    {
         m_jsClassRef = JSClassCreate(&m_classInfo);
     }
     return m_jsClassRef;
@@ -77,18 +82,20 @@ const JSClassDefinition* JSWebSettingManager::getClassInfo()
 
 void JSWebSettingManager::initialize(JSContextRef context, JSObjectRef object)
 {
-    if (!JSObjectGetPrivate(object)) {
-               SLoggerI("JSWebSettingManager::initialize called...");
+    if (!JSObjectGetPrivate(object))
+    {
+        SLoggerI("JSWebSettingManager::initialize called...");
         WebSettingManager *priv = WebSettingManager::getInstance();
-               JSObjectSetPrivate(object, static_cast<void*>(priv));
+        JSObjectSetPrivate(object, static_cast<void*>(priv));
     }
 }
 
 void JSWebSettingManager::finalize(JSObjectRef object)
 {
-       SLoggerI("JSWebSettingManager::finalize called...");
+    SLoggerI("JSWebSettingManager::finalize called...");
     WebSettingManager *priv = static_cast<WebSettingManager*>(JSObjectGetPrivate(object));
-    if (priv) {
+    if (priv)
+    {
         JSObjectSetPrivate(object, NULL);
     }
 }
@@ -100,10 +107,12 @@ JSValueRef JSWebSettingManager::setUserAgentString(JSContextRef context,
         const JSValueRef arguments[],
         JSValueRef* exception)
 {
-    try {
+    try
+    {
         // Private Object
         WebSettingManager *priv = static_cast<WebSettingManager*>(JSObjectGetPrivate(thisObject));
-        if (!priv) {
+        if (!priv)
+        {
             throw TypeMismatchException("Private object is NULL.");
         }
         ArgumentValidator validator(context, argumentCount, arguments);
@@ -121,21 +130,26 @@ JSValueRef JSWebSettingManager::setUserAgentString(JSContextRef context,
 
         // errorCallback
         JSObjectRef errorCallbackObj = validator.toFunction(2, true);
-               
+
         if (errorCallbackObj)
         {
             callbacks->setCallback("onerror", errorCallbackObj);
         }
 
         priv->setUserAgentString(userAgent, callbacks);
+
         return JSValueMakeUndefined(context);
-    } catch (const BasePlatformException &err) {
-           SLoggerE(err.getName().c_str() << ":" << err.getMessage().c_str());
-           return JSWebAPIErrorFactory::postException(context, exception, err);                
-    } catch (...) {
+    }
+    catch (const BasePlatformException &err)
+    {
+        SLoggerE(err.getName().c_str() << ":" << err.getMessage().c_str());
+        return JSWebAPIErrorFactory::postException(context, exception, err);
+    }
+    catch (...)
+    {
         DeviceAPI::Common::UnknownException err("Unknown Error in WebSettingManager.setUserAgentString().");
-           SLoggerE(err.getName().c_str() << ":" <<  err.getMessage().c_str());
-           return JSWebAPIErrorFactory::postException(context, exception, err);                
+        SLoggerE(err.getName().c_str() << ":" <<  err.getMessage().c_str());
+        return JSWebAPIErrorFactory::postException(context, exception, err);
     }
 }
 
@@ -146,13 +160,16 @@ JSValueRef JSWebSettingManager::removeAllCookies(JSContextRef context,
         const JSValueRef arguments[],
         JSValueRef* exception)
 {
-    //AceSecurityStatus status = WEB_SETTING_CHECK_ACCESS(WEB_SETTING_MANAGER_API_REMOVE_ALL_COOKIES);
-    //TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+    AceSecurityStatus status = WEB_SETTING_CHECK_ACCESS(WEB_SETTING_MANAGER_API_REMOVE_ALL_COOKIES);
+    TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+    SLoggerI("removeAllCookies::TIZEN_SYNC_ACCESS_HANDLER succeeded.");
 
-    try {
+    try
+    {
         // Private Object
         WebSettingManager *priv = static_cast<WebSettingManager*>(JSObjectGetPrivate(thisObject));
-        if (!priv) {
+        if (!priv)
+        {
             throw TypeMismatchException("Private object is NULL.");
         }
 
@@ -174,13 +191,17 @@ JSValueRef JSWebSettingManager::removeAllCookies(JSContextRef context,
         }
         priv->removeAllCookies(callbacks);
         return JSValueMakeUndefined(context);
-    } catch (const BasePlatformException &err) {
-           SLoggerE(err.getName().c_str() << ":" << err.getMessage().c_str());
-           return JSWebAPIErrorFactory::postException(context, exception, err);                
-    } catch (...) {
+    }
+    catch (const BasePlatformException &err)
+    {
+        SLoggerE(err.getName().c_str() << ":" << err.getMessage().c_str());
+        return JSWebAPIErrorFactory::postException(context, exception, err);
+    }
+    catch (...)
+    {
         DeviceAPI::Common::UnknownException err("Unknown Error in WebSettingManager.removeAllCookies().");
-           SLoggerE(err.getName().c_str() << ":" << err.getMessage().c_str());
-           return JSWebAPIErrorFactory::postException(context, exception, err);                
+        SLoggerE(err.getName().c_str() << ":" << err.getMessage().c_str());
+        return JSWebAPIErrorFactory::postException(context, exception, err);
     }
 }
 
old mode 100644 (file)
new mode 100755 (executable)
index 0733ca8..b3c6f24
 
 #include "WebSettingManager.h"
 
-namespace DeviceAPI {
-namespace WebSetting {
+namespace DeviceAPI
+{
+namespace WebSetting
+{
 
 class JSWebSettingManager
 {
@@ -36,7 +38,7 @@ private:
      * The callback invoked when an object is first created.
      */
     static void initialize(JSContextRef context,
-            JSObjectRef object);
+                           JSObjectRef object);
 
     /**
      * The callback invoked when an object is finalized.
@@ -44,18 +46,18 @@ private:
     static void finalize(JSObjectRef object);
 
     static JSValueRef setUserAgentString(JSContextRef context,
-            JSObjectRef object,
-            JSObjectRef thisObject,
-            size_t argumentCount,
-            const JSValueRef arguments[],
-            JSValueRef* exception);
+                                         JSObjectRef object,
+                                         JSObjectRef thisObject,
+                                         size_t argumentCount,
+                                         const JSValueRef arguments[],
+                                         JSValueRef* exception);
 
     static JSValueRef removeAllCookies(JSContextRef context,
-            JSObjectRef object,
-            JSObjectRef thisObject,
-            size_t argumentCount,
-            const JSValueRef arguments[],
-            JSValueRef* exception);
+                                       JSObjectRef object,
+                                       JSObjectRef thisObject,
+                                       size_t argumentCount,
+                                       const JSValueRef arguments[],
+                                       JSValueRef* exception);
 
     /**
      * This member variable contains the values which has to be passed
index 65200f4..3b443d1 100755 (executable)
 
 #include <plugins-ipc-message/ipc_message_support.h>
 
-namespace DeviceAPI {
-namespace WebSetting {
+namespace DeviceAPI
+{
+namespace WebSetting
+{
 
 std::list<Common::MultiCallbackUserData *> WebSettingManager::mUserAgentCallbacks;
 std::list<Common::MultiCallbackUserData *> WebSettingManager::mDeleteAllCookiesCallbacks;
@@ -42,68 +44,76 @@ WebSettingManager::~WebSettingManager()
     SLoggerI("Desstructor of WebSettingManager...");
 }
 
-WebSettingManager* WebSettingManager::getInstance() 
+WebSettingManager* WebSettingManager::getInstance()
 {
     SLoggerI("Getting instance of WebSettingManager...");
     static WebSettingManager instance;
     return &instance;
 }
 
-void WebSettingManager::onAsyncUAStringReplyCallback(unsigned int num, void* user_data, const char* result) 
-{    
-    MultiCallbackUserData* multiPointer = static_cast<MultiCallbackUserData *>(user_data);    
-       if (multiPointer != NULL) {
-               int successStrLength = strlen("success");
-        if ((strncmp(result,"success", successStrLength)== 0) && (strlen(result) == successStrLength)) {
+void WebSettingManager::onAsyncUAStringReplyCallback(unsigned int num, void* user_data, const char* result)
+{
+    MultiCallbackUserData* multiPointer = static_cast<MultiCallbackUserData *>(user_data);
+    if (multiPointer != NULL)
+    {
+        unsigned int successStrLength = strlen("success");
+        if ((strncmp(result,"success", successStrLength) == 0) && (strlen(result) == successStrLength))
+        {
             multiPointer->invokeCallback("onsuccess", NULL);
         }
-               else {
+        else
+        {
             UnknownException error("Unknown");
             JSObjectRef errorObj = JSWebAPIErrorFactory::makeErrorObject(multiPointer->getContext(), error);
-                       multiPointer->invokeCallback("onerror", errorObj);
-               }
-               WebSettingManager::mUserAgentCallbacks.remove(multiPointer);
-               delete multiPointer;;
-       }
-       else {
-               SLoggerI("[WebSettingManager::onAsyncUAStringReplyCallback] Warning. MultiCallbackUserData is NULL." << __LINE__);;
-       }
+            multiPointer->invokeCallback("onerror", errorObj);
+        }
+        WebSettingManager::mUserAgentCallbacks.remove(multiPointer);
+        delete multiPointer;;
+    }
+    else
+    {
+        SLoggerI("[WebSettingManager::onAsyncUAStringReplyCallback] Warning. MultiCallbackUserData is NULL." << __LINE__);;
+    }
 }
 
-void WebSettingManager::onAsyncReplyRemoveAllCookiesCallback(unsigned int num, void* user_data, const char* result) 
-{    
-    MultiCallbackUserData* multiPointer = static_cast<MultiCallbackUserData *>(user_data);    
-       if (multiPointer != NULL) {
-               int successStrLength = strlen("success");
-        if ((strncmp(result,"success", successStrLength)== 0) && (strlen(result) == successStrLength)) {
-                   multiPointer->invokeCallback("onsuccess", NULL);
-               }
-               else {
+void WebSettingManager::onAsyncReplyRemoveAllCookiesCallback(unsigned int num, void* user_data, const char* result)
+{
+    MultiCallbackUserData* multiPointer = static_cast<MultiCallbackUserData *>(user_data);
+    if (multiPointer != NULL)
+    {
+        unsigned int successStrLength = strlen("success");
+        if ((strncmp(result,"success", successStrLength)== 0) && (strlen(result) == successStrLength))
+        {
+            multiPointer->invokeCallback("onsuccess", NULL);
+        }
+        else
+        {
             UnknownException error("Unknown");
             JSObjectRef errorObj = JSWebAPIErrorFactory::makeErrorObject(multiPointer->getContext(), error);
-                       multiPointer->invokeCallback("onerror", errorObj);
-               }
-               WebSettingManager::mDeleteAllCookiesCallbacks.remove(multiPointer);
-               delete multiPointer;;
-       }
-       else {
-               SLoggerI("[WebSettingManager::onAsyncReplyRemoveAllCookiesCallback] Warning. MultiCallbackUserData is NULL." << __LINE__);;
-       }
+            multiPointer->invokeCallback("onerror", errorObj);
+        }
+        WebSettingManager::mDeleteAllCookiesCallbacks.remove(multiPointer);
+        delete multiPointer;;
+    }
+    else
+    {
+        SLoggerI("[WebSettingManager::onAsyncReplyRemoveAllCookiesCallback] Warning. MultiCallbackUserData is NULL." << __LINE__);;
+    }
 }
 
 void WebSettingManager::setUserAgentString(std::string userAgent, MultiCallbackUserData* callbacks)
 {
     SLoggerI("WebSetting:setUserAgentString: " << userAgent);
-       WebSettingManager::mUserAgentCallbacks.push_back(callbacks); 
+    WebSettingManager::mUserAgentCallbacks.push_back(callbacks);
     IPCMessageSupport::sendAsyncMessageToUiProcess(IPCMessageSupport::TIZEN_CHANGE_USERAGENT, userAgent.c_str(), WebSettingManager::onAsyncUAStringReplyCallback, callbacks);
 }
 
 void WebSettingManager::removeAllCookies(MultiCallbackUserData* callbacks)
 {
     SLoggerI("WebSetting:removeAllCookies: ");
-       WebSettingManager::mDeleteAllCookiesCallbacks.push_back(callbacks);
+    WebSettingManager::mDeleteAllCookiesCallbacks.push_back(callbacks);
     IPCMessageSupport::sendAsyncMessageToUiProcess(IPCMessageSupport::TIZEN_DELETE_ALL_COOKIES, NULL, WebSettingManager::onAsyncReplyRemoveAllCookiesCallback, callbacks);
-} 
+}
 
 }
 }
index bc75787..f9316e3 100755 (executable)
 
 using namespace DeviceAPI::Common;
 
-namespace DeviceAPI {
-namespace WebSetting {
+namespace DeviceAPI
+{
+namespace WebSetting
+{
 
 class WebSettingManager
 {
@@ -33,12 +35,12 @@ public:
     void setUserAgentString(std::string userAgent, MultiCallbackUserData* callbacks);
     void removeAllCookies(MultiCallbackUserData* callbacks);
 
-       static std::list<Common::MultiCallbackUserData *> mUserAgentCallbacks;
-       static std::list<Common::MultiCallbackUserData *> mDeleteAllCookiesCallbacks;
+    static std::list<Common::MultiCallbackUserData *> mUserAgentCallbacks;
+    static std::list<Common::MultiCallbackUserData *> mDeleteAllCookiesCallbacks;
 
     static void onAsyncUAStringReplyCallback(unsigned int num, void* user_data, const char* result);
     static void onAsyncReplyRemoveAllCookiesCallback(unsigned int num, void* user_data, const char* result);
-       static WebSettingManager* getInstance();
+    static WebSettingManager* getInstance();
 private:
     WebSettingManager();
     virtual ~WebSettingManager();
old mode 100644 (file)
new mode 100755 (executable)
index a25c897..6c4f54e
 #include <vector>
 #include <map>
 
-namespace DeviceAPI {
-namespace WebSetting {
+namespace DeviceAPI
+{
+namespace WebSetting
+{
 
 
 } // WebSetting
index 539d902..3ceef6b 100755 (executable)
 
 using namespace WrtDeviceApis::Commons;
 
-namespace DeviceAPI {
-namespace WebSetting {
+namespace DeviceAPI
+{
+namespace WebSetting
+{
 
 static FunctionMapping createWebSettingFunctions();
 static FunctionMapping WebSettingFunctions = createWebSettingFunctions();
@@ -42,38 +44,37 @@ DEFINE_FUNCTION_GETTER(WebSetting, WebSettingFunctions);
 
 static FunctionMapping createWebSettingFunctions()
 {
-    FunctionMapping webSettingMapping;
     /**
      * Device capabilities
-     */ 
+     */
     ACE_CREATE_DEVICE_CAP(DEVICE_CAP_WEBSETTING, WEBSETTING_DEVICE_CAP);
     ACE_CREATE_DEVICE_CAPS_LIST(DEVICE_LIST_WEBSETTING);
     ACE_ADD_DEVICE_CAP(DEVICE_LIST_WEBSETTING, DEVICE_CAP_WEBSETTING);
-               
+
     /**
      * Api Features
      */
     ACE_CREATE_FEATURE(FEATURE_WEBSETTING, WEBSETTING_FEATURE_API);
     ACE_CREATE_FEATURE_LIST(WEBSETTING_FEATURES);
-    ACE_ADD_API_FEATURE(WEBSETTING_FEATURES, FEATURE_WEBSETTING);        
-       
+    ACE_ADD_API_FEATURE(WEBSETTING_FEATURES, FEATURE_WEBSETTING);
+
     /**
      * Functions
      */
     FunctionMapping websettingMapping;
-               
-       // remove cookies
-       AceFunction removeAllCookiesFunc = ACE_CREATE_FUNCTION(
-                               FUNCTION_ADD,
-                               WEB_SETTING_MANAGER_API_REMOVE_ALL_COOKIES,
-                               WEBSETTING_FEATURES,
-                               DEVICE_LIST_WEBSETTING);
-               
-       websettingMapping.insert(std::make_pair(
-            WEB_SETTING_MANAGER_API_REMOVE_ALL_COOKIES,
-            removeAllCookiesFunc));
-
-    return webSettingMapping;
+
+    // remove cookies
+    AceFunction removeAllCookiesFunc = ACE_CREATE_FUNCTION(
+                                           FUNCTION_REMOVE_ALL_COOKIES,
+                                           WEB_SETTING_MANAGER_API_REMOVE_ALL_COOKIES,
+                                           WEBSETTING_FEATURES,
+                                           DEVICE_LIST_WEBSETTING);
+
+    websettingMapping.insert(std::make_pair(
+                                 WEB_SETTING_MANAGER_API_REMOVE_ALL_COOKIES,
+                                 removeAllCookiesFunc));
+
+    return websettingMapping;
 }
 
 } // WebSetting
old mode 100644 (file)
new mode 100755 (executable)
index 9443546..fafd85f
 
 #include <Logger.h>
 
-namespace DeviceAPI {
-namespace WebSetting {
+namespace DeviceAPI
+{
+namespace WebSetting
+{
 
 // attributes
 
index db1fca2..5c24308 100755 (executable)
@@ -29,16 +29,21 @@ using namespace WrtDeviceApis;
 using namespace WrtDeviceApis::Commons;
 using namespace DeviceAPI::Common;
 
-namespace DeviceAPI {
-namespace WebSetting {
+namespace DeviceAPI
+{
+namespace WebSetting
+{
 
 
 void on_widget_start_callback(int widgetId)
 {
     SLoggerD("[Tizen\\WebSetting] on_widget_start_callback (%d)", widgetId);
-    try {
+    try
+    {
         WrtAccessSingleton::Instance().initialize(widgetId);
-    } catch (...) {
+    }
+    catch (...)
+    {
         SLoggerE("WrtAccess initialization failed");
     }
 }
@@ -46,9 +51,12 @@ void on_widget_start_callback(int widgetId)
 void on_widget_stop_callback(int widgetId)
 {
     SLoggerD("[Tizen\\WebSetting] on_widget_stop_callback (%d)", widgetId);
-    try {
+    try
+    {
         WrtAccessSingleton::Instance().deinitialize(widgetId);
-    } catch (...) {
+    }
+    catch (...)
+    {
         SLoggerE("WrtAccess deinitialization failed");
     }
 }
@@ -72,9 +80,9 @@ PLUGIN_ON_FRAME_UNLOAD(on_frame_unload_callback)
 
 PLUGIN_CLASS_MAP_BEGIN
 PLUGIN_CLASS_MAP_ADD_CLASS(WRT_JS_EXTENSION_OBJECT_TIZEN,
-        "websetting",
-        (js_class_template_getter)JSWebSettingManager::getClassRef,
-        NULL)
+                           "websetting",
+                           (js_class_template_getter)JSWebSettingManager::getClassRef,
+                           NULL)
 PLUGIN_CLASS_MAP_END
 
 } // WebSetting