Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
jni_android.cpp File Reference

(7cdef8fa3b370dab0c7ec27262c7aa28f28c11a4)

#include <jni.h>
#include <android/log.h>
#include <QtCore/QLoggingCategory>
#include <QtBluetooth/qtbluetoothglobal.h>
#include "android/jni_android_p.h"
#include "android/androidbroadcastreceiver_p.h"
#include "android/serveracceptancethread_p.h"
#include "android/inputstreamthread_p.h"
#include "android/lowenergynotificationhub_p.h"
+ Include dependency graph for jni_android.cpp:

Go to the source code of this file.

Macros

#define FIND_AND_CHECK_CLASS(CLASS_NAME)
 
#define LEHUB_SCOPED_METHOD(Method)   Q_JNI_NATIVE_SCOPED_METHOD(Method, LowEnergyNotificationHub)
 

Functions

 Q_GLOBAL_STATIC (QMutex, stringCacheMutex)
 
QString valueFromStaticFieldCache (const char *key, const char *className, const char *fieldName)
 
void QtBroadcastReceiver_jniOnReceive (JNIEnv *env, jobject, jlong qtObject, QtJniTypes::Context context, QtJniTypes::Intent intent)
 
static void QtBluetoothSocketServer_errorOccurred (JNIEnv *, jobject, jlong qtObject, jint errorCode)
 
static void QtBluetoothSocketServer_newSocket (JNIEnv *, jobject, jlong qtObject, QtJniTypes::BluetoothSocket socket)
 
static void QtBluetoothInputStreamThread_errorOccurred (JNIEnv *, jobject, jlong qtObject, jint errorCode)
 
static void QtBluetoothInputStreamThread_readyData (JNIEnv *, jobject, jlong qtObject, jbyteArray buffer, jint bufferLength)
 
void QtBluetoothLE_leScanResult (JNIEnv *env, jobject, jlong qtObject, QtJniTypes::BluetoothDevice bluetoothDevice, jint rssi, jbyteArray scanRecord)
 
static bool registerNatives ()
 
QT_END_NAMESPACE Q_BLUETOOTH_EXPORT jint JNICALL JNI_OnLoad (JavaVM *vm, void *)
 

Variables

QT_BEGIN_NAMESPACE typedef QHash< QByteArray, QStringJCachedStringFields
 
static const char logTag [] = "QtBluetooth"
 
static const char classErrorMsg [] = "Can't find class \"%s\""
 

Macro Definition Documentation

◆ FIND_AND_CHECK_CLASS

#define FIND_AND_CHECK_CLASS ( CLASS_NAME)
Value:
clazz = env.findClass<CLASS_NAME>(); \
if (!clazz) { \
__android_log_print(ANDROID_LOG_FATAL, logTag, classErrorMsg, \
QtJniTypes::Traits<CLASS_NAME>::className().data()); \
return JNI_FALSE; \
} \
static const char logTag[]
static const char classErrorMsg[]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data

Definition at line 99 of file jni_android.cpp.

Referenced by registerNatives().

◆ LEHUB_SCOPED_METHOD

#define LEHUB_SCOPED_METHOD ( Method)    Q_JNI_NATIVE_SCOPED_METHOD(Method, LowEnergyNotificationHub)

Definition at line 107 of file jni_android.cpp.

Function Documentation

◆ JNI_OnLoad()

QT_END_NAMESPACE Q_BLUETOOTH_EXPORT jint JNICALL JNI_OnLoad ( JavaVM * vm,
void *  )

Definition at line 191 of file jni_android.cpp.

References logTag, and registerNatives().

+ Here is the call graph for this function:

◆ Q_GLOBAL_STATIC()

Q_GLOBAL_STATIC ( QMutex ,
stringCacheMutex  )

◆ QtBluetoothInputStreamThread_errorOccurred()

static void QtBluetoothInputStreamThread_errorOccurred ( JNIEnv * ,
jobject ,
jlong qtObject,
jint errorCode )
static

Definition at line 69 of file jni_android.cpp.

◆ QtBluetoothInputStreamThread_readyData()

static void QtBluetoothInputStreamThread_readyData ( JNIEnv * ,
jobject ,
jlong qtObject,
jbyteArray buffer,
jint bufferLength )
static

Definition at line 76 of file jni_android.cpp.

◆ QtBluetoothLE_leScanResult()

void QtBluetoothLE_leScanResult ( JNIEnv * env,
jobject ,
jlong qtObject,
QtJniTypes::BluetoothDevice bluetoothDevice,
jint rssi,
jbyteArray scanRecord )

Definition at line 83 of file jni_android.cpp.

◆ QtBluetoothSocketServer_errorOccurred()

static void QtBluetoothSocketServer_errorOccurred ( JNIEnv * ,
jobject ,
jlong qtObject,
jint errorCode )
static

Definition at line 55 of file jni_android.cpp.

◆ QtBluetoothSocketServer_newSocket()

static void QtBluetoothSocketServer_newSocket ( JNIEnv * ,
jobject ,
jlong qtObject,
QtJniTypes::BluetoothSocket socket )
static

Definition at line 62 of file jni_android.cpp.

References socket.

◆ QtBroadcastReceiver_jniOnReceive()

void QtBroadcastReceiver_jniOnReceive ( JNIEnv * env,
jobject ,
jlong qtObject,
QtJniTypes::Context context,
QtJniTypes::Intent intent )

Definition at line 47 of file jni_android.cpp.

◆ registerNatives()

static bool registerNatives ( )
static

Definition at line 109 of file jni_android.cpp.

References FIND_AND_CHECK_CLASS, and logTag.

Referenced by JNI_OnLoad().

+ Here is the caller graph for this function:

◆ valueFromStaticFieldCache()

QString valueFromStaticFieldCache ( const char * key,
const char * className,
const char * fieldName )

Definition at line 27 of file jni_android.cpp.

References className, QSet< T >::find(), it, and lock.

Referenced by valueForStaticField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ classErrorMsg

const char classErrorMsg[] = "Can't find class \"%s\""
static

Definition at line 97 of file jni_android.cpp.

◆ JCachedStringFields

QT_BEGIN_NAMESPACE typedef QHash<QByteArray, QString> JCachedStringFields

Definition at line 19 of file jni_android.cpp.

◆ logTag

const char logTag[] = "QtBluetooth"
static