// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/Validator.h>
#include <Commons/Exception.h>
#include "SEConverter.h"
#include "SEAsyncCallbackManager.h"
#include "plugin_config.h"
-
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::Commons;
JSValueRef JSSESession::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
Converter convert(context);
return convert.toJSValueRef(seSession->isClosed());
}
} Catch (ConversionException) {
- LogError("ConversionException: " << _rethrown_exception.GetMessage());
+ LoggerE("ConversionException: " << _rethrown_exception.GetMessage());
} Catch (NullPointerException) {
- LogError("NullPointerException: " << _rethrown_exception.GetMessage());
+ LoggerE("NullPointerException: " << _rethrown_exception.GetMessage());
} Catch (WrtDeviceApis::Commons::UnknownException) {
- LogError("UnknownExceptionException: " << _rethrown_exception.GetMessage());
+ LoggerE("UnknownExceptionException: " << _rethrown_exception.GetMessage());
} Catch (PlatformException) {
- LogError("PlatformExceptionException: " << _rethrown_exception.GetMessage());
+ LoggerE("PlatformExceptionException: " << _rethrown_exception.GetMessage());
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
JSObjectRef JSSESession::createJSObject(JSContextRef context, void *session) {
- LogDebug("entered");
+ LoggerD("entered");
ISESessionPtr seSession = SEFactory::getInstance().createSESessionObject(session);
void JSSESession::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
SESessionPrivObject *priv = static_cast<SESessionPrivObject*>( JSObjectGetPrivate( object ) ) ;
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting SecureElement object");
+ LoggerD("Deleting SecureElement object");
delete priv;
}
Try {
SESessionPrivObject* privateObject = static_cast<SESessionPrivObject*>(JSObjectGetPrivate(thisObject));
if (NULL == privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
SEConverter convert(context);
return convert.toJSValueRef(seSession->getATR());
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
Try {
SESessionPrivObject* privateObject = static_cast<SESessionPrivObject*>(JSObjectGetPrivate(thisObject));
if (NULL == privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
seSession->close();
return JSValueMakeUndefined(context);
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
Try {
SESessionPrivObject* privateObject = static_cast<SESessionPrivObject*>(JSObjectGetPrivate(thisObject));
if (NULL == privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
seSession->closeChannels();
return JSValueMakeUndefined(context);
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
AceSecurityStatus status = SECURE_ELEMENT_CHECK_ACCESS(SECUREELEMENT_FUNCTION_API_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
if ((argumentCount < 2) || JSValueIsNull(context, arguments[0]) || JSValueIsUndefined(context, arguments[0]) || !JSIsArrayValue(context, arguments[0])) {
/* 1st argument is mandatory. And 1st argument must be Array. */
- LogError("AID TypeMismatchException!");
+ LoggerE("AID TypeMismatchException!");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
onErrorForCbm = arguments[2];
}
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
SESessionPrivObject* privateObject = static_cast<SESessionPrivObject*>(JSObjectGetPrivate(thisObject));
if (NULL == privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
Try {
std::vector<unsigned char> aid = convert.toVectorOfUChars(arguments[0]);
if ((aid.size() < 5) || (aid.size() > 16)) {
- LogError("wrong aid length : " << aid.size());
+ LoggerE("wrong aid length : " << aid.size());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Wrong AID length");
}
EventSEOpenChannelPtr event(new EventSEOpenChannel(aid, true));
return JSValueMakeUndefined(context);
} Catch (ConversionException) {
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (WrtDeviceApis::Commons::UnknownException) {
- LogError("UnknownException: " << _rethrown_exception.GetMessage());
+ LoggerE("UnknownException: " << _rethrown_exception.GetMessage());
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR,"Unknown Error"));
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
AceSecurityStatus status = SECURE_ELEMENT_CHECK_ACCESS(SECUREELEMENT_FUNCTION_API_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
if ((argumentCount < 2) || JSValueIsNull(context, arguments[0]) || JSValueIsUndefined(context, arguments[0]) || !JSIsArrayValue(context, arguments[0])) {
/* 1st argument is mandatory. And 1st argument must be Array. */
- LogError("AID TypeMismatchException!");
+ LoggerE("AID TypeMismatchException!");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
onErrorForCbm = arguments[2];
}
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
SESessionPrivObject* privateObject = static_cast<SESessionPrivObject*>(JSObjectGetPrivate(thisObject));
if (NULL == privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
Try {
std::vector<unsigned char> aid = convert.toVectorOfUChars(arguments[0]);
if ((aid.size() < 5) || (aid.size() > 16)) {
- LogError("wrong aid length : " << aid.size());
+ LoggerE("wrong aid length : " << aid.size());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Wrong AID length");
}
EventSEOpenChannelPtr event(new EventSEOpenChannel(aid, false));
return JSValueMakeUndefined(context);
} Catch (ConversionException) {
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (WrtDeviceApis::Commons::UnknownException) {
- LogError("UnknownException: " << _rethrown_exception.GetMessage());
+ LoggerE("UnknownException: " << _rethrown_exception.GetMessage());
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR,"Unknown Error"));