// Copyright (C) 2016 Centria research and development // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "androidjninfc_p.h" QT_BEGIN_NAMESPACE namespace QtNfc { bool startDiscovery() { return QJniObject::callStaticMethod(QtJniTypes::className(), "startDiscovery"); } bool isEnabled() { return QJniObject::callStaticMethod(QtJniTypes::className(), "isEnabled"); } bool isSupported() { return QJniObject::callStaticMethod(QtJniTypes::className(), "isSupported"); } bool stopDiscovery() { return QJniObject::callStaticMethod(QtJniTypes::className(), "stopDiscovery"); } QJniObject getStartIntent() { return QJniObject::callStaticMethod( QtJniTypes::className(), "getStartIntent"); } QJniObject getTag(const QJniObject &intent) { return QJniObject::callStaticMethod( QtJniTypes::className(), "getTag", intent.object()); } } // namespace QtNfc QT_END_NAMESPACE Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void * /*reserved*/) { static bool initialized = false; if (initialized) return JNI_VERSION_1_6; initialized = true; JNIEnv* env; if (vm->GetEnv(reinterpret_cast(&env), JNI_VERSION_1_6) != JNI_OK) { return -1; } return JNI_VERSION_1_6; }