From ece7b9430d35564186975dbaf20660ad83475748 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Sat, 16 Sep 2023 11:41:20 +0200 Subject: [PATCH] JNI: Explicitly convert QtJniType instances to jobject for variadic arguments When calling the (old and outdated) variadic argument overloads of callMethod (as opposed to the variadic template overloads), then we cannot pass complex types. That types declared via the Q_DECLARE_JNI_CLASS macro are trivial was an implementation detail that we shouldn't rely on as long as those types are not part of the public API. Cast explicitly to jobject so that we can make those types proper QJniObjects. Updating this code to use the new variadic template overloads is for a follow-up commit. Change-Id: Ia9d610c84de6f989ef957c23401b1cbc64d2d1ef Reviewed-by: Petri Virkkunen Reviewed-by: Assam Boudjelthia --- src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp b/src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp index 25427d5ede..087aca943b 100644 --- a/src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp +++ b/src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp @@ -19,7 +19,7 @@ static jclass g_messageDialogHelperClass = nullptr; QAndroidPlatformMessageDialogHelper::QAndroidPlatformMessageDialogHelper() : m_javaMessageDialog(g_messageDialogHelperClass, "(Landroid/app/Activity;)V", - QtAndroid::activity()) + static_cast(QtAndroid::activity())) { }