Android: Fix broken insertNativeView() signature

Method is trying to infer the signature from the types of the
arguments, but since the argument for the view is a plain jobject
this signature is wrong, method is not found and the view is never
inserted.

Change-Id: I3cbf9bccbcb1e5526f843213ba0f66e5bd1e7107
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Tinja Paavoseppä 2023-11-16 13:32:07 +02:00
parent 99c70de9a6
commit 2198fc6a4a
2 changed files with 3 additions and 2 deletions

View File

@ -340,7 +340,7 @@ namespace QtAndroid
return surfaceId; return surfaceId;
} }
int insertNativeView(jobject view, const QRect &geometry) int insertNativeView(QtJniTypes::View view, const QRect &geometry)
{ {
m_surfacesMutex.lock(); m_surfacesMutex.lock();
jint surfaceId = generateViewId(); jint surfaceId = generateViewId();

View File

@ -28,6 +28,7 @@ class QBasicMutex;
Q_DECLARE_JNI_CLASS(QtActivityDelegate, "org/qtproject/qt/android/QtActivityDelegate") Q_DECLARE_JNI_CLASS(QtActivityDelegate, "org/qtproject/qt/android/QtActivityDelegate")
Q_DECLARE_JNI_CLASS(QtInputDelegate, "org/qtproject/qt/android/QtInputDelegate") Q_DECLARE_JNI_CLASS(QtInputDelegate, "org/qtproject/qt/android/QtInputDelegate")
Q_DECLARE_JNI_CLASS(View, "android/view/View");
namespace QtAndroid namespace QtAndroid
{ {
@ -37,7 +38,7 @@ namespace QtAndroid
void setQtThread(QThread *thread); void setQtThread(QThread *thread);
int createSurface(AndroidSurfaceClient * client, const QRect &geometry, bool onTop, int imageDepth); int createSurface(AndroidSurfaceClient * client, const QRect &geometry, bool onTop, int imageDepth);
int insertNativeView(jobject view, const QRect &geometry); int insertNativeView(QtJniTypes::View view, const QRect &geometry);
void setViewVisibility(jobject view, bool visible); void setViewVisibility(jobject view, bool visible);
void setSurfaceGeometry(int surfaceId, const QRect &geometry); void setSurfaceGeometry(int surfaceId, const QRect &geometry);
void destroySurface(int surfaceId); void destroySurface(int surfaceId);