merge wrt-plugins-tizen_0.2.0-3
[platform/framework/web/wrt-plugins-tizen.git] / src / standards / Tizen / Call / JSCallManager.cpp
index e782a8b..f0c36fd 100755 (executable)
@@ -22,6 +22,7 @@
 #include <CommonsJavaScript/JSDOMExceptionFactory.h>
 #include <API/Call/ICallManager.h>
 #include <API/Call/CallFactory.h>
+#include <API/Call/CallDefine.h>
 #include <API/Call/EventGetCallService.h>
 #include <Tizen/Common/JSTizenExceptionFactory.h>
 #include <Tizen/Common/JSTizenException.h> 
@@ -67,7 +68,7 @@ JSClassDefinition JSCallManager::m_classInfo =
 };
 
 JSStaticValue JSCallManager::m_property[] = {
-       { "history", getProperty, NULL, kJSPropertyAttributeReadOnly },
+       { STR_HISTORY, getProperty, NULL, kJSPropertyAttributeReadOnly },
        { 0, 0, 0, 0 }
 };
 
@@ -125,7 +126,7 @@ JSValueRef JSCallManager::getProperty(JSContextRef context,
        JSContextRef globalContext = priv->getContext();
        try {
                Converter convert(context);
-               if(JSStringIsEqualToUTF8CString(propertyName, "history")) {
+               if(JSStringIsEqualToUTF8CString(propertyName, STR_HISTORY)) {
                        return JSCallHistory::createJSObject(globalContext, object);
                }
        } catch(const WrtDeviceApis::Commons::Exception& ex) {
@@ -198,7 +199,7 @@ JSValueRef JSCallManager::getCallServices(JSContextRef context, JSObjectRef obje
 
                if (argumentCount == 0) {
                        StringArrayPtr tags(new StringArray());
-                       tags->push_back("call");
+                       tags->push_back(STR_CALL);
                        filter->setTags(tags);
                } else {
                        if (!JSValueIsObject(context, arguments[0])) {
@@ -218,8 +219,8 @@ JSValueRef JSCallManager::getCallServices(JSContextRef context, JSObjectRef obje
                if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::None) {
                        return converter.toJSValueRef(event->getResult(), gContext);
                } else {
-                       if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::UnsupportedException) {
-                               return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, "Not supported value");
+                       if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException) {
+                               return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid values error : CallServiceFilter");
                        } else {
                                return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown error");
                        }