forked from jbagg/QtZeroConf
also set pointer size to 64bit fixed on the C++ size
Signed-off-by: Jonathan Bagg <drwho@infidigm.net>
This commit is contained in:
committed by
Jonathan Bagg
parent
2a7a8fb9d8
commit
61f5676248
@ -49,9 +49,10 @@ QZeroConfPrivate::QZeroConfPrivate(QZeroConf *parent)
|
|||||||
{ "onServiceNameChangedJNI", "(JLjava/lang/String;)V", (void*)QZeroConfPrivate::onServiceNameChangedJNI }
|
{ "onServiceNameChangedJNI", "(JLjava/lang/String;)V", (void*)QZeroConfPrivate::onServiceNameChangedJNI }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Passing "this" as ID down to Java so we can access "this" in callbacks.
|
|
||||||
// There seems to be no straight forward way to match the "thiz" pointer from JNI calls to our pointer of the Java class
|
// There seems to be no straight forward way to match the "thiz" pointer from JNI calls to our pointer of the Java class
|
||||||
nsdManager = QAndroidJniObject("qtzeroconf/QZeroConfNsdManager", "(JLandroid/content/Context;)V", reinterpret_cast<uintptr_t>(this), QtAndroid::androidActivity().object());
|
// Passing "this" as ID down to Java so we can access "this" in callbacks.
|
||||||
|
// Note: needs to be quint64 as uintptr_t might be 32 or 64 bit depending on the system, while Java expects a jlong which is always 64 bit.
|
||||||
|
nsdManager = QAndroidJniObject("qtzeroconf/QZeroConfNsdManager", "(JLandroid/content/Context;)V", reinterpret_cast<quint64>(this), QtAndroid::androidActivity().object());
|
||||||
if (nsdManager.isValid()) {
|
if (nsdManager.isValid()) {
|
||||||
jclass objectClass = env->GetObjectClass(nsdManager.object<jobject>());
|
jclass objectClass = env->GetObjectClass(nsdManager.object<jobject>());
|
||||||
env->RegisterNatives(objectClass, methods, sizeof(methods) / sizeof(methods[0]));
|
env->RegisterNatives(objectClass, methods, sizeof(methods) / sizeof(methods[0]));
|
||||||
|
Reference in New Issue
Block a user